scheduledqueryrules

package
v0.20240320.1144505 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2024 License: MPL-2.0 Imports: 13 Imported by: 1

README

github.com/hashicorp/go-azure-sdk/resource-manager/insights/2023-03-15-preview/scheduledqueryrules Documentation

The scheduledqueryrules SDK allows for interaction with the Azure Resource Manager Service insights (API Version 2023-03-15-preview).

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/insights/2023-03-15-preview/scheduledqueryrules"

Client Initialization

client := scheduledqueryrules.NewScheduledQueryRulesClientWithBaseURI("https://management.azure.com")
client.Client.Authorizer = authorizer

Example Usage: ScheduledQueryRulesClient.CreateOrUpdate

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

payload := scheduledqueryrules.ScheduledQueryRuleResource{
	// ...
}


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

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

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

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

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

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

// alternatively `client.ListByResourceGroup(ctx, id)` can be used to do batched pagination
items, err := client.ListByResourceGroupComplete(ctx, id)
if err != nil {
	// handle the error
}
for _, item := range items {
	// do something
}

Example Usage: ScheduledQueryRulesClient.ListBySubscription

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

// alternatively `client.ListBySubscription(ctx, id)` can be used to do batched pagination
items, err := client.ListBySubscriptionComplete(ctx, id)
if err != nil {
	// handle the error
}
for _, item := range items {
	// do something
}

Example Usage: ScheduledQueryRulesClient.Update

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

payload := scheduledqueryrules.ScheduledQueryRuleResourcePatch{
	// ...
}


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 PossibleValuesForAlertSeverity

func PossibleValuesForAlertSeverity() []int64

func PossibleValuesForConditionOperator

func PossibleValuesForConditionOperator() []string

func PossibleValuesForDimensionOperator

func PossibleValuesForDimensionOperator() []string

func PossibleValuesForKind

func PossibleValuesForKind() []string

func PossibleValuesForTimeAggregation

func PossibleValuesForTimeAggregation() []string

func ValidateScheduledQueryRuleID

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

ValidateScheduledQueryRuleID checks that 'input' can be parsed as a Scheduled Query Rule ID

Types

type Actions

type Actions struct {
	ActionGroups     *[]string          `json:"actionGroups,omitempty"`
	ActionProperties *map[string]string `json:"actionProperties,omitempty"`
	CustomProperties *map[string]string `json:"customProperties,omitempty"`
}

type AlertSeverity

type AlertSeverity int64
const (
	AlertSeverityFour  AlertSeverity = 4
	AlertSeverityOne   AlertSeverity = 1
	AlertSeverityThree AlertSeverity = 3
	AlertSeverityTwo   AlertSeverity = 2
	AlertSeverityZero  AlertSeverity = 0
)

type Condition

type Condition struct {
	Dimensions          *[]Dimension             `json:"dimensions,omitempty"`
	FailingPeriods      *ConditionFailingPeriods `json:"failingPeriods,omitempty"`
	MetricMeasureColumn *string                  `json:"metricMeasureColumn,omitempty"`
	MetricName          *string                  `json:"metricName,omitempty"`
	Operator            *ConditionOperator       `json:"operator,omitempty"`
	Query               *string                  `json:"query,omitempty"`
	ResourceIdColumn    *string                  `json:"resourceIdColumn,omitempty"`
	Threshold           *float64                 `json:"threshold,omitempty"`
	TimeAggregation     *TimeAggregation         `json:"timeAggregation,omitempty"`
}

type ConditionFailingPeriods

type ConditionFailingPeriods struct {
	MinFailingPeriodsToAlert  *int64 `json:"minFailingPeriodsToAlert,omitempty"`
	NumberOfEvaluationPeriods *int64 `json:"numberOfEvaluationPeriods,omitempty"`
}

type ConditionOperator

type ConditionOperator string
const (
	ConditionOperatorEquals             ConditionOperator = "Equals"
	ConditionOperatorGreaterThan        ConditionOperator = "GreaterThan"
	ConditionOperatorGreaterThanOrEqual ConditionOperator = "GreaterThanOrEqual"
	ConditionOperatorLessThan           ConditionOperator = "LessThan"
	ConditionOperatorLessThanOrEqual    ConditionOperator = "LessThanOrEqual"
)

