actionrules

package
v0.20240731.1212841 Latest Latest
Warning

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

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

README

github.com/hashicorp/go-azure-sdk/resource-manager/alertsmanagement/2019-05-05-preview/actionrules Documentation

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

Client Initialization

client := actionrules.NewActionRulesClientWithBaseURI("https://management.azure.com")
client.Client.Authorizer = authorizer

Example Usage: ActionRulesClient.CreateUpdate

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

payload := actionrules.ActionRule{
	// ...
}


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

Example Usage: ActionRulesClient.Delete

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

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: ActionRulesClient.GetByName

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

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

Example Usage: ActionRulesClient.ListByResourceGroup

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

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

Example Usage: ActionRulesClient.ListBySubscription

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

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

Example Usage: ActionRulesClient.Update

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

payload := actionrules.PatchObject{
	// ...
}


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 PossibleValuesForActionRuleStatus

func PossibleValuesForActionRuleStatus() []string

func PossibleValuesForActionRuleType

func PossibleValuesForActionRuleType() []string

func PossibleValuesForMonitorService

func PossibleValuesForMonitorService() []string

func PossibleValuesForOperator

func PossibleValuesForOperator() []string

func PossibleValuesForScopeType

func PossibleValuesForScopeType() []string

func PossibleValuesForSeverity

func PossibleValuesForSeverity() []string

func PossibleValuesForSuppressionType added in v0.20240402.1085733

func PossibleValuesForSuppressionType() []string

func ValidateActionRuleID

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

ValidateActionRuleID checks that 'input' can be parsed as a Action Rule ID

Types

type ActionGroup added in v0.20240402.1085733

type ActionGroup struct {
	ActionGroupId *string `json:"actionGroupId,omitempty"`

	// Fields inherited from ActionRuleProperties
	Conditions     *Conditions       `json:"conditions,omitempty"`
	CreatedAt      *string           `json:"createdAt,omitempty"`
	CreatedBy      *string           `json:"createdBy,omitempty"`
	Description    *string           `json:"description,omitempty"`
	LastModifiedAt *string           `json:"lastModifiedAt,omitempty"`
	LastModifiedBy *string           `json:"lastModifiedBy,omitempty"`
	Scope          *Scope            `json:"scope,omitempty"`
	Status         *ActionRuleStatus `json:"status,omitempty"`
}

func (*ActionGroup) GetCreatedAtAsTime added in v0.20240402.1085733

func (o *ActionGroup) GetCreatedAtAsTime() (*time.Time, error)

func (*ActionGroup) GetLastModifiedAtAsTime added in v0.20240402.1085733

func (o *ActionGroup) GetLastModifiedAtAsTime() (*time.Time, error)

func (ActionGroup) MarshalJSON added in v0.20240402.1085733

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

func (*ActionGroup) SetCreatedAtAsTime added in v0.20240402.1085733

func (o *ActionGroup) SetCreatedAtAsTime(input time.Time)

func (*ActionGroup) SetLastModifiedAtAsTime added in v0.20240402.1085733

func (o *ActionGroup) SetLastModifiedAtAsTime(input time.Time)

type ActionRule

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

func (*ActionRule) UnmarshalJSON

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

type ActionRuleId

type ActionRuleId struct {
	SubscriptionId    string
	ResourceGroupName string
	ActionRuleName    string
}

ActionRuleId is a struct representing the Resource ID for a Action Rule

func NewActionRuleID

func NewActionRuleID(subscriptionId string, resourceGroupName string, actionRuleName string) ActionRuleId

NewActionRuleID returns a new ActionRuleId struct

func ParseActionRuleID

func ParseActionRuleID(input string) (*ActionRuleId, error)

ParseActionRuleID parses 'input' into a ActionRuleId

func ParseActionRuleIDInsensitively

func ParseActionRuleIDInsensitively(input string) (*ActionRuleId, error)

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

func (*ActionRuleId) FromParseResult

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

func (ActionRuleId) ID

func (id ActionRuleId) ID() string

ID returns the formatted Action Rule ID

func (ActionRuleId) Segments

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

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

func (ActionRuleId) String

func (id ActionRuleId) String() string

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

type ActionRuleOperationPredicate

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

func (ActionRuleOperationPredicate) Matches

func (p ActionRuleOperationPredicate) Matches(input ActionRule) bool

type ActionRuleProperties

type ActionRuleProperties interface {
}

type ActionRuleStatus

type ActionRuleStatus string
const (
	ActionRuleStatusDisabled ActionRuleStatus = "Disabled"
	ActionRuleStatusEnabled  ActionRuleStatus = "Enabled"
)

func (*ActionRuleStatus) UnmarshalJSON

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

type ActionRuleType

type ActionRuleType string
const (
	ActionRuleTypeActionGroup ActionRuleType = "ActionGroup"
	ActionRuleTypeDiagnostics ActionRuleType = "Diagnostics"
	ActionRuleTypeSuppression ActionRuleType = "Suppression"
)

func (*ActionRuleType) UnmarshalJSON

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

type ActionRulesClient

type ActionRulesClient struct {
	Client *resourcemanager.Client
}

func NewActionRulesClientWithBaseURI

func NewActionRulesClientWithBaseURI(sdkApi sdkEnv.Api) (*ActionRulesClient, error)

func (ActionRulesClient) CreateUpdate

func (c ActionRulesClient) CreateUpdate(ctx context.Context, id ActionRuleId, input ActionRule) (result CreateUpdateOperationResponse, err error)

CreateUpdate ...

func (ActionRulesClient) Delete

Delete ...

func (ActionRulesClient) GetByName

GetByName ...

func (ActionRulesClient) ListByResourceGroup

ListByResourceGroup ...

func (ActionRulesClient) ListByResourceGroupComplete

ListByResourceGroupComplete retrieves all the results into a single object

func (ActionRulesClient) ListByResourceGroupCompleteMatchingPredicate

func (c ActionRulesClient) ListByResourceGroupCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, options ListByResourceGroupOperationOptions, predicate ActionRuleOperationPredicate) (result ListByResourceGroupCompleteResult, err error)

ListByResourceGroupCompleteMatchingPredicate retrieves all the results and then applies the predicate

func (ActionRulesClient) ListBySubscription

ListBySubscription ...

func (ActionRulesClient) ListBySubscriptionComplete

ListBySubscriptionComplete retrieves all the results into a single object

func (ActionRulesClient) ListBySubscriptionCompleteMatchingPredicate

func (c ActionRulesClient) ListBySubscriptionCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, options ListBySubscriptionOperationOptions, predicate ActionRuleOperationPredicate) (result ListBySubscriptionCompleteResult, err error)

ListBySubscriptionCompleteMatchingPredicate retrieves all the results and then applies the predicate

func (ActionRulesClient) Update

Update ...

type Condition

type Condition struct {
	Operator *Operator `json:"operator,omitempty"`
	Values   *[]string `json:"values,omitempty"`
}

type Conditions

type Conditions struct {
	AlertContext       *Condition `json:"alertContext,omitempty"`
	AlertRuleId        *Condition `json:"alertRuleId,omitempty"`
	AlertRuleName      *Condition `json:"alertRuleName,omitempty"`
	Description        *Condition `json:"description,omitempty"`
	MonitorCondition   *Condition `json:"monitorCondition,omitempty"`
	MonitorService     *Condition `json:"monitorService,omitempty"`
	Severity           *Condition `json:"severity,omitempty"`
	TargetResourceType *Condition `json:"targetResourceType,omitempty"`
}

type CreateUpdateOperationResponse

type CreateUpdateOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *ActionRule
}

type DeleteOperationResponse

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

type Diagnostics added in v0.20240402.1085733

type Diagnostics struct {

	// Fields inherited from ActionRuleProperties
	Conditions     *Conditions       `json:"conditions,omitempty"`
	CreatedAt      *string           `json:"createdAt,omitempty"`
	CreatedBy      *string           `json:"createdBy,omitempty"`
	Description    *string           `json:"description,omitempty"`
	LastModifiedAt *string           `json:"lastModifiedAt,omitempty"`
	LastModifiedBy *string           `json:"lastModifiedBy,omitempty"`
	Scope          *Scope            `json:"scope,omitempty"`
	Status         *ActionRuleStatus `json:"status,omitempty"`
}

func (*Diagnostics) GetCreatedAtAsTime added in v0.20240402.1085733

func (o *Diagnostics) GetCreatedAtAsTime() (*time.Time, error)

func (*Diagnostics) GetLastModifiedAtAsTime added in v0.20240402.1085733

func (o *Diagnostics) GetLastModifiedAtAsTime() (*time.Time, error)

func (Diagnostics) MarshalJSON added in v0.20240402.1085733

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

func (*Diagnostics) SetCreatedAtAsTime added in v0.20240402.1085733

func (o *Diagnostics) SetCreatedAtAsTime(input time.Time)

func (*Diagnostics) SetLastModifiedAtAsTime added in v0.20240402.1085733

func (o *Diagnostics) SetLastModifiedAtAsTime(input time.Time)

type GetByNameOperationResponse

type GetByNameOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *ActionRule
}

type ListByResourceGroupCompleteResult

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

type ListByResourceGroupCustomPager added in v0.20240628.1153531

type ListByResourceGroupCustomPager struct {
	NextLink *odata.Link `json:"nextLink"`
}
func (p *ListByResourceGroupCustomPager) NextPageLink() *odata.Link

type ListByResourceGroupOperationOptions

type ListByResourceGroupOperationOptions struct {
	ActionGroup         *string
	AlertRuleId         *string
	Description         *string
	ImpactedScope       *string
	MonitorService      *MonitorService
	Name                *string
	Severity            *Severity
	TargetResource      *string
	TargetResourceGroup *string
	TargetResourceType  *string
}

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        *[]ActionRule
}

type ListBySubscriptionCompleteResult

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

type ListBySubscriptionCustomPager added in v0.20240628.1153531

type ListBySubscriptionCustomPager struct {
	NextLink *odata.Link `json:"nextLink"`
}
func (p *ListBySubscriptionCustomPager) NextPageLink() *odata.Link

type ListBySubscriptionOperationOptions

type ListBySubscriptionOperationOptions struct {
	ActionGroup         *string
	AlertRuleId         *string
	Description         *string
	ImpactedScope       *string
	MonitorService      *MonitorService
	Name                *string
	Severity            *Severity
	TargetResource      *string
	TargetResourceGroup *string
	TargetResourceType  *string
}

func DefaultListBySubscriptionOperationOptions

func DefaultListBySubscriptionOperationOptions() ListBySubscriptionOperationOptions

func (ListBySubscriptionOperationOptions) ToHeaders

func (ListBySubscriptionOperationOptions) ToOData

func (ListBySubscriptionOperationOptions) ToQuery

type ListBySubscriptionOperationResponse

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

type MonitorService

type MonitorService string
const (
	MonitorServiceActivityLogAdministrative MonitorService = "ActivityLog Administrative"
	MonitorServiceActivityLogAutoscale      MonitorService = "ActivityLog Autoscale"
	MonitorServiceActivityLogPolicy         MonitorService = "ActivityLog Policy"
	MonitorServiceActivityLogRecommendation MonitorService = "ActivityLog Recommendation"
	MonitorServiceActivityLogSecurity       MonitorService = "ActivityLog Security"
	MonitorServiceApplicationInsights       MonitorService = "Application Insights"
	MonitorServiceLogAnalytics              MonitorService = "Log Analytics"
	MonitorServiceNagios                    MonitorService = "Nagios"
	MonitorServicePlatform                  MonitorService = "Platform"
	MonitorServiceSCOM                      MonitorService = "SCOM"
	MonitorServiceServiceHealth             MonitorService = "ServiceHealth"
	MonitorServiceSmartDetector             MonitorService = "SmartDetector"
	MonitorServiceVMInsights                MonitorService = "VM Insights"
	MonitorServiceZabbix                    MonitorService = "Zabbix"
)

func (*MonitorService) UnmarshalJSON

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

type Operator

type Operator string
const (
	OperatorContains       Operator = "Contains"
	OperatorDoesNotContain Operator = "DoesNotContain"
	OperatorEquals         Operator = "Equals"
	OperatorNotEquals      Operator = "NotEquals"
)

func (*Operator) UnmarshalJSON

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

type PatchObject

type PatchObject struct {
	Properties *PatchProperties `json:"properties,omitempty"`
	Tags       *interface{}     `json:"tags,omitempty"`
}

type PatchProperties

type PatchProperties struct {
	Status *ActionRuleStatus `json:"status,omitempty"`
}

type RawActionRulePropertiesImpl

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

RawActionRulePropertiesImpl 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 Scope

type Scope struct {
	ScopeType *ScopeType `json:"scopeType,omitempty"`
	Values    *[]string  `json:"values,omitempty"`
}

type ScopeType

type ScopeType string
const (
	ScopeTypeResource      ScopeType = "Resource"
	ScopeTypeResourceGroup ScopeType = "ResourceGroup"
	ScopeTypeSubscription  ScopeType = "Subscription"
)

func (*ScopeType) UnmarshalJSON

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

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 Suppression added in v0.20240402.1085733

type Suppression struct {
	SuppressionConfig *SuppressionConfig `json:"suppressionConfig,omitempty"`

	// Fields inherited from ActionRuleProperties
	Conditions     *Conditions       `json:"conditions,omitempty"`
	CreatedAt      *string           `json:"createdAt,omitempty"`
	CreatedBy      *string           `json:"createdBy,omitempty"`
	Description    *string           `json:"description,omitempty"`
	LastModifiedAt *string           `json:"lastModifiedAt,omitempty"`
	LastModifiedBy *string           `json:"lastModifiedBy,omitempty"`
	Scope          *Scope            `json:"scope,omitempty"`
	Status         *ActionRuleStatus `json:"status,omitempty"`
}

func (*Suppression) GetCreatedAtAsTime added in v0.20240402.1085733

func (o *Suppression) GetCreatedAtAsTime() (*time.Time, error)

func (*Suppression) GetLastModifiedAtAsTime added in v0.20240402.1085733

func (o *Suppression) GetLastModifiedAtAsTime() (*time.Time, error)

func (Suppression) MarshalJSON added in v0.20240402.1085733

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

func (*Suppression) SetCreatedAtAsTime added in v0.20240402.1085733

func (o *Suppression) SetCreatedAtAsTime(input time.Time)

func (*Suppression) SetLastModifiedAtAsTime added in v0.20240402.1085733

func (o *Suppression) SetLastModifiedAtAsTime(input time.Time)

type SuppressionConfig added in v0.20240402.1085733

type SuppressionConfig struct {
	RecurrenceType SuppressionType      `json:"recurrenceType"`
	Schedule       *SuppressionSchedule `json:"schedule,omitempty"`
}

type SuppressionSchedule added in v0.20240402.1085733

type SuppressionSchedule struct {
	EndDate          *string  `json:"endDate,omitempty"`
	EndTime          *string  `json:"endTime,omitempty"`
	RecurrenceValues *[]int64 `json:"recurrenceValues,omitempty"`
	StartDate        *string  `json:"startDate,omitempty"`
	StartTime        *string  `json:"startTime,omitempty"`
}

type SuppressionType added in v0.20240402.1085733

type SuppressionType string
const (
	SuppressionTypeAlways  SuppressionType = "Always"
	SuppressionTypeDaily   SuppressionType = "Daily"
	SuppressionTypeMonthly SuppressionType = "Monthly"
	SuppressionTypeOnce    SuppressionType = "Once"
	SuppressionTypeWeekly  SuppressionType = "Weekly"
)

func (*SuppressionType) UnmarshalJSON added in v0.20240402.1085733

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

type UpdateOperationResponse

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

Jump to

Keyboard shortcuts

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