armalertsmanagement

package module
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2022 License: MIT Imports: 18 Imported by: 2

README

Azure Alerts Management Module for Go

PkgGoDev

The armalertsmanagement module provides operations for working with Azure Alerts Management.

Source code

Getting started

Prerequisites

Install the package

This project uses Go modules for versioning and dependency management.

Install the Azure Alerts Management module:

go get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/alertsmanagement/armalertsmanagement

Authorization

When creating a client, you will need to provide a credential for authenticating with Azure Alerts Management. The azidentity module provides facilities for various ways of authenticating with Azure including client/secret, certificate, managed identity, and more.

cred, err := azidentity.NewDefaultAzureCredential(nil)

For more information on authentication, please see the documentation for azidentity at pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity.

Clients

Azure Alerts Management modules consist of one or more clients. A client groups a set of related APIs, providing access to its functionality within the specified subscription. Create one or more clients to access the APIs you require using your credential.

client, err := armalertsmanagement.NewAlertsClient(<subscription ID>, cred, nil)

You can use ClientOptions in package github.com/Azure/azure-sdk-for-go/sdk/azcore/arm to set endpoint to connect with public and sovereign clouds as well as Azure Stack. For more information, please see the documentation for azcore at pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azcore.

options := arm.ClientOptions {
    ClientOptions: azcore.ClientOptions {
        Cloud: cloud.AzureChina,
	},
}
client, err := armalertsmanagement.NewAlertsClient(<subscription ID>, cred, &options)

Provide Feedback

If you encounter bugs or have suggestions, please open an issue and assign the Alerts Management label.

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.

When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information, see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action added in v0.3.0

type Action struct {
	// REQUIRED; Action that should be applied.
	ActionType *ActionType `json:"actionType,omitempty"`
}

Action to be applied.

func (*Action) GetAction added in v0.3.0

func (a *Action) GetAction() *Action

GetAction implements the ActionClassification interface for type Action.

func (Action) MarshalJSON added in v0.7.0

func (a Action) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type Action.

func (*Action) UnmarshalJSON added in v0.7.0

func (a *Action) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type Action.

type ActionClassification added in v0.3.0

type ActionClassification interface {
	// GetAction returns the Action content of the underlying type.
	GetAction() *Action
}

ActionClassification provides polymorphic access to related types. Call the interface's GetAction() method to access the common type. Use a type switch to determine the concrete type. The possible types are: - *Action, *AddActionGroups, *RemoveAllActionGroups

type ActionStatus added in v0.4.0

type ActionStatus struct {
	// Value indicating whether alert is suppressed.
	IsSuppressed *bool `json:"isSuppressed,omitempty"`
}

ActionStatus - Action status

func (ActionStatus) MarshalJSON added in v0.7.0

func (a ActionStatus) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ActionStatus.

func (*ActionStatus) UnmarshalJSON added in v0.7.0

func (a *ActionStatus) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ActionStatus.

type ActionType added in v0.3.0

type ActionType string

ActionType - Action that should be applied.

const (
	ActionTypeAddActionGroups       ActionType = "AddActionGroups"
	ActionTypeRemoveAllActionGroups ActionType = "RemoveAllActionGroups"
)

func PossibleActionTypeValues added in v0.3.0

func PossibleActionTypeValues() []ActionType

PossibleActionTypeValues returns the possible values for the ActionType const type.

type AddActionGroups added in v0.3.0

type AddActionGroups struct {
	// REQUIRED; List of action group Ids to add to alert processing rule.
	ActionGroupIDs []*string `json:"actionGroupIds,omitempty"`

	// REQUIRED; Action that should be applied.
	ActionType *ActionType `json:"actionType,omitempty"`
}

AddActionGroups - Add action groups to alert processing rule.

func (*AddActionGroups) GetAction added in v0.3.0

func (a *AddActionGroups) GetAction() *Action

GetAction implements the ActionClassification interface for type AddActionGroups.

func (AddActionGroups) MarshalJSON added in v0.3.0

func (a AddActionGroups) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type AddActionGroups.

func (*AddActionGroups) UnmarshalJSON added in v0.3.0

func (a *AddActionGroups) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type AddActionGroups.

type Alert

type Alert struct {
	// Alert property bag
	Properties *AlertProperties `json:"properties,omitempty"`

	// READ-ONLY; Azure resource Id
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; Azure resource name
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; Azure resource type
	Type *string `json:"type,omitempty" azure:"ro"`
}

Alert - An alert created in alert management service.

func (Alert) MarshalJSON

func (a Alert) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type Alert.

func (*Alert) UnmarshalJSON

func (a *Alert) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type Alert.

type AlertModification

type AlertModification struct {
	// Properties of the alert modification item.
	Properties *AlertModificationProperties `json:"properties,omitempty"`

	// READ-ONLY; Azure resource Id
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; Azure resource name
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; Azure resource type
	Type *string `json:"type,omitempty" azure:"ro"`
}

AlertModification - Alert Modification details

func (AlertModification) MarshalJSON

func (a AlertModification) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type AlertModification.

func (*AlertModification) UnmarshalJSON

func (a *AlertModification) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type AlertModification.

type AlertModificationEvent

type AlertModificationEvent string

AlertModificationEvent - Reason for the modification

const (
	AlertModificationEventAlertCreated           AlertModificationEvent = "AlertCreated"
	AlertModificationEventStateChange            AlertModificationEvent = "StateChange"
	AlertModificationEventMonitorConditionChange AlertModificationEvent = "MonitorConditionChange"
	AlertModificationEventSeverityChange         AlertModificationEvent = "SeverityChange"
	AlertModificationEventActionRuleTriggered    AlertModificationEvent = "ActionRuleTriggered"
	AlertModificationEventActionRuleSuppressed   AlertModificationEvent = "ActionRuleSuppressed"
	AlertModificationEventActionsTriggered       AlertModificationEvent = "ActionsTriggered"
	AlertModificationEventActionsSuppressed      AlertModificationEvent = "ActionsSuppressed"
	AlertModificationEventActionsFailed          AlertModificationEvent = "ActionsFailed"
)

func PossibleAlertModificationEventValues

func PossibleAlertModificationEventValues() []AlertModificationEvent

PossibleAlertModificationEventValues returns the possible values for the AlertModificationEvent const type.

type AlertModificationItem

type AlertModificationItem struct {
	// Modification comments
	Comments *string `json:"comments,omitempty"`

	// Description of the modification
	Description *string `json:"description,omitempty"`

	// Reason for the modification
	ModificationEvent *AlertModificationEvent `json:"modificationEvent,omitempty"`

	// Modified date and time
	ModifiedAt *string `json:"modifiedAt,omitempty"`

	// Modified user details (Principal client name)
	ModifiedBy *string `json:"modifiedBy,omitempty"`

	// New value
	NewValue *string `json:"newValue,omitempty"`

	// Old value
	OldValue *string `json:"oldValue,omitempty"`
}

AlertModificationItem - Alert modification item.

func (AlertModificationItem) MarshalJSON added in v0.7.0

func (a AlertModificationItem) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type AlertModificationItem.

func (*AlertModificationItem) UnmarshalJSON added in v0.7.0

func (a *AlertModificationItem) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type AlertModificationItem.

type AlertModificationProperties

type AlertModificationProperties struct {
	// Modification details
	Modifications []*AlertModificationItem `json:"modifications,omitempty"`

	// READ-ONLY; Unique Id of the alert for which the history is being retrieved
	AlertID *string `json:"alertId,omitempty" azure:"ro"`
}

AlertModificationProperties - Properties of the alert modification item.

func (AlertModificationProperties) MarshalJSON

