alertrules

package
v0.20241206.1180327 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2024 License: MPL-2.0 Imports: 14 Imported by: 0

README

github.com/hashicorp/go-azure-sdk/resource-manager/insights/2016-03-01/alertrules Documentation

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

Client Initialization

client := alertrules.NewAlertRulesClientWithBaseURI("https://management.azure.com")
client.Client.Authorizer = authorizer

Example Usage: AlertRulesClient.CreateOrUpdate

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

payload := alertrules.AlertRuleResource{
	// ...
}


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

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

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

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

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: AlertRulesClient.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: AlertRulesClient.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
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PossibleValuesForConditionOperator

func PossibleValuesForConditionOperator() []string

func PossibleValuesForTimeAggregationOperator

func PossibleValuesForTimeAggregationOperator() []string

func ValidateAlertRuleID

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

ValidateAlertRuleID checks that 'input' can be parsed as a Alert Rule ID

Types

type AlertRule

type AlertRule struct {
	Action            RuleAction    `json:"action"`
	Actions           *[]RuleAction `json:"actions,omitempty"`
	Condition         RuleCondition `json:"condition"`
	Description       *string       `json:"description,omitempty"`
	IsEnabled         bool          `json:"isEnabled"`
	LastUpdatedTime   *string       `json:"lastUpdatedTime,omitempty"`
	Name              string        `json:"name"`
	ProvisioningState *string       `json:"provisioningState,omitempty"`
}

func (*AlertRule) GetLastUpdatedTimeAsTime

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

func (*AlertRule) SetLastUpdatedTimeAsTime

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

func (*AlertRule) UnmarshalJSON

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

type AlertRuleId

type AlertRuleId struct {
	SubscriptionId    string
	ResourceGroupName string
	AlertRuleName     string
}

AlertRuleId is a struct representing the Resource ID for a Alert Rule

func NewAlertRuleID

func NewAlertRuleID(subscriptionId string, resourceGroupName string, alertRuleName string) AlertRuleId

NewAlertRuleID returns a new AlertRuleId struct

func ParseAlertRuleID

func ParseAlertRuleID(input string) (*AlertRuleId, error)

ParseAlertRuleID parses 'input' into a AlertRuleId

func ParseAlertRuleIDInsensitively

func ParseAlertRuleIDInsensitively(input string) (*AlertRuleId, error)

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

func (*AlertRuleId) FromParseResult

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

func (AlertRuleId) ID

func (id AlertRuleId) ID() string

ID returns the formatted Alert Rule ID

func (AlertRuleId) Segments

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

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

func (AlertRuleId) String

func (id AlertRuleId) String() string

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

type AlertRuleResource

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

type AlertRuleResourceCollection

type AlertRuleResourceCollection struct {
	Value *[]AlertRuleResource `json:"value,omitempty"`
}

type AlertRulesClient

type AlertRulesClient struct {
	Client *resourcemanager.Client
}

func NewAlertRulesClientWithBaseURI

func NewAlertRulesClientWithBaseURI(sdkApi sdkEnv.Api) (*AlertRulesClient, error)

func (AlertRulesClient) CreateOrUpdate

CreateOrUpdate ...

func (AlertRulesClient) Delete

func (c AlertRulesClient) Delete(ctx context.Context, id AlertRuleId) (result DeleteOperationResponse, err error)

Delete ...

func (AlertRulesClient) Get

Get ...

func (AlertRulesClient) ListByResourceGroup

ListByResourceGroup ...

func (AlertRulesClient) ListBySubscription

ListBySubscription ...

type BaseRuleActionImpl added in v0.20240920.1135249

type BaseRuleActionImpl struct {
	OdataType string `json:"odata.type"`
}

func (BaseRuleActionImpl) RuleAction added in v0.20240920.1135249

func (s BaseRuleActionImpl) RuleAction() BaseRuleActionImpl

type BaseRuleConditionImpl added in v0.20240920.1135249

type BaseRuleConditionImpl struct {
	DataSource RuleDataSource `json:"dataSource"`
	OdataType  string         `json:"odata.type"`
}

func (BaseRuleConditionImpl) RuleCondition added in v0.20240920.1135249

func (s BaseRuleConditionImpl) RuleCondition() BaseRuleConditionImpl

