prometheusrulegroups

package
v0.0.0-...-a81a29a Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2023 License: MPL-2.0 Imports: 9 Imported by: 0

README

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

The prometheusrulegroups SDK allows for interaction with the Azure Resource Manager Service 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-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", "prometheusRuleGroupValue")

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", "prometheusRuleGroupValue")

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", "prometheusRuleGroupValue")

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 := prometheusrulegroups.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 := prometheusrulegroups.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", "prometheusRuleGroupValue")

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
	Model        *PrometheusRuleGroupResource
}

type DeleteOperationResponse

type DeleteOperationResponse struct {
	HttpResponse *http.Response
}

type GetOperationResponse

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

type ListByResourceGroupOperationResponse

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

type ListBySubscriptionOperationResponse

type ListBySubscriptionOperationResponse struct {
	HttpResponse *http.Response
	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) 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 autorest.Client
	// contains filtered or unexported fields
}

func NewPrometheusRuleGroupsClientWithBaseURI

func NewPrometheusRuleGroupsClientWithBaseURI(endpoint string) PrometheusRuleGroupsClient

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
	Model        *PrometheusRuleGroupResource
}

Jump to

Keyboard shortcuts

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