func (a AlertModificationProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type AlertModificationProperties.

func (*AlertModificationProperties) UnmarshalJSON added in v0.7.0

func (a *AlertModificationProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type AlertModificationProperties.

type AlertProcessingRule added in v0.3.0

type AlertProcessingRule struct {
	// REQUIRED; Resource location
	Location *string `json:"location,omitempty"`

	// Alert processing rule properties.
	Properties *AlertProcessingRuleProperties `json:"properties,omitempty"`

	// Resource tags
	Tags map[string]*string `json:"tags,omitempty"`

	// READ-ONLY; Azure resource Id
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; Azure resource name
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; Alert processing rule system data.
	SystemData *SystemData `json:"systemData,omitempty" azure:"ro"`

	// READ-ONLY; Azure resource type
	Type *string `json:"type,omitempty" azure:"ro"`
}

AlertProcessingRule - Alert processing rule object containing target scopes, conditions and scheduling logic.

func (AlertProcessingRule) MarshalJSON added in v0.3.0

func (a AlertProcessingRule) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type AlertProcessingRule.

func (*AlertProcessingRule) UnmarshalJSON added in v0.7.0

func (a *AlertProcessingRule) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type AlertProcessingRule.

type AlertProcessingRuleProperties added in v0.3.0

type AlertProcessingRuleProperties struct {
	// REQUIRED; Actions to be applied.
	Actions []ActionClassification `json:"actions,omitempty"`

	// REQUIRED; Scopes on which alert processing rule will apply.
	Scopes []*string `json:"scopes,omitempty"`

	// Conditions on which alerts will be filtered.
	Conditions []*Condition `json:"conditions,omitempty"`

	// Description of alert processing rule.
	Description *string `json:"description,omitempty"`

	// Indicates if the given alert processing rule is enabled or disabled.
	Enabled *bool `json:"enabled,omitempty"`

	// Scheduling for alert processing rule.
	Schedule *Schedule `json:"schedule,omitempty"`
}

AlertProcessingRuleProperties - Alert processing rule properties defining scopes, conditions and scheduling logic for alert processing rule.

func (AlertProcessingRuleProperties) MarshalJSON added in v0.3.0

func (a AlertProcessingRuleProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type AlertProcessingRuleProperties.

func (*AlertProcessingRuleProperties) UnmarshalJSON added in v0.3.0

func (a *AlertProcessingRuleProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type AlertProcessingRuleProperties.

type AlertProcessingRulesClient added in v0.3.0

type AlertProcessingRulesClient struct {
	// contains filtered or unexported fields
}

AlertProcessingRulesClient contains the methods for the AlertProcessingRules group. Don't use this type directly, use NewAlertProcessingRulesClient() instead.

func NewAlertProcessingRulesClient added in v0.3.0

func NewAlertProcessingRulesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AlertProcessingRulesClient, error)

NewAlertProcessingRulesClient creates a new instance of AlertProcessingRulesClient with the specified values. subscriptionID - The ID of the target subscription. credential - used to authorize requests. Usually a credential from azidentity. options - pass nil to accept the default values.

func (*AlertProcessingRulesClient) CreateOrUpdate added in v0.3.0

func (client *AlertProcessingRulesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, alertProcessingRuleName string, alertProcessingRule AlertProcessingRule, options *AlertProcessingRulesClientCreateOrUpdateOptions) (AlertProcessingRulesClientCreateOrUpdateResponse, error)

CreateOrUpdate - Create or update an alert processing rule. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2021-08-08 resourceGroupName - Resource group name where the resource is created. alertProcessingRuleName - The name of the alert processing rule that needs to be created/updated. alertProcessingRule - Alert processing rule to be created/updated. options - AlertProcessingRulesClientCreateOrUpdateOptions contains the optional parameters for the AlertProcessingRulesClient.CreateOrUpdate method.

Example (CreateOrUpdateARuleThatAddsAnActionGroupToAllAlertsInASubscription)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/stable/2021-08-08/examples/AlertProcessingRules_Create_or_update_add_action_group_all_alerts_in_subscription.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/alertsmanagement/armalertsmanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armalertsmanagement.NewAlertProcessingRulesClient("subId1", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := client.CreateOrUpdate(ctx, "alertscorrelationrg", "AddActionGroupToSubscription", armalertsmanagement.AlertProcessingRule{
		Location: to.Ptr("Global"),
		Tags:     map[string]*string{},
		Properties: &armalertsmanagement.AlertProcessingRuleProperties{
			Description: to.Ptr("Add ActionGroup1 to all alerts in the subscription"),
			Actions: []armalertsmanagement.ActionClassification{
				&armalertsmanagement.AddActionGroups{
					ActionType: to.Ptr(armalertsmanagement.ActionTypeAddActionGroups),
					ActionGroupIDs: []*string{
						to.Ptr("/subscriptions/subId1/resourcegroups/RGId1/providers/microsoft.insights/actiongroups/ActionGroup1")},
				}},
			Enabled: to.Ptr(true),
			Scopes: []*string{
				to.Ptr("/subscriptions/subId1")},
		},
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// TODO: use response item
	_ = res
}
Output:

Example (CreateOrUpdateARuleThatAddsTwoActionGroupsToAllSev0AndSev1AlertsInTwoResourceGroups)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/stable/2021-08-08/examples/AlertProcessingRules_Create_or_update_add_two_action_groups_all_Sev0_Sev1_two_resource_groups.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/alertsmanagement/armalertsmanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armalertsmanagement.NewAlertProcessingRulesClient("subId1", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := client.CreateOrUpdate(ctx, "alertscorrelationrg", "AddActionGroupsBySeverity", armalertsmanagement.AlertProcessingRule{
		Location: to.Ptr("Global"),
		Tags:     map[string]*string{},
		Properties: &armalertsmanagement.AlertProcessingRuleProperties{
			Description: to.Ptr("Add AGId1 and AGId2 to all Sev0 and Sev1 alerts in these resourceGroups"),
			Actions: []armalertsmanagement.ActionClassification{
				&armalertsmanagement.AddActionGroups{
					ActionType: to.Ptr(armalertsmanagement.ActionTypeAddActionGroups),
					ActionGroupIDs: []*string{
						to.Ptr("/subscriptions/subId1/resourcegroups/RGId1/providers/microsoft.insights/actiongroups/AGId1"),
						to.Ptr("/subscriptions/subId1/resourcegroups/RGId1/providers/microsoft.insights/actiongroups/AGId2")},
				}},
			Conditions: []*armalertsmanagement.Condition{
				{
					Field:    to.Ptr(armalertsmanagement.FieldSeverity),
					Operator: to.Ptr(armalertsmanagement.OperatorEquals),
					Values: []*string{
						to.Ptr("sev0"),
						to.Ptr("sev1")},
				}},
			Enabled: to.Ptr(true),
			Scopes: []*string{
				to.Ptr("/subscriptions/subId1/resourceGroups/RGId1"),
				to.Ptr("/subscriptions/subId1/resourceGroups/RGId2")},
		},
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// TODO: use response item
	_ = res
}
Output:

Example (CreateOrUpdateARuleThatRemovesAllActionGroupsFromAlertsOnASpecificVmDuringAOneOffMaintenanceWindow18002000AtASpecificDatePacificStandardTime)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/stable/2021-08-08/examples/AlertProcessingRules_Create_or_update_remove_all_action_groups_specific_VM_one-off_maintenance_window.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/alertsmanagement/armalertsmanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armalertsmanagement.NewAlertProcessingRulesClient("subId1", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := client.CreateOrUpdate(ctx, "alertscorrelationrg", "RemoveActionGroupsMaintenanceWindow", armalertsmanagement.AlertProcessingRule{
		Location: to.Ptr("Global"),
		Tags:     map[string]*string{},
		Properties: &armalertsmanagement.AlertProcessingRuleProperties{
			Description: to.Ptr("Removes all ActionGroups from all Alerts on VMName during the maintenance window"),
			Actions: []armalertsmanagement.ActionClassification{
				&armalertsmanagement.RemoveAllActionGroups{
					ActionType: to.Ptr(armalertsmanagement.ActionTypeRemoveAllActionGroups),
				}},
			Enabled: to.Ptr(true),
			Schedule: &armalertsmanagement.Schedule{
				EffectiveFrom:  to.Ptr("2021-04-15T18:00:00"),
				EffectiveUntil: to.Ptr("2021-04-15T20:00:00"),
				TimeZone:       to.Ptr("Pacific Standard Time"),
			},
			Scopes: []*string{
				to.Ptr("/subscriptions/subId1/resourceGroups/RGId1/providers/Microsoft.Compute/virtualMachines/VMName")},
		},
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// TODO: use response item
	_ = res
}
Output:

Example (CreateOrUpdateARuleThatRemovesAllActionGroupsFromAllAlertsInASubscriptionComingFromASpecificAlertRule)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/stable/2021-08-08/examples/AlertProcessingRules_Create_or_update_remove_all_action_groups_from_specific_alert_rule.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/alertsmanagement/armalertsmanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armalertsmanagement.NewAlertProcessingRulesClient("subId1", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := client.CreateOrUpdate(ctx, "alertscorrelationrg", "RemoveActionGroupsSpecificAlertRule", armalertsmanagement.AlertProcessingRule{
		Location: to.Ptr("Global"),
		Tags:     map[string]*string{},
		Properties: &armalertsmanagement.AlertProcessingRuleProperties{
			Description: to.Ptr("Removes all ActionGroups from all Alerts that fire on above AlertRule"),
			Actions: []armalertsmanagement.ActionClassification{
				&armalertsmanagement.RemoveAllActionGroups{
					ActionType: to.Ptr(armalertsmanagement.ActionTypeRemoveAllActionGroups),
				}},
			Conditions: []*armalertsmanagement.Condition{
				{
					Field:    to.Ptr(armalertsmanagement.FieldAlertRuleID),
					Operator: to.Ptr(armalertsmanagement.OperatorEquals),
					Values: []*string{
						to.Ptr("/subscriptions/suubId1/resourceGroups/Rgid2/providers/microsoft.insights/activityLogAlerts/RuleName")},
				}},
			Enabled: to.Ptr(true),
			Scopes: []*string{
				to.Ptr("/subscriptions/subId1")},
		},
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// TODO: use response item
	_ = res
}
Output:

Example (CreateOrUpdateARuleThatRemovesAllActionGroupsFromAllAlertsOnAnyVmInTwoResourceGroupsDuringARecurringMaintenanceWindow22000400EverySatAndSunIndiaStandardTime)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/stable/2021-08-08/examples/AlertProcessingRules_Create_or_update_remove_all_action_groups_recurring_maintenance_window.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/alertsmanagement/armalertsmanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armalertsmanagement.NewAlertProcessingRulesClient("subId1", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := client.CreateOrUpdate(ctx, "alertscorrelationrg", "RemoveActionGroupsRecurringMaintenance", armalertsmanagement.AlertProcessingRule{
		Location: to.Ptr("Global"),
		Tags:     map[string]*string{},
		Properties: &armalertsmanagement.AlertProcessingRuleProperties{
			Description: to.Ptr("Remove all ActionGroups from all Vitual machine Alerts during the recurring maintenance"),
			Actions: []armalertsmanagement.ActionClassification{
				&armalertsmanagement.RemoveAllActionGroups{
					ActionType: to.Ptr(armalertsmanagement.ActionTypeRemoveAllActionGroups),
				}},
			Conditions: []*armalertsmanagement.Condition{
				{
					Field:    to.Ptr(armalertsmanagement.FieldTargetResourceType),
					Operator: to.Ptr(armalertsmanagement.OperatorEquals),
					Values: []*string{
						to.Ptr("microsoft.compute/virtualmachines")},
				}},
			Enabled: to.Ptr(true),
			Schedule: &armalertsmanagement.Schedule{
				Recurrences: []armalertsmanagement.RecurrenceClassification{
					&armalertsmanagement.WeeklyRecurrence{
						EndTime:        to.Ptr("04:00:00"),
						RecurrenceType: to.Ptr(armalertsmanagement.RecurrenceTypeWeekly),
						StartTime:      to.Ptr("22:00:00"),
						DaysOfWeek: []*armalertsmanagement.DaysOfWeek{
							to.Ptr(armalertsmanagement.DaysOfWeekSaturday),
							to.Ptr(armalertsmanagement.DaysOfWeekSunday)},
					}},
				TimeZone: to.Ptr("India Standard Time"),
			},
			Scopes: []*string{
				to.Ptr("/subscriptions/subId1/resourceGroups/RGId1"),
				to.Ptr("/subscriptions/subId1/resourceGroups/RGId2")},
		},
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// TODO: use response item
	_ = res
}
Output:

Example (CreateOrUpdateARuleThatRemovesAllActionGroupsOutsideBusinessHoursMonFri09001700EasternStandardTime)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/stable/2021-08-08/examples/AlertProcessingRules_Create_or_update_remove_all_action_groups_outside_business_hours.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/alertsmanagement/armalertsmanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armalertsmanagement.NewAlertProcessingRulesClient("subId1", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := client.CreateOrUpdate(ctx, "alertscorrelationrg", "RemoveActionGroupsOutsideBusinessHours", armalertsmanagement.AlertProcessingRule{
		Location: to.Ptr("Global"),
		Tags:     map[string]*string{},
		Properties: &armalertsmanagement.AlertProcessingRuleProperties{
			Description: to.Ptr("Remove all ActionGroups outside business hours"),
			Actions: []armalertsmanagement.ActionClassification{
				&armalertsmanagement.RemoveAllActionGroups{
					ActionType: to.Ptr(armalertsmanagement.ActionTypeRemoveAllActionGroups),
				}},
			Enabled: to.Ptr(true),
			Schedule: &armalertsmanagement.Schedule{
				Recurrences: []armalertsmanagement.RecurrenceClassification{
					&armalertsmanagement.DailyRecurrence{
						EndTime:        to.Ptr("09:00:00"),
						RecurrenceType: to.Ptr(armalertsmanagement.RecurrenceTypeDaily),
						StartTime:      to.Ptr("17:00:00"),
					},
					&armalertsmanagement.WeeklyRecurrence{
						RecurrenceType: to.Ptr(armalertsmanagement.RecurrenceTypeWeekly),
						DaysOfWeek: []*armalertsmanagement.DaysOfWeek{
							to.Ptr(armalertsmanagement.DaysOfWeekSaturday),
							to.Ptr(armalertsmanagement.DaysOfWeekSunday)},
					}},
				TimeZone: to.Ptr("Eastern Standard Time"),
			},
			Scopes: []*string{
				to.Ptr("/subscriptions/subId1")},
		},
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// TODO: use response item
	_ = res
}
Output:

func (*AlertProcessingRulesClient) Delete added in v0.3.0

func (client *AlertProcessingRulesClient) Delete(ctx context.Context, resourceGroupName string, alertProcessingRuleName string, options *AlertProcessingRulesClientDeleteOptions) (AlertProcessingRulesClientDeleteResponse, error)

Delete - Delete an alert processing rule. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2021-08-08 resourceGroupName - Resource group name where the resource is created. alertProcessingRuleName - The name of the alert processing rule that needs to be deleted. options - AlertProcessingRulesClientDeleteOptions contains the optional parameters for the AlertProcessingRulesClient.Delete method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/stable/2021-08-08/examples/AlertProcessingRules_Delete.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/alertsmanagement/armalertsmanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armalertsmanagement.NewAlertProcessingRulesClient("1e3ff1c0-771a-4119-a03b-be82a51e232d", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = client.Delete(ctx, "alertscorrelationrg", "DailySuppression", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}
Output:

func (*AlertProcessingRulesClient) GetByName added in v0.3.0

func (client *AlertProcessingRulesClient) GetByName(ctx context.Context, resourceGroupName string, alertProcessingRuleName string, options *AlertProcessingRulesClientGetByNameOptions) (AlertProcessingRulesClientGetByNameResponse, error)

GetByName - Get an alert processing rule by name. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2021-08-08 resourceGroupName - Resource group name where the resource is created. alertProcessingRuleName - The name of the alert processing rule that needs to be fetched. options - AlertProcessingRulesClientGetByNameOptions contains the optional parameters for the AlertProcessingRulesClient.GetByName method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/stable/2021-08-08/examples/AlertProcessingRules_GetById.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/alertsmanagement/armalertsmanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armalertsmanagement.NewAlertProcessingRulesClient("1e3ff1c0-771a-4119-a03b-be82a51e232d", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := client.GetByName(ctx, "alertscorrelationrg", "DailySuppression", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// TODO: use response item
	_ = res
}
Output:

func (*AlertProcessingRulesClient) NewListByResourceGroupPager added in v0.5.0

NewListByResourceGroupPager - List all alert processing rules in a resource group. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2021-08-08 resourceGroupName - Resource group name where the resource is created. options - AlertProcessingRulesClientListByResourceGroupOptions contains the optional parameters for the AlertProcessingRulesClient.ListByResourceGroup method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/stable/2021-08-08/examples/AlertProcessingRules_List_ResourceGroup.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/alertsmanagement/armalertsmanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armalertsmanagement.NewAlertProcessingRulesClient("1e3ff1c0-771a-4119-a03b-be82a51e232d", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := client.NewListByResourceGroupPager("alertscorrelationrg", nil)
	for pager.More() {
		nextResult, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range nextResult.Value {
			// TODO: use page item
			_ = v
		}
	}
}
Output:

func (*AlertProcessingRulesClient) NewListBySubscriptionPager added in v0.5.0

NewListBySubscriptionPager - List all alert processing rules in a subscription. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2021-08-08 options - AlertProcessingRulesClientListBySubscriptionOptions contains the optional parameters for the AlertProcessingRulesClient.ListBySubscription method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/stable/2021-08-08/examples/AlertProcessingRules_List_Subscription.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/alertsmanagement/armalertsmanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armalertsmanagement.NewAlertProcessingRulesClient("1e3ff1c0-771a-4119-a03b-be82a51e232d", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := client.NewListBySubscriptionPager(nil)
	for pager.More() {
		nextResult, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range nextResult.Value {
			// TODO: use page item
			_ = v
		}
	}
}
Output:

func (*AlertProcessingRulesClient) Update added in v0.3.0

func (client *AlertProcessingRulesClient) Update(ctx context.Context, resourceGroupName string, alertProcessingRuleName string, alertProcessingRulePatch PatchObject, options *AlertProcessingRulesClientUpdateOptions) (AlertProcessingRulesClientUpdateResponse, error)

Update - Enable, disable, or update tags for an alert processing rule. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2021-08-08 resourceGroupName - Resource group name where the resource is created. alertProcessingRuleName - The name that needs to be updated. alertProcessingRulePatch - Parameters supplied to the operation. options - AlertProcessingRulesClientUpdateOptions contains the optional parameters for the AlertProcessingRulesClient.Update method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/stable/2021-08-08/examples/AlertProcessingRules_Patch.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/alertsmanagement/armalertsmanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armalertsmanagement.NewAlertProcessingRulesClient("1e3ff1c0-771a-4119-a03b-be82a51e232d", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := client.Update(ctx, "alertscorrelationrg", "WeeklySuppression", armalertsmanagement.PatchObject{
		Properties: &armalertsmanagement.PatchProperties{
			Enabled: to.Ptr(false),
		},
		Tags: map[string]*string{
			"key1": to.Ptr("value1"),
			"key2": to.Ptr("value2"),
		},
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// TODO: use response item
	_ = res
}
Output:

type AlertProcessingRulesClientCreateOrUpdateOptions added in v0.3.0

type AlertProcessingRulesClientCreateOrUpdateOptions struct {
}

AlertProcessingRulesClientCreateOrUpdateOptions contains the optional parameters for the AlertProcessingRulesClient.CreateOrUpdate method.

type AlertProcessingRulesClientCreateOrUpdateResponse added in v0.3.0

type AlertProcessingRulesClientCreateOrUpdateResponse struct {
	AlertProcessingRule
	// XMSRequestID contains the information returned from the x-ms-request-id header response.
	XMSRequestID *string
}

AlertProcessingRulesClientCreateOrUpdateResponse contains the response from method AlertProcessingRulesClient.CreateOrUpdate.

type AlertProcessingRulesClientDeleteOptions added in v0.3.0

type AlertProcessingRulesClientDeleteOptions struct {
}

AlertProcessingRulesClientDeleteOptions contains the optional parameters for the AlertProcessingRulesClient.Delete method.

type AlertProcessingRulesClientDeleteResponse added in v0.3.0

type AlertProcessingRulesClientDeleteResponse struct {
	// XMSRequestID contains the information returned from the x-ms-request-id header response.
	XMSRequestID *string
}

AlertProcessingRulesClientDeleteResponse contains the response from method AlertProcessingRulesClient.Delete.

type AlertProcessingRulesClientGetByNameOptions added in v0.3.0

type AlertProcessingRulesClientGetByNameOptions struct {
}

AlertProcessingRulesClientGetByNameOptions contains the optional parameters for the AlertProcessingRulesClient.GetByName method.

type AlertProcessingRulesClientGetByNameResponse added in v0.3.0

type AlertProcessingRulesClientGetByNameResponse struct {
	AlertProcessingRule
	// XMSRequestID contains the information returned from the x-ms-request-id header response.
	XMSRequestID *string
}

AlertProcessingRulesClientGetByNameResponse contains the response from method AlertProcessingRulesClient.GetByName.

type AlertProcessingRulesClientListByResourceGroupOptions added in v0.3.0

type AlertProcessingRulesClientListByResourceGroupOptions struct {
}

AlertProcessingRulesClientListByResourceGroupOptions contains the optional parameters for the AlertProcessingRulesClient.ListByResourceGroup method.

type AlertProcessingRulesClientListByResourceGroupResponse added in v0.3.0

type AlertProcessingRulesClientListByResourceGroupResponse struct {
	AlertProcessingRulesList
	// XMSRequestID contains the information returned from the x-ms-request-id header response.
	XMSRequestID *string
}

AlertProcessingRulesClientListByResourceGroupResponse contains the response from method AlertProcessingRulesClient.ListByResourceGroup.

type AlertProcessingRulesClientListBySubscriptionOptions added in v0.3.0

type AlertProcessingRulesClientListBySubscriptionOptions struct {
}

AlertProcessingRulesClientListBySubscriptionOptions contains the optional parameters for the AlertProcessingRulesClient.ListBySubscription method.

type AlertProcessingRulesClientListBySubscriptionResponse added in v0.3.0

type AlertProcessingRulesClientListBySubscriptionResponse struct {
	AlertProcessingRulesList
	// XMSRequestID contains the information returned from the x-ms-request-id header response.
	XMSRequestID *string
}

AlertProcessingRulesClientListBySubscriptionResponse contains the response from method AlertProcessingRulesClient.ListBySubscription.

type AlertProcessingRulesClientUpdateOptions added in v0.3.0

type AlertProcessingRulesClientUpdateOptions struct {
}

AlertProcessingRulesClientUpdateOptions contains the optional parameters for the AlertProcessingRulesClient.Update method.

type AlertProcessingRulesClientUpdateResponse added in v0.3.0

type AlertProcessingRulesClientUpdateResponse struct {
	AlertProcessingRule
	// XMSRequestID contains the information returned from the x-ms-request-id header response.
	XMSRequestID *string
}

AlertProcessingRulesClientUpdateResponse contains the response from method AlertProcessingRulesClient.Update.

type AlertProcessingRulesList added in v0.3.0

type AlertProcessingRulesList struct {
	// URL to fetch the next set of alert processing rules.
	NextLink *string `json:"nextLink,omitempty"`

	// List of alert processing rules.
	Value []*AlertProcessingRule `json:"value,omitempty"`
}

AlertProcessingRulesList - List of alert processing rules.

func (AlertProcessingRulesList) MarshalJSON added in v0.3.0

func (a AlertProcessingRulesList) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type AlertProcessingRulesList.

func (*AlertProcessingRulesList) UnmarshalJSON added in v0.7.0

func (a *AlertProcessingRulesList) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type AlertProcessingRulesList.

type AlertProperties

type AlertProperties struct {
	// This object contains consistent fields across different monitor services.
	Essentials *Essentials `json:"essentials,omitempty"`

	// READ-ONLY; Information specific to the monitor service that gives more contextual details about the alert.
	Context interface{} `json:"context,omitempty" azure:"ro"`

	// READ-ONLY; Config which would be used for displaying the data in portal.
	EgressConfig interface{} `json:"egressConfig,omitempty" azure:"ro"`
}

AlertProperties - Alert property bag

func (AlertProperties) MarshalJSON added in v0.7.0

func (a AlertProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type AlertProperties.

func (*AlertProperties) UnmarshalJSON added in v0.7.0

func (a *AlertProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type AlertProperties.

type AlertState

type AlertState string
const (
	AlertStateAcknowledged AlertState = "Acknowledged"
	AlertStateClosed       AlertState = "Closed"
	AlertStateNew          AlertState = "New"
)

func PossibleAlertStateValues

func PossibleAlertStateValues() []AlertState

PossibleAlertStateValues returns the possible values for the AlertState const type.

type AlertsClient

type AlertsClient struct {
	// contains filtered or unexported fields
}

AlertsClient contains the methods for the Alerts group. Don't use this type directly, use NewAlertsClient() instead.

func NewAlertsClient

func NewAlertsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AlertsClient, error)

NewAlertsClient creates a new instance of AlertsClient with the specified values. subscriptionID - The ID of the target subscription. credential - used to authorize requests. Usually a credential from azidentity. options - pass nil to accept the default values.

func (*AlertsClient) ChangeState

func (client *AlertsClient) ChangeState(ctx context.Context, alertID string, newState AlertState, options *AlertsClientChangeStateOptions) (AlertsClientChangeStateResponse, error)

ChangeState - Change the state of an alert. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2019-05-05-preview alertID - Unique ID of an alert instance. newState - New state of the alert. options - AlertsClientChangeStateOptions contains the optional parameters for the AlertsClient.ChangeState method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2019-05-05-preview/examples/Alerts_ChangeState.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/alertsmanagement/armalertsmanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armalertsmanagement.NewAlertsClient("9e261de7-c804-4b9d-9ebf-6f50fe350a9a", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := client.ChangeState(ctx, "66114d64-d9d9-478b-95c9-b789d6502100", armalertsmanagement.AlertStateAcknowledged, &armalertsmanagement.AlertsClientChangeStateOptions{Comment: nil})
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// TODO: use response item
	_ = res
}
Output:

func (*AlertsClient) GetByID

GetByID - Get information related to a specific alert If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2019-05-05-preview alertID - Unique ID of an alert instance. options - AlertsClientGetByIDOptions contains the optional parameters for the AlertsClient.GetByID method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2019-05-05-preview/examples/Alerts_GetById.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/alertsmanagement/armalertsmanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armalertsmanagement.NewAlertsClient("9e261de7-c804-4b9d-9ebf-6f50fe350a9a", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := client.GetByID(ctx, "66114d64-d9d9-478b-95c9-b789d6502100", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// TODO: use response item
	_ = res
}
Output:

func (*AlertsClient) GetHistory

GetHistory - Get the history of an alert, which captures any monitor condition changes (Fired/Resolved) and alert state changes (New/Acknowledged/Closed). If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2019-05-05-preview alertID - Unique ID of an alert instance. options - AlertsClientGetHistoryOptions contains the optional parameters for the AlertsClient.GetHistory method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2019-05-05-preview/examples/Alerts_History.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/alertsmanagement/armalertsmanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armalertsmanagement.NewAlertsClient("9e261de7-c804-4b9d-9ebf-6f50fe350a9a", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := client.GetHistory(ctx, "66114d64-d9d9-478b-95c9-b789d6502100", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// TODO: use response item
	_ = res
}
Output:

func (*AlertsClient) GetSummary

GetSummary - Get a summarized count of your alerts grouped by various parameters (e.g. grouping by 'Severity' returns the count of alerts for each severity). If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2019-05-05-preview groupby - This parameter allows the result set to be grouped by input fields (Maximum 2 comma separated fields supported). For example, groupby=severity or groupby=severity,alertstate. options - AlertsClientGetSummaryOptions contains the optional parameters for the AlertsClient.GetSummary method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2019-05-05-preview/examples/Alerts_Summary.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/alertsmanagement/armalertsmanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armalertsmanagement.NewAlertsClient("1e3ff1c0-771a-4119-a03b-be82a51e232d", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := client.GetSummary(ctx, armalertsmanagement.AlertsSummaryGroupByFields("severity,alertState"), &armalertsmanagement.AlertsClientGetSummaryOptions{IncludeSmartGroupsCount: nil,
		TargetResource:      nil,
		TargetResourceType:  nil,
		TargetResourceGroup: nil,
		MonitorService:      nil,
		MonitorCondition:    nil,
		Severity:            nil,
		AlertState:          nil,
		AlertRule:           nil,
		TimeRange:           nil,
		CustomTimeRange:     nil,
	})
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// TODO: use response item
	_ = res
}
Output:

func (*AlertsClient) MetaData

MetaData - List alerts meta data information based on value of identifier parameter. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2019-05-05-preview identifier - Identification of the information to be retrieved by API call. options - AlertsClientMetaDataOptions contains the optional parameters for the AlertsClient.MetaData method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2019-05-05-preview/examples/AlertsMetaData_MonitorService.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/alertsmanagement/armalertsmanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armalertsmanagement.NewAlertsClient("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := client.MetaData(ctx, armalertsmanagement.IdentifierMonitorServiceList, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// TODO: use response item
	_ = res
}
Output:

func (*AlertsClient) NewGetAllPager added in v0.5.0

NewGetAllPager - List all existing alerts, where the results can be filtered on the basis of multiple parameters (e.g. time range). The results can then be sorted on the basis specific fields, with the default being lastModifiedDateTime. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2019-05-05-preview options - AlertsClientGetAllOptions contains the optional parameters for the AlertsClient.GetAll method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2019-05-05-preview/examples/Alerts_List.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/alertsmanagement/armalertsmanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armalertsmanagement.NewAlertsClient("1e3ff1c0-771a-4119-a03b-be82a51e232d", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := client.NewGetAllPager(&armalertsmanagement.AlertsClientGetAllOptions{TargetResource: nil,
		TargetResourceType:  nil,
		TargetResourceGroup: nil,
		MonitorService:      nil,
		MonitorCondition:    nil,
		Severity:            nil,
		AlertState:          nil,
		AlertRule:           nil,
		SmartGroupID:        nil,
		IncludeContext:      nil,
		IncludeEgressConfig: nil,
		PageCount:           nil,
		SortBy:              nil,
		SortOrder:           nil,
		Select:              nil,
		TimeRange:           nil,
		CustomTimeRange:     nil,
	})
	for pager.More() {
		nextResult, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range nextResult.Value {
			// TODO: use page item
			_ = v
		}
	}
}
Output:

type AlertsClientChangeStateOptions added in v0.3.0

type AlertsClientChangeStateOptions struct {
	// reason of change alert state
	Comment *string
}

AlertsClientChangeStateOptions contains the optional parameters for the AlertsClient.ChangeState method.

type AlertsClientChangeStateResponse added in v0.3.0

type AlertsClientChangeStateResponse struct {
	Alert
}

AlertsClientChangeStateResponse contains the response from method AlertsClient.ChangeState.

type AlertsClientGetAllOptions added in v0.3.0

type AlertsClientGetAllOptions struct {
	// Filter by specific alert rule. Default value is to select all.
	AlertRule *string
	// Filter by state of the alert instance. Default value is to select all.
	AlertState *AlertState
	// Filter by custom time range in the format / where time is in (ISO-8601 format)'. Permissible values is within 30 days from
	// query time. Either timeRange or customTimeRange could be used but not both.
	// Default is none.
	CustomTimeRange *string
	// Include context which has contextual data specific to the monitor service. Default value is false'
	IncludeContext *bool
	// Include egress config which would be used for displaying the content in portal. Default value is 'false'.
	IncludeEgressConfig *bool
	// Filter by monitor condition which is either 'Fired' or 'Resolved'. Default value is to select all.
	MonitorCondition *MonitorCondition
	// Filter by monitor service which generates the alert instance. Default value is select all.
	MonitorService *MonitorService
	// Determines number of alerts returned per page in response. Permissible value is between 1 to 250. When the "includeContent"
	// filter is selected, maximum value allowed is 25. Default value is 25.
	PageCount *int64
	// This filter allows to selection of the fields(comma separated) which would be part of the essential section. This would
	// allow to project only the required fields rather than getting entire content.
	// Default is to fetch all the fields in the essentials section.
	Select *string
	// Filter by severity. Default value is select all.
	Severity *Severity
	// Filter the alerts list by the Smart Group Id. Default value is none.
	SmartGroupID *string
	// Sort the query results by input field, Default value is 'lastModifiedDateTime'.
	SortBy *AlertsSortByFields
	// Sort the query results order in either ascending or descending. Default value is 'desc' for time fields and 'asc' for others.
	SortOrder *SortOrder
	// Filter by target resource( which is full ARM ID) Default value is select all.
	TargetResource *string
	// Filter by target resource group name. Default value is select all.
	TargetResourceGroup *string
	// Filter by target resource type. Default value is select all.
	TargetResourceType *string
	// Filter by time range by below listed values. Default value is 1 day.
	TimeRange *TimeRange
}

AlertsClientGetAllOptions contains the optional parameters for the AlertsClient.GetAll method.

type AlertsClientGetAllResponse added in v0.3.0

type AlertsClientGetAllResponse struct {
	AlertsList
}

AlertsClientGetAllResponse contains the response from method AlertsClient.GetAll.

type AlertsClientGetByIDOptions added in v0.3.0

type AlertsClientGetByIDOptions struct {
}

AlertsClientGetByIDOptions contains the optional parameters for the AlertsClient.GetByID method.

type AlertsClientGetByIDResponse added in v0.3.0

type AlertsClientGetByIDResponse struct {
	Alert
}

AlertsClientGetByIDResponse contains the response from method AlertsClient.GetByID.

type AlertsClientGetHistoryOptions added in v0.3.0

type AlertsClientGetHistoryOptions struct {
}

AlertsClientGetHistoryOptions contains the optional parameters for the AlertsClient.GetHistory method.

type AlertsClientGetHistoryResponse added in v0.3.0

type AlertsClientGetHistoryResponse struct {
	AlertModification
}

AlertsClientGetHistoryResponse contains the response from method AlertsClient.GetHistory.

type AlertsClientGetSummaryOptions added in v0.3.0

type AlertsClientGetSummaryOptions struct {
	// Filter by specific alert rule. Default value is to select all.
	AlertRule *string
	// Filter by state of the alert instance. Default value is to select all.
	AlertState *AlertState
	// Filter by custom time range in the format / where time is in (ISO-8601 format)'. Permissible values is within 30 days from
	// query time. Either timeRange or customTimeRange could be used but not both.
	// Default is none.
	CustomTimeRange *string
	// Include count of the SmartGroups as part of the summary. Default value is 'false'.
	IncludeSmartGroupsCount *bool
	// Filter by monitor condition which is either 'Fired' or 'Resolved'. Default value is to select all.
	MonitorCondition *MonitorCondition
	// Filter by monitor service which generates the alert instance. Default value is select all.
	MonitorService *MonitorService
	// Filter by severity. Default value is select all.
	Severity *Severity
	// Filter by target resource( which is full ARM ID) Default value is select all.
	TargetResource *string
	// Filter by target resource group name. Default value is select all.
	TargetResourceGroup *string
	// Filter by target resource type. Default value is select all.
	TargetResourceType *string
	// Filter by time range by below listed values. Default value is 1 day.
	TimeRange *TimeRange
}

AlertsClientGetSummaryOptions contains the optional parameters for the AlertsClient.GetSummary method.

type AlertsClientGetSummaryResponse added in v0.3.0

type AlertsClientGetSummaryResponse struct {
	AlertsSummary
}

AlertsClientGetSummaryResponse contains the response from method AlertsClient.GetSummary.

type AlertsClientMetaDataOptions added in v0.3.0

type AlertsClientMetaDataOptions struct {
}

AlertsClientMetaDataOptions contains the optional parameters for the AlertsClient.MetaData method.

type AlertsClientMetaDataResponse added in v0.3.0

type AlertsClientMetaDataResponse struct {
	AlertsMetaData
}

AlertsClientMetaDataResponse contains the response from method AlertsClient.MetaData.

type AlertsList

type AlertsList struct {
	// URL to fetch the next set of alerts.
	NextLink *string `json:"nextLink,omitempty"`

	// List of alerts
	Value []*Alert `json:"value,omitempty"`
}

AlertsList - List the alerts.

func (AlertsList) MarshalJSON

func (a AlertsList) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type AlertsList.

func (*AlertsList) UnmarshalJSON added in v0.7.0

func (a *AlertsList) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type AlertsList.

type AlertsMetaData

type AlertsMetaData struct {
	// alert meta data property bag
	Properties AlertsMetaDataPropertiesClassification `json:"properties,omitempty"`
}

AlertsMetaData - alert meta data information.

func (AlertsMetaData) MarshalJSON

func (a AlertsMetaData) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type AlertsMetaData.

func (*AlertsMetaData) UnmarshalJSON

func (a *AlertsMetaData) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type AlertsMetaData.

type AlertsMetaDataProperties

type AlertsMetaDataProperties struct {
	// REQUIRED; Identification of the information to be retrieved by API call
	MetadataIdentifier *MetadataIdentifier `json:"metadataIdentifier,omitempty"`
}

AlertsMetaDataProperties - alert meta data property bag

func (*AlertsMetaDataProperties) GetAlertsMetaDataProperties

func (a *AlertsMetaDataProperties) GetAlertsMetaDataProperties() *AlertsMetaDataProperties

GetAlertsMetaDataProperties implements the AlertsMetaDataPropertiesClassification interface for type AlertsMetaDataProperties.

func (AlertsMetaDataProperties) MarshalJSON added in v0.7.0

func (a AlertsMetaDataProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type AlertsMetaDataProperties.

func (*AlertsMetaDataProperties) UnmarshalJSON

func (a *AlertsMetaDataProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type AlertsMetaDataProperties.

type AlertsMetaDataPropertiesClassification

type AlertsMetaDataPropertiesClassification interface {
	// GetAlertsMetaDataProperties returns the AlertsMetaDataProperties content of the underlying type.
	GetAlertsMetaDataProperties() *AlertsMetaDataProperties
}

AlertsMetaDataPropertiesClassification provides polymorphic access to related types. Call the interface's GetAlertsMetaDataProperties() method to access the common type. Use a type switch to determine the concrete type. The possible types are: - *AlertsMetaDataProperties, *MonitorServiceList

type AlertsSortByFields

type AlertsSortByFields string
const (
	AlertsSortByFieldsAlertState           AlertsSortByFields = "alertState"
	AlertsSortByFieldsLastModifiedDateTime AlertsSortByFields = "lastModifiedDateTime"
	AlertsSortByFieldsMonitorCondition     AlertsSortByFields = "monitorCondition"
	AlertsSortByFieldsName                 AlertsSortByFields = "name"
	AlertsSortByFieldsSeverity             AlertsSortByFields = "severity"
	AlertsSortByFieldsStartDateTime        AlertsSortByFields = "startDateTime"
	AlertsSortByFieldsTargetResource       AlertsSortByFields = "targetResource"
	AlertsSortByFieldsTargetResourceGroup  AlertsSortByFields = "targetResourceGroup"
	AlertsSortByFieldsTargetResourceName   AlertsSortByFields = "targetResourceName"
	AlertsSortByFieldsTargetResourceType   AlertsSortByFields = "targetResourceType"
)

func PossibleAlertsSortByFieldsValues

func PossibleAlertsSortByFieldsValues() []AlertsSortByFields

PossibleAlertsSortByFieldsValues returns the possible values for the AlertsSortByFields const type.

type AlertsSummary

type AlertsSummary struct {
	// Group the result set.
	Properties *AlertsSummaryGroup `json:"properties,omitempty"`

	// READ-ONLY; Azure resource Id
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; Azure resource name
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; Azure resource type
	Type *string `json:"type,omitempty" azure:"ro"`
}

AlertsSummary - Summary of alerts based on the input filters and 'groupby' parameters.

func (AlertsSummary) MarshalJSON

func (a AlertsSummary) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type AlertsSummary.

func (*AlertsSummary) UnmarshalJSON

func (a *AlertsSummary) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type AlertsSummary.

type AlertsSummaryGroup

type AlertsSummaryGroup struct {
	// Name of the field aggregated
	Groupedby *string `json:"groupedby,omitempty"`

	// Total count of the smart groups.
	SmartGroupsCount *int64 `json:"smartGroupsCount,omitempty"`

	// Total count of the result set.
	Total *int64 `json:"total,omitempty"`

	// List of the items
	Values []*AlertsSummaryGroupItem `json:"values,omitempty"`
}

AlertsSummaryGroup - Group the result set.

func (AlertsSummaryGroup) MarshalJSON

func (a AlertsSummaryGroup) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type AlertsSummaryGroup.

func (*AlertsSummaryGroup) UnmarshalJSON added in v0.7.0

func (a *AlertsSummaryGroup) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type AlertsSummaryGroup.

type AlertsSummaryGroupByFields

type AlertsSummaryGroupByFields string
const (
	AlertsSummaryGroupByFieldsAlertRule        AlertsSummaryGroupByFields = "alertRule"
	AlertsSummaryGroupByFieldsAlertState       AlertsSummaryGroupByFields = "alertState"
	AlertsSummaryGroupByFieldsMonitorCondition AlertsSummaryGroupByFields = "monitorCondition"
	AlertsSummaryGroupByFieldsMonitorService   AlertsSummaryGroupByFields = "monitorService"
	AlertsSummaryGroupByFieldsSeverity         AlertsSummaryGroupByFields = "severity"
	AlertsSummaryGroupByFieldsSignalType       AlertsSummaryGroupByFields = "signalType"
)

func PossibleAlertsSummaryGroupByFieldsValues

func PossibleAlertsSummaryGroupByFieldsValues() []AlertsSummaryGroupByFields

PossibleAlertsSummaryGroupByFieldsValues returns the possible values for the AlertsSummaryGroupByFields const type.

type AlertsSummaryGroupItem

type AlertsSummaryGroupItem struct {
	// Count of the aggregated field
	Count *int64 `json:"count,omitempty"`

	// Name of the field aggregated
	Groupedby *string `json:"groupedby,omitempty"`

	// Value of the aggregated field
	Name *string `json:"name,omitempty"`

	// List of the items
	Values []*AlertsSummaryGroupItem `json:"values,omitempty"`
}

AlertsSummaryGroupItem - Alerts summary group item

func (AlertsSummaryGroupItem) MarshalJSON

func (a AlertsSummaryGroupItem) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type AlertsSummaryGroupItem.

func (*AlertsSummaryGroupItem) UnmarshalJSON added in v0.7.0

func (a *AlertsSummaryGroupItem) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type AlertsSummaryGroupItem.

type Condition

type Condition struct {
	// Field for a given condition.
	Field *Field `json:"field,omitempty"`

	// Operator for a given condition.
	Operator *Operator `json:"operator,omitempty"`

	// List of values to match for a given condition.
	Values []*string `json:"values,omitempty"`
}

Condition to trigger an alert processing rule.

func (Condition) MarshalJSON

func (c Condition) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type Condition.

func (*Condition) UnmarshalJSON added in v0.7.0

func (c *Condition) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type Condition.

type CreatedByType added in v0.3.0

type CreatedByType string

CreatedByType - The type of identity that created the resource.

const (
	CreatedByTypeApplication     CreatedByType = "Application"
	CreatedByTypeKey             CreatedByType = "Key"
	CreatedByTypeManagedIdentity CreatedByType = "ManagedIdentity"
	CreatedByTypeUser            CreatedByType = "User"
)

func PossibleCreatedByTypeValues added in v0.3.0

func PossibleCreatedByTypeValues() []CreatedByType

PossibleCreatedByTypeValues returns the possible values for the CreatedByType const type.

type DailyRecurrence added in v0.3.0

type DailyRecurrence struct {
	// REQUIRED; Specifies when the recurrence should be applied.
	RecurrenceType *RecurrenceType `json:"recurrenceType,omitempty"`

	// End time for recurrence.
	EndTime *string `json:"endTime,omitempty"`

	// Start time for recurrence.
	StartTime *string `json:"startTime,omitempty"`
}

DailyRecurrence - Daily recurrence object.

func (*DailyRecurrence) GetRecurrence added in v0.3.0

func (d *DailyRecurrence) GetRecurrence() *Recurrence

GetRecurrence implements the RecurrenceClassification interface for type DailyRecurrence.

func (DailyRecurrence) MarshalJSON added in v0.3.0

func (d DailyRecurrence) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type DailyRecurrence.

func (*DailyRecurrence) UnmarshalJSON added in v0.3.0

func (d *DailyRecurrence) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type DailyRecurrence.

type DaysOfWeek added in v0.3.0

type DaysOfWeek string

DaysOfWeek - Days of week.

const (
	DaysOfWeekFriday    DaysOfWeek = "Friday"
	DaysOfWeekMonday    DaysOfWeek = "Monday"
	DaysOfWeekSaturday  DaysOfWeek = "Saturday"
	DaysOfWeekSunday    DaysOfWeek = "Sunday"
	DaysOfWeekThursday  DaysOfWeek = "Thursday"
	DaysOfWeekTuesday   DaysOfWeek = "Tuesday"
	DaysOfWeekWednesday DaysOfWeek = "Wednesday"
)

func PossibleDaysOfWeekValues added in v0.3.0

func PossibleDaysOfWeekValues() []DaysOfWeek

PossibleDaysOfWeekValues returns the possible values for the DaysOfWeek const type.

type ErrorResponse

type ErrorResponse struct {
	// Details of error response.
	Error *ErrorResponseBody `json:"error,omitempty"`
}

ErrorResponse - An error response from the service.

func (ErrorResponse) MarshalJSON added in v0.7.0

func (e ErrorResponse) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ErrorResponse.

func (*ErrorResponse) UnmarshalJSON added in v0.7.0

func (e *ErrorResponse) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ErrorResponse.

type ErrorResponseAutoGenerated

type ErrorResponseAutoGenerated struct {
	// Details of error response.
	Error *ErrorResponseBodyAutoGenerated `json:"error,omitempty"`
}

ErrorResponseAutoGenerated - An error response from the service.

func (ErrorResponseAutoGenerated) MarshalJSON added in v0.7.0

func (e ErrorResponseAutoGenerated) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ErrorResponseAutoGenerated.

func (*ErrorResponseAutoGenerated) UnmarshalJSON added in v0.7.0

func (e *ErrorResponseAutoGenerated) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ErrorResponseAutoGenerated.

type ErrorResponseAutoGenerated2

type ErrorResponseAutoGenerated2 struct {
	// Details of error response.
	Error *ErrorResponseBodyAutoGenerated2 `json:"error,omitempty"`
}

ErrorResponseAutoGenerated2 - An error response from the service.

func (ErrorResponseAutoGenerated2) MarshalJSON added in v0.7.0

func (e ErrorResponseAutoGenerated2) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ErrorResponseAutoGenerated2.

func (*ErrorResponseAutoGenerated2) UnmarshalJSON added in v0.7.0

func (e *ErrorResponseAutoGenerated2) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ErrorResponseAutoGenerated2.

type ErrorResponseBody

type ErrorResponseBody struct {
	// Error code, intended to be consumed programmatically.
	Code *string `json:"code,omitempty"`

	// A list of additional details about the error.
	Details []*ErrorResponseBody `json:"details,omitempty"`

	// Description of the error, intended for display in user interface.
	Message *string `json:"message,omitempty"`

	// Target of the particular error, for example name of the property.
	Target *string `json:"target,omitempty"`
}

ErrorResponseBody - Details of error response.

func (ErrorResponseBody) MarshalJSON

func (e ErrorResponseBody) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ErrorResponseBody.

func (*ErrorResponseBody) UnmarshalJSON added in v0.7.0

func (e *ErrorResponseBody) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ErrorResponseBody.

type ErrorResponseBodyAutoGenerated

type ErrorResponseBodyAutoGenerated struct {
	// Error code, intended to be consumed programmatically.
	Code *string `json:"code,omitempty"`

	// A list of additional details about the error.
	Details []*ErrorResponseBodyAutoGenerated `json:"details,omitempty"`

	// Description of the error, intended for display in user interface.
	Message *string `json:"message,omitempty"`

	// Target of the particular error, for example name of the property.
	Target *string `json:"target,omitempty"`
}

ErrorResponseBodyAutoGenerated - Details of error response.

func (ErrorResponseBodyAutoGenerated) MarshalJSON

func (e ErrorResponseBodyAutoGenerated) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ErrorResponseBodyAutoGenerated.

func (*ErrorResponseBodyAutoGenerated) UnmarshalJSON added in v0.7.0

func (e *ErrorResponseBodyAutoGenerated) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ErrorResponseBodyAutoGenerated.

type ErrorResponseBodyAutoGenerated2

type ErrorResponseBodyAutoGenerated2 struct {
	// Error code, intended to be consumed programmatically.
	Code *string `json:"code,omitempty"`

	// A list of additional details about the error.
	Details []*ErrorResponseBodyAutoGenerated2 `json:"details,omitempty"`

	// Description of the error, intended for display in user interface.
	Message *string `json:"message,omitempty"`

	// Target of the particular error, for example name of the property.
	Target *string `json:"target,omitempty"`
}

ErrorResponseBodyAutoGenerated2 - Details of error response.

func (ErrorResponseBodyAutoGenerated2) MarshalJSON

func (e ErrorResponseBodyAutoGenerated2) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ErrorResponseBodyAutoGenerated2.

func (*ErrorResponseBodyAutoGenerated2) UnmarshalJSON added in v0.7.0

func (e *ErrorResponseBodyAutoGenerated2) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ErrorResponseBodyAutoGenerated2.

type Essentials

type Essentials struct {
	// Action status
	ActionStatus *ActionStatus `json:"actionStatus,omitempty"`

	// Alert description.
	Description *string `json:"description,omitempty"`

	// Target ARM resource, on which alert got created.
	TargetResource *string `json:"targetResource,omitempty"`

	// Resource group of target ARM resource, on which alert got created.
	TargetResourceGroup *string `json:"targetResourceGroup,omitempty"`

	// Name of the target ARM resource name, on which alert got created.
	TargetResourceName *string `json:"targetResourceName,omitempty"`

	// Resource type of target ARM resource, on which alert got created.
	TargetResourceType *string `json:"targetResourceType,omitempty"`

	// READ-ONLY; Rule(monitor) which fired alert instance. Depending on the monitor service, this would be ARM id or name of
	// the rule.
	AlertRule *string `json:"alertRule,omitempty" azure:"ro"`

	// READ-ONLY; Alert object state, which can be modified by the user.
	AlertState *AlertState `json:"alertState,omitempty" azure:"ro"`

	// READ-ONLY; Last modification time(ISO-8601 format) of alert instance.
	LastModifiedDateTime *time.Time `json:"lastModifiedDateTime,omitempty" azure:"ro"`

	// READ-ONLY; User who last modified the alert, in case of monitor service updates user would be 'system', otherwise name
	// of the user.
	LastModifiedUserName *string `json:"lastModifiedUserName,omitempty" azure:"ro"`

	// READ-ONLY; Condition of the rule at the monitor service. It represents whether the underlying conditions have crossed the
	// defined alert rule thresholds.
	MonitorCondition *MonitorCondition `json:"monitorCondition,omitempty" azure:"ro"`

	// READ-ONLY; Resolved time(ISO-8601 format) of alert instance. This will be updated when monitor service resolves the alert
	// instance because the rule condition is no longer met.
	MonitorConditionResolvedDateTime *time.Time `json:"monitorConditionResolvedDateTime,omitempty" azure:"ro"`

	// READ-ONLY; Monitor service on which the rule(monitor) is set.
	MonitorService *MonitorService `json:"monitorService,omitempty" azure:"ro"`

	// READ-ONLY; Severity of alert Sev0 being highest and Sev4 being lowest.
	Severity *Severity `json:"severity,omitempty" azure:"ro"`

	// READ-ONLY; The type of signal the alert is based on, which could be metrics, logs or activity logs.
	SignalType *SignalType `json:"signalType,omitempty" azure:"ro"`

	// READ-ONLY; Unique Id of the smart group
	SmartGroupID *string `json:"smartGroupId,omitempty" azure:"ro"`

	// READ-ONLY; Verbose reason describing the reason why this alert instance is added to a smart group
	SmartGroupingReason *string `json:"smartGroupingReason,omitempty" azure:"ro"`

	// READ-ONLY; Unique Id created by monitor service for each alert instance. This could be used to track the issue at the monitor
	// service, in case of Nagios, Zabbix, SCOM etc.
	SourceCreatedID *string `json:"sourceCreatedId,omitempty" azure:"ro"`

	// READ-ONLY; Creation time(ISO-8601 format) of alert instance.
	StartDateTime *time.Time `json:"startDateTime,omitempty" azure:"ro"`
}

Essentials - This object contains consistent fields across different monitor services.

func (Essentials) MarshalJSON

func (e Essentials) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type Essentials.

func (*Essentials) UnmarshalJSON

func (e *Essentials) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type Essentials.

type Field added in v0.3.0

type Field string

Field - Field for a given condition.

const (
	FieldAlertContext        Field = "AlertContext"
	FieldAlertRuleID         Field = "AlertRuleId"
	FieldAlertRuleName       Field = "AlertRuleName"
	FieldDescription         Field = "Description"
	FieldMonitorCondition    Field = "MonitorCondition"
	FieldMonitorService      Field = "MonitorService"
	FieldSeverity            Field = "Severity"
	FieldSignalType          Field = "SignalType"
	FieldTargetResource      Field = "TargetResource"
	FieldTargetResourceGroup Field = "TargetResourceGroup"
	FieldTargetResourceType  Field = "TargetResourceType"
)

func PossibleFieldValues added in v0.3.0

func PossibleFieldValues() []Field

PossibleFieldValues returns the possible values for the Field const type.

type Identifier

type Identifier string
const (
	IdentifierMonitorServiceList Identifier = "MonitorServiceList"
)

func PossibleIdentifierValues

func PossibleIdentifierValues() []Identifier

PossibleIdentifierValues returns the possible values for the Identifier const type.

type ManagedResource

type ManagedResource struct {
	// REQUIRED; Resource location
	Location *string `json:"location,omitempty"`

	// Resource tags
	Tags map[string]*string `json:"tags,omitempty"`

	// READ-ONLY; Azure resource Id
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; Azure resource name
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; Azure resource type
	Type *string `json:"type,omitempty" azure:"ro"`
}

ManagedResource - An azure managed resource object.

func (ManagedResource) MarshalJSON

func (m ManagedResource) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ManagedResource.

func (*ManagedResource) UnmarshalJSON

func (m *ManagedResource) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ManagedResource.

type MetadataIdentifier

type MetadataIdentifier string

MetadataIdentifier - Identification of the information to be retrieved by API call

const (
	MetadataIdentifierMonitorServiceList MetadataIdentifier = "MonitorServiceList"
)

func PossibleMetadataIdentifierValues

func PossibleMetadataIdentifierValues() []MetadataIdentifier

PossibleMetadataIdentifierValues returns the possible values for the MetadataIdentifier const type.

type MonitorCondition

type MonitorCondition string
const (
	MonitorConditionFired    MonitorCondition = "Fired"
	MonitorConditionResolved MonitorCondition = "Resolved"
)

func PossibleMonitorConditionValues

func PossibleMonitorConditionValues() []MonitorCondition

PossibleMonitorConditionValues returns the possible values for the MonitorCondition const type.

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 PossibleMonitorServiceValues

func PossibleMonitorServiceValues() []MonitorService

PossibleMonitorServiceValues returns the possible values for the MonitorService const type.

type MonitorServiceDetails

type MonitorServiceDetails struct {
	// Monitor service display name
	DisplayName *string `json:"displayName,omitempty"`

	// Monitor service name
	Name *string `json:"name,omitempty"`
}

MonitorServiceDetails - Details of a monitor service

func (MonitorServiceDetails) MarshalJSON added in v0.7.0

func (m MonitorServiceDetails) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type MonitorServiceDetails.

func (*MonitorServiceDetails) UnmarshalJSON added in v0.7.0

func (m *MonitorServiceDetails) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type MonitorServiceDetails.

type MonitorServiceList

type MonitorServiceList struct {
	// REQUIRED; Array of operations
	Data []*MonitorServiceDetails `json:"data,omitempty"`

	// REQUIRED; Identification of the information to be retrieved by API call
	MetadataIdentifier *MetadataIdentifier `json:"metadataIdentifier,omitempty"`
}

MonitorServiceList - Monitor service details

func (*MonitorServiceList) GetAlertsMetaDataProperties added in v0.3.0

func (m *MonitorServiceList) GetAlertsMetaDataProperties() *AlertsMetaDataProperties

GetAlertsMetaDataProperties implements the AlertsMetaDataPropertiesClassification interface for type MonitorServiceList.

func (MonitorServiceList) MarshalJSON

func (m MonitorServiceList) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type MonitorServiceList.

func (*MonitorServiceList) UnmarshalJSON

func (m *MonitorServiceList) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type MonitorServiceList.

type MonthlyRecurrence added in v0.3.0

type MonthlyRecurrence struct {
	// REQUIRED; Specifies the values for monthly recurrence pattern.
	DaysOfMonth []*int32 `json:"daysOfMonth,omitempty"`

	// REQUIRED; Specifies when the recurrence should be applied.
	RecurrenceType *RecurrenceType `json:"recurrenceType,omitempty"`

	// End time for recurrence.
	EndTime *string `json:"endTime,omitempty"`

	// Start time for recurrence.
	StartTime *string `json:"startTime,omitempty"`
}

MonthlyRecurrence - Monthly recurrence object.

func (*MonthlyRecurrence) GetRecurrence added in v0.3.0

func (m *MonthlyRecurrence) GetRecurrence() *Recurrence

GetRecurrence implements the RecurrenceClassification interface for type MonthlyRecurrence.

func (MonthlyRecurrence) MarshalJSON added in v0.3.0

func (m MonthlyRecurrence) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type MonthlyRecurrence.

func (*MonthlyRecurrence) UnmarshalJSON added in v0.3.0

func (m *MonthlyRecurrence) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type MonthlyRecurrence.

type Operation

type Operation struct {
	// Properties of the operation
	Display *OperationDisplay `json:"display,omitempty"`

	// Name of the operation
	Name *string `json:"name,omitempty"`

	// Origin of the operation
	Origin *string `json:"origin,omitempty"`
}

Operation provided by provider

func (Operation) MarshalJSON added in v0.7.0

func (o Operation) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type Operation.

func (*Operation) UnmarshalJSON added in v0.7.0

func (o *Operation) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type Operation.

type OperationDisplay

type OperationDisplay struct {
	// Description of the operation
	Description *string `json:"description,omitempty"`

	// Operation name
	Operation *string `json:"operation,omitempty"`

	// Provider name
	Provider *string `json:"provider,omitempty"`

	// Resource name
	Resource *string `json:"resource,omitempty"`
}

OperationDisplay - Properties of the operation

func (OperationDisplay) MarshalJSON added in v0.7.0

func (o OperationDisplay) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type OperationDisplay.

func (*OperationDisplay) UnmarshalJSON added in v0.7.0

func (o *OperationDisplay) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type OperationDisplay.

type OperationsClient

type OperationsClient struct {
	// contains filtered or unexported fields
}

OperationsClient contains the methods for the Operations group. Don't use this type directly, use NewOperationsClient() instead.

func NewOperationsClient

func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*OperationsClient, error)

NewOperationsClient creates a new instance of OperationsClient with the specified values. credential - used to authorize requests. Usually a credential from azidentity. options - pass nil to accept the default values.

func (*OperationsClient) NewListPager added in v0.5.0

NewListPager - List all operations available through Azure Alerts Management Resource Provider. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2019-05-05-preview options - OperationsClientListOptions contains the optional parameters for the OperationsClient.List method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2019-05-05-preview/examples/Operations_List.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/alertsmanagement/armalertsmanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armalertsmanagement.NewOperationsClient(cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := client.NewListPager(nil)
	for pager.More() {
		nextResult, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range nextResult.Value {
			// TODO: use page item
			_ = v
		}
	}
}
Output:

type OperationsClientListOptions added in v0.3.0

type OperationsClientListOptions struct {
}

OperationsClientListOptions contains the optional parameters for the OperationsClient.List method.

type OperationsClientListResponse added in v0.3.0

type OperationsClientListResponse struct {
	OperationsList
}

OperationsClientListResponse contains the response from method OperationsClient.List.

type OperationsList

type OperationsList struct {
	// REQUIRED; Array of operations
	Value []*Operation `json:"value,omitempty"`

	// URL to fetch the next set of alerts.
	NextLink *string `json:"nextLink,omitempty"`
}

OperationsList - Lists the operations available in the AlertsManagement RP.

func (OperationsList) MarshalJSON

func (o OperationsList) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type OperationsList.

func (*OperationsList) UnmarshalJSON added in v0.7.0

func (o *OperationsList) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type OperationsList.

type Operator

type Operator string

Operator - Operator for a given condition.

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

func PossibleOperatorValues

func PossibleOperatorValues() []Operator

PossibleOperatorValues returns the possible values for the Operator const type.

type PatchObject

type PatchObject struct {
	// Properties supported by patch operation.
	Properties *PatchProperties `json:"properties,omitempty"`

	// Tags to be updated.
	Tags map[string]*string `json:"tags,omitempty"`
}

PatchObject - Data contract for patch.

func (PatchObject) MarshalJSON

func (p PatchObject) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type PatchObject.

func (*PatchObject) UnmarshalJSON added in v0.7.0

func (p *PatchObject) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type PatchObject.

type PatchProperties

type PatchProperties struct {
	// Indicates if the given alert processing rule is enabled or disabled.
	Enabled *bool `json:"enabled,omitempty"`
}

PatchProperties - Alert processing rule properties supported by patch.

func (PatchProperties) MarshalJSON added in v0.7.0

func (p PatchProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type PatchProperties.

func (*PatchProperties) UnmarshalJSON added in v0.7.0

func (p *PatchProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type PatchProperties.

type Recurrence added in v0.3.0

type Recurrence struct {
	// REQUIRED; Specifies when the recurrence should be applied.
	RecurrenceType *RecurrenceType `json:"recurrenceType,omitempty"`

	// End time for recurrence.
	EndTime *string `json:"endTime,omitempty"`

	// Start time for recurrence.
	StartTime *string `json:"startTime,omitempty"`
}

Recurrence object.

func (*Recurrence) GetRecurrence added in v0.3.0

func (r *Recurrence) GetRecurrence() *Recurrence

GetRecurrence implements the RecurrenceClassification interface for type Recurrence.

func (Recurrence) MarshalJSON added in v0.7.0

func (r Recurrence) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type Recurrence.

func (*Recurrence) UnmarshalJSON added in v0.7.0

func (r *Recurrence) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type Recurrence.

type RecurrenceClassification added in v0.3.0

type RecurrenceClassification interface {
	// GetRecurrence returns the Recurrence content of the underlying type.
	GetRecurrence() *Recurrence
}

RecurrenceClassification provides polymorphic access to related types. Call the interface's GetRecurrence() method to access the common type. Use a type switch to determine the concrete type. The possible types are: - *DailyRecurrence, *MonthlyRecurrence, *Recurrence, *WeeklyRecurrence

type RecurrenceType added in v0.3.0

type RecurrenceType string

RecurrenceType - Specifies when the recurrence should be applied.

const (
	RecurrenceTypeDaily   RecurrenceType = "Daily"
	RecurrenceTypeMonthly RecurrenceType = "Monthly"
	RecurrenceTypeWeekly  RecurrenceType = "Weekly"
)

func PossibleRecurrenceTypeValues added in v0.3.0

func PossibleRecurrenceTypeValues() []RecurrenceType

PossibleRecurrenceTypeValues returns the possible values for the RecurrenceType const type.

type RemoveAllActionGroups added in v0.3.0

type RemoveAllActionGroups struct {
	// REQUIRED; Action that should be applied.
	ActionType *ActionType `json:"actionType,omitempty"`
}

RemoveAllActionGroups - Indicates if all action groups should be removed.

func (*RemoveAllActionGroups) GetAction added in v0.3.0

func (r *RemoveAllActionGroups) GetAction() *Action

GetAction implements the ActionClassification interface for type RemoveAllActionGroups.

func (RemoveAllActionGroups) MarshalJSON added in v0.3.0

func (r RemoveAllActionGroups) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type RemoveAllActionGroups.

func (*RemoveAllActionGroups) UnmarshalJSON added in v0.3.0

func (r *RemoveAllActionGroups) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type RemoveAllActionGroups.

type Resource

type Resource struct {
	// READ-ONLY; Azure resource Id
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; Azure resource name
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; Azure resource type
	Type *string `json:"type,omitempty" azure:"ro"`
}

Resource - An azure resource object

func (Resource) MarshalJSON

func (r Resource) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type Resource.

func (*Resource) UnmarshalJSON

func (r *Resource) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type Resource.

type Schedule added in v0.3.0

type Schedule struct {
	// Scheduling effective from time. Date-Time in ISO-8601 format without timezone suffix.
	EffectiveFrom *string `json:"effectiveFrom,omitempty"`

	// Scheduling effective until time. Date-Time in ISO-8601 format without timezone suffix.
	EffectiveUntil *string `json:"effectiveUntil,omitempty"`

	// List of recurrences.
	Recurrences []RecurrenceClassification `json:"recurrences,omitempty"`

	// Scheduling time zone.
	TimeZone *string `json:"timeZone,omitempty"`
}

Schedule - Scheduling configuration for a given alert processing rule.

func (Schedule) MarshalJSON added in v0.3.0

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

MarshalJSON implements the json.Marshaller interface for type Schedule.

func (*Schedule) UnmarshalJSON added in v0.3.0

func (s *Schedule) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type Schedule.

type Severity

type Severity string
const (
	SeveritySev0 Severity = "Sev0"
	SeveritySev1 Severity = "Sev1"
	SeveritySev2 Severity = "Sev2"
	SeveritySev3 Severity = "Sev3"
	SeveritySev4 Severity = "Sev4"
)

func PossibleSeverityValues

func PossibleSeverityValues() []Severity

PossibleSeverityValues returns the possible values for the Severity const type.

type SignalType

type SignalType string

SignalType - The type of signal the alert is based on, which could be metrics, logs or activity logs.

const (
	SignalTypeLog     SignalType = "Log"
	SignalTypeMetric  SignalType = "Metric"
	SignalTypeUnknown SignalType = "Unknown"
)

func PossibleSignalTypeValues

func PossibleSignalTypeValues() []SignalType

PossibleSignalTypeValues returns the possible values for the SignalType const type.

type SmartGroup

type SmartGroup struct {
	// Properties of smart group.
	Properties *SmartGroupProperties `json:"properties,omitempty"`

	// READ-ONLY; Azure resource Id
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; Azure resource name
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; Azure resource type
	Type *string `json:"type,omitempty" azure:"ro"`
}

SmartGroup - Set of related alerts grouped together smartly by AMS.

func (SmartGroup) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type SmartGroup.

func (*SmartGroup) UnmarshalJSON

func (s *SmartGroup) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type SmartGroup.

type SmartGroupAggregatedProperty

type SmartGroupAggregatedProperty struct {
	// Total number of items of type.
	Count *int64 `json:"count,omitempty"`

	// Name of the type.
	Name *string `json:"name,omitempty"`
}

SmartGroupAggregatedProperty - Aggregated property of each type

func (SmartGroupAggregatedProperty) MarshalJSON added in v0.7.0

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

MarshalJSON implements the json.Marshaller interface for type SmartGroupAggregatedProperty.

func (*SmartGroupAggregatedProperty) UnmarshalJSON added in v0.7.0

func (s *SmartGroupAggregatedProperty) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type SmartGroupAggregatedProperty.

type SmartGroupModification

type SmartGroupModification struct {
	// Properties of the smartGroup modification item.
	Properties *SmartGroupModificationProperties `json:"properties,omitempty"`

	// READ-ONLY; Azure resource Id
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; Azure resource name
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; Azure resource type
	Type *string `json:"type,omitempty" azure:"ro"`
}

SmartGroupModification - Alert Modification details

func (SmartGroupModification) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type SmartGroupModification.

func (*SmartGroupModification) UnmarshalJSON

func (s *SmartGroupModification) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type SmartGroupModification.

type SmartGroupModificationEvent

type SmartGroupModificationEvent string

SmartGroupModificationEvent - Reason for the modification

const (
	SmartGroupModificationEventSmartGroupCreated SmartGroupModificationEvent = "SmartGroupCreated"
	SmartGroupModificationEventStateChange       SmartGroupModificationEvent = "StateChange"
	SmartGroupModificationEventAlertAdded        SmartGroupModificationEvent = "AlertAdded"
	SmartGroupModificationEventAlertRemoved      SmartGroupModificationEvent = "AlertRemoved"
)

func PossibleSmartGroupModificationEventValues

func PossibleSmartGroupModificationEventValues() []SmartGroupModificationEvent

PossibleSmartGroupModificationEventValues returns the possible values for the SmartGroupModificationEvent const type.

type SmartGroupModificationItem

type SmartGroupModificationItem struct {
	// Modification comments
	Comments *string `json:"comments,omitempty"`

	// Description of the modification
	Description *string `json:"description,omitempty"`

	// Reason for the modification
	ModificationEvent *SmartGroupModificationEvent `json:"modificationEvent,omitempty"`

	// Modified date and time
	ModifiedAt *string `json:"modifiedAt,omitempty"`

	// Modified user details (Principal client name)
	ModifiedBy *string `json:"modifiedBy,omitempty"`

	// New value
	NewValue *string `json:"newValue,omitempty"`

	// Old value
	OldValue *string `json:"oldValue,omitempty"`
}

SmartGroupModificationItem - smartGroup modification item.

func (SmartGroupModificationItem) MarshalJSON added in v0.7.0

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

MarshalJSON implements the json.Marshaller interface for type SmartGroupModificationItem.

func (*SmartGroupModificationItem) UnmarshalJSON added in v0.7.0

func (s *SmartGroupModificationItem) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type SmartGroupModificationItem.

type SmartGroupModificationProperties

type SmartGroupModificationProperties struct {
	// Modification details
	Modifications []*SmartGroupModificationItem `json:"modifications,omitempty"`

	// URL to fetch the next set of results.
	NextLink *string `json:"nextLink,omitempty"`

	// READ-ONLY; Unique Id of the smartGroup for which the history is being retrieved
	SmartGroupID *string `json:"smartGroupId,omitempty" azure:"ro"`
}

SmartGroupModificationProperties - Properties of the smartGroup modification item.

func (SmartGroupModificationProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type SmartGroupModificationProperties.

func (*SmartGroupModificationProperties) UnmarshalJSON added in v0.7.0

func (s *SmartGroupModificationProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type SmartGroupModificationProperties.

type SmartGroupProperties

type SmartGroupProperties struct {
	// Summary of alertSeverities in the smart group
	AlertSeverities []*SmartGroupAggregatedProperty `json:"alertSeverities,omitempty"`

	// Summary of alertStates in the smart group
	AlertStates []*SmartGroupAggregatedProperty `json:"alertStates,omitempty"`

	// Total number of alerts in smart group
	AlertsCount *int64 `json:"alertsCount,omitempty"`

	// Summary of monitorConditions in the smart group
	MonitorConditions []*SmartGroupAggregatedProperty `json:"monitorConditions,omitempty"`

	// Summary of monitorServices in the smart group
	MonitorServices []*SmartGroupAggregatedProperty `json:"monitorServices,omitempty"`

	// The URI to fetch the next page of alerts. Call ListNext() with this URI to fetch the next page alerts.
	NextLink *string `json:"nextLink,omitempty"`

	// Summary of target resource groups in the smart group
	ResourceGroups []*SmartGroupAggregatedProperty `json:"resourceGroups,omitempty"`

	// Summary of target resource types in the smart group
	ResourceTypes []*SmartGroupAggregatedProperty `json:"resourceTypes,omitempty"`

	// Summary of target resources in the smart group
	Resources []*SmartGroupAggregatedProperty `json:"resources,omitempty"`

	// READ-ONLY; Last updated time of smart group. Date-Time in ISO-8601 format.
	LastModifiedDateTime *time.Time `json:"lastModifiedDateTime,omitempty" azure:"ro"`

	// READ-ONLY; Last modified by user name.
	LastModifiedUserName *string `json:"lastModifiedUserName,omitempty" azure:"ro"`

	// READ-ONLY; Severity of smart group is the highest(Sev0 >… > Sev4) severity of all the alerts in the group.
	Severity *Severity `json:"severity,omitempty" azure:"ro"`

	// READ-ONLY; Smart group state
	SmartGroupState *State `json:"smartGroupState,omitempty" azure:"ro"`

	// READ-ONLY; Creation time of smart group. Date-Time in ISO-8601 format.
	StartDateTime *time.Time `json:"startDateTime,omitempty" azure:"ro"`
}

SmartGroupProperties - Properties of smart group.

func (SmartGroupProperties) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type SmartGroupProperties.

func (*SmartGroupProperties) UnmarshalJSON

func (s *SmartGroupProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type SmartGroupProperties.

type SmartGroupsClient

type SmartGroupsClient struct {
	// contains filtered or unexported fields
}

SmartGroupsClient contains the methods for the SmartGroups group. Don't use this type directly, use NewSmartGroupsClient() instead.

func NewSmartGroupsClient

func NewSmartGroupsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SmartGroupsClient, error)

NewSmartGroupsClient creates a new instance of SmartGroupsClient with the specified values. subscriptionID - The ID of the target subscription. credential - used to authorize requests. Usually a credential from azidentity. options - pass nil to accept the default values.

func (*SmartGroupsClient) ChangeState

ChangeState - Change the state of a Smart Group. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2019-05-05-preview smartGroupID - Smart group unique id. newState - New state of the alert. options - SmartGroupsClientChangeStateOptions contains the optional parameters for the SmartGroupsClient.ChangeState method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2019-05-05-preview/examples/SmartGroups_ChangeState.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/alertsmanagement/armalertsmanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armalertsmanagement.NewSmartGroupsClient("dd91de05-d791-4ceb-b6dc-988682dc7d72", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := client.ChangeState(ctx, "a808445e-bb38-4751-85c2-1b109ccc1059", armalertsmanagement.AlertStateAcknowledged, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// TODO: use response item
	_ = res
}
Output:

func (*SmartGroupsClient) GetByID

GetByID - Get information related to a specific Smart Group. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2019-05-05-preview smartGroupID - Smart group unique id. options - SmartGroupsClientGetByIDOptions contains the optional parameters for the SmartGroupsClient.GetByID method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2019-05-05-preview/examples/SmartGroups_GetById.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/alertsmanagement/armalertsmanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armalertsmanagement.NewSmartGroupsClient("9e261de7-c804-4b9d-9ebf-6f50fe350a9a", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := client.GetByID(ctx, "603675da-9851-4b26-854a-49fc53d32715", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// TODO: use response item
	_ = res
}
Output:

func (*SmartGroupsClient) GetHistory

GetHistory - Get the history a smart group, which captures any Smart Group state changes (New/Acknowledged/Closed) . If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2019-05-05-preview smartGroupID - Smart group unique id. options - SmartGroupsClientGetHistoryOptions contains the optional parameters for the SmartGroupsClient.GetHistory method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2019-05-05-preview/examples/SmartGroups_History.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/alertsmanagement/armalertsmanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armalertsmanagement.NewSmartGroupsClient("9e261de7-c804-4b9d-9ebf-6f50fe350a9a", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := client.GetHistory(ctx, "a808445e-bb38-4751-85c2-1b109ccc1059", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// TODO: use response item
	_ = res
}
Output:

func (*SmartGroupsClient) NewGetAllPager added in v0.5.0

NewGetAllPager - List all the Smart Groups within a specified subscription. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2019-05-05-preview options - SmartGroupsClientGetAllOptions contains the optional parameters for the SmartGroupsClient.GetAll method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2019-05-05-preview/examples/SmartGroups_List.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/alertsmanagement/armalertsmanagement"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armalertsmanagement.NewSmartGroupsClient("dd91de05-d791-4ceb-b6dc-988682dc7d72", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := client.NewGetAllPager(&armalertsmanagement.SmartGroupsClientGetAllOptions{TargetResource: nil,
		TargetResourceGroup: nil,
		TargetResourceType:  nil,
		MonitorService:      nil,
		MonitorCondition:    nil,
		Severity:            nil,
		SmartGroupState:     nil,
		TimeRange:           nil,
		PageCount:           nil,
		SortBy:              nil,
		SortOrder:           nil,
	})
	for pager.More() {
		nextResult, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range nextResult.Value {
			// TODO: use page item
			_ = v
		}
	}
}
Output:

type SmartGroupsClientChangeStateOptions added in v0.3.0

type SmartGroupsClientChangeStateOptions struct {
}

SmartGroupsClientChangeStateOptions contains the optional parameters for the SmartGroupsClient.ChangeState method.

type SmartGroupsClientChangeStateResponse added in v0.3.0

type SmartGroupsClientChangeStateResponse struct {
	SmartGroup
	// XMSRequestID contains the information returned from the x-ms-request-id header response.
	XMSRequestID *string
}

SmartGroupsClientChangeStateResponse contains the response from method SmartGroupsClient.ChangeState.

type SmartGroupsClientGetAllOptions added in v0.3.0

type SmartGroupsClientGetAllOptions struct {
	// Filter by monitor condition which is either 'Fired' or 'Resolved'. Default value is to select all.
	MonitorCondition *MonitorCondition
	// Filter by monitor service which generates the alert instance. Default value is select all.
	MonitorService *MonitorService
	// Determines number of alerts returned per page in response. Permissible value is between 1 to 250. When the "includeContent"
	// filter is selected, maximum value allowed is 25. Default value is 25.
	PageCount *int64
	// Filter by severity. Default value is select all.
	Severity *Severity
	// Filter by state of the smart group. Default value is to select all.
	SmartGroupState *AlertState
	// Sort the query results by input field. Default value is sort by 'lastModifiedDateTime'.
	SortBy *SmartGroupsSortByFields
	// Sort the query results order in either ascending or descending. Default value is 'desc' for time fields and 'asc' for others.
	SortOrder *SortOrder
	// Filter by target resource( which is full ARM ID) Default value is select all.
	TargetResource *string
	// Filter by target resource group name. Default value is select all.
	TargetResourceGroup *string
	// Filter by target resource type. Default value is select all.
	TargetResourceType *string
	// Filter by time range by below listed values. Default value is 1 day.
	TimeRange *TimeRange
}

SmartGroupsClientGetAllOptions contains the optional parameters for the SmartGroupsClient.GetAll method.

type SmartGroupsClientGetAllResponse added in v0.3.0

type SmartGroupsClientGetAllResponse struct {
	SmartGroupsList
}

SmartGroupsClientGetAllResponse contains the response from method SmartGroupsClient.GetAll.

type SmartGroupsClientGetByIDOptions added in v0.3.0

type SmartGroupsClientGetByIDOptions struct {
}

SmartGroupsClientGetByIDOptions contains the optional parameters for the SmartGroupsClient.GetByID method.

type SmartGroupsClientGetByIDResponse added in v0.3.0

type SmartGroupsClientGetByIDResponse struct {
	SmartGroup
	// XMSRequestID contains the information returned from the x-ms-request-id header response.
	XMSRequestID *string
}

SmartGroupsClientGetByIDResponse contains the response from method SmartGroupsClient.GetByID.

type SmartGroupsClientGetHistoryOptions added in v0.3.0

type SmartGroupsClientGetHistoryOptions struct {
}

SmartGroupsClientGetHistoryOptions contains the optional parameters for the SmartGroupsClient.GetHistory method.

type SmartGroupsClientGetHistoryResponse added in v0.3.0

type SmartGroupsClientGetHistoryResponse struct {
	SmartGroupModification
}

SmartGroupsClientGetHistoryResponse contains the response from method SmartGroupsClient.GetHistory.

type SmartGroupsList

type SmartGroupsList struct {
	// URL to fetch the next set of alerts.
	NextLink *string `json:"nextLink,omitempty"`

	// List of alerts
	Value []*SmartGroup `json:"value,omitempty"`
}

SmartGroupsList - List the alerts.

func (SmartGroupsList) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type SmartGroupsList.

func (*SmartGroupsList) UnmarshalJSON added in v0.7.0

func (s *SmartGroupsList) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type SmartGroupsList.

type SmartGroupsSortByFields

type SmartGroupsSortByFields string
const (
	SmartGroupsSortByFieldsAlertsCount          SmartGroupsSortByFields = "alertsCount"
	SmartGroupsSortByFieldsLastModifiedDateTime SmartGroupsSortByFields = "lastModifiedDateTime"
	SmartGroupsSortByFieldsSeverity             SmartGroupsSortByFields = "severity"
	SmartGroupsSortByFieldsStartDateTime        SmartGroupsSortByFields = "startDateTime"
	SmartGroupsSortByFieldsState                SmartGroupsSortByFields = "state"
)

func PossibleSmartGroupsSortByFieldsValues

func PossibleSmartGroupsSortByFieldsValues() []SmartGroupsSortByFields

PossibleSmartGroupsSortByFieldsValues returns the possible values for the SmartGroupsSortByFields const type.

type SortOrder added in v0.3.0

type SortOrder string
const (
	SortOrderAsc  SortOrder = "asc"
	SortOrderDesc SortOrder = "desc"
)

func PossibleSortOrderValues added in v0.3.0

func PossibleSortOrderValues() []SortOrder

PossibleSortOrderValues returns the possible values for the SortOrder const type.

type State

type State string

State - Smart group state

const (
	StateAcknowledged State = "Acknowledged"
	StateClosed       State = "Closed"
	StateNew          State = "New"
)

func PossibleStateValues

func PossibleStateValues() []State

PossibleStateValues returns the possible values for the State const type.

type SystemData added in v0.3.0

type SystemData struct {
	// The timestamp of resource creation (UTC).
	CreatedAt *time.Time `json:"createdAt,omitempty"`

	// The identity that created the resource.
	CreatedBy *string `json:"createdBy,omitempty"`

	// The type of identity that created the resource.
	CreatedByType *CreatedByType `json:"createdByType,omitempty"`

	// The timestamp of resource last modification (UTC)
	LastModifiedAt *time.Time `json:"lastModifiedAt,omitempty"`

	// The identity that last modified the resource.
	LastModifiedBy *string `json:"lastModifiedBy,omitempty"`

	// The type of identity that last modified the resource.
	LastModifiedByType *CreatedByType `json:"lastModifiedByType,omitempty"`
}

SystemData - Metadata pertaining to creation and last modification of the resource.

func (SystemData) MarshalJSON added in v0.3.0

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

MarshalJSON implements the json.Marshaller interface for type SystemData.

func (*SystemData) UnmarshalJSON added in v0.3.0

func (s *SystemData) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type SystemData.

type TimeRange

type TimeRange string
const (
	TimeRangeOneD    TimeRange = "1d"
	TimeRangeOneH    TimeRange = "1h"
	TimeRangeSevenD  TimeRange = "7d"
	TimeRangeThirtyD TimeRange = "30d"
)

func PossibleTimeRangeValues

func PossibleTimeRangeValues() []TimeRange

PossibleTimeRangeValues returns the possible values for the TimeRange const type.

type WeeklyRecurrence added in v0.3.0

type WeeklyRecurrence struct {
	// REQUIRED; Specifies the values for weekly recurrence pattern.
	DaysOfWeek []*DaysOfWeek `json:"daysOfWeek,omitempty"`

	// REQUIRED; Specifies when the recurrence should be applied.
	RecurrenceType *RecurrenceType `json:"recurrenceType,omitempty"`

	// End time for recurrence.
	EndTime *string `json:"endTime,omitempty"`

	// Start time for recurrence.
	StartTime *string `json:"startTime,omitempty"`
}

WeeklyRecurrence - Weekly recurrence object.

func (*WeeklyRecurrence) GetRecurrence added in v0.3.0

func (w *WeeklyRecurrence) GetRecurrence() *Recurrence

GetRecurrence implements the RecurrenceClassification interface for type WeeklyRecurrence.

func (WeeklyRecurrence) MarshalJSON added in v0.3.0

func (w WeeklyRecurrence) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type WeeklyRecurrence.

func (*WeeklyRecurrence) UnmarshalJSON added in v0.3.0

func (w *WeeklyRecurrence) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type WeeklyRecurrence.

Jump to

Keyboard shortcuts

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