prometheusrulegroups

package
v0.20241128.1112539 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 28, 2024 License: MPL-2.0 Imports: 12 Imported by: 1

README

github.com/hashicorp/go-azure-sdk/resource-manager/alertsmanagement/2023-03-01/prometheusrulegroups Documentation

The prometheusrulegroups SDK allows for interaction with Azure Resource Manager alertsmanagement (API Version 2023-03-01).

This readme covers example usages, but further information on using this SDK can be found in the project root.

Import Path

import "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids"
import "github.com/hashicorp/go-azure-sdk/resource-manager/alertsmanagement/2023-03-01/prometheusrulegroups"

Client Initialization

client := prometheusrulegroups.NewPrometheusRuleGroupsClientWithBaseURI("https://management.azure.com")
client.Client.Authorizer = authorizer

Example Usage: PrometheusRuleGroupsClient.CreateOrUpdate

ctx := context.TODO()
id := prometheusrulegroups.NewPrometheusRuleGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "prometheusRuleGroupName")

payload := prometheusrulegroups.PrometheusRuleGroupResource{
	// ...
}


read, err := client.CreateOrUpdate(ctx, id, payload)
if err != nil {
	// handle the error
}
if model := read.Model; model != nil {
	// do something with the model/response object
}

Example Usage: PrometheusRuleGroupsClient.Delete

ctx := context.TODO()
id := prometheusrulegroups.NewPrometheusRuleGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "prometheusRuleGroupName")

read, err := client.Delete(ctx, id)
if err != nil {
	// handle the error
}
if model := read.Model; model != nil {
	// do something with the model/response object
}

Example Usage: PrometheusRuleGroupsClient.Get

ctx := context.TODO()
id := prometheusrulegroups.NewPrometheusRuleGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "prometheusRuleGroupName")

read, err := client.Get(ctx, id)
if err != nil {
	// handle the error
}
if model := read.Model; model != nil {
	// do something with the model/response object
}

Example Usage: PrometheusRuleGroupsClient.ListByResourceGroup

ctx := context.TODO()
id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group")

read, err := client.ListByResourceGroup(ctx, id)
if err != nil {
	// handle the error
}
if model := read.Model; model != nil {
	// do something with the model/response object
}

Example Usage: PrometheusRuleGroupsClient.ListBySubscription

ctx := context.TODO()
id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012")

read, err := client.ListBySubscription(ctx, id)
if err != nil {
	// handle the error
}
if model := read.Model; model != nil {
	// do something with the model/response object
}

Example Usage: PrometheusRuleGroupsClient.Update

ctx := context.TODO()
id := prometheusrulegroups.NewPrometheusRuleGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "prometheusRuleGroupName")

payload := prometheusrulegroups.PrometheusRuleGroupResourcePatchParameters{
	// ...
}


read, err := client.Update(ctx, id, payload)
if err != nil {
	// handle the error
}
if model := read.Model; model != nil {
	// do something with the model/response object
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidatePrometheusRuleGroupID

func ValidatePrometheusRuleGroupID(input interface{}, key string) (warnings []string, errors []error)

ValidatePrometheusRuleGroupID checks that 'input' can be parsed as a Prometheus Rule Group ID

Types

type CreateOrUpdateOperationResponse

type CreateOrUpdateOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *PrometheusRuleGroupResource
}

type DeleteOperationResponse

type DeleteOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
}

type GetOperationResponse

type GetOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *PrometheusRuleGroupResource
}

type ListByResourceGroupOperationResponse

type ListByResourceGroupOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *PrometheusRuleGroupResourceCollection
}

type ListBySubscriptionOperationResponse

type ListBySubscriptionOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *PrometheusRuleGroupResourceCollection
}

type PrometheusRule

type PrometheusRule struct {
	Actions              *[]PrometheusRuleGroupAction        `json:"actions,omitempty"`
	Alert                *string                             `json:"alert,omitempty"`
	Annotations          *map[string]string                  `json:"annotations,omitempty"`
	Enabled              *bool                               `json:"enabled,omitempty"`
	Expression           string                              `json:"expression"`
	For                  *string                             `json:"for,omitempty"`
	Labels               *map[string]string                  `json:"labels,omitempty"`
	Record               *string                             `json:"record,omitempty"`
	ResolveConfiguration *PrometheusRuleResolveConfiguration `json:"resolveConfiguration,omitempty"`
	Severity             *int64                              `json:"severity,omitempty"`
}

type PrometheusRuleGroupAction

type PrometheusRuleGroupAction struct {
	ActionGroupId    *string            `json:"actionGroupId,omitempty"`
	ActionProperties *map[string]string `json:"actionProperties,omitempty"`
}