func (*BaseRuleConditionImpl) UnmarshalJSON added in v0.20240920.1135249

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

type BaseRuleDataSourceImpl added in v0.20240920.1135249

type BaseRuleDataSourceImpl struct {
	LegacyResourceId *string `json:"legacyResourceId,omitempty"`
	MetricNamespace  *string `json:"metricNamespace,omitempty"`
	OdataType        string  `json:"odata.type"`
	ResourceLocation *string `json:"resourceLocation,omitempty"`
	ResourceUri      *string `json:"resourceUri,omitempty"`
}

func (BaseRuleDataSourceImpl) RuleDataSource added in v0.20240920.1135249

type ConditionOperator

type ConditionOperator string
const (
	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        *AlertRuleResource
}

type DeleteOperationResponse

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

type GetOperationResponse

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

type ListByResourceGroupOperationResponse

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

type ListBySubscriptionOperationResponse

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

type LocationThresholdRuleCondition

type LocationThresholdRuleCondition struct {
	FailedLocationCount int64   `json:"failedLocationCount"`
	WindowSize          *string `json:"windowSize,omitempty"`

	DataSource RuleDataSource `json:"dataSource"`
	OdataType  string         `json:"odata.type"`
}

func (LocationThresholdRuleCondition) MarshalJSON

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

func (LocationThresholdRuleCondition) RuleCondition added in v0.20240920.1135249

func (*LocationThresholdRuleCondition) UnmarshalJSON

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

type ManagementEventAggregationCondition

type ManagementEventAggregationCondition struct {
	Operator   *ConditionOperator `json:"operator,omitempty"`
	Threshold  *float64           `json:"threshold,omitempty"`
	WindowSize *string            `json:"windowSize,omitempty"`
}

type ManagementEventRuleCondition

type ManagementEventRuleCondition struct {
	Aggregation *ManagementEventAggregationCondition `json:"aggregation,omitempty"`

	DataSource RuleDataSource `json:"dataSource"`
	OdataType  string         `json:"odata.type"`
}

func (ManagementEventRuleCondition) MarshalJSON

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

func (ManagementEventRuleCondition) RuleCondition added in v0.20240920.1135249

func (*ManagementEventRuleCondition) UnmarshalJSON

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

type RawRuleActionImpl

type RawRuleActionImpl struct {
	Type   string
	Values map[string]interface{}
	// contains filtered or unexported fields
}

RawRuleActionImpl 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).

func (RawRuleActionImpl) RuleAction added in v0.20240920.1135249

func (s RawRuleActionImpl) RuleAction() BaseRuleActionImpl

type RawRuleConditionImpl

type RawRuleConditionImpl struct {
	Type   string
	Values map[string]interface{}
	// contains filtered or unexported fields
}

RawRuleConditionImpl 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).

func (RawRuleConditionImpl) RuleCondition added in v0.20240920.1135249

func (s RawRuleConditionImpl) RuleCondition() BaseRuleConditionImpl

type RawRuleDataSourceImpl

type RawRuleDataSourceImpl struct {
	Type   string
	Values map[string]interface{}
	// contains filtered or unexported fields
}

RawRuleDataSourceImpl 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).

func (RawRuleDataSourceImpl) RuleDataSource added in v0.20240920.1135249

func (s RawRuleDataSourceImpl) RuleDataSource() BaseRuleDataSourceImpl

type RuleAction

type RuleAction interface {
	RuleAction() BaseRuleActionImpl
}

func UnmarshalRuleActionImplementation added in v0.20240920.1135249

func UnmarshalRuleActionImplementation(input []byte) (RuleAction, error)

type RuleCondition

type RuleCondition interface {
	RuleCondition() BaseRuleConditionImpl
}

func UnmarshalRuleConditionImplementation added in v0.20240920.1135249

func UnmarshalRuleConditionImplementation(input []byte) (RuleCondition, error)

type RuleDataSource

type RuleDataSource interface {
	RuleDataSource() BaseRuleDataSourceImpl
}

func UnmarshalRuleDataSourceImplementation added in v0.20240920.1135249

func UnmarshalRuleDataSourceImplementation(input []byte) (RuleDataSource, error)

type RuleEmailAction

type RuleEmailAction struct {
	CustomEmails        *[]string `json:"customEmails,omitempty"`
	SendToServiceOwners *bool     `json:"sendToServiceOwners,omitempty"`

	OdataType string `json:"odata.type"`
}

func (RuleEmailAction) MarshalJSON

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

func (RuleEmailAction) RuleAction added in v0.20240920.1135249

func (s RuleEmailAction) RuleAction() BaseRuleActionImpl

type RuleManagementEventClaimsDataSource

type RuleManagementEventClaimsDataSource struct {
	EmailAddress *string `json:"emailAddress,omitempty"`
}

type RuleManagementEventDataSource

type RuleManagementEventDataSource struct {
	Claims               *RuleManagementEventClaimsDataSource `json:"claims,omitempty"`
	EventName            *string                              `json:"eventName,omitempty"`
	EventSource          *string                              `json:"eventSource,omitempty"`
	Level                *string                              `json:"level,omitempty"`
	OperationName        *string                              `json:"operationName,omitempty"`
	ResourceGroupName    *string                              `json:"resourceGroupName,omitempty"`
	ResourceProviderName *string                              `json:"resourceProviderName,omitempty"`
	Status               *string                              `json:"status,omitempty"`
	SubStatus            *string                              `json:"subStatus,omitempty"`

	LegacyResourceId *string `json:"legacyResourceId,omitempty"`
	MetricNamespace  *string `json:"metricNamespace,omitempty"`
	OdataType        string  `json:"odata.type"`
	ResourceLocation *string `json:"resourceLocation,omitempty"`
	ResourceUri      *string `json:"resourceUri,omitempty"`
}

func (RuleManagementEventDataSource) MarshalJSON

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

func (RuleManagementEventDataSource) RuleDataSource added in v0.20240920.1135249

type RuleMetricDataSource

type RuleMetricDataSource struct {
	MetricName *string `json:"metricName,omitempty"`

	LegacyResourceId *string `json:"legacyResourceId,omitempty"`
	MetricNamespace  *string `json:"metricNamespace,omitempty"`
	OdataType        string  `json:"odata.type"`
	ResourceLocation *string `json:"resourceLocation,omitempty"`
	ResourceUri      *string `json:"resourceUri,omitempty"`
}

func (RuleMetricDataSource) MarshalJSON

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

func (RuleMetricDataSource) RuleDataSource added in v0.20240920.1135249

func (s RuleMetricDataSource) RuleDataSource() BaseRuleDataSourceImpl

type RuleWebhookAction

type RuleWebhookAction struct {
	Properties *map[string]string `json:"properties,omitempty"`
	ServiceUri *string            `json:"serviceUri,omitempty"`

	OdataType string `json:"odata.type"`
}

func (RuleWebhookAction) MarshalJSON

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

func (RuleWebhookAction) RuleAction added in v0.20240920.1135249

func (s RuleWebhookAction) RuleAction() BaseRuleActionImpl

type ThresholdRuleCondition

type ThresholdRuleCondition struct {
	Operator        ConditionOperator        `json:"operator"`
	Threshold       float64                  `json:"threshold"`
	TimeAggregation *TimeAggregationOperator `json:"timeAggregation,omitempty"`
	WindowSize      *string                  `json:"windowSize,omitempty"`

	DataSource RuleDataSource `json:"dataSource"`
	OdataType  string         `json:"odata.type"`
}

func (ThresholdRuleCondition) MarshalJSON

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

func (ThresholdRuleCondition) RuleCondition added in v0.20240920.1135249

func (*ThresholdRuleCondition) UnmarshalJSON

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

type TimeAggregationOperator

type TimeAggregationOperator string
const (
	TimeAggregationOperatorAverage TimeAggregationOperator = "Average"
	TimeAggregationOperatorLast    TimeAggregationOperator = "Last"
	TimeAggregationOperatorMaximum TimeAggregationOperator = "Maximum"
	TimeAggregationOperatorMinimum TimeAggregationOperator = "Minimum"
	TimeAggregationOperatorTotal   TimeAggregationOperator = "Total"
)

func (*TimeAggregationOperator) UnmarshalJSON added in v0.20240229.1102109

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

Jump to

Keyboard shortcuts

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