metricalerts

package
v0.20231106.1151347 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2023 License: MPL-2.0 Imports: 11 Imported by: 1

README

github.com/hashicorp/go-azure-sdk/resource-manager/insights/2018-03-01/metricalerts Documentation

The metricalerts SDK allows for interaction with the Azure Resource Manager Service insights (API Version 2018-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/insights/2018-03-01/metricalerts"

Client Initialization

client := metricalerts.NewMetricAlertsClientWithBaseURI("https://management.azure.com")
client.Client.Authorizer = authorizer

Example Usage: MetricAlertsClient.CreateOrUpdate

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

payload := metricalerts.MetricAlertResource{
	// ...
}


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: MetricAlertsClient.Delete

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

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: MetricAlertsClient.Get

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

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: MetricAlertsClient.ListByResourceGroup

ctx := context.TODO()
id := metricalerts.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: MetricAlertsClient.ListBySubscription

ctx := context.TODO()
id := metricalerts.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: MetricAlertsClient.Update

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

payload := metricalerts.MetricAlertResourcePatch{
	// ...
}


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 PossibleValuesForAggregationTypeEnum

func PossibleValuesForAggregationTypeEnum() []string

func PossibleValuesForCriterionType

func PossibleValuesForCriterionType() []string

func PossibleValuesForDynamicThresholdOperator

func PossibleValuesForDynamicThresholdOperator() []string

func PossibleValuesForDynamicThresholdSensitivity

func PossibleValuesForDynamicThresholdSensitivity() []string

func PossibleValuesForOdatatype

func PossibleValuesForOdatatype() []string

func PossibleValuesForOperator

func PossibleValuesForOperator() []string

func ValidateMetricAlertID

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

ValidateMetricAlertID checks that 'input' can be parsed as a Metric Alert ID

Types

type AggregationTypeEnum

type AggregationTypeEnum string
const (
	AggregationTypeEnumAverage AggregationTypeEnum = "Average"
	AggregationTypeEnumCount   AggregationTypeEnum = "Count"
	AggregationTypeEnumMaximum AggregationTypeEnum = "Maximum"
	AggregationTypeEnumMinimum AggregationTypeEnum = "Minimum"
	AggregationTypeEnumTotal   AggregationTypeEnum = "Total"
)

type CreateOrUpdateOperationResponse

type CreateOrUpdateOperationResponse struct {
	HttpResponse *http.Response
	Model        *MetricAlertResource
}

type CriterionType

type CriterionType string
const (
	CriterionTypeDynamicThresholdCriterion CriterionType = "DynamicThresholdCriterion"
	CriterionTypeStaticThresholdCriterion  CriterionType = "StaticThresholdCriterion"
)

type DeleteOperationResponse

type DeleteOperationResponse struct {
	HttpResponse *http.Response
}

type DynamicMetricCriteria

type DynamicMetricCriteria struct {
	AlertSensitivity DynamicThresholdSensitivity    `json:"alertSensitivity"`
	FailingPeriods   DynamicThresholdFailingPeriods `json:"failingPeriods"`
	IgnoreDataBefore *string                        `json:"ignoreDataBefore,omitempty"`
	Operator         DynamicThresholdOperator       `json:"operator"`

	// Fields inherited from MultiMetricCriteria
	Dimensions           *[]MetricDimension  `json:"dimensions,omitempty"`
	MetricName           string              `json:"metricName"`
	MetricNamespace      *string             `json:"metricNamespace,omitempty"`
	Name                 string              `json:"name"`
	SkipMetricValidation *bool               `json:"skipMetricValidation,omitempty"`
	TimeAggregation      AggregationTypeEnum `json:"timeAggregation"`
}

func (DynamicMetricCriteria) MarshalJSON

func (s DynamicMetricCriteria) MarshalJSON() ([]byte, error)

type DynamicThresholdFailingPeriods

type DynamicThresholdFailingPeriods struct {
	MinFailingPeriodsToAlert  float64 `json:"minFailingPeriodsToAlert"`
	NumberOfEvaluationPeriods float64 `json:"numberOfEvaluationPeriods"`
}

type DynamicThresholdOperator

type DynamicThresholdOperator string
const (
	DynamicThresholdOperatorGreaterOrLessThan DynamicThresholdOperator = "GreaterOrLessThan"
	DynamicThresholdOperatorGreaterThan       DynamicThresholdOperator = "GreaterThan"
	DynamicThresholdOperatorLessThan          DynamicThresholdOperator = "LessThan"
)

type DynamicThresholdSensitivity

type DynamicThresholdSensitivity string
const (
	DynamicThresholdSensitivityHigh   DynamicThresholdSensitivity = "High"
	DynamicThresholdSensitivityLow    DynamicThresholdSensitivity = "Low"
	DynamicThresholdSensitivityMedium DynamicThresholdSensitivity = "Medium"
)

type GetOperationResponse

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

type ListByResourceGroupOperationResponse

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

type ListBySubscriptionOperationResponse

type ListBySubscriptionOperationResponse struct {
	HttpResponse *http.Response
	Model        *MetricAlertResourceCollection
}

type MetricAlertAction

type MetricAlertAction struct {
	ActionGroupId     *string            `json:"actionGroupId,omitempty"`
	WebHookProperties *map[string]string `json:"webHookProperties,omitempty"`
}

type MetricAlertCriteria

type MetricAlertCriteria interface {
}

type MetricAlertId

type MetricAlertId struct {
	SubscriptionId    string
	ResourceGroupName string
	MetricAlertName   string
}

MetricAlertId is a struct representing the Resource ID for a Metric Alert

func NewMetricAlertID

func NewMetricAlertID(subscriptionId string, resourceGroupName string, metricAlertName string) MetricAlertId

NewMetricAlertID returns a new MetricAlertId struct

func ParseMetricAlertID

func ParseMetricAlertID(input string) (*MetricAlertId, error)

ParseMetricAlertID parses 'input' into a MetricAlertId

func ParseMetricAlertIDInsensitively

func ParseMetricAlertIDInsensitively(input string) (*MetricAlertId, error)

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

func (MetricAlertId) ID

func (id MetricAlertId) ID() string

ID returns the formatted Metric Alert ID

func (MetricAlertId) Segments

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

Segments returns a slice of Resource ID Segments which comprise this Metric Alert ID

func (MetricAlertId) String

func (id MetricAlertId) String() string

String returns a human-readable description of this Metric Alert ID

type MetricAlertMultipleResourceMultipleMetricCriteria

type MetricAlertMultipleResourceMultipleMetricCriteria struct {
	AllOf *[]MultiMetricCriteria `json:"allOf,omitempty"`
}

func (MetricAlertMultipleResourceMultipleMetricCriteria) MarshalJSON

func (*MetricAlertMultipleResourceMultipleMetricCriteria) UnmarshalJSON

type MetricAlertProperties

type MetricAlertProperties struct {
	Actions              *[]MetricAlertAction `json:"actions,omitempty"`
	AutoMitigate         *bool                `json:"autoMitigate,omitempty"`
	Criteria             MetricAlertCriteria  `json:"criteria"`
	Description          *string              `json:"description,omitempty"`
	Enabled              bool                 `json:"enabled"`
	EvaluationFrequency  string               `json:"evaluationFrequency"`
	IsMigrated           *bool                `json:"isMigrated,omitempty"`
	LastUpdatedTime      *string              `json:"lastUpdatedTime,omitempty"`
	Scopes               []string             `json:"scopes"`
	Severity             int64                `json:"severity"`
	TargetResourceRegion *string              `json:"targetResourceRegion,omitempty"`
	TargetResourceType   *string              `json:"targetResourceType,omitempty"`
	WindowSize           string               `json:"windowSize"`
}

func (*MetricAlertProperties) GetLastUpdatedTimeAsTime

func (o *MetricAlertProperties) GetLastUpdatedTimeAsTime() (*time.Time, error)

func (*MetricAlertProperties) SetLastUpdatedTimeAsTime

func (o *MetricAlertProperties) SetLastUpdatedTimeAsTime(input time.Time)

func (*MetricAlertProperties) UnmarshalJSON

func (s *MetricAlertProperties) UnmarshalJSON(bytes []byte) error

type MetricAlertPropertiesPatch

type MetricAlertPropertiesPatch struct {
	Actions              *[]MetricAlertAction `json:"actions,omitempty"`
	AutoMitigate         *bool                `json:"autoMitigate,omitempty"`
	Criteria             MetricAlertCriteria  `json:"criteria"`
	Description          *string              `json:"description,omitempty"`
	Enabled              *bool                `json:"enabled,omitempty"`
	EvaluationFrequency  *string              `json:"evaluationFrequency,omitempty"`
	IsMigrated           *bool                `json:"isMigrated,omitempty"`
	LastUpdatedTime      *string              `json:"lastUpdatedTime,omitempty"`
	Scopes               *[]string            `json:"scopes,omitempty"`
	Severity             *int64               `json:"severity,omitempty"`
	TargetResourceRegion *string              `json:"targetResourceRegion,omitempty"`
	TargetResourceType   *string              `json:"targetResourceType,omitempty"`
	WindowSize           *string              `json:"windowSize,omitempty"`
}

func (*MetricAlertPropertiesPatch) GetLastUpdatedTimeAsTime

func (o *MetricAlertPropertiesPatch) GetLastUpdatedTimeAsTime() (*time.Time, error)

func (*MetricAlertPropertiesPatch) SetLastUpdatedTimeAsTime

func (o *MetricAlertPropertiesPatch) SetLastUpdatedTimeAsTime(input time.Time)

func (*MetricAlertPropertiesPatch) UnmarshalJSON

func (s *MetricAlertPropertiesPatch) UnmarshalJSON(bytes []byte) error

type MetricAlertResource

type MetricAlertResource struct {
	Id         *string               `json:"id,omitempty"`
	Location   string                `json:"location"`
	Name       *string               `json:"name,omitempty"`
	Properties MetricAlertProperties `json:"properties"`
	Tags       *map[string]string    `json:"tags,omitempty"`
	Type       *string               `json:"type,omitempty"`
}

type MetricAlertResourceCollection

type MetricAlertResourceCollection struct {
	Value *[]MetricAlertResource `json:"value,omitempty"`
}

type MetricAlertResourcePatch

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

type MetricAlertSingleResourceMultipleMetricCriteria

type MetricAlertSingleResourceMultipleMetricCriteria struct {
	AllOf *[]MetricCriteria `json:"allOf,omitempty"`
}

func (MetricAlertSingleResourceMultipleMetricCriteria) MarshalJSON

type MetricAlertsClient

type MetricAlertsClient struct {
	Client autorest.Client
	// contains filtered or unexported fields
}

func NewMetricAlertsClientWithBaseURI

func NewMetricAlertsClientWithBaseURI(endpoint string) MetricAlertsClient

func (MetricAlertsClient) CreateOrUpdate

CreateOrUpdate ...

func (MetricAlertsClient) Delete

Delete ...

func (MetricAlertsClient) Get

Get ...

func (MetricAlertsClient) ListByResourceGroup

ListByResourceGroup ...

func (MetricAlertsClient) ListBySubscription

ListBySubscription ...

func (MetricAlertsClient) Update

Update ...

type MetricCriteria

type MetricCriteria struct {
	Operator  Operator `json:"operator"`
	Threshold float64  `json:"threshold"`

	// Fields inherited from MultiMetricCriteria
	Dimensions           *[]MetricDimension  `json:"dimensions,omitempty"`
	MetricName           string              `json:"metricName"`
	MetricNamespace      *string             `json:"metricNamespace,omitempty"`
	Name                 string              `json:"name"`
	SkipMetricValidation *bool               `json:"skipMetricValidation,omitempty"`
	TimeAggregation      AggregationTypeEnum `json:"timeAggregation"`
}

func (MetricCriteria) MarshalJSON

func (s MetricCriteria) MarshalJSON() ([]byte, error)

type MetricDimension

type MetricDimension struct {
	Name     string   `json:"name"`
	Operator string   `json:"operator"`
	Values   []string `json:"values"`
}

type MultiMetricCriteria

type MultiMetricCriteria interface {
}

type Odatatype

type Odatatype string
const (
	OdatatypeMicrosoftPointAzurePointMonitorPointMultipleResourceMultipleMetricCriteria Odatatype = "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria"
	OdatatypeMicrosoftPointAzurePointMonitorPointSingleResourceMultipleMetricCriteria   Odatatype = "Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria"
	OdatatypeMicrosoftPointAzurePointMonitorPointWebtestLocationAvailabilityCriteria    Odatatype = "Microsoft.Azure.Monitor.WebtestLocationAvailabilityCriteria"
)

type Operator

type Operator string
const (
	OperatorEquals             Operator = "Equals"
	OperatorGreaterThan        Operator = "GreaterThan"
	OperatorGreaterThanOrEqual Operator = "GreaterThanOrEqual"
	OperatorLessThan           Operator = "LessThan"
	OperatorLessThanOrEqual    Operator = "LessThanOrEqual"
)

type RawMetricAlertCriteriaImpl added in v0.20230807.1063129

type RawMetricAlertCriteriaImpl struct {
	Type   string
	Values map[string]interface{}
}

RawMetricAlertCriteriaImpl is returned when the Discriminated Value doesn't match any of the defined types NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) and is used only for Deserialization (e.g. this cannot be used as a Request Payload).

type RawMultiMetricCriteriaImpl added in v0.20230807.1063129

type RawMultiMetricCriteriaImpl struct {
	Type   string
	Values map[string]interface{}
}

RawMultiMetricCriteriaImpl is returned when the Discriminated Value doesn't match any of the defined types NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) and is used only for Deserialization (e.g. this cannot be used as a Request Payload).

type UpdateOperationResponse

type UpdateOperationResponse struct {
	HttpResponse *http.Response
	Model        *MetricAlertResource
}

type WebtestLocationAvailabilityCriteria

type WebtestLocationAvailabilityCriteria struct {
	ComponentId         string  `json:"componentId"`
	FailedLocationCount float64 `json:"failedLocationCount"`
	WebTestId           string  `json:"webTestId"`
}

func (WebtestLocationAvailabilityCriteria) MarshalJSON

func (s WebtestLocationAvailabilityCriteria) MarshalJSON() ([]byte, error)

Jump to

Keyboard shortcuts

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