func (*ConditionOperator) UnmarshalJSON added in v0.20240229.1102109

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

type CreateOrUpdateOperationResponse

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

type DeleteOperationResponse

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

type Dimension

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

type DimensionOperator

type DimensionOperator string
const (
	DimensionOperatorExclude DimensionOperator = "Exclude"
	DimensionOperatorInclude DimensionOperator = "Include"
)

func (*DimensionOperator) UnmarshalJSON added in v0.20240229.1102109

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

type GetOperationResponse

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

type Kind

type Kind string
const (
	KindLogAlert    Kind = "LogAlert"
	KindLogToMetric Kind = "LogToMetric"
)

func (*Kind) UnmarshalJSON added in v0.20240229.1102109

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

type ListByResourceGroupCompleteResult

type ListByResourceGroupCompleteResult struct {
	LatestHttpResponse *http.Response
	Items              []ScheduledQueryRuleResource
}

type ListByResourceGroupOperationResponse

type ListByResourceGroupOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *[]ScheduledQueryRuleResource
}

type ListBySubscriptionCompleteResult

type ListBySubscriptionCompleteResult struct {
	LatestHttpResponse *http.Response
	Items              []ScheduledQueryRuleResource
}

type ListBySubscriptionOperationResponse

type ListBySubscriptionOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *[]ScheduledQueryRuleResource
}

type RuleResolveConfiguration

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

type ScheduledQueryRuleCriteria

type ScheduledQueryRuleCriteria struct {
	AllOf *[]Condition `json:"allOf,omitempty"`
}

type ScheduledQueryRuleId

type ScheduledQueryRuleId struct {
	SubscriptionId         string
	ResourceGroupName      string
	ScheduledQueryRuleName string
}

ScheduledQueryRuleId is a struct representing the Resource ID for a Scheduled Query Rule

func NewScheduledQueryRuleID

func NewScheduledQueryRuleID(subscriptionId string, resourceGroupName string, scheduledQueryRuleName string) ScheduledQueryRuleId

NewScheduledQueryRuleID returns a new ScheduledQueryRuleId struct

func ParseScheduledQueryRuleID

func ParseScheduledQueryRuleID(input string) (*ScheduledQueryRuleId, error)

ParseScheduledQueryRuleID parses 'input' into a ScheduledQueryRuleId

func ParseScheduledQueryRuleIDInsensitively

func ParseScheduledQueryRuleIDInsensitively(input string) (*ScheduledQueryRuleId, error)

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

func (*ScheduledQueryRuleId) FromParseResult

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

func (ScheduledQueryRuleId) ID

func (id ScheduledQueryRuleId) ID() string

ID returns the formatted Scheduled Query Rule ID

func (ScheduledQueryRuleId) Segments

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

Segments returns a slice of Resource ID Segments which comprise this Scheduled Query Rule ID

func (ScheduledQueryRuleId) String

func (id ScheduledQueryRuleId) String() string

String returns a human-readable description of this Scheduled Query Rule ID

type ScheduledQueryRuleProperties

type ScheduledQueryRuleProperties struct {
	Actions                               *Actions                    `json:"actions,omitempty"`
	AutoMitigate                          *bool                       `json:"autoMitigate,omitempty"`
	CheckWorkspaceAlertsStorageConfigured *bool                       `json:"checkWorkspaceAlertsStorageConfigured,omitempty"`
	CreatedWithApiVersion                 *string                     `json:"createdWithApiVersion,omitempty"`
	Criteria                              *ScheduledQueryRuleCriteria `json:"criteria,omitempty"`
	Description                           *string                     `json:"description,omitempty"`
	DisplayName                           *string                     `json:"displayName,omitempty"`
	Enabled                               *bool                       `json:"enabled,omitempty"`
	EvaluationFrequency                   *string                     `json:"evaluationFrequency,omitempty"`
	IsLegacyLogAnalyticsRule              *bool                       `json:"isLegacyLogAnalyticsRule,omitempty"`
	IsWorkspaceAlertsStorageConfigured    *bool                       `json:"isWorkspaceAlertsStorageConfigured,omitempty"`
	MuteActionsDuration                   *string                     `json:"muteActionsDuration,omitempty"`
	OverrideQueryTimeRange                *string                     `json:"overrideQueryTimeRange,omitempty"`
	RuleResolveConfiguration              *RuleResolveConfiguration   `json:"ruleResolveConfiguration,omitempty"`
	Scopes                                *[]string                   `json:"scopes,omitempty"`
	Severity                              *AlertSeverity              `json:"severity,omitempty"`
	SkipQueryValidation                   *bool                       `json:"skipQueryValidation,omitempty"`
	TargetResourceTypes                   *[]string                   `json:"targetResourceTypes,omitempty"`
	WindowSize                            *string                     `json:"windowSize,omitempty"`
}