type PrometheusRuleGroupId

type PrometheusRuleGroupId struct {
	SubscriptionId          string
	ResourceGroupName       string
	PrometheusRuleGroupName string
}

PrometheusRuleGroupId is a struct representing the Resource ID for a Prometheus Rule Group

func NewPrometheusRuleGroupID

func NewPrometheusRuleGroupID(subscriptionId string, resourceGroupName string, prometheusRuleGroupName string) PrometheusRuleGroupId

NewPrometheusRuleGroupID returns a new PrometheusRuleGroupId struct

func ParsePrometheusRuleGroupID

func ParsePrometheusRuleGroupID(input string) (*PrometheusRuleGroupId, error)

ParsePrometheusRuleGroupID parses 'input' into a PrometheusRuleGroupId

func ParsePrometheusRuleGroupIDInsensitively

func ParsePrometheusRuleGroupIDInsensitively(input string) (*PrometheusRuleGroupId, error)

ParsePrometheusRuleGroupIDInsensitively parses 'input' case-insensitively into a PrometheusRuleGroupId note: this method should only be used for API response data and not user input

func (*PrometheusRuleGroupId) FromParseResult

func (id *PrometheusRuleGroupId) FromParseResult(input resourceids.ParseResult) error

func (PrometheusRuleGroupId) ID

func (id PrometheusRuleGroupId) ID() string

ID returns the formatted Prometheus Rule Group ID

func (PrometheusRuleGroupId) Segments

func (id PrometheusRuleGroupId) Segments() []resourceids.Segment

Segments returns a slice of Resource ID Segments which comprise this Prometheus Rule Group ID

func (PrometheusRuleGroupId) String

func (id PrometheusRuleGroupId) String() string

String returns a human-readable description of this Prometheus Rule Group ID

type PrometheusRuleGroupProperties

type PrometheusRuleGroupProperties struct {
	ClusterName *string          `json:"clusterName,omitempty"`
	Description *string          `json:"description,omitempty"`
	Enabled     *bool            `json:"enabled,omitempty"`
	Interval    *string          `json:"interval,omitempty"`
	Rules       []PrometheusRule `json:"rules"`
	Scopes      []string         `json:"scopes"`
}

type PrometheusRuleGroupResource

type PrometheusRuleGroupResource struct {
	Id         *string                       `json:"id,omitempty"`
	Location   string                        `json:"location"`
	Name       *string                       `json:"name,omitempty"`
	Properties PrometheusRuleGroupProperties `json:"properties"`
	SystemData *systemdata.SystemData        `json:"systemData,omitempty"`
	Tags       *map[string]string            `json:"tags,omitempty"`
	Type       *string                       `json:"type,omitempty"`
}

type PrometheusRuleGroupResourceCollection

type PrometheusRuleGroupResourceCollection struct {
	Value *[]PrometheusRuleGroupResource `json:"value,omitempty"`
}

type PrometheusRuleGroupResourcePatchParameters

type PrometheusRuleGroupResourcePatchParameters struct {
	Properties *PrometheusRuleGroupResourcePatchParametersProperties `json:"properties,omitempty"`
	Tags       *map[string]string                                    `json:"tags,omitempty"`
}

type PrometheusRuleGroupResourcePatchParametersProperties

type PrometheusRuleGroupResourcePatchParametersProperties struct {
	Enabled *bool `json:"enabled,omitempty"`
}

type PrometheusRuleGroupsClient

type PrometheusRuleGroupsClient struct {
	Client *resourcemanager.Client
}

func NewPrometheusRuleGroupsClientWithBaseURI

func NewPrometheusRuleGroupsClientWithBaseURI(sdkApi sdkEnv.Api) (*PrometheusRuleGroupsClient, error)

func (PrometheusRuleGroupsClient) CreateOrUpdate

CreateOrUpdate ...

func (PrometheusRuleGroupsClient) Delete

Delete ...

func (PrometheusRuleGroupsClient) Get

Get ...

func (PrometheusRuleGroupsClient) ListByResourceGroup

ListByResourceGroup ...

func (PrometheusRuleGroupsClient) ListBySubscription

ListBySubscription ...

func (PrometheusRuleGroupsClient) Update

Update ...

type PrometheusRuleResolveConfiguration

type PrometheusRuleResolveConfiguration struct {
	AutoResolved  *bool   `json:"autoResolved,omitempty"`
	TimeToResolve *string `json:"timeToResolve,omitempty"`
}

type UpdateOperationResponse

type UpdateOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *PrometheusRuleGroupResource
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL