smartdetectoralertrules

package
v0.20231215.1114251 Latest Latest
Warning

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

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

README

github.com/hashicorp/go-azure-sdk/resource-manager/alertsmanagement/2019-06-01/smartdetectoralertrules Documentation

The smartdetectoralertrules SDK allows for interaction with the Azure Resource Manager Service alertsmanagement (API Version 2019-06-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/2019-06-01/smartdetectoralertrules"

Client Initialization

client := smartdetectoralertrules.NewSmartDetectorAlertRulesClientWithBaseURI("https://management.azure.com")
client.Client.Authorizer = authorizer

Example Usage: SmartDetectorAlertRulesClient.CreateOrUpdate

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

payload := smartdetectoralertrules.AlertRule{
	// ...
}


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

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

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

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

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

Example Usage: SmartDetectorAlertRulesClient.List

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

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

Example Usage: SmartDetectorAlertRulesClient.ListByResourceGroup

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

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

Example Usage: SmartDetectorAlertRulesClient.Patch

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

payload := smartdetectoralertrules.AlertRulePatchObject{
	// ...
}


read, err := client.Patch(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 PossibleValuesForAlertRuleState

func PossibleValuesForAlertRuleState() []string

func PossibleValuesForSeverity

func PossibleValuesForSeverity() []string

func ValidateSmartDetectorAlertRuleID

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

ValidateSmartDetectorAlertRuleID checks that 'input' can be parsed as a Smart Detector Alert Rule ID

Types

type ActionGroupsInformation

type ActionGroupsInformation struct {
	CustomEmailSubject   *string  `json:"customEmailSubject,omitempty"`
	CustomWebhookPayload *string  `json:"customWebhookPayload,omitempty"`
	GroupIds             []string `json:"groupIds"`
}

type AlertRule

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

type AlertRuleOperationPredicate

type AlertRuleOperationPredicate struct {
	Id       *string
	Location *string
	Name     *string
	Type     *string
}

func (AlertRuleOperationPredicate) Matches

func (p AlertRuleOperationPredicate) Matches(input AlertRule) bool

type AlertRulePatchObject

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

type AlertRulePatchProperties

type AlertRulePatchProperties struct {
	ActionGroups *ActionGroupsInformation `json:"actionGroups,omitempty"`
	Description  *string                  `json:"description,omitempty"`
	Frequency    *string                  `json:"frequency,omitempty"`
	Severity     *Severity                `json:"severity,omitempty"`
	State        *AlertRuleState          `json:"state,omitempty"`
	Throttling   *ThrottlingInformation   `json:"throttling,omitempty"`
}

type AlertRuleProperties

type AlertRuleProperties struct {
	ActionGroups ActionGroupsInformation `json:"actionGroups"`
	Description  *string                 `json:"description,omitempty"`
	Detector     Detector                `json:"detector"`
	Frequency    string                  `json:"frequency"`
	Scope        []string                `json:"scope"`
	Severity     Severity                `json:"severity"`
	State        AlertRuleState          `json:"state"`
	Throttling   *ThrottlingInformation  `json:"throttling,omitempty"`
}

type AlertRuleState

type AlertRuleState string
const (
	AlertRuleStateDisabled AlertRuleState = "Disabled"
	AlertRuleStateEnabled  AlertRuleState = "Enabled"
)

func (*AlertRuleState) UnmarshalJSON

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

type CreateOrUpdateOperationResponse

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

type DeleteOperationResponse

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

type Detector

type Detector struct {
	Description            *string                 `json:"description,omitempty"`
	Id                     string                  `json:"id"`
	ImagePaths             *[]string               `json:"imagePaths,omitempty"`
	Name                   *string                 `json:"name,omitempty"`
	Parameters             *map[string]interface{} `json:"parameters,omitempty"`
	SupportedResourceTypes *[]string               `json:"supportedResourceTypes,omitempty"`
}

type GetOperationOptions

type GetOperationOptions struct {
	ExpandDetector *bool
}

func DefaultGetOperationOptions

func DefaultGetOperationOptions() GetOperationOptions

func (GetOperationOptions) ToHeaders

func (o GetOperationOptions) ToHeaders() *client.Headers

func (GetOperationOptions) ToOData

func (o GetOperationOptions) ToOData() *odata.Query

func (GetOperationOptions) ToQuery

func (o GetOperationOptions) ToQuery() *client.QueryParams

type GetOperationResponse

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

type ListByResourceGroupCompleteResult

type ListByResourceGroupCompleteResult struct {
	Items []AlertRule
}

type ListByResourceGroupOperationOptions

type ListByResourceGroupOperationOptions struct {
	ExpandDetector *bool
}

func DefaultListByResourceGroupOperationOptions

func DefaultListByResourceGroupOperationOptions() ListByResourceGroupOperationOptions

func (ListByResourceGroupOperationOptions) ToHeaders

func (ListByResourceGroupOperationOptions) ToOData

func (ListByResourceGroupOperationOptions) ToQuery

type ListByResourceGroupOperationResponse

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

type ListCompleteResult

type ListCompleteResult struct {
	Items []AlertRule
}

type ListOperationOptions

type ListOperationOptions struct {
	ExpandDetector *bool
}

func DefaultListOperationOptions

func DefaultListOperationOptions() ListOperationOptions

func (ListOperationOptions) ToHeaders

func (o ListOperationOptions) ToHeaders() *client.Headers

func (ListOperationOptions) ToOData

func (o ListOperationOptions) ToOData() *odata.Query

func (ListOperationOptions) ToQuery

type ListOperationResponse

type ListOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *[]AlertRule
}

type PatchOperationResponse

type PatchOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *AlertRule
}

type Severity

type Severity string
const (
	SeveritySevFour  Severity = "Sev4"
	SeveritySevOne   Severity = "Sev1"
	SeveritySevThree Severity = "Sev3"
	SeveritySevTwo   Severity = "Sev2"
	SeveritySevZero  Severity = "Sev0"
)

func (*Severity) UnmarshalJSON

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

type SmartDetectorAlertRuleId

type SmartDetectorAlertRuleId struct {
	SubscriptionId             string
	ResourceGroupName          string
	SmartDetectorAlertRuleName string
}

SmartDetectorAlertRuleId is a struct representing the Resource ID for a Smart Detector Alert Rule

func NewSmartDetectorAlertRuleID

func NewSmartDetectorAlertRuleID(subscriptionId string, resourceGroupName string, smartDetectorAlertRuleName string) SmartDetectorAlertRuleId

NewSmartDetectorAlertRuleID returns a new SmartDetectorAlertRuleId struct

func ParseSmartDetectorAlertRuleID

func ParseSmartDetectorAlertRuleID(input string) (*SmartDetectorAlertRuleId, error)

ParseSmartDetectorAlertRuleID parses 'input' into a SmartDetectorAlertRuleId

func ParseSmartDetectorAlertRuleIDInsensitively

func ParseSmartDetectorAlertRuleIDInsensitively(input string) (*SmartDetectorAlertRuleId, error)

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

func (*SmartDetectorAlertRuleId) FromParseResult added in v0.20231127.1171502

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

func (SmartDetectorAlertRuleId) ID

ID returns the formatted Smart Detector Alert Rule ID

func (SmartDetectorAlertRuleId) Segments

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

func (SmartDetectorAlertRuleId) String

func (id SmartDetectorAlertRuleId) String() string

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

type SmartDetectorAlertRulesClient

type SmartDetectorAlertRulesClient struct {
	Client *resourcemanager.Client
}

func NewSmartDetectorAlertRulesClientWithBaseURI

func NewSmartDetectorAlertRulesClientWithBaseURI(sdkApi sdkEnv.Api) (*SmartDetectorAlertRulesClient, error)

func (SmartDetectorAlertRulesClient) CreateOrUpdate

CreateOrUpdate ...

func (SmartDetectorAlertRulesClient) Delete

Delete ...

func (SmartDetectorAlertRulesClient) Get

Get ...

func (SmartDetectorAlertRulesClient) List

List ...

func (SmartDetectorAlertRulesClient) ListByResourceGroup

ListByResourceGroup ...

func (SmartDetectorAlertRulesClient) ListByResourceGroupComplete

ListByResourceGroupComplete retrieves all the results into a single object

func (SmartDetectorAlertRulesClient) ListByResourceGroupCompleteMatchingPredicate

ListByResourceGroupCompleteMatchingPredicate retrieves all the results and then applies the predicate

func (SmartDetectorAlertRulesClient) ListComplete

ListComplete retrieves all the results into a single object

func (SmartDetectorAlertRulesClient) ListCompleteMatchingPredicate

func (c SmartDetectorAlertRulesClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, options ListOperationOptions, predicate AlertRuleOperationPredicate) (result ListCompleteResult, err error)

ListCompleteMatchingPredicate retrieves all the results and then applies the predicate

func (SmartDetectorAlertRulesClient) Patch

Patch ...

type ThrottlingInformation

type ThrottlingInformation struct {
	Duration *string `json:"duration,omitempty"`
}

Jump to

Keyboard shortcuts

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