type ScheduledQueryRuleResource

type ScheduledQueryRuleResource struct {
	Etag       *string                           `json:"etag,omitempty"`
	Id         *string                           `json:"id,omitempty"`
	Identity   *identity.SystemOrUserAssignedMap `json:"identity,omitempty"`
	Kind       *Kind                             `json:"kind,omitempty"`
	Location   string                            `json:"location"`
	Name       *string                           `json:"name,omitempty"`
	Properties ScheduledQueryRuleProperties      `json:"properties"`
	SystemData *systemdata.SystemData            `json:"systemData,omitempty"`
	Tags       *map[string]string                `json:"tags,omitempty"`
	Type       *string                           `json:"type,omitempty"`
}

type ScheduledQueryRuleResourceOperationPredicate

type ScheduledQueryRuleResourceOperationPredicate struct {
	Etag     *string
	Id       *string
	Location *string
	Name     *string
	Type     *string
}

func (ScheduledQueryRuleResourceOperationPredicate) Matches

type ScheduledQueryRuleResourcePatch

type ScheduledQueryRuleResourcePatch struct {
	Identity   *identity.SystemOrUserAssignedMap `json:"identity,omitempty"`
	Properties *ScheduledQueryRuleProperties     `json:"properties,omitempty"`
	Tags       *map[string]string                `json:"tags,omitempty"`
}

type ScheduledQueryRulesClient

type ScheduledQueryRulesClient struct {
	Client *resourcemanager.Client
}

func NewScheduledQueryRulesClientWithBaseURI

func NewScheduledQueryRulesClientWithBaseURI(sdkApi sdkEnv.Api) (*ScheduledQueryRulesClient, error)

func (ScheduledQueryRulesClient) CreateOrUpdate

CreateOrUpdate ...

func (ScheduledQueryRulesClient) Delete

Delete ...

func (ScheduledQueryRulesClient) Get

Get ...

func (ScheduledQueryRulesClient) ListByResourceGroup

ListByResourceGroup ...

func (ScheduledQueryRulesClient) ListByResourceGroupComplete

ListByResourceGroupComplete retrieves all the results into a single object

func (ScheduledQueryRulesClient) ListByResourceGroupCompleteMatchingPredicate

func (c ScheduledQueryRulesClient) ListByResourceGroupCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate ScheduledQueryRuleResourceOperationPredicate) (result ListByResourceGroupCompleteResult, err error)

ListByResourceGroupCompleteMatchingPredicate retrieves all the results and then applies the predicate

func (ScheduledQueryRulesClient) ListBySubscription

ListBySubscription ...

func (ScheduledQueryRulesClient) ListBySubscriptionComplete

ListBySubscriptionComplete retrieves all the results into a single object

func (ScheduledQueryRulesClient) ListBySubscriptionCompleteMatchingPredicate

func (c ScheduledQueryRulesClient) ListBySubscriptionCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate ScheduledQueryRuleResourceOperationPredicate) (result ListBySubscriptionCompleteResult, err error)

ListBySubscriptionCompleteMatchingPredicate retrieves all the results and then applies the predicate

func (ScheduledQueryRulesClient) Update

Update ...

type TimeAggregation

type TimeAggregation string
const (
	TimeAggregationAverage TimeAggregation = "Average"
	TimeAggregationCount   TimeAggregation = "Count"
	TimeAggregationMaximum TimeAggregation = "Maximum"
	TimeAggregationMinimum TimeAggregation = "Minimum"
	TimeAggregationTotal   TimeAggregation = "Total"
)

func (*TimeAggregation) UnmarshalJSON added in v0.20240229.1102109

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

type UpdateOperationResponse

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

Jump to

Keyboard shortcuts

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