Documentation
¶
Index ¶
- type ActionStatus
- type ActionSuppressedDetails
- type ActionTriggeredDetails
- type ActionType
- type Alert
- type AlertEnrichmentItem
- type AlertEnrichmentItemClassification
- type AlertEnrichmentProperties
- type AlertEnrichmentResponse
- type AlertEnrichmentsList
- type AlertModification
- type AlertModificationEvent
- type AlertModificationItem
- type AlertModificationProperties
- type AlertModificationType
- type AlertProperties
- type AlertState
- type AlertsClient
- func (client *AlertsClient) ChangeState(ctx context.Context, alertID string, newState AlertState, ...) (AlertsClientChangeStateResponse, error)
- func (client *AlertsClient) ChangeStateTenant(ctx context.Context, alertID string, newState AlertState, ...) (AlertsClientChangeStateTenantResponse, error)
- func (client *AlertsClient) GetByID(ctx context.Context, alertID string, options *AlertsClientGetByIDOptions) (AlertsClientGetByIDResponse, error)
- func (client *AlertsClient) GetByIDTenant(ctx context.Context, alertID string, options *AlertsClientGetByIDTenantOptions) (AlertsClientGetByIDTenantResponse, error)
- func (client *AlertsClient) GetHistory(ctx context.Context, alertID string, options *AlertsClientGetHistoryOptions) (AlertsClientGetHistoryResponse, error)
- func (client *AlertsClient) GetHistoryTenant(ctx context.Context, alertID string, ...) (AlertsClientGetHistoryTenantResponse, error)
- func (client *AlertsClient) GetSummary(ctx context.Context, groupby AlertsSummaryGroupByFields, ...) (AlertsClientGetSummaryResponse, error)
- func (client *AlertsClient) MetaData(ctx context.Context, identifier Identifier, ...) (AlertsClientMetaDataResponse, error)
- func (client *AlertsClient) NewGetAllPager(options *AlertsClientGetAllOptions) *runtime.Pager[AlertsClientGetAllResponse]
- func (client *AlertsClient) NewGetAllTenantPager(options *AlertsClientGetAllTenantOptions) *runtime.Pager[AlertsClientGetAllTenantResponse]
- func (client *AlertsClient) NewGetEnrichmentsPager(alertID string, options *AlertsClientGetEnrichmentsOptions) *runtime.Pager[AlertsClientGetEnrichmentsResponse]
- type AlertsClientChangeStateOptions
- type AlertsClientChangeStateResponse
- type AlertsClientChangeStateTenantOptions
- type AlertsClientChangeStateTenantResponse
- type AlertsClientGetAllOptions
- type AlertsClientGetAllResponse
- type AlertsClientGetAllTenantOptions
- type AlertsClientGetAllTenantResponse
- type AlertsClientGetByIDOptions
- type AlertsClientGetByIDResponse
- type AlertsClientGetByIDTenantOptions
- type AlertsClientGetByIDTenantResponse
- type AlertsClientGetEnrichmentsOptions
- type AlertsClientGetEnrichmentsResponse
- type AlertsClientGetHistoryOptions
- type AlertsClientGetHistoryResponse
- type AlertsClientGetHistoryTenantOptions
- type AlertsClientGetHistoryTenantResponse
- type AlertsClientGetSummaryOptions
- type AlertsClientGetSummaryResponse
- type AlertsClientMetaDataOptions
- type AlertsClientMetaDataResponse
- type AlertsList
- type AlertsMetaData
- type AlertsMetaDataProperties
- type AlertsMetaDataPropertiesClassification
- type AlertsSortByFields
- type AlertsSummary
- type AlertsSummaryGroup
- type AlertsSummaryGroupByFields
- type AlertsSummaryGroupItem
- type BaseDetails
- type BaseDetailsClassification
- type ClientFactory
- type Comments
- type CreatedByType
- type Essentials
- type Identifier
- type MetadataIdentifier
- type MonitorCondition
- type MonitorService
- type MonitorServiceDetails
- type MonitorServiceList
- type NotificationResult
- type Operation
- type OperationDisplay
- type OperationListResult
- type OperationsClient
- type OperationsClientListOptions
- type OperationsClientListResponse
- type Origin
- type PrometheusEnrichmentItem
- func (p *PrometheusEnrichmentItem) GetAlertEnrichmentItem() *AlertEnrichmentItem
- func (p *PrometheusEnrichmentItem) GetPrometheusEnrichmentItem() *PrometheusEnrichmentItem
- func (p PrometheusEnrichmentItem) MarshalJSON() ([]byte, error)
- func (p *PrometheusEnrichmentItem) UnmarshalJSON(data []byte) error
- type PrometheusEnrichmentItemClassification
- type PrometheusInstantQuery
- type PrometheusRangeQuery
- type PropertyChangeDetails
- type ResultStatus
- type RuleType
- type Severity
- type SignalType
- type SortOrder
- type Status
- type SystemData
- type TimeRange
- type TriggeredRule
- type Type
Examples ¶
- AlertsClient.ChangeState
- AlertsClient.ChangeStateTenant
- AlertsClient.GetByID
- AlertsClient.GetByIDTenant
- AlertsClient.GetHistory
- AlertsClient.GetHistoryTenant
- AlertsClient.GetSummary
- AlertsClient.MetaData
- AlertsClient.NewGetAllPager
- AlertsClient.NewGetAllTenantPager
- AlertsClient.NewGetEnrichmentsPager
- OperationsClient.NewListPager
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ActionStatus ¶ added in v0.4.0
type ActionStatus struct {
// Value indicating whether alert is suppressed.
IsSuppressed *bool
}
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 ActionSuppressedDetails ¶ added in v0.11.0
type ActionSuppressedDetails struct {
// REQUIRED; Type of modification details
Type *AlertModificationType
// List of suppressed action groups
SuppressedActionGroups []*TriggeredRule
// List of suppression action rules
SuppressionActionRules []*string
}
func (*ActionSuppressedDetails) GetBaseDetails ¶ added in v0.11.0
func (a *ActionSuppressedDetails) GetBaseDetails() *BaseDetails
GetBaseDetails implements the BaseDetailsClassification interface for type ActionSuppressedDetails.
func (ActionSuppressedDetails) MarshalJSON ¶ added in v0.11.0
func (a ActionSuppressedDetails) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ActionSuppressedDetails.
func (*ActionSuppressedDetails) UnmarshalJSON ¶ added in v0.11.0
func (a *ActionSuppressedDetails) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ActionSuppressedDetails.
type ActionTriggeredDetails ¶ added in v0.11.0
type ActionTriggeredDetails struct {
// REQUIRED; Type of modification details
Type *AlertModificationType
// The action group that was triggered
ActionGroup *TriggeredRule
// The result of the notification delivery
NotificationResult *NotificationResult
}
func (*ActionTriggeredDetails) GetBaseDetails ¶ added in v0.11.0
func (a *ActionTriggeredDetails) GetBaseDetails() *BaseDetails
GetBaseDetails implements the BaseDetailsClassification interface for type ActionTriggeredDetails.
func (ActionTriggeredDetails) MarshalJSON ¶ added in v0.11.0
func (a ActionTriggeredDetails) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ActionTriggeredDetails.
func (*ActionTriggeredDetails) UnmarshalJSON ¶ added in v0.11.0
func (a *ActionTriggeredDetails) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ActionTriggeredDetails.
type ActionType ¶ added in v0.3.0
type ActionType string
ActionType - Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs.
const ( // ActionTypeInternal - Actions are for internal-only APIs. ActionTypeInternal ActionType = "Internal" )
func PossibleActionTypeValues ¶ added in v0.3.0
func PossibleActionTypeValues() []ActionType
PossibleActionTypeValues returns the possible values for the ActionType const type.
type Alert ¶
type Alert struct {
// Alert property bag
Properties *AlertProperties
// READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
ID *string
// READ-ONLY; The name of the resource
Name *string
// READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information.
SystemData *SystemData
// READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
Type *string
}
Alert - An alert created in alert management service.
func (Alert) MarshalJSON ¶
MarshalJSON implements the json.Marshaller interface for type Alert.
func (*Alert) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaller interface for type Alert.
type AlertEnrichmentItem ¶ added in v0.11.0
type AlertEnrichmentItem struct {
// REQUIRED; The enrichment description.
Description *string
// REQUIRED; The status of the evaluation of the enrichment.
Status *Status
// REQUIRED; The enrichment title.
Title *string
// REQUIRED; The enrichment type.
Type *Type
// The error message. Will be present only if the status is 'Failed'.
ErrorMessage *string
}
AlertEnrichmentItem - Alert enrichment item.
func (*AlertEnrichmentItem) GetAlertEnrichmentItem ¶ added in v0.11.0
func (a *AlertEnrichmentItem) GetAlertEnrichmentItem() *AlertEnrichmentItem
GetAlertEnrichmentItem implements the AlertEnrichmentItemClassification interface for type AlertEnrichmentItem.
func (AlertEnrichmentItem) MarshalJSON ¶ added in v0.11.0
func (a AlertEnrichmentItem) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type AlertEnrichmentItem.
func (*AlertEnrichmentItem) UnmarshalJSON ¶ added in v0.11.0
func (a *AlertEnrichmentItem) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type AlertEnrichmentItem.
type AlertEnrichmentItemClassification ¶ added in v0.11.0
type AlertEnrichmentItemClassification interface {
// GetAlertEnrichmentItem returns the AlertEnrichmentItem content of the underlying type.
GetAlertEnrichmentItem() *AlertEnrichmentItem
}
AlertEnrichmentItemClassification provides polymorphic access to related types. Call the interface's GetAlertEnrichmentItem() method to access the common type. Use a type switch to determine the concrete type. The possible types are: - *AlertEnrichmentItem, *PrometheusEnrichmentItem, *PrometheusInstantQuery, *PrometheusRangeQuery
type AlertEnrichmentProperties ¶ added in v0.11.0
type AlertEnrichmentProperties struct {
// Enrichment details
Enrichments []AlertEnrichmentItemClassification
// READ-ONLY; Unique Id (GUID) of the alert for which the enrichments are being retrieved.
AlertID *string
}
AlertEnrichmentProperties - Properties of the alert enrichment item.
func (AlertEnrichmentProperties) MarshalJSON ¶ added in v0.11.0
func (a AlertEnrichmentProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type AlertEnrichmentProperties.
func (*AlertEnrichmentProperties) UnmarshalJSON ¶ added in v0.11.0
func (a *AlertEnrichmentProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type AlertEnrichmentProperties.
type AlertEnrichmentResponse ¶ added in v0.11.0
type AlertEnrichmentResponse struct {
// Properties of the alert enrichment item.
Properties *AlertEnrichmentProperties
// READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
ID *string
// READ-ONLY; The name of the resource
Name *string
// READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information.
SystemData *SystemData
// READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
Type *string
}
AlertEnrichmentResponse - The alert's enrichments.
func (AlertEnrichmentResponse) MarshalJSON ¶ added in v0.11.0
func (a AlertEnrichmentResponse) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type AlertEnrichmentResponse.
func (*AlertEnrichmentResponse) UnmarshalJSON ¶ added in v0.11.0
func (a *AlertEnrichmentResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type AlertEnrichmentResponse.
type AlertEnrichmentsList ¶ added in v0.11.0
type AlertEnrichmentsList struct {
// REQUIRED; The AlertEnrichmentResponse items on this page
Value []*AlertEnrichmentResponse
// The link to the next page of items
NextLink *string
}
AlertEnrichmentsList - List the alert's enrichments.
func (AlertEnrichmentsList) MarshalJSON ¶ added in v0.11.0
func (a AlertEnrichmentsList) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type AlertEnrichmentsList.
func (*AlertEnrichmentsList) UnmarshalJSON ¶ added in v0.11.0
func (a *AlertEnrichmentsList) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type AlertEnrichmentsList.
type AlertModification ¶
type AlertModification struct {
// Alert modification history properties.
Properties *AlertModificationProperties
// READ-ONLY; Azure resource Id
ID *string
// READ-ONLY; Azure resource name
Name *string
// READ-ONLY; Azure resource type
Type *string
}
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 ( // AlertModificationEventActionsSuppressed - ActionsSuppressed AlertModificationEventActionsSuppressed AlertModificationEvent = "ActionsSuppressed" // AlertModificationEventActionsTriggered - ActionsTriggered AlertModificationEventActionsTriggered AlertModificationEvent = "ActionsTriggered" // AlertModificationEventAlertCreated - AlertCreated AlertModificationEventAlertCreated AlertModificationEvent = "AlertCreated" // AlertModificationEventMonitorConditionChange - MonitorConditionChange AlertModificationEventMonitorConditionChange AlertModificationEvent = "MonitorConditionChange" // AlertModificationEventSeverityChange - SeverityChange AlertModificationEventSeverityChange AlertModificationEvent = "SeverityChange" // AlertModificationEventStateChange - StateChange AlertModificationEventStateChange AlertModificationEvent = "StateChange" )
func PossibleAlertModificationEventValues ¶
func PossibleAlertModificationEventValues() []AlertModificationEvent
PossibleAlertModificationEventValues returns the possible values for the AlertModificationEvent const type.
type AlertModificationItem ¶
type AlertModificationItem struct {
// Modification comments
Comments *string
// Description of the modification
Description *string
// Base details class.
Details BaseDetailsClassification
// Reason for the modification
ModificationEvent *AlertModificationEvent
// Modified date and time
ModifiedAt *string
// Modified user details (Principal client name)
ModifiedBy *string
// New value
NewValue *string
// Old value
OldValue *string
}
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 {
// Array of alert modification events.
Modifications []*AlertModificationItem
// READ-ONLY; Unique identifier of the alert.
AlertID *string
}
AlertModificationProperties - Alert modification history properties.
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 AlertModificationType ¶ added in v0.11.0
type AlertModificationType string
AlertModificationType - Type of modification details
const ( // AlertModificationTypeActionsSuppressed - ActionsSuppressed AlertModificationTypeActionsSuppressed AlertModificationType = "ActionsSuppressed" // AlertModificationTypeActionsTriggered - ActionsTriggered AlertModificationTypeActionsTriggered AlertModificationType = "ActionsTriggered" // AlertModificationTypePropertyChange - PropertyChange AlertModificationTypePropertyChange AlertModificationType = "PropertyChange" )
func PossibleAlertModificationTypeValues ¶ added in v0.11.0
func PossibleAlertModificationTypeValues() []AlertModificationType
PossibleAlertModificationTypeValues returns the possible values for the AlertModificationType const type.
type AlertProperties ¶
type AlertProperties struct {
// Custom properties that can hold any user defined key-value pairs
CustomProperties map[string]*string
// This object contains consistent fields across different monitor services.
Essentials *Essentials
// READ-ONLY; Information specific to the monitor service that gives more contextual details about the alert.
Context any
// READ-ONLY; Config which would be used for displaying the data in portal.
EgressConfig any
}
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 - Acknowledged AlertStateAcknowledged AlertState = "Acknowledged" // AlertStateClosed - Closed AlertStateClosed AlertState = "Closed" // AlertStateNew - New 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(scope string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AlertsClient, error)
NewAlertsClient creates a new instance of AlertsClient with the specified values.
- scope - The fully qualified Azure Resource manager identifier of the resource.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - Contains optional client configuration. 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 scope is a deleted resource then please use scope as parent resource of the delete resource. For example if my alert id is '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/virtualMachines/vm1/providers/Microsoft.AlertsManagement/alerts/{alertId}' and 'vm1' is deleted then if you want to change state of this particular alert then use parent resource of scope. So in this example change state call will look like this: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.AlertsManagement/alerts/{alertId}'. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2025-05-25-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: 2025-05-25-preview/Alerts_ChangeState.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/alertsmanagement/armalertsmanagement"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armalertsmanagement.NewClientFactory("subscriptions/3b540246-808d-4331-99aa-917b808a9166/resourcegroups/servicedeskresourcegroup/providers/microsoft.insights/components/servicedeskappinsight", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewAlertsClient().ChangeState(ctx, "66114d64-d9d9-478b-95c9-b789d6502100", armalertsmanagement.AlertStateAcknowledged, &armalertsmanagement.AlertsClientChangeStateOptions{
Comment: &armalertsmanagement.Comments{}})
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res = armalertsmanagement.AlertsClientChangeStateResponse{
// Alert: &armalertsmanagement.Alert{
// Name: to.Ptr("cpu alert"),
// Type: to.Ptr("Microsoft.AlertsManagement/alerts"),
// ID: to.Ptr("/subscriptions/3b540246-808d-4331-99aa-917b808a9166/resourcegroups/servicedeskresourcegroup/providers/microsoft.insights/components/servicedeskappinsight/providers/Microsoft.AlertsManagement/alerts/66114d64-d9d9-478b-95c9-b789d6502100"),
// Properties: &armalertsmanagement.AlertProperties{
// Context: map[string]any{
// },
// EgressConfig: map[string]any{
// },
// Essentials: &armalertsmanagement.Essentials{
// Description: to.Ptr("description of the alert"),
// ActionStatus: &armalertsmanagement.ActionStatus{
// IsSuppressed: to.Ptr(false),
// },
// AlertRule: to.Ptr("https://servisdfsdfappinsight.portal.mms.microsoft.com/#Workspace/overview/settings/details/Edit Alert Rule/details/index?savedSearchId=&scheduleId="),
// AlertState: to.Ptr(armalertsmanagement.AlertStateAcknowledged),
// LastModifiedDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-09-13T15:51:02Z"); return t}()),
// LastModifiedUserName: to.Ptr("System"),
// MonitorCondition: to.Ptr(armalertsmanagement.MonitorConditionFired),
// MonitorConditionResolvedDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-09-13T15:51:02Z"); return t}()),
// MonitorService: to.Ptr(armalertsmanagement.MonitorServiceApplicationInsights),
// Severity: to.Ptr(armalertsmanagement.SeveritySev3),
// SignalType: to.Ptr(armalertsmanagement.SignalTypeLog),
// SmartGroupID: to.Ptr("23d6b2ce-8c54-468f-aff0-sd32aebb7e56"),
// SmartGroupingReason: to.Ptr("Occurred frequently with other alerts"),
// SourceCreatedID: to.Ptr("6cd6b2ce-8c54-468f-aff0-9d12aebb7e49"),
// StartDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-09-13T15:51:02Z"); return t}()),
// TargetResource: to.Ptr("/subscriptions/3b540246-808d-4331-99aa-917b808a9166/resourcegroups/servicedeskresourcegroup/providers/microsoft.insights/components/servicedeskappinsight"),
// TargetResourceGroup: to.Ptr("servicedeskresourcegroup"),
// TargetResourceName: to.Ptr("servicedeskappinsight"),
// TargetResourceType: to.Ptr("components"),
// },
// },
// },
// }
}
Output:
func (*AlertsClient) ChangeStateTenant ¶ added in v0.11.0
func (client *AlertsClient) ChangeStateTenant(ctx context.Context, alertID string, newState AlertState, options *AlertsClientChangeStateTenantOptions) (AlertsClientChangeStateTenantResponse, error)
ChangeStateTenant - Change the state of an alert. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2025-05-25-preview
- alertID - Unique ID of an alert instance.
- newState - New state of the alert.
- options - AlertsClientChangeStateTenantOptions contains the optional parameters for the AlertsClient.ChangeStateTenant method.
Example ¶
Generated from example definition: 2025-05-25-preview/Alerts_ChangeStateTenant.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/alertsmanagement/armalertsmanagement"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armalertsmanagement.NewClientFactory("<scope>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewAlertsClient().ChangeStateTenant(ctx, "66114d64-d9d9-478b-95c9-b789d6502100", armalertsmanagement.AlertStateAcknowledged, &armalertsmanagement.AlertsClientChangeStateTenantOptions{
Comment: &armalertsmanagement.Comments{}})
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res = armalertsmanagement.AlertsClientChangeStateTenantResponse{
// Alert: &armalertsmanagement.Alert{
// Name: to.Ptr("cpu alert"),
// Type: to.Ptr("Microsoft.AlertsManagement/alerts"),
// ID: to.Ptr("/subscriptions/3b540246-808d-4331-99aa-917b808a9166/resourcegroups/servicedeskresourcegroup/providers/microsoft.insights/components/servicedeskappinsight/providers/Microsoft.AlertsManagement/alerts/66114d64-d9d9-478b-95c9-b789d6502100"),
// Properties: &armalertsmanagement.AlertProperties{
// Context: map[string]any{
// },
// EgressConfig: map[string]any{
// },
// Essentials: &armalertsmanagement.Essentials{
// Description: to.Ptr("description of the alert"),
// ActionStatus: &armalertsmanagement.ActionStatus{
// IsSuppressed: to.Ptr(false),
// },
// AlertRule: to.Ptr("https://servisdfsdfappinsight.portal.mms.microsoft.com/#Workspace/overview/settings/details/Edit Alert Rule/details/index?savedSearchId=&scheduleId="),
// AlertState: to.Ptr(armalertsmanagement.AlertStateAcknowledged),
// LastModifiedDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-09-13T15:51:02Z"); return t}()),
// LastModifiedUserName: to.Ptr("System"),
// MonitorCondition: to.Ptr(armalertsmanagement.MonitorConditionFired),
// MonitorConditionResolvedDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-09-13T15:51:02Z"); return t}()),
// MonitorService: to.Ptr(armalertsmanagement.MonitorServiceApplicationInsights),
// Severity: to.Ptr(armalertsmanagement.SeveritySev3),
// SignalType: to.Ptr(armalertsmanagement.SignalTypeLog),
// SmartGroupID: to.Ptr("23d6b2ce-8c54-468f-aff0-sd32aebb7e56"),
// SmartGroupingReason: to.Ptr("Occurred frequently with other alerts"),
// SourceCreatedID: to.Ptr("6cd6b2ce-8c54-468f-aff0-9d12aebb7e49"),
// StartDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-09-13T15:51:02Z"); return t}()),
// TargetResource: to.Ptr("/subscriptions/3b540246-808d-4331-99aa-917b808a9166/resourcegroups/servicedeskresourcegroup/providers/microsoft.insights/components/servicedeskappinsight"),
// TargetResourceGroup: to.Ptr("servicedeskresourcegroup"),
// TargetResourceName: to.Ptr("servicedeskappinsight"),
// TargetResourceType: to.Ptr("components"),
// },
// },
// },
// }
}
Output:
func (*AlertsClient) GetByID ¶
func (client *AlertsClient) GetByID(ctx context.Context, alertID string, options *AlertsClientGetByIDOptions) (AlertsClientGetByIDResponse, error)
GetByID - Get a specific alert.
Get information related to a specific alert. If scope is a deleted resource then please use scope as parent resource of the delete resource. For example if my alert id is '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/virtualMachines/vm1/providers/Microsoft.AlertsManagement/alerts/{alertId}' and 'vm1' is deleted then if you want to get alert by id then use parent resource of scope. So in this example get alert by id call will look like this: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.AlertsManagement/alerts/{alertId}'. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2025-05-25-preview
- alertID - Unique ID of an alert instance.
- options - AlertsClientGetByIDOptions contains the optional parameters for the AlertsClient.GetByID method.
Example ¶
Generated from example definition: 2025-05-25-preview/Alerts_GetById.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/alertsmanagement/armalertsmanagement"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armalertsmanagement.NewClientFactory("subscriptions/3b540246-808d-4331-99aa-917b808a9166/resourcegroups/servicedeskresourcegroup/providers/microsoft.insights/components/servicedeskappinsight", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewAlertsClient().GetByID(ctx, "66114d64-d9d9-478b-95c9-b789d6502100", nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res = armalertsmanagement.AlertsClientGetByIDResponse{
// Alert: &armalertsmanagement.Alert{
// Name: to.Ptr("cpu alert"),
// Type: to.Ptr("Microsoft.AlertsManagement/alerts"),
// ID: to.Ptr("/subscriptions/3b540246-808d-4331-99aa-917b808a9166/resourcegroups/servicedeskresourcegroup/providers/microsoft.insights/components/servicedeskappinsight/providers/Microsoft.AlertsManagement/alerts/66114d64-d9d9-478b-95c9-b789d6502100"),
// Properties: &armalertsmanagement.AlertProperties{
// Context: map[string]any{
// },
// CustomProperties: map[string]*string{
// "key1": to.Ptr("value1"),
// "key2": to.Ptr("value2"),
// },
// EgressConfig: map[string]any{
// },
// Essentials: &armalertsmanagement.Essentials{
// Description: to.Ptr("description of the alert"),
// ActionStatus: &armalertsmanagement.ActionStatus{
// IsSuppressed: to.Ptr(false),
// },
// AlertRule: to.Ptr("https://sersdfsdfinsight.portal.mms.microsoft.com/#Workspace/overview/settings/details/Edit Alert Rule/details/index?savedSearchId=&scheduleId="),
// AlertState: to.Ptr(armalertsmanagement.AlertStateAcknowledged),
// LastModifiedDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-09-13T15:51:02Z"); return t}()),
// LastModifiedUserName: to.Ptr("System"),
// MonitorCondition: to.Ptr(armalertsmanagement.MonitorConditionFired),
// MonitorConditionResolvedDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-09-13T15:51:02Z"); return t}()),
// MonitorService: to.Ptr(armalertsmanagement.MonitorServiceApplicationInsights),
// Severity: to.Ptr(armalertsmanagement.SeveritySev3),
// SignalType: to.Ptr(armalertsmanagement.SignalTypeLog),
// SmartGroupID: to.Ptr("23d6b2ce-8c54-468f-aff0-sd32aebb7e56"),
// SmartGroupingReason: to.Ptr("Occurred frequently with other alerts"),
// SourceCreatedID: to.Ptr("6cd6b2ce-8c54-468f-aff0-9d12aebb7e49"),
// StartDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-09-13T15:51:02Z"); return t}()),
// TargetResource: to.Ptr("/subscriptions/3b540246-808d-4331-99aa-917b808a9166/resourcegroups/servicedeskresourcegroup/providers/microsoft.insights/components/servicedeskappinsight"),
// TargetResourceGroup: to.Ptr("servicedeskresourcegroup"),
// TargetResourceName: to.Ptr("servicedeskappinsight"),
// TargetResourceType: to.Ptr("components"),
// },
// },
// },
// }
}
Output:
func (*AlertsClient) GetByIDTenant ¶ added in v0.11.0
func (client *AlertsClient) GetByIDTenant(ctx context.Context, alertID string, options *AlertsClientGetByIDTenantOptions) (AlertsClientGetByIDTenantResponse, error)
GetByIDTenant - Get a specific alert.
Get information related to a specific alert. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2025-05-25-preview
- alertID - Unique ID of an alert instance.
- options - AlertsClientGetByIDTenantOptions contains the optional parameters for the AlertsClient.GetByIDTenant method.
Example ¶
Generated from example definition: 2025-05-25-preview/Alerts_GetByIdTenant.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/alertsmanagement/armalertsmanagement"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armalertsmanagement.NewClientFactory("<scope>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewAlertsClient().GetByIDTenant(ctx, "66114d64-d9d9-478b-95c9-b789d6502100", nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res = armalertsmanagement.AlertsClientGetByIDTenantResponse{
// Alert: &armalertsmanagement.Alert{
// Name: to.Ptr("cpu alert"),
// Type: to.Ptr("Microsoft.AlertsManagement/alerts"),
// ID: to.Ptr("/subscriptions/3b540246-808d-4331-99aa-917b808a9166/resourcegroups/servicedeskresourcegroup/providers/microsoft.insights/components/servicedeskappinsight/providers/Microsoft.AlertsManagement/alerts/66114d64-d9d9-478b-95c9-b789d6502100"),
// Properties: &armalertsmanagement.AlertProperties{
// Context: map[string]any{
// },
// CustomProperties: map[string]*string{
// "key1": to.Ptr("value1"),
// "key2": to.Ptr("value2"),
// },
// EgressConfig: map[string]any{
// },
// Essentials: &armalertsmanagement.Essentials{
// Description: to.Ptr("description of the alert"),
// ActionStatus: &armalertsmanagement.ActionStatus{
// IsSuppressed: to.Ptr(false),
// },
// AlertRule: to.Ptr("https://sersdfsdfinsight.portal.mms.microsoft.com/#Workspace/overview/settings/details/Edit Alert Rule/details/index?savedSearchId=&scheduleId="),
// AlertState: to.Ptr(armalertsmanagement.AlertStateAcknowledged),
// LastModifiedDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-09-13T15:51:02Z"); return t}()),
// LastModifiedUserName: to.Ptr("System"),
// MonitorCondition: to.Ptr(armalertsmanagement.MonitorConditionFired),
// MonitorConditionResolvedDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-09-13T15:51:02Z"); return t}()),
// MonitorService: to.Ptr(armalertsmanagement.MonitorServiceApplicationInsights),
// Severity: to.Ptr(armalertsmanagement.SeveritySev3),
// SignalType: to.Ptr(armalertsmanagement.SignalTypeLog),
// SmartGroupID: to.Ptr("23d6b2ce-8c54-468f-aff0-sd32aebb7e56"),
// SmartGroupingReason: to.Ptr("Occurred frequently with other alerts"),
// SourceCreatedID: to.Ptr("6cd6b2ce-8c54-468f-aff0-9d12aebb7e49"),
// StartDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-09-13T15:51:02Z"); return t}()),
// TargetResource: to.Ptr("/subscriptions/3b540246-808d-4331-99aa-917b808a9166/resourcegroups/servicedeskresourcegroup/providers/microsoft.insights/components/servicedeskappinsight"),
// TargetResourceGroup: to.Ptr("servicedeskresourcegroup"),
// TargetResourceName: to.Ptr("servicedeskappinsight"),
// TargetResourceType: to.Ptr("components"),
// },
// },
// },
// }
}
Output:
func (*AlertsClient) GetHistory ¶
func (client *AlertsClient) GetHistory(ctx context.Context, alertID string, options *AlertsClientGetHistoryOptions) (AlertsClientGetHistoryResponse, error)
GetHistory - Get the history of an alert, which captures any monitor condition changes (Fired/Resolved), alert state changes (New/Acknowledged/Closed) and applied action rules for that particular alert. If scope is a deleted resource then please use scope as parent resource of the delete resource. For example if my alert id is '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/virtualMachines/vm1/providers/Microsoft.AlertsManagement/alerts/{alertId}' and 'vm1' is deleted then if you want to get history of this particular alert then use parent resource of scope. So in this example get history call will look like this: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.AlertsManagement/alerts/{alertId}/history'. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2025-05-25-preview
- alertID - Unique ID of an alert instance.
- options - AlertsClientGetHistoryOptions contains the optional parameters for the AlertsClient.GetHistory method.
Example ¶
Generated from example definition: 2025-05-25-preview/Alerts_History.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/alertsmanagement/armalertsmanagement"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armalertsmanagement.NewClientFactory("subscriptions/9e261de7-c804-4b9d-9ebf-6f50fe350a9a", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewAlertsClient().GetHistory(ctx, "66114d64-d9d9-478b-95c9-b789d6502100", nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res = armalertsmanagement.AlertsClientGetHistoryResponse{
// AlertModification: &armalertsmanagement.AlertModification{
// Name: to.Ptr("CPU Alert"),
// Type: to.Ptr("Microsoft.AlertsManagement/alerts"),
// ID: to.Ptr("/subscriptions/9e261de7-c804-4b9d-9ebf-6f50fe350a9a/resourceGroups/someResourceGroup/providers/Microsoft.AlertsManagement/alerts/66114d64-d9d9-478b-95c9-b789d6502100"),
// Properties: &armalertsmanagement.AlertModificationProperties{
// AlertID: to.Ptr("66114d64-d9d9-478b-95c9-b789d6502100"),
// Modifications: []*armalertsmanagement.AlertModificationItem{
// {
// Description: to.Ptr("New Alert Object is created"),
// Comments: to.Ptr(""),
// ModificationEvent: to.Ptr(armalertsmanagement.AlertModificationEventAlertCreated),
// ModifiedAt: to.Ptr("2018-06-13T06:09:01Z"),
// ModifiedBy: to.Ptr("System"),
// NewValue: to.Ptr(""),
// OldValue: to.Ptr(""),
// Details: nil,
// },
// {
// Description: to.Ptr("State changed from 'New' to 'Acknowledged'"),
// Comments: to.Ptr("The alert has been resolved"),
// ModificationEvent: to.Ptr(armalertsmanagement.AlertModificationEventStateChange),
// ModifiedAt: to.Ptr("2018-06-13T06:14:15.7378737Z"),
// ModifiedBy: to.Ptr("vikramm@microsoft.com"),
// NewValue: to.Ptr("Resolved"),
// OldValue: to.Ptr("Fired"),
// Details: &armalertsmanagement.PropertyChangeDetails{
// Type: to.Ptr(armalertsmanagement.AlertModificationTypePropertyChange),
// Comment: to.Ptr("The alert has been resolved"),
// NewValue: to.Ptr("Resolved"),
// OldValue: to.Ptr("Fired"),
// },
// },
// {
// Description: to.Ptr("New Alert Object is created"),
// Comments: to.Ptr(""),
// ModificationEvent: to.Ptr(armalertsmanagement.AlertModificationEventActionsTriggered),
// ModifiedAt: to.Ptr("2018-06-13T06:09:01Z"),
// ModifiedBy: to.Ptr("System"),
// NewValue: to.Ptr(""),
// OldValue: to.Ptr(""),
// Details: &armalertsmanagement.ActionTriggeredDetails{
// Type: to.Ptr(armalertsmanagement.AlertModificationTypeActionsTriggered),
// ActionGroup: &armalertsmanagement.TriggeredRule{
// ActionGroupID: to.Ptr("/subscriptions/9e261de7-c804-4b9d-9ebf-6f50fe350a9a/resourceGroups/rg1/providers/Microsoft.Insights/actionGroups/actionGroup1"),
// RuleID: to.Ptr("RuleId1"),
// RuleType: to.Ptr(armalertsmanagement.RuleTypeAlertRule),
// },
// NotificationResult: &armalertsmanagement.NotificationResult{
// Status: to.Ptr(armalertsmanagement.ResultStatus("Accepted")),
// StatusURL: to.Ptr("https://management.azure.com/subscriptions/2a784a95-81bd-41c8-ba8a-362d1098a2b9/resourceGroups/AzNSTest/providers/microsoft.insights/actionGroups/ag2/notificationStatus/00000000000?api-version=2021-09-01"),
// },
// },
// },
// {
// Description: to.Ptr("New Alert Object is created"),
// Comments: to.Ptr(""),
// ModificationEvent: to.Ptr(armalertsmanagement.AlertModificationEventActionsSuppressed),
// ModifiedAt: to.Ptr("2018-06-13T06:09:01Z"),
// ModifiedBy: to.Ptr("System"),
// NewValue: to.Ptr(""),
// OldValue: to.Ptr(""),
// Details: &armalertsmanagement.ActionSuppressedDetails{
// Type: to.Ptr(armalertsmanagement.AlertModificationTypeActionsSuppressed),
// SuppressedActionGroups: []*armalertsmanagement.TriggeredRule{
// {
// ActionGroupID: to.Ptr("/subscriptions/9e261de7-c804-4b9d-9ebf-6f50fe350a9a/resourceGroups/rg1/providers/Microsoft.Insights/actionGroups/actionGroup1"),
// RuleID: to.Ptr("RuleId1"),
// RuleType: to.Ptr(armalertsmanagement.RuleTypeAlertRule),
// },
// },
// SuppressionActionRules: []*string{
// to.Ptr("ActionRule 1"),
// to.Ptr("ActionRule 2"),
// },
// },
// },
// },
// },
// },
// }
}
Output:
func (*AlertsClient) GetHistoryTenant ¶ added in v0.11.0
func (client *AlertsClient) GetHistoryTenant(ctx context.Context, alertID string, options *AlertsClientGetHistoryTenantOptions) (AlertsClientGetHistoryTenantResponse, error)
GetHistoryTenant - Get the history of an alert, which captures any monitor condition changes (Fired/Resolved), alert state changes (New/Acknowledged/Closed) and applied action rules for that particular alert. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2025-05-25-preview
- alertID - Unique ID of an alert instance.
- options - AlertsClientGetHistoryTenantOptions contains the optional parameters for the AlertsClient.GetHistoryTenant method.
Example ¶
Generated from example definition: 2025-05-25-preview/Alerts_GetHistoryTenant.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/alertsmanagement/armalertsmanagement"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armalertsmanagement.NewClientFactory("<scope>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewAlertsClient().GetHistoryTenant(ctx, "66114d64-d9d9-478b-95c9-b789d6502100", nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res = armalertsmanagement.AlertsClientGetHistoryTenantResponse{
// AlertModification: &armalertsmanagement.AlertModification{
// Name: to.Ptr("CPU Alert"),
// Type: to.Ptr("Microsoft.AlertsManagement/alerts"),
// ID: to.Ptr("/subscriptions/9e261de7-c804-4b9d-9ebf-6f50fe350a9a/resourceGroups/someResourceGroup/providers/Microsoft.AlertsManagement/alerts/66114d64-d9d9-478b-95c9-b789d6502100"),
// Properties: &armalertsmanagement.AlertModificationProperties{
// AlertID: to.Ptr("66114d64-d9d9-478b-95c9-b789d6502100"),
// Modifications: []*armalertsmanagement.AlertModificationItem{
// {
// Description: to.Ptr("New Alert Object is created"),
// Comments: to.Ptr(""),
// ModificationEvent: to.Ptr(armalertsmanagement.AlertModificationEventAlertCreated),
// ModifiedAt: to.Ptr("2018-06-13T06:09:01Z"),
// ModifiedBy: to.Ptr("System"),
// NewValue: to.Ptr(""),
// OldValue: to.Ptr(""),
// Details: nil,
// },
// {
// Description: to.Ptr("State changed from 'New' to 'Acknowledged'"),
// Comments: to.Ptr("The alert has been resolved"),
// ModificationEvent: to.Ptr(armalertsmanagement.AlertModificationEventStateChange),
// ModifiedAt: to.Ptr("2018-06-13T06:14:15.7378737Z"),
// ModifiedBy: to.Ptr("vikramm@microsoft.com"),
// NewValue: to.Ptr("Resolved"),
// OldValue: to.Ptr("Fired"),
// Details: &armalertsmanagement.PropertyChangeDetails{
// Type: to.Ptr(armalertsmanagement.AlertModificationTypePropertyChange),
// Comment: to.Ptr("The alert has been resolved"),
// NewValue: to.Ptr("Resolved"),
// OldValue: to.Ptr("Fired"),
// },
// },
// {
// Description: to.Ptr("New Alert Object is created"),
// Comments: to.Ptr(""),
// ModificationEvent: to.Ptr(armalertsmanagement.AlertModificationEventActionsTriggered),
// ModifiedAt: to.Ptr("2018-06-13T06:09:01Z"),
// ModifiedBy: to.Ptr("System"),
// NewValue: to.Ptr(""),
// OldValue: to.Ptr(""),
// Details: &armalertsmanagement.ActionTriggeredDetails{
// Type: to.Ptr(armalertsmanagement.AlertModificationTypeActionsTriggered),
// ActionGroup: &armalertsmanagement.TriggeredRule{
// ActionGroupID: to.Ptr("/subscriptions/9e261de7-c804-4b9d-9ebf-6f50fe350a9a/resourceGroups/rg1/providers/Microsoft.Insights/actionGroups/actionGroup1"),
// RuleID: to.Ptr("RuleId1"),
// RuleType: to.Ptr(armalertsmanagement.RuleTypeAlertRule),
// },
// NotificationResult: &armalertsmanagement.NotificationResult{
// Status: to.Ptr(armalertsmanagement.ResultStatus("Accepted")),
// StatusURL: to.Ptr("https://management.azure.com/subscriptions/2a784a95-81bd-41c8-ba8a-362d1098a2b9/resourceGroups/AzNSTest/providers/microsoft.insights/actionGroups/ag2/notificationStatus/00000000000?api-version=2021-09-01"),
// },
// },
// },
// {
// Description: to.Ptr("New Alert Object is created"),
// Comments: to.Ptr(""),
// ModificationEvent: to.Ptr(armalertsmanagement.AlertModificationEventActionsSuppressed),
// ModifiedAt: to.Ptr("2018-06-13T06:09:01Z"),
// ModifiedBy: to.Ptr("System"),
// NewValue: to.Ptr(""),
// OldValue: to.Ptr(""),
// Details: &armalertsmanagement.ActionSuppressedDetails{
// Type: to.Ptr(armalertsmanagement.AlertModificationTypeActionsSuppressed),
// SuppressedActionGroups: []*armalertsmanagement.TriggeredRule{
// {
// ActionGroupID: to.Ptr("/subscriptions/9e261de7-c804-4b9d-9ebf-6f50fe350a9a/resourceGroups/rg1/providers/Microsoft.Insights/actionGroups/actionGroup1"),
// RuleID: to.Ptr("RuleId1"),
// RuleType: to.Ptr(armalertsmanagement.RuleTypeAlertRule),
// },
// },
// SuppressionActionRules: []*string{
// to.Ptr("ActionRule 1"),
// to.Ptr("ActionRule 2"),
// },
// },
// },
// },
// },
// },
// }
}
Output:
func (*AlertsClient) GetSummary ¶
func (client *AlertsClient) GetSummary(ctx context.Context, groupby AlertsSummaryGroupByFields, options *AlertsClientGetSummaryOptions) (AlertsClientGetSummaryResponse, error)
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 2025-05-25-preview
- groupby - This parameter allows the result set to be grouped by input fields. For example, groupby=severity,alertstate.
- options - AlertsClientGetSummaryOptions contains the optional parameters for the AlertsClient.GetSummary method.
Example ¶
Generated from example definition: 2025-05-25-preview/Alerts_Summary.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/alertsmanagement/armalertsmanagement"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armalertsmanagement.NewClientFactory("subscriptions/1e3ff1c0-771a-4119-a03b-be82a51e232d", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewAlertsClient().GetSummary(ctx, armalertsmanagement.AlertsSummaryGroupByFields("severity,alertState"), nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res = armalertsmanagement.AlertsClientGetSummaryResponse{
// AlertsSummary: &armalertsmanagement.AlertsSummary{
// Name: to.Ptr("current"),
// Type: to.Ptr("Microsoft.AlertsManagement/alertsSummary"),
// ID: to.Ptr("/subscriptions/1e3ff1c0-771a-4119-a03b-be82a51e232d/providers/Microsoft.AlertsManagement/alertsSummary/current"),
// Properties: &armalertsmanagement.AlertsSummaryGroup{
// Groupedby: to.Ptr("severity"),
// SmartGroupsCount: to.Ptr[int64](100),
// Total: to.Ptr[int64](14189),
// Values: []*armalertsmanagement.AlertsSummaryGroupItem{
// {
// Name: to.Ptr("Sev0"),
// Count: to.Ptr[int64](6517),
// Groupedby: to.Ptr("alertState"),
// Values: []*armalertsmanagement.AlertsSummaryGroupItem{
// {
// Name: to.Ptr("New"),
// Count: to.Ptr[int64](6517),
// },
// {
// Name: to.Ptr("Acknowledged"),
// Count: to.Ptr[int64](0),
// },
// {
// Name: to.Ptr("Closed"),
// Count: to.Ptr[int64](0),
// },
// },
// },
// {
// Name: to.Ptr("Sev1"),
// Count: to.Ptr[int64](3175),
// Groupedby: to.Ptr("alertState"),
// Values: []*armalertsmanagement.AlertsSummaryGroupItem{
// {
// Name: to.Ptr("New"),
// Count: to.Ptr[int64](3175),
// },
// {
// Name: to.Ptr("Acknowledged"),
// Count: to.Ptr[int64](0),
// },
// {
// Name: to.Ptr("Closed"),
// Count: to.Ptr[int64](0),
// },
// },
// },
// {
// Name: to.Ptr("Sev2"),
// Count: to.Ptr[int64](1120),
// Groupedby: to.Ptr("alertState"),
// Values: []*armalertsmanagement.AlertsSummaryGroupItem{
// {
// Name: to.Ptr("New"),
// Count: to.Ptr[int64](1120),
// },
// {
// Name: to.Ptr("Acknowledged"),
// Count: to.Ptr[int64](0),
// },
// {
// Name: to.Ptr("Closed"),
// Count: to.Ptr[int64](0),
// },
// },
// },
// {
// Name: to.Ptr("Sev3"),
// Count: to.Ptr[int64](1902),
// Groupedby: to.Ptr("alertState"),
// Values: []*armalertsmanagement.AlertsSummaryGroupItem{
// {
// Name: to.Ptr("New"),
// Count: to.Ptr[int64](1902),
// },
// {
// Name: to.Ptr("Acknowledged"),
// Count: to.Ptr[int64](0),
// },
// {
// Name: to.Ptr("Closed"),
// Count: to.Ptr[int64](0),
// },
// },
// },
// {
// Name: to.Ptr("Sev4"),
// Count: to.Ptr[int64](1475),
// Groupedby: to.Ptr("alertState"),
// Values: []*armalertsmanagement.AlertsSummaryGroupItem{
// {
// Name: to.Ptr("New"),
// Count: to.Ptr[int64](1475),
// },
// {
// Name: to.Ptr("Acknowledged"),
// Count: to.Ptr[int64](0),
// },
// {
// Name: to.Ptr("Closed"),
// Count: to.Ptr[int64](0),
// },
// },
// },
// },
// },
// },
// }
}
Output:
func (*AlertsClient) MetaData ¶
func (client *AlertsClient) MetaData(ctx context.Context, identifier Identifier, options *AlertsClientMetaDataOptions) (AlertsClientMetaDataResponse, error)
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 2025-05-25-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: 2025-05-25-preview/AlertsMetaData_MonitorService.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/alertsmanagement/armalertsmanagement"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armalertsmanagement.NewClientFactory("<scope>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewAlertsClient().MetaData(ctx, armalertsmanagement.IdentifierMonitorServiceList, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res = armalertsmanagement.AlertsClientMetaDataResponse{
// AlertsMetaData: &armalertsmanagement.AlertsMetaData{
// Properties: &armalertsmanagement.MonitorServiceList{
// Data: []*armalertsmanagement.MonitorServiceDetails{
// {
// Name: to.Ptr("ActivityLog Administrative"),
// DisplayName: to.Ptr("Activity Log - Administrative"),
// },
// {
// Name: to.Ptr("ActivityLog Autoscale"),
// DisplayName: to.Ptr("Activity Log - Autoscale"),
// },
// {
// Name: to.Ptr("ActivityLog Policy"),
// DisplayName: to.Ptr("Activity Log - Policy"),
// },
// {
// Name: to.Ptr("ActivityLog Recommendation"),
// DisplayName: to.Ptr("Activity Log - Recommendation"),
// },
// {
// Name: to.Ptr("ActivityLog Security"),
// DisplayName: to.Ptr("Activity Log - Security"),
// },
// {
// Name: to.Ptr("Application Insights"),
// DisplayName: to.Ptr("Application Insights"),
// },
// {
// Name: to.Ptr("Azure Backup"),
// DisplayName: to.Ptr("Azure Backup"),
// },
// {
// Name: to.Ptr("Custom"),
// DisplayName: to.Ptr("Custom"),
// },
// {
// Name: to.Ptr("Data Box Edge"),
// DisplayName: to.Ptr("Data Box Edge"),
// },
// {
// Name: to.Ptr("VM Insights"),
// DisplayName: to.Ptr("VM Insights"),
// },
// {
// Name: to.Ptr("Log Analytics"),
// DisplayName: to.Ptr("Log Analytics"),
// },
// {
// Name: to.Ptr("Nagios"),
// DisplayName: to.Ptr("NAGIOS"),
// },
// {
// Name: to.Ptr("Platform"),
// DisplayName: to.Ptr("Platform"),
// },
// {
// Name: to.Ptr("Resource Health"),
// DisplayName: to.Ptr("Resource Health"),
// },
// {
// Name: to.Ptr("SCOM"),
// DisplayName: to.Ptr("SCOM"),
// },
// {
// Name: to.Ptr("ServiceHealth"),
// DisplayName: to.Ptr("Service Health"),
// },
// {
// Name: to.Ptr("Smart Detector"),
// DisplayName: to.Ptr("SmartDetector"),
// },
// {
// Name: to.Ptr("Zabbix"),
// DisplayName: to.Ptr("ZABBIX"),
// },
// },
// MetadataIdentifier: to.Ptr(armalertsmanagement.MetadataIdentifierMonitorServiceList),
// },
// },
// }
}
Output:
func (*AlertsClient) NewGetAllPager ¶ added in v0.5.0
func (client *AlertsClient) NewGetAllPager(options *AlertsClientGetAllOptions) *runtime.Pager[AlertsClientGetAllResponse]
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.
Generated from API version 2025-05-25-preview
- options - AlertsClientGetAllOptions contains the optional parameters for the AlertsClient.NewGetAllPager method.
Example ¶
Generated from example definition: 2025-05-25-preview/Alerts_List.json
package main
import (
"context"
"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"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armalertsmanagement.NewClientFactory("subscriptions/3b540246-808d-4331-99aa-917b808a9166", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewAlertsClient().NewGetAllPager(&armalertsmanagement.AlertsClientGetAllOptions{
IncludeContext: to.Ptr(true)})
for pager.More() {
page, err := pager.NextPage(ctx)
if err != nil {
log.Fatalf("failed to advance page: %v", err)
}
for _, v := range page.Value {
// You could use page here. We use blank identifier for just demo purposes.
_ = v
}
// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// page = armalertsmanagement.AlertsClientGetAllResponse{
// AlertsList: armalertsmanagement.AlertsList{
// NextLink: to.Ptr("https://management.azure.com:443/subscriptions/1e3ff1c0-771a-4119-a03b-be82a51e232d/providers/Microsoft.AlertsManagement/alerts?api-version=2018-05-05-preview&timeRange=1d&ctoken=%2bRID%3aPlwOAPHEGwB9UwEAAAAgCw%3d%3d%23RT%3a2%23TRC%3a500%23RTD%3aqtQyMDE4LTA2LTEyVDE1OjEyOjE1"),
// Value: []*armalertsmanagement.Alert{
// {
// Name: to.Ptr("cpu alert"),
// Type: to.Ptr("Microsoft.AlertsManagement/alerts"),
// ID: to.Ptr("/subscriptions/3b540246-808d-4331-99aa-917b808a9166/resourcegroups/servicedeskresourcegroup/providers/microsoft.insights/components/servicedeskappinsight/providers/Microsoft.AlertsManagement/alerts/66114d64-d9d9-478b-95c9-b789d6502100"),
// Properties: &armalertsmanagement.AlertProperties{
// Context: map[string]any{
// "AffectedConfigurationItems": []any{
// "",
// },
// "AlertRuleName": "Test number of results",
// "AlertThresholdOperator": "Greater Than Or Equal To",
// "AlertThresholdValue": 0,
// "AlertType": "Number of results",
// "Description": "",
// "Frequency": 5,
// "IncludeSearchResults": true,
// "LinkToFilteredSearchResultsAPI": "https://api.applicationinsights.io/v1/apps/e72c8301-003e-4251-aac9-2374b3320ecf/query?query=traces×pan=2023-04-19T12%3a02%3a25.0000000Z%2f2023-04-19T12%3a32%3a25.0000000Z",
// "LinkToFilteredSearchResultsUI": "https://portal.azure.com#@0ef55770-ee07-488d-8dc5-75f53fa5a901/blade/Microsoft_Azure_Monitoring_Logs/LogsBlade/source/Alerts.EmailLinks/scope/%7B%22resources%22%3A%5B%7B%22resourceId%22%3A%22%2Fsubscriptions%2F0ef55770-ee07-488d-8dc5-75f53fa5a901%2FresourceGroups%2Fexample_resource_group%2Fproviders%2Fmicrosoft.insights%2Fcomponents%2FPortal%22%7D%5D%7D/q/eJwrKUdd0ejhGAA%3D%3D/prettify/1/timespan/2023-04-19T12%3a02%3a25.0000000Z%2f2023-04-19T12%3a32%3a25.0000000Z",
// "LinkToSearchResults": "https://portal.azure.com#@0ef55770-ee07-488d-8dc5-75f53fa5a901/blade/Microsoft_Azure_Monitoring_Logs/LogsBlade/source/Alerts.EmailLinks/scope/%7B%22resources%22%3A%5B%7B%22resourceId%22%3A%22%2Fsubscriptions%2F0ef55770-ee07-488d-8dc5-75f53fa5a901%2FresourceGroups%2Fexample_name%2Fproviders%2Fmicrosoft.insights%2Fcomponents%2FPortal%22%7D%5D%7D/q/eJwreefe4tGAA%3D%3D/prettify/1/timespan/2023-04-19T12%3a02%3a25.0000000Z%2f2023-04-19T12%3a32%3a25.0000000Z",
// "LinkToSearchResultsAPI": "https://api.applicationinsights.io/v1/apps/e72c8301-003e-4251-aac9-2374b3320ecf/query?query=traces×pan=2023-04-19T12%3a02%3a25.0000000Z%2f2023-04-19T12%3a32%3a25.0000000Z",
// "ResultCount": 3,
// "SearchIntervalDurationMin": "30",
// "SearchIntervalEndtimeUtc": "2023-04-19T12:32:25Z",
// "SearchIntervalInSeconds": 1800,
// "SearchIntervalStartTimeUtc": "2023-04-19T12:02:25Z",
// "SearchQuery": "traces",
// "SeverityDescription": "Informational",
// "SubscriptionId": "0ef55770-ee07-488d-8dc5-75f53fa5a901",
// "WorkspaceId": "e72c8301-003e-4251-aac9-2374b3320ecf",
// },
// CustomProperties: map[string]*string{
// "key1": to.Ptr("value1"),
// "key2": to.Ptr("value2"),
// },
// EgressConfig: map[string]any{
// },
// Essentials: &armalertsmanagement.Essentials{
// Description: to.Ptr("description of the alert"),
// ActionStatus: &armalertsmanagement.ActionStatus{
// IsSuppressed: to.Ptr(false),
// },
// AlertRule: to.Ptr("https://servisdffsdf.portal.mms.microsoft.com/#Workspace/overview/settings/details/Edit Alert Rule/details/index?savedSearchId=&scheduleId="),
// AlertState: to.Ptr(armalertsmanagement.AlertStateAcknowledged),
// LastModifiedDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-09-13T15:51:02Z"); return t}()),
// LastModifiedUserName: to.Ptr("System"),
// MonitorCondition: to.Ptr(armalertsmanagement.MonitorConditionFired),
// MonitorConditionResolvedDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-09-13T15:51:02Z"); return t}()),
// MonitorService: to.Ptr(armalertsmanagement.MonitorServiceApplicationInsights),
// Severity: to.Ptr(armalertsmanagement.SeveritySev3),
// SignalType: to.Ptr(armalertsmanagement.SignalTypeLog),
// SmartGroupID: to.Ptr("23d6b2ce-8c54-468f-aff0-sd32aebb7e56"),
// SmartGroupingReason: to.Ptr("Occurred frequently with other alerts"),
// SourceCreatedID: to.Ptr("6cd6b2ce-8c54-468f-aff0-9d12aebb7e49"),
// StartDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-09-13T15:51:02Z"); return t}()),
// TargetResource: to.Ptr("/subscriptions/3b540246-808d-4331-99aa-917b808a9166/resourcegroups/servicedeskresourcegroup/providers/microsoft.insights/components/servicedeskappinsight"),
// TargetResourceGroup: to.Ptr("servicedeskresourcegroup"),
// TargetResourceName: to.Ptr("servicedeskappinsight"),
// TargetResourceType: to.Ptr("components"),
// },
// },
// },
// {
// Name: to.Ptr("cpu alert"),
// Type: to.Ptr("Microsoft.AlertsManagement/alerts"),
// ID: to.Ptr("/subscriptions/3b540246-808d-4331-99aa-917b808a9166/resourcegroups/cind/providers/microsoft.operationalinsights/workspaces/servicedeskwcus/providers/Microsoft.AlertsManagement/alerts/66114d64-d9d9-478b-95c9-b789d6502100"),
// Properties: &armalertsmanagement.AlertProperties{
// Context: map[string]any{
// "AffectedConfigurationItems": []any{
// "",
// },
// "AlertRuleName": "Test number of results",
// "AlertThresholdOperator": "Greater Than Or Equal To",
// "AlertThresholdValue": 0,
// "AlertType": "Number of results",
// "Description": "",
// "Frequency": 5,
// "IncludeSearchResults": true,
// "LinkToFilteredSearchResultsAPI": "https://api.applicationinsights.io/v1/apps/e72c8301-003e-4251-aac9-2374b3320ecf/query?query=traces×pan=2023-04-19T12%3a02%3a25.0000000Z%2f2023-04-19T12%3a32%3a25.0000000Z",
// "LinkToFilteredSearchResultsUI": "https://portal.azure.com#@0ef55770-ee07-488d-8dc5-75f53fa5a901/blade/Microsoft_Azure_Monitoring_Logs/LogsBlade/source/Alerts.EmailLinks/scope/%7B%22resources%22%3A%5B%7B%22resourceId%22%3A%22%2Fsubscriptions%2F0ef55770-ee07-488d-8dc5-75f53fa5a901%2FresourceGroups%2Fexample_resource_group%2Fproviders%2Fmicrosoft.insights%2Fcomponents%2FPortal%22%7D%5D%7D/q/eJwrKUdd0ejhGAA%3D%3D/prettify/1/timespan/2023-04-19T12%3a02%3a25.0000000Z%2f2023-04-19T12%3a32%3a25.0000000Z",
// "LinkToSearchResults": "https://portal.azure.com#@0ef55770-ee07-488d-8dc5-75f53fa5a901/blade/Microsoft_Azure_Monitoring_Logs/LogsBlade/source/Alerts.EmailLinks/scope/%7B%22resources%22%3A%5B%7B%22resourceId%22%3A%22%2Fsubscriptions%2F0ef55770-ee07-488d-8dc5-75f53fa5a901%2FresourceGroups%2Fexample_name%2Fproviders%2Fmicrosoft.insights%2Fcomponents%2FPortal%22%7D%5D%7D/q/eJwreefe4tGAA%3D%3D/prettify/1/timespan/2023-04-19T12%3a02%3a25.0000000Z%2f2023-04-19T12%3a32%3a25.0000000Z",
// "LinkToSearchResultsAPI": "https://api.applicationinsights.io/v1/apps/e72c8301-003e-4251-aac9-2374b3320ecf/query?query=traces×pan=2023-04-19T12%3a02%3a25.0000000Z%2f2023-04-19T12%3a32%3a25.0000000Z",
// "ResultCount": 3,
// "SearchIntervalDurationMin": "30",
// "SearchIntervalEndtimeUtc": "2023-04-19T12:32:25Z",
// "SearchIntervalInSeconds": 1800,
// "SearchIntervalStartTimeUtc": "2023-04-19T12:02:25Z",
// "SearchQuery": "traces",
// "SeverityDescription": "Informational",
// "SubscriptionId": "0ef55770-ee07-488d-8dc5-75f53fa5a901",
// "WorkspaceId": "e72c8301-003e-4251-aac9-2374b3320ecf",
// },
// CustomProperties: map[string]*string{
// "category": to.Ptr("performance"),
// "environment": to.Ptr("production"),
// "priority": to.Ptr("high"),
// },
// EgressConfig: map[string]any{
// },
// Essentials: &armalertsmanagement.Essentials{
// Description: to.Ptr("description of the alert"),
// ActionStatus: &armalertsmanagement.ActionStatus{
// IsSuppressed: to.Ptr(false),
// },
// AlertRule: to.Ptr("https://servicsdfsdf.portal.mms.microsoft.com/#Workspace/overview/settings/details/Edit Alert Rule/details/index?savedSearchId=&scheduleId="),
// AlertState: to.Ptr(armalertsmanagement.AlertStateNew),
// LastModifiedDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-09-13T15:51:02Z"); return t}()),
// LastModifiedUserName: to.Ptr("System"),
// MonitorCondition: to.Ptr(armalertsmanagement.MonitorConditionFired),
// MonitorConditionResolvedDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-09-13T15:51:02Z"); return t}()),
// MonitorService: to.Ptr(armalertsmanagement.MonitorServiceApplicationInsights),
// Severity: to.Ptr(armalertsmanagement.SeveritySev3),
// SignalType: to.Ptr(armalertsmanagement.SignalTypeLog),
// SmartGroupID: to.Ptr("d1c49c89-ea95-4697-a299-c0f5ebac62f1"),
// SmartGroupingReason: to.Ptr("Alerts that frequently occur together have been grouped."),
// SourceCreatedID: to.Ptr("6cd6b2ce-8c54-468f-aff0-9d12aebb7e49"),
// StartDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-09-13T15:51:02Z"); return t}()),
// TargetResource: to.Ptr("/subscriptions/3b540246-808d-4331-99aa-917b808a9166/resourcegroups/cind/providers/microsoft.operationalinsights/workspaces/servicedeskwcus"),
// TargetResourceGroup: to.Ptr("servicedeskresourcegroup"),
// TargetResourceName: to.Ptr("servicedeskwcus"),
// TargetResourceType: to.Ptr("components"),
// },
// },
// },
// },
// },
// }
}
}
Output:
func (*AlertsClient) NewGetAllTenantPager ¶ added in v0.11.0
func (client *AlertsClient) NewGetAllTenantPager(options *AlertsClientGetAllTenantOptions) *runtime.Pager[AlertsClientGetAllTenantResponse]
NewGetAllTenantPager - 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.
Generated from API version 2025-05-25-preview
- options - AlertsClientGetAllTenantOptions contains the optional parameters for the AlertsClient.NewGetAllTenantPager method.
Example ¶
Generated from example definition: 2025-05-25-preview/Alerts_List_GetAllTenant.json
package main
import (
"context"
"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"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armalertsmanagement.NewClientFactory("<scope>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewAlertsClient().NewGetAllTenantPager(&armalertsmanagement.AlertsClientGetAllTenantOptions{
IncludeContext: to.Ptr(true)})
for pager.More() {
page, err := pager.NextPage(ctx)
if err != nil {
log.Fatalf("failed to advance page: %v", err)
}
for _, v := range page.Value {
// You could use page here. We use blank identifier for just demo purposes.
_ = v
}
// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// page = armalertsmanagement.AlertsClientGetAllTenantResponse{
// AlertsList: armalertsmanagement.AlertsList{
// NextLink: to.Ptr("https://management.azure.com:443/subscriptions/1e3ff1c0-771a-4119-a03b-be82a51e232d/providers/Microsoft.AlertsManagement/alerts?api-version=2018-05-05-preview&timeRange=1d&ctoken=%2bRID%3aPlwOAPHEGwB9UwEAAAAgCw%3d%3d%23RT%3a2%23TRC%3a500%23RTD%3aqtQyMDE4LTA2LTEyVDE1OjEyOjE1"),
// Value: []*armalertsmanagement.Alert{
// {
// Name: to.Ptr("cpu alert"),
// Type: to.Ptr("Microsoft.AlertsManagement/alerts"),
// ID: to.Ptr("/subscriptions/3b540246-808d-4331-99aa-917b808a9166/resourcegroups/servicedeskresourcegroup/providers/microsoft.insights/components/servicedeskappinsight/providers/Microsoft.AlertsManagement/alerts/66114d64-d9d9-478b-95c9-b789d6502100"),
// Properties: &armalertsmanagement.AlertProperties{
// Context: map[string]any{
// "AffectedConfigurationItems": []any{
// "",
// },
// "AlertRuleName": "Test number of results",
// "AlertThresholdOperator": "Greater Than Or Equal To",
// "AlertThresholdValue": 0,
// "AlertType": "Number of results",
// "Description": "",
// "Frequency": 5,
// "IncludeSearchResults": true,
// "LinkToFilteredSearchResultsAPI": "https://api.applicationinsights.io/v1/apps/e72c8301-003e-4251-aac9-2374b3320ecf/query?query=traces×pan=2023-04-19T12%3a02%3a25.0000000Z%2f2023-04-19T12%3a32%3a25.0000000Z",
// "LinkToFilteredSearchResultsUI": "https://portal.azure.com#@0ef55770-ee07-488d-8dc5-75f53fa5a901/blade/Microsoft_Azure_Monitoring_Logs/LogsBlade/source/Alerts.EmailLinks/scope/%7B%22resources%22%3A%5B%7B%22resourceId%22%3A%22%2Fsubscriptions%2F0ef55770-ee07-488d-8dc5-75f53fa5a901%2FresourceGroups%2Fexample_resource_group%2Fproviders%2Fmicrosoft.insights%2Fcomponents%2FPortal%22%7D%5D%7D/q/eJwrKUdd0ejhGAA%3D%3D/prettify/1/timespan/2023-04-19T12%3a02%3a25.0000000Z%2f2023-04-19T12%3a32%3a25.0000000Z",
// "LinkToSearchResults": "https://portal.azure.com#@0ef55770-ee07-488d-8dc5-75f53fa5a901/blade/Microsoft_Azure_Monitoring_Logs/LogsBlade/source/Alerts.EmailLinks/scope/%7B%22resources%22%3A%5B%7B%22resourceId%22%3A%22%2Fsubscriptions%2F0ef55770-ee07-488d-8dc5-75f53fa5a901%2FresourceGroups%2Fexample_name%2Fproviders%2Fmicrosoft.insights%2Fcomponents%2FPortal%22%7D%5D%7D/q/eJwreefe4tGAA%3D%3D/prettify/1/timespan/2023-04-19T12%3a02%3a25.0000000Z%2f2023-04-19T12%3a32%3a25.0000000Z",
// "LinkToSearchResultsAPI": "https://api.applicationinsights.io/v1/apps/e72c8301-003e-4251-aac9-2374b3320ecf/query?query=traces×pan=2023-04-19T12%3a02%3a25.0000000Z%2f2023-04-19T12%3a32%3a25.0000000Z",
// "ResultCount": 3,
// "SearchIntervalDurationMin": "30",
// "SearchIntervalEndtimeUtc": "2023-04-19T12:32:25Z",
// "SearchIntervalInSeconds": 1800,
// "SearchIntervalStartTimeUtc": "2023-04-19T12:02:25Z",
// "SearchQuery": "traces",
// "SeverityDescription": "Informational",
// "SubscriptionId": "0ef55770-ee07-488d-8dc5-75f53fa5a901",
// "WorkspaceId": "e72c8301-003e-4251-aac9-2374b3320ecf",
// },
// CustomProperties: map[string]*string{
// "key1": to.Ptr("value1"),
// "key2": to.Ptr("value2"),
// },
// EgressConfig: map[string]any{
// },
// Essentials: &armalertsmanagement.Essentials{
// Description: to.Ptr("description of the alert"),
// ActionStatus: &armalertsmanagement.ActionStatus{
// IsSuppressed: to.Ptr(false),
// },
// AlertRule: to.Ptr("https://servisdffsdf.portal.mms.microsoft.com/#Workspace/overview/settings/details/Edit Alert Rule/details/index?savedSearchId=&scheduleId="),
// AlertState: to.Ptr(armalertsmanagement.AlertStateAcknowledged),
// LastModifiedDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-09-13T15:51:02Z"); return t}()),
// LastModifiedUserName: to.Ptr("System"),
// MonitorCondition: to.Ptr(armalertsmanagement.MonitorConditionFired),
// MonitorConditionResolvedDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-09-13T15:51:02Z"); return t}()),
// MonitorService: to.Ptr(armalertsmanagement.MonitorServiceApplicationInsights),
// Severity: to.Ptr(armalertsmanagement.SeveritySev3),
// SignalType: to.Ptr(armalertsmanagement.SignalTypeLog),
// SmartGroupID: to.Ptr("23d6b2ce-8c54-468f-aff0-sd32aebb7e56"),
// SmartGroupingReason: to.Ptr("Occurred frequently with other alerts"),
// SourceCreatedID: to.Ptr("6cd6b2ce-8c54-468f-aff0-9d12aebb7e49"),
// StartDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-09-13T15:51:02Z"); return t}()),
// TargetResource: to.Ptr("/subscriptions/3b540246-808d-4331-99aa-917b808a9166/resourcegroups/servicedeskresourcegroup/providers/microsoft.insights/components/servicedeskappinsight"),
// TargetResourceGroup: to.Ptr("servicedeskresourcegroup"),
// TargetResourceName: to.Ptr("servicedeskappinsight"),
// TargetResourceType: to.Ptr("components"),
// },
// },
// },
// {
// Name: to.Ptr("cpu alert"),
// Type: to.Ptr("Microsoft.AlertsManagement/alerts"),
// ID: to.Ptr("/subscriptions/3b540246-808d-4331-99aa-917b808a9166/resourcegroups/cind/providers/microsoft.operationalinsights/workspaces/servicedeskwcus/providers/Microsoft.AlertsManagement/alerts/66114d64-d9d9-478b-95c9-b789d6502100"),
// Properties: &armalertsmanagement.AlertProperties{
// Context: map[string]any{
// "AffectedConfigurationItems": []any{
// "",
// },
// "AlertRuleName": "Test number of results",
// "AlertThresholdOperator": "Greater Than Or Equal To",
// "AlertThresholdValue": 0,
// "AlertType": "Number of results",
// "Description": "",
// "Frequency": 5,
// "IncludeSearchResults": true,
// "LinkToFilteredSearchResultsAPI": "https://api.applicationinsights.io/v1/apps/e72c8301-003e-4251-aac9-2374b3320ecf/query?query=traces×pan=2023-04-19T12%3a02%3a25.0000000Z%2f2023-04-19T12%3a32%3a25.0000000Z",
// "LinkToFilteredSearchResultsUI": "https://portal.azure.com#@0ef55770-ee07-488d-8dc5-75f53fa5a901/blade/Microsoft_Azure_Monitoring_Logs/LogsBlade/source/Alerts.EmailLinks/scope/%7B%22resources%22%3A%5B%7B%22resourceId%22%3A%22%2Fsubscriptions%2F0ef55770-ee07-488d-8dc5-75f53fa5a901%2FresourceGroups%2Fexample_resource_group%2Fproviders%2Fmicrosoft.insights%2Fcomponents%2FPortal%22%7D%5D%7D/q/eJwrKUdd0ejhGAA%3D%3D/prettify/1/timespan/2023-04-19T12%3a02%3a25.0000000Z%2f2023-04-19T12%3a32%3a25.0000000Z",
// "LinkToSearchResults": "https://portal.azure.com#@0ef55770-ee07-488d-8dc5-75f53fa5a901/blade/Microsoft_Azure_Monitoring_Logs/LogsBlade/source/Alerts.EmailLinks/scope/%7B%22resources%22%3A%5B%7B%22resourceId%22%3A%22%2Fsubscriptions%2F0ef55770-ee07-488d-8dc5-75f53fa5a901%2FresourceGroups%2Fexample_name%2Fproviders%2Fmicrosoft.insights%2Fcomponents%2FPortal%22%7D%5D%7D/q/eJwreefe4tGAA%3D%3D/prettify/1/timespan/2023-04-19T12%3a02%3a25.0000000Z%2f2023-04-19T12%3a32%3a25.0000000Z",
// "LinkToSearchResultsAPI": "https://api.applicationinsights.io/v1/apps/e72c8301-003e-4251-aac9-2374b3320ecf/query?query=traces×pan=2023-04-19T12%3a02%3a25.0000000Z%2f2023-04-19T12%3a32%3a25.0000000Z",
// "ResultCount": 3,
// "SearchIntervalDurationMin": "30",
// "SearchIntervalEndtimeUtc": "2023-04-19T12:32:25Z",
// "SearchIntervalInSeconds": 1800,
// "SearchIntervalStartTimeUtc": "2023-04-19T12:02:25Z",
// "SearchQuery": "traces",
// "SeverityDescription": "Informational",
// "SubscriptionId": "0ef55770-ee07-488d-8dc5-75f53fa5a901",
// "WorkspaceId": "e72c8301-003e-4251-aac9-2374b3320ecf",
// },
// CustomProperties: map[string]*string{
// "category": to.Ptr("performance"),
// "environment": to.Ptr("production"),
// "priority": to.Ptr("high"),
// },
// EgressConfig: map[string]any{
// },
// Essentials: &armalertsmanagement.Essentials{
// Description: to.Ptr("description of the alert"),
// ActionStatus: &armalertsmanagement.ActionStatus{
// IsSuppressed: to.Ptr(false),
// },
// AlertRule: to.Ptr("https://servicsdfsdf.portal.mms.microsoft.com/#Workspace/overview/settings/details/Edit Alert Rule/details/index?savedSearchId=&scheduleId="),
// AlertState: to.Ptr(armalertsmanagement.AlertStateNew),
// LastModifiedDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-09-13T15:51:02Z"); return t}()),
// LastModifiedUserName: to.Ptr("System"),
// MonitorCondition: to.Ptr(armalertsmanagement.MonitorConditionFired),
// MonitorConditionResolvedDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-09-13T15:51:02Z"); return t}()),
// MonitorService: to.Ptr(armalertsmanagement.MonitorServiceApplicationInsights),
// Severity: to.Ptr(armalertsmanagement.SeveritySev3),
// SignalType: to.Ptr(armalertsmanagement.SignalTypeLog),
// SmartGroupID: to.Ptr("d1c49c89-ea95-4697-a299-c0f5ebac62f1"),
// SmartGroupingReason: to.Ptr("Alerts that frequently occur together have been grouped."),
// SourceCreatedID: to.Ptr("6cd6b2ce-8c54-468f-aff0-9d12aebb7e49"),
// StartDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-09-13T15:51:02Z"); return t}()),
// TargetResource: to.Ptr("/subscriptions/3b540246-808d-4331-99aa-917b808a9166/resourcegroups/cind/providers/microsoft.operationalinsights/workspaces/servicedeskwcus"),
// TargetResourceGroup: to.Ptr("servicedeskresourcegroup"),
// TargetResourceName: to.Ptr("servicedeskwcus"),
// TargetResourceType: to.Ptr("components"),
// },
// },
// },
// },
// },
// }
}
}
Output:
func (*AlertsClient) NewGetEnrichmentsPager ¶ added in v0.11.0
func (client *AlertsClient) NewGetEnrichmentsPager(alertID string, options *AlertsClientGetEnrichmentsOptions) *runtime.Pager[AlertsClientGetEnrichmentsResponse]
NewGetEnrichmentsPager - Get the enrichments of an alert. It returns a collection of one object named default.
Generated from API version 2025-05-25-preview
- alertID - Unique ID of an alert instance.
- options - AlertsClientGetEnrichmentsOptions contains the optional parameters for the AlertsClient.NewGetEnrichmentsPager method.
Example ¶
Generated from example definition: 2025-05-25-preview/Alerts_GetEnrichments.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/alertsmanagement/armalertsmanagement"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armalertsmanagement.NewClientFactory("subscriptions/72fa99ef-9c84-4a7c-b343-ec62da107d81", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewAlertsClient().NewGetEnrichmentsPager("66114d64-d9d9-478b-95c9-b789d6502101", nil)
for pager.More() {
page, err := pager.NextPage(ctx)
if err != nil {
log.Fatalf("failed to advance page: %v", err)
}
for _, v := range page.Value {
// You could use page here. We use blank identifier for just demo purposes.
_ = v
}
// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// page = armalertsmanagement.AlertsClientGetEnrichmentsResponse{
// AlertEnrichmentsList: armalertsmanagement.AlertEnrichmentsList{
// Value: []*armalertsmanagement.AlertEnrichmentResponse{
// {
// Name: to.Ptr("default"),
// Type: to.Ptr("Microsoft.AlertsManagement/alerts/enrichments"),
// ID: to.Ptr("/subscriptions/9e261de7-c804-4b9d-9ebf-6f50fe350a9a/providers/Microsoft.AlertsManagement/alerts/66114d64-d9d9-478b-95c9-b789d6502101/enrichments/default"),
// Properties: &armalertsmanagement.AlertEnrichmentProperties{
// AlertID: to.Ptr("66114d64-d9d9-478b-95c9-b789d6502101"),
// Enrichments: []armalertsmanagement.AlertEnrichmentItemClassification{
// &armalertsmanagement.PrometheusInstantQuery{
// Type: to.Ptr(armalertsmanagement.TypePrometheusInstantQuery),
// Description: to.Ptr("Enrichment description"),
// Datasources: []*string{
// to.Ptr("/subscriptions/72fa99ef-9c84-4a7c-b343-ec62da107d81/resourceGroups/SyntheticRules/providers/microsoft.monitor/accounts/canaryamw"),
// },
// GrafanaExplorePath: to.Ptr("/explore?left=%7B%22datasource%22..."),
// LinkToAPI: to.Ptr("https://test-3sxl.eastus.prometheus.monitor.azure.com/api/v1/query_range?..."),
// Query: to.Ptr("sum by (cluster,container,replicaset,namespace)(label_replace( kube_pod_container_status_last_terminated_reason{reason='OOMKilled', cluster='cluster1', namespace='namespace1'}'}, 'replicaset', '$1', 'pod', '(.*)(-[a-z0-9]{5})$')) > 0"),
// Status: to.Ptr(armalertsmanagement.StatusSucceeded),
// Time: to.Ptr("2015-07-01T20:10:51.781Z"),
// Title: to.Ptr("Number of OOM killed events by container"),
// },
// &armalertsmanagement.PrometheusRangeQuery{
// Type: to.Ptr(armalertsmanagement.TypePrometheusRangeQuery),
// Description: to.Ptr("Enrichment description"),
// Datasources: []*string{
// to.Ptr("/subscriptions/72fa99ef-9c84-4a7c-b343-ec62da107d81/resourceGroups/SyntheticRules/providers/microsoft.monitor/accounts/canaryamw"),
// },
// End: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-07-01T20:20:51.781Z"); return t}()),
// GrafanaExplorePath: to.Ptr("/explore?left=%7B%22datasource%22..."),
// LinkToAPI: to.Ptr("https://test-3sxl.eastus.prometheus.monitor.azure.com/api/v1/query_range?..."),
// Query: to.Ptr("sum by (cluster,container,replicaset,namespace)(label_replace( kube_pod_container_status_last_terminated_reason{reason='OOMKilled', cluster='cluster1', namespace='namespace'}'}, 'replicaset', '$1', 'pod', '(.*)(-[a-z0-9]{5})$')) > 0"),
// Start: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-07-01T20:10:51.781Z"); return t}()),
// Status: to.Ptr(armalertsmanagement.StatusSucceeded),
// Step: to.Ptr("PT15S"),
// Title: to.Ptr("Number of OOM killed events by container"),
// },
// &armalertsmanagement.PrometheusRangeQuery{
// Type: to.Ptr(armalertsmanagement.TypePrometheusRangeQuery),
// Description: to.Ptr("Enrichment description"),
// Datasources: []*string{
// to.Ptr("/subscriptions/72fa99ef-9c84-4a7c-b343-ec62da107d81/resourceGroups/SyntheticRules/providers/microsoft.monitor/accounts/canaryamw"),
// },
// End: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-07-01T20:20:51.781Z"); return t}()),
// ErrorMessage: to.Ptr("Calling Prometheus query API failed"),
// GrafanaExplorePath: to.Ptr("/explore?left=%7B%22datasource%22..."),
// LinkToAPI: to.Ptr("https://test-3sxl.eastus.prometheus.monitor.azure.com/api/v1/query_range?..."),
// Query: to.Ptr("sum by (cluster,container,replicaset,namespace)(label_replace( kube_pod_container_status_last_terminated_reason{reason='OOMKilled', cluster='cluster1', namespace='namespace'}'}, 'replicaset', '$1', 'pod', '(.*)(-[a-z0-9]{5})$')) > 0"),
// Start: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-07-01T20:10:51.781Z"); return t}()),
// Status: to.Ptr(armalertsmanagement.StatusFailed),
// Step: to.Ptr("PT15S"),
// Title: to.Ptr("Number of OOM killed events by container"),
// },
// },
// },
// },
// },
// },
// }
}
}
Output:
type AlertsClientChangeStateOptions ¶ added in v0.3.0
type AlertsClientChangeStateOptions struct {
// reason of change alert state
Comment *Comments
}
AlertsClientChangeStateOptions contains the optional parameters for the AlertsClient.ChangeState method.
type AlertsClientChangeStateResponse ¶ added in v0.3.0
type AlertsClientChangeStateResponse struct {
// An alert created in alert management service.
Alert
}
AlertsClientChangeStateResponse contains the response from method AlertsClient.ChangeState.
type AlertsClientChangeStateTenantOptions ¶ added in v0.11.0
type AlertsClientChangeStateTenantOptions struct {
// reason of change alert state
Comment *Comments
}
AlertsClientChangeStateTenantOptions contains the optional parameters for the AlertsClient.ChangeStateTenant method.
type AlertsClientChangeStateTenantResponse ¶ added in v0.11.0
type AlertsClientChangeStateTenantResponse struct {
// An alert created in alert management service.
Alert
}
AlertsClientChangeStateTenantResponse contains the response from method AlertsClient.ChangeStateTenant.
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 <start-time>/<end-time> 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.NewGetAllPager method.
type AlertsClientGetAllResponse ¶ added in v0.3.0
type AlertsClientGetAllResponse struct {
// List the alerts.
AlertsList
}
AlertsClientGetAllResponse contains the response from method AlertsClient.NewGetAllPager.
type AlertsClientGetAllTenantOptions ¶ added in v0.11.0
type AlertsClientGetAllTenantOptions 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 <start-time>/<end-time> 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
}
AlertsClientGetAllTenantOptions contains the optional parameters for the AlertsClient.NewGetAllTenantPager method.
type AlertsClientGetAllTenantResponse ¶ added in v0.11.0
type AlertsClientGetAllTenantResponse struct {
// List the alerts.
AlertsList
}
AlertsClientGetAllTenantResponse contains the response from method AlertsClient.NewGetAllTenantPager.
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 {
// An alert created in alert management service.
Alert
}
AlertsClientGetByIDResponse contains the response from method AlertsClient.GetByID.
type AlertsClientGetByIDTenantOptions ¶ added in v0.11.0
type AlertsClientGetByIDTenantOptions struct {
}
AlertsClientGetByIDTenantOptions contains the optional parameters for the AlertsClient.GetByIDTenant method.
type AlertsClientGetByIDTenantResponse ¶ added in v0.11.0
type AlertsClientGetByIDTenantResponse struct {
// An alert created in alert management service.
Alert
}
AlertsClientGetByIDTenantResponse contains the response from method AlertsClient.GetByIDTenant.
type AlertsClientGetEnrichmentsOptions ¶ added in v0.11.0
type AlertsClientGetEnrichmentsOptions struct {
}
AlertsClientGetEnrichmentsOptions contains the optional parameters for the AlertsClient.NewGetEnrichmentsPager method.
type AlertsClientGetEnrichmentsResponse ¶ added in v0.11.0
type AlertsClientGetEnrichmentsResponse struct {
// List the alert's enrichments.
AlertEnrichmentsList
}
AlertsClientGetEnrichmentsResponse contains the response from method AlertsClient.NewGetEnrichmentsPager.
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 {
// Alert Modification details
AlertModification
}
AlertsClientGetHistoryResponse contains the response from method AlertsClient.GetHistory.
type AlertsClientGetHistoryTenantOptions ¶ added in v0.11.0
type AlertsClientGetHistoryTenantOptions struct {
}
AlertsClientGetHistoryTenantOptions contains the optional parameters for the AlertsClient.GetHistoryTenant method.
type AlertsClientGetHistoryTenantResponse ¶ added in v0.11.0
type AlertsClientGetHistoryTenantResponse struct {
// Alert Modification details
AlertModification
}
AlertsClientGetHistoryTenantResponse contains the response from method AlertsClient.GetHistoryTenant.
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 <start-time>/<end-time> 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 {
// Summary of alerts based on the input filters and 'groupby' parameters.
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 {
// alert meta data information.
AlertsMetaData
}
AlertsClientMetaDataResponse contains the response from method AlertsClient.MetaData.
type AlertsList ¶
type AlertsList struct {
// REQUIRED; The Alert items on this page
Value []*Alert
// The link to the next page of items
NextLink *string
}
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
}
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
}
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 - alertState AlertsSortByFieldsAlertState AlertsSortByFields = "alertState" // AlertsSortByFieldsLastModifiedDateTime - lastModifiedDateTime AlertsSortByFieldsLastModifiedDateTime AlertsSortByFields = "lastModifiedDateTime" // AlertsSortByFieldsMonitorCondition - monitorCondition AlertsSortByFieldsMonitorCondition AlertsSortByFields = "monitorCondition" // AlertsSortByFieldsName - name AlertsSortByFieldsName AlertsSortByFields = "name" // AlertsSortByFieldsSeverity - severity AlertsSortByFieldsSeverity AlertsSortByFields = "severity" // AlertsSortByFieldsStartDateTime - startDateTime AlertsSortByFieldsStartDateTime AlertsSortByFields = "startDateTime" // AlertsSortByFieldsTargetResource - targetResource AlertsSortByFieldsTargetResource AlertsSortByFields = "targetResource" // AlertsSortByFieldsTargetResourceGroup - targetResourceGroup AlertsSortByFieldsTargetResourceGroup AlertsSortByFields = "targetResourceGroup" // AlertsSortByFieldsTargetResourceName - targetResourceName AlertsSortByFieldsTargetResourceName AlertsSortByFields = "targetResourceName" // AlertsSortByFieldsTargetResourceType - targetResourceType 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
// READ-ONLY; Azure resource Id
ID *string
// READ-ONLY; Azure resource name
Name *string
// READ-ONLY; Azure resource type
Type *string
}
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
// Total count of the smart groups.
SmartGroupsCount *int64
// Total count of the result set.
Total *int64
// List of the items
Values []*AlertsSummaryGroupItem
}
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 - alertRule AlertsSummaryGroupByFieldsAlertRule AlertsSummaryGroupByFields = "alertRule" // AlertsSummaryGroupByFieldsAlertState - alertState AlertsSummaryGroupByFieldsAlertState AlertsSummaryGroupByFields = "alertState" // AlertsSummaryGroupByFieldsMonitorCondition - monitorCondition AlertsSummaryGroupByFieldsMonitorCondition AlertsSummaryGroupByFields = "monitorCondition" // AlertsSummaryGroupByFieldsMonitorService - monitorService AlertsSummaryGroupByFieldsMonitorService AlertsSummaryGroupByFields = "monitorService" // AlertsSummaryGroupByFieldsSeverity - severity AlertsSummaryGroupByFieldsSeverity AlertsSummaryGroupByFields = "severity" // AlertsSummaryGroupByFieldsSignalType - signalType 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
// Name of the field aggregated
Groupedby *string
// Value of the aggregated field
Name *string
// List of the items
Values []*AlertsSummaryGroupItem
}
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 BaseDetails ¶ added in v0.11.0
type BaseDetails struct {
// REQUIRED; Type of modification details
Type *AlertModificationType
}
BaseDetails - Base details class.
func (*BaseDetails) GetBaseDetails ¶ added in v0.11.0
func (b *BaseDetails) GetBaseDetails() *BaseDetails
GetBaseDetails implements the BaseDetailsClassification interface for type BaseDetails.
func (BaseDetails) MarshalJSON ¶ added in v0.11.0
func (b BaseDetails) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type BaseDetails.
func (*BaseDetails) UnmarshalJSON ¶ added in v0.11.0
func (b *BaseDetails) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type BaseDetails.
type BaseDetailsClassification ¶ added in v0.11.0
type BaseDetailsClassification interface {
// GetBaseDetails returns the BaseDetails content of the underlying type.
GetBaseDetails() *BaseDetails
}
BaseDetailsClassification provides polymorphic access to related types. Call the interface's GetBaseDetails() method to access the common type. Use a type switch to determine the concrete type. The possible types are: - *ActionSuppressedDetails, *ActionTriggeredDetails, *BaseDetails, *PropertyChangeDetails
type ClientFactory ¶ added in v0.8.0
type ClientFactory struct {
// contains filtered or unexported fields
}
ClientFactory is a client factory used to create any client in this module. Don't use this type directly, use NewClientFactory instead.
func NewClientFactory ¶ added in v0.8.0
func NewClientFactory(scope string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ClientFactory, error)
NewClientFactory creates a new instance of ClientFactory with the specified values. The parameter values will be propagated to any client created from this factory.
- scope - The fully qualified Azure Resource manager identifier of the resource.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - pass nil to accept the default values.
func (*ClientFactory) NewAlertsClient ¶ added in v0.8.0
func (c *ClientFactory) NewAlertsClient() *AlertsClient
NewAlertsClient creates a new instance of AlertsClient.
func (*ClientFactory) NewOperationsClient ¶ added in v0.8.0
func (c *ClientFactory) NewOperationsClient() *OperationsClient
NewOperationsClient creates a new instance of OperationsClient.
type Comments ¶ added in v0.10.0
type Comments struct {
Comments *string
}
Comments - Change alert state reason
func (Comments) MarshalJSON ¶ added in v0.10.0
MarshalJSON implements the json.Marshaller interface for type Comments.
func (*Comments) UnmarshalJSON ¶ added in v0.10.0
UnmarshalJSON implements the json.Unmarshaller interface for type Comments.
type CreatedByType ¶ added in v0.3.0
type CreatedByType string
CreatedByType - The kind of entity that created the resource.
const ( // CreatedByTypeApplication - The entity was created by an application. CreatedByTypeApplication CreatedByType = "Application" // CreatedByTypeKey - The entity was created by a key. CreatedByTypeKey CreatedByType = "Key" // CreatedByTypeManagedIdentity - The entity was created by a managed identity. CreatedByTypeManagedIdentity CreatedByType = "ManagedIdentity" // CreatedByTypeUser - The entity was created by a user. CreatedByTypeUser CreatedByType = "User" )
func PossibleCreatedByTypeValues ¶ added in v0.3.0
func PossibleCreatedByTypeValues() []CreatedByType
PossibleCreatedByTypeValues returns the possible values for the CreatedByType const type.
type Essentials ¶
type Essentials struct {
// Action status
ActionStatus *ActionStatus
// Alert description.
Description *string
// Target ARM resource, on which alert got created.
TargetResource *string
// Resource group of target ARM resource, on which alert got created.
TargetResourceGroup *string
// Name of the target ARM resource name, on which alert got created.
TargetResourceName *string
// Resource type of target ARM resource, on which alert got created.
TargetResourceType *string
// 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
// READ-ONLY; Alert object state, which can be modified by the user.
AlertState *AlertState
// READ-ONLY; Last modification time(ISO-8601 format) of alert instance.
LastModifiedDateTime *time.Time
// 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
// READ-ONLY; Can be 'Fired' or 'Resolved', which represents whether the underlying conditions have crossed the defined alert
// rule thresholds.
MonitorCondition *MonitorCondition
// 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
// READ-ONLY; Monitor service on which the rule(monitor) is set.
MonitorService *MonitorService
// READ-ONLY; Severity of alert Sev0 being highest and Sev4 being lowest.
Severity *Severity
// READ-ONLY; The type of signal the alert is based on, which could be metrics, logs or activity logs.
SignalType *SignalType
// READ-ONLY; Unique Id of the smart group
SmartGroupID *string
// READ-ONLY; Verbose reason describing the reason why this alert instance is added to a smart group
SmartGroupingReason *string
// 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
// READ-ONLY; Creation time(ISO-8601 format) of alert instance.
StartDateTime *time.Time
}
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 Identifier ¶
type Identifier string
const ( // IdentifierMonitorServiceList - MonitorServiceList IdentifierMonitorServiceList Identifier = "MonitorServiceList" )
func PossibleIdentifierValues ¶
func PossibleIdentifierValues() []Identifier
PossibleIdentifierValues returns the possible values for the Identifier const type.
type MetadataIdentifier ¶
type MetadataIdentifier string
MetadataIdentifier - Identification of the information to be retrieved by API call
const ( // MetadataIdentifierMonitorServiceList - MonitorServiceList 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 - Fired MonitorConditionFired MonitorCondition = "Fired" // MonitorConditionResolved - Resolved 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 - ActivityLog Administrative MonitorServiceActivityLogAdministrative MonitorService = "ActivityLog Administrative" // MonitorServiceActivityLogAutoscale - ActivityLog Autoscale MonitorServiceActivityLogAutoscale MonitorService = "ActivityLog Autoscale" // MonitorServiceActivityLogPolicy - ActivityLog Policy MonitorServiceActivityLogPolicy MonitorService = "ActivityLog Policy" // MonitorServiceActivityLogRecommendation - ActivityLog Recommendation MonitorServiceActivityLogRecommendation MonitorService = "ActivityLog Recommendation" // MonitorServiceActivityLogSecurity - ActivityLog Security MonitorServiceActivityLogSecurity MonitorService = "ActivityLog Security" // MonitorServiceApplicationInsights - Application Insights MonitorServiceApplicationInsights MonitorService = "Application Insights" // MonitorServiceLogAnalytics - Log Analytics MonitorServiceLogAnalytics MonitorService = "Log Analytics" // MonitorServiceNagios - Nagios MonitorServiceNagios MonitorService = "Nagios" // MonitorServicePlatform - Platform MonitorServicePlatform MonitorService = "Platform" // MonitorServiceResourceHealth - Resource Health MonitorServiceResourceHealth MonitorService = "Resource Health" // MonitorServiceSCOM - SCOM MonitorServiceSCOM MonitorService = "SCOM" // MonitorServiceServiceHealth - ServiceHealth MonitorServiceServiceHealth MonitorService = "ServiceHealth" // MonitorServiceSmartDetector - SmartDetector MonitorServiceSmartDetector MonitorService = "SmartDetector" // MonitorServiceVMInsights - VM Insights MonitorServiceVMInsights MonitorService = "VM Insights" // MonitorServiceZabbix - Zabbix 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
// Monitor service name
Name *string
}
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
// REQUIRED; Identification of the information to be retrieved by API call
MetadataIdentifier *MetadataIdentifier
}
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 NotificationResult ¶ added in v0.11.0
type NotificationResult struct {
// The status of the notification
Status *ResultStatus
// URL endpoint for checking notification delivery status. Only populated when status is 'Inline'.
StatusURL *string
}
func (NotificationResult) MarshalJSON ¶ added in v0.11.0
func (n NotificationResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type NotificationResult.
func (*NotificationResult) UnmarshalJSON ¶ added in v0.11.0
func (n *NotificationResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type NotificationResult.
type Operation ¶
type Operation struct {
// Localized display information for this particular operation.
Display *OperationDisplay
// READ-ONLY; Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs.
ActionType *ActionType
// READ-ONLY; Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for Azure
// Resource Manager/control-plane operations.
IsDataAction *bool
// READ-ONLY; The name of the operation, as per Resource-Based Access Control (RBAC). Examples: "Microsoft.Compute/virtualMachines/write",
// "Microsoft.Compute/virtualMachines/capture/action"
Name *string
// READ-ONLY; The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default
// value is "user,system"
Origin *Origin
}
Operation - REST API Operation
Details of a REST API operation, returned from the Resource Provider Operations API
func (Operation) MarshalJSON ¶ added in v0.7.0
MarshalJSON implements the json.Marshaller interface for type Operation.
func (*Operation) UnmarshalJSON ¶ added in v0.7.0
UnmarshalJSON implements the json.Unmarshaller interface for type Operation.
type OperationDisplay ¶
type OperationDisplay struct {
// READ-ONLY; The short, localized friendly description of the operation; suitable for tool tips and detailed views.
Description *string
// READ-ONLY; The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual
// Machine", "Restart Virtual Machine".
Operation *string
// READ-ONLY; The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft
// Compute".
Provider *string
// READ-ONLY; The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job
// Schedule Collections".
Resource *string
}
OperationDisplay - Localized display information for an 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 OperationListResult ¶ added in v0.11.0
type OperationListResult struct {
// REQUIRED; The Operation items on this page
Value []*Operation
// The link to the next page of items
NextLink *string
}
OperationListResult - A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results.
func (OperationListResult) MarshalJSON ¶ added in v0.11.0
func (o OperationListResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type OperationListResult.
func (*OperationListResult) UnmarshalJSON ¶ added in v0.11.0
func (o *OperationListResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type OperationListResult.
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 - Contains optional client configuration. Pass nil to accept the default values.
func (*OperationsClient) NewListPager ¶ added in v0.5.0
func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse]
NewListPager - List all operations available through Azure Alerts Management Resource Provider.
Generated from API version 2025-05-25-preview
- options - OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method.
Example ¶
Generated from example definition: 2025-05-25-preview/Operations_List.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/alertsmanagement/armalertsmanagement"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armalertsmanagement.NewClientFactory("<scope>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewOperationsClient().NewListPager(nil)
for pager.More() {
page, err := pager.NextPage(ctx)
if err != nil {
log.Fatalf("failed to advance page: %v", err)
}
for _, v := range page.Value {
// You could use page here. We use blank identifier for just demo purposes.
_ = v
}
// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// page = armalertsmanagement.OperationsClientListResponse{
// OperationListResult: armalertsmanagement.OperationListResult{
// Value: []*armalertsmanagement.Operation{
// {
// Name: to.Ptr("Microsoft.AlertsManagement/register/action"),
// Display: &armalertsmanagement.OperationDisplay{
// Description: to.Ptr("Subscription Registration Action"),
// Operation: to.Ptr("Subscription Registration Action"),
// Provider: to.Ptr("Microsoft.AlertsManagement"),
// Resource: to.Ptr("Subscription"),
// },
// },
// {
// Name: to.Ptr("Microsoft.AlertsManagement/register/action"),
// Display: &armalertsmanagement.OperationDisplay{
// Description: to.Ptr("Registers the subscription for the Microsoft Alerts Management"),
// Operation: to.Ptr("Register subscription"),
// Provider: to.Ptr("Microsoft.AlertsManagement"),
// Resource: to.Ptr("register"),
// },
// },
// {
// Name: to.Ptr("Microsoft.AlertsManagement/alerts/read"),
// Display: &armalertsmanagement.OperationDisplay{
// Description: to.Ptr("Get all the alerts for the input filters."),
// Operation: to.Ptr("Read alerts"),
// Provider: to.Ptr("Microsoft.AlertsManagement"),
// Resource: to.Ptr("alerts"),
// },
// },
// {
// Name: to.Ptr("Microsoft.AlertsManagement/alerts/changestate/action"),
// Display: &armalertsmanagement.OperationDisplay{
// Description: to.Ptr("Change the state of the alert."),
// Operation: to.Ptr("Resolve alerts"),
// Provider: to.Ptr("Microsoft.AlertsManagement"),
// Resource: to.Ptr("alerts"),
// },
// },
// {
// Name: to.Ptr("Microsoft.AlertsManagement/alerts/history/read"),
// Display: &armalertsmanagement.OperationDisplay{
// Description: to.Ptr("Get history of the alert"),
// Operation: to.Ptr("Read alert history"),
// Provider: to.Ptr("Microsoft.AlertsManagement"),
// Resource: to.Ptr("alerts"),
// },
// },
// {
// Name: to.Ptr("Microsoft.AlertsManagement/smartDetectorAlertRules/write"),
// Display: &armalertsmanagement.OperationDisplay{
// Description: to.Ptr("Create or update Smart Detector alert rule in a given subscription"),
// Operation: to.Ptr("Create Smart Detector alert rule"),
// Provider: to.Ptr("Microsoft.AlertsManagement"),
// Resource: to.Ptr("smartDetectorAlertRules"),
// },
// },
// {
// Name: to.Ptr("Microsoft.AlertsManagement/smartDetectorAlertRules/read"),
// Display: &armalertsmanagement.OperationDisplay{
// Description: to.Ptr("Get all the Smart Detector alert rules for the input filters"),
// Operation: to.Ptr("Read Smart Detector alert rules"),
// Provider: to.Ptr("Microsoft.AlertsManagement"),
// Resource: to.Ptr("smartDetectorAlertRules"),
// },
// },
// {
// Name: to.Ptr("Microsoft.AlertsManagement/smartDetectorAlertRules/delete"),
// Display: &armalertsmanagement.OperationDisplay{
// Description: to.Ptr("Delete Smart Detector alert rule in a given subscription"),
// Operation: to.Ptr("Delete Smart Detector alert rule"),
// Provider: to.Ptr("Microsoft.AlertsManagement"),
// Resource: to.Ptr("smartDetectorAlertRules"),
// },
// },
// {
// Name: to.Ptr("Microsoft.AlertsManagement/resourceHealthAlertRules/write"),
// Display: &armalertsmanagement.OperationDisplay{
// Description: to.Ptr("Create or update Resource Health alert rule in a given subscription"),
// Operation: to.Ptr("Create Resource Health alert rule"),
// Provider: to.Ptr("Microsoft.AlertsManagement"),
// Resource: to.Ptr("resourceHealthAlertRules"),
// },
// },
// {
// Name: to.Ptr("Microsoft.AlertsManagement/resourceHealthAlertRules/read"),
// Display: &armalertsmanagement.OperationDisplay{
// Description: to.Ptr("Get all the Resource Health alert rules for the input filters"),
// Operation: to.Ptr("Read Resource Health alert rules"),
// Provider: to.Ptr("Microsoft.AlertsManagement"),
// Resource: to.Ptr("resourceHealthAlertRules"),
// },
// },
// {
// Name: to.Ptr("Microsoft.AlertsManagement/resourceHealthAlertRules/delete"),
// Display: &armalertsmanagement.OperationDisplay{
// Description: to.Ptr("Delete Resource Health alert rule in a given subscription"),
// Operation: to.Ptr("Delete Resource Health alert rule"),
// Provider: to.Ptr("Microsoft.AlertsManagement"),
// Resource: to.Ptr("resourceHealthAlertRules"),
// },
// },
// {
// Name: to.Ptr("Microsoft.AlertsManagement/migrateFromSmartDetection/read"),
// Display: &armalertsmanagement.OperationDisplay{
// Description: to.Ptr("Get the status of an asynchronous Smart Detection to smart alerts migration process"),
// Operation: to.Ptr("Get Smart Detection Migration status"),
// Provider: to.Ptr("Microsoft.AlertsManagement"),
// Resource: to.Ptr("migrateFromSmartDetection"),
// },
// },
// {
// Name: to.Ptr("Microsoft.AlertsManagement/migrateFromSmartDetection/action"),
// Display: &armalertsmanagement.OperationDisplay{
// Description: to.Ptr("Starts an asynchronous migration process of Smart Detection to smart alerts in an Application Insights resource"),
// Operation: to.Ptr("Migrate From Smart Detection"),
// Provider: to.Ptr("Microsoft.AlertsManagement"),
// Resource: to.Ptr("migrateFromSmartDetection"),
// },
// },
// {
// Name: to.Ptr("Microsoft.AlertsManagement/alertsSummary/read"),
// Display: &armalertsmanagement.OperationDisplay{
// Description: to.Ptr("Get the summary of alerts"),
// Operation: to.Ptr("Read alerts summary"),
// Provider: to.Ptr("Microsoft.AlertsManagement"),
// Resource: to.Ptr("alertsSummary"),
// },
// },
// {
// Name: to.Ptr("Microsoft.AlertsManagement/smartGroups/read"),
// Display: &armalertsmanagement.OperationDisplay{
// Description: to.Ptr("Get all the smart groups for the input filters"),
// Operation: to.Ptr("Read smart groups"),
// Provider: to.Ptr("Microsoft.AlertsManagement"),
// Resource: to.Ptr("smartGroups"),
// },
// },
// {
// Name: to.Ptr("Microsoft.AlertsManagement/smartGroups/changestate/action"),
// Display: &armalertsmanagement.OperationDisplay{
// Description: to.Ptr("Change the state of the smart group"),
// Operation: to.Ptr("Read smart groups"),
// Provider: to.Ptr("Microsoft.AlertsManagement"),
// Resource: to.Ptr("smartGroups"),
// },
// },
// {
// Name: to.Ptr("Microsoft.AlertsManagement/smartGroups/history/read"),
// Display: &armalertsmanagement.OperationDisplay{
// Description: to.Ptr("Get history of the smart group"),
// Operation: to.Ptr("Read smart group history"),
// Provider: to.Ptr("Microsoft.AlertsManagement"),
// Resource: to.Ptr("smartGroups"),
// },
// },
// {
// Name: to.Ptr("Microsoft.AlertsManagement/actionRules/read"),
// Display: &armalertsmanagement.OperationDisplay{
// Description: to.Ptr("Get all the alert processing rules for the input filters."),
// Operation: to.Ptr("Read action rules"),
// Provider: to.Ptr("Microsoft.AlertsManagement"),
// Resource: to.Ptr("actionRules"),
// },
// },
// {
// Name: to.Ptr("Microsoft.AlertsManagement/actionRules/write"),
// Display: &armalertsmanagement.OperationDisplay{
// Description: to.Ptr("Create or update alert processing rule in a given subscription"),
// Operation: to.Ptr("Write action rule"),
// Provider: to.Ptr("Microsoft.AlertsManagement"),
// Resource: to.Ptr("actionRules"),
// },
// },
// {
// Name: to.Ptr("Microsoft.AlertsManagement/actionRules/delete"),
// Display: &armalertsmanagement.OperationDisplay{
// Description: to.Ptr("Delete alert processing rule in a given subscription."),
// Operation: to.Ptr("Delete action rule"),
// Provider: to.Ptr("Microsoft.AlertsManagement"),
// Resource: to.Ptr("actionRules"),
// },
// },
// {
// Name: to.Ptr("Microsoft.AlertsManagement/alertsMetaData/read"),
// Display: &armalertsmanagement.OperationDisplay{
// Description: to.Ptr("Get alerts meta data for the input parameter."),
// Operation: to.Ptr("Read alerts meta data"),
// Provider: to.Ptr("Microsoft.AlertsManagement"),
// Resource: to.Ptr("Microsoft.AlertsManagement/alertsMetaData"),
// },
// },
// {
// Name: to.Ptr("Microsoft.AlertsManagement/Operations/read"),
// Display: &armalertsmanagement.OperationDisplay{
// Description: to.Ptr("Reads the operations provided"),
// Operation: to.Ptr("Read operations"),
// Provider: to.Ptr("Microsoft.AlertsManagement"),
// Resource: to.Ptr("operations"),
// },
// },
// {
// Name: to.Ptr("Microsoft.AlertsManagement/prometheusRuleGroups/Write"),
// Display: &armalertsmanagement.OperationDisplay{
// Description: to.Ptr("Set prometheusRuleGroups"),
// Operation: to.Ptr("Creates or updates the prometheusRuleGroups"),
// Provider: to.Ptr("Microsoft.AlertsManagement"),
// Resource: to.Ptr("prometheusRuleGroups"),
// },
// },
// {
// Name: to.Ptr("Microsoft.AlertsManagement/prometheusRuleGroups/Delete"),
// Display: &armalertsmanagement.OperationDisplay{
// Description: to.Ptr("Delete prometheusRuleGroups"),
// Operation: to.Ptr("Deletes the prometheusRuleGroups"),
// Provider: to.Ptr("Microsoft.AlertsManagement"),
// Resource: to.Ptr("prometheusRuleGroups"),
// },
// },
// {
// Name: to.Ptr("Microsoft.AlertsManagement/prometheusRuleGroups/Read"),
// Display: &armalertsmanagement.OperationDisplay{
// Description: to.Ptr("Read prometheusRuleGroups"),
// Operation: to.Ptr("Reads the prometheusRuleGroups"),
// Provider: to.Ptr("Microsoft.AlertsManagement"),
// Resource: to.Ptr("prometheusRuleGroups"),
// },
// },
// },
// },
// }
}
}
Output:
type OperationsClientListOptions ¶ added in v0.3.0
type OperationsClientListOptions struct {
}
OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method.
type OperationsClientListResponse ¶ added in v0.3.0
type OperationsClientListResponse struct {
// A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results.
OperationListResult
}
OperationsClientListResponse contains the response from method OperationsClient.NewListPager.
type Origin ¶ added in v0.11.0
type Origin string
Origin - The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is "user,system"
const ( // OriginSystem - Indicates the operation is initiated by a system. OriginSystem Origin = "system" // OriginUser - Indicates the operation is initiated by a user. OriginUser Origin = "user" // OriginUserSystem - Indicates the operation is initiated by a user or system. OriginUserSystem Origin = "user,system" )
func PossibleOriginValues ¶ added in v0.11.0
func PossibleOriginValues() []Origin
PossibleOriginValues returns the possible values for the Origin const type.
type PrometheusEnrichmentItem ¶ added in v0.11.0
type PrometheusEnrichmentItem struct {
// REQUIRED; An array of the azure monitor workspace resource ids.
Datasources []*string
// REQUIRED; The enrichment description.
Description *string
// REQUIRED; Partial link to the Grafana explore API.
GrafanaExplorePath *string
// REQUIRED; Link to Prometheus query API (Url format).
LinkToAPI *string
// REQUIRED; The Prometheus expression query.
Query *string
// REQUIRED; The status of the evaluation of the enrichment.
Status *Status
// REQUIRED; The enrichment title.
Title *string
// REQUIRED
Type *Type
// The error message. Will be present only if the status is 'Failed'.
ErrorMessage *string
}
PrometheusEnrichmentItem - Prometheus enrichment object.
func (*PrometheusEnrichmentItem) GetAlertEnrichmentItem ¶ added in v0.11.0
func (p *PrometheusEnrichmentItem) GetAlertEnrichmentItem() *AlertEnrichmentItem
GetAlertEnrichmentItem implements the AlertEnrichmentItemClassification interface for type PrometheusEnrichmentItem.
func (*PrometheusEnrichmentItem) GetPrometheusEnrichmentItem ¶ added in v0.11.0
func (p *PrometheusEnrichmentItem) GetPrometheusEnrichmentItem() *PrometheusEnrichmentItem
GetPrometheusEnrichmentItem implements the PrometheusEnrichmentItemClassification interface for type PrometheusEnrichmentItem.
func (PrometheusEnrichmentItem) MarshalJSON ¶ added in v0.11.0
func (p PrometheusEnrichmentItem) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type PrometheusEnrichmentItem.
func (*PrometheusEnrichmentItem) UnmarshalJSON ¶ added in v0.11.0
func (p *PrometheusEnrichmentItem) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type PrometheusEnrichmentItem.
type PrometheusEnrichmentItemClassification ¶ added in v0.11.0
type PrometheusEnrichmentItemClassification interface {
AlertEnrichmentItemClassification
// GetPrometheusEnrichmentItem returns the PrometheusEnrichmentItem content of the underlying type.
GetPrometheusEnrichmentItem() *PrometheusEnrichmentItem
}
PrometheusEnrichmentItemClassification provides polymorphic access to related types. Call the interface's GetPrometheusEnrichmentItem() method to access the common type. Use a type switch to determine the concrete type. The possible types are: - *PrometheusEnrichmentItem, *PrometheusInstantQuery, *PrometheusRangeQuery
type PrometheusInstantQuery ¶ added in v0.11.0
type PrometheusInstantQuery struct {
// REQUIRED; An array of the azure monitor workspace resource ids.
Datasources []*string
// REQUIRED; The enrichment description.
Description *string
// REQUIRED; Partial link to the Grafana explore API.
GrafanaExplorePath *string
// REQUIRED; Link to Prometheus query API (Url format).
LinkToAPI *string
// REQUIRED; The Prometheus expression query.
Query *string
// REQUIRED; The status of the evaluation of the enrichment.
Status *Status
// REQUIRED; The date and the time of the evaluation.
Time *string
// REQUIRED; The enrichment title.
Title *string
// REQUIRED; The enrichment type.
Type *Type
// The error message. Will be present only if the status is 'Failed'.
ErrorMessage *string
}
PrometheusInstantQuery - Prometheus instant query enrichment object.
func (*PrometheusInstantQuery) GetAlertEnrichmentItem ¶ added in v0.11.0
func (p *PrometheusInstantQuery) GetAlertEnrichmentItem() *AlertEnrichmentItem
GetAlertEnrichmentItem implements the AlertEnrichmentItemClassification interface for type PrometheusInstantQuery.
func (*PrometheusInstantQuery) GetPrometheusEnrichmentItem ¶ added in v0.11.0
func (p *PrometheusInstantQuery) GetPrometheusEnrichmentItem() *PrometheusEnrichmentItem
GetPrometheusEnrichmentItem implements the PrometheusEnrichmentItemClassification interface for type PrometheusInstantQuery.
func (PrometheusInstantQuery) MarshalJSON ¶ added in v0.11.0
func (p PrometheusInstantQuery) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type PrometheusInstantQuery.
func (*PrometheusInstantQuery) UnmarshalJSON ¶ added in v0.11.0
func (p *PrometheusInstantQuery) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type PrometheusInstantQuery.
type PrometheusRangeQuery ¶ added in v0.11.0
type PrometheusRangeQuery struct {
// REQUIRED; An array of the azure monitor workspace resource ids.
Datasources []*string
// REQUIRED; The enrichment description.
Description *string
// REQUIRED; The end evaluation date and time in ISO8601 format.
End *time.Time
// REQUIRED; Partial link to the Grafana explore API.
GrafanaExplorePath *string
// REQUIRED; Link to Prometheus query API (Url format).
LinkToAPI *string
// REQUIRED; The Prometheus expression query.
Query *string
// REQUIRED; The start evaluation date and time in ISO8601 format.
Start *time.Time
// REQUIRED; The status of the evaluation of the enrichment.
Status *Status
// REQUIRED; Query resolution step width in ISO8601 format.
Step *string
// REQUIRED; The enrichment title.
Title *string
// REQUIRED; The enrichment type.
Type *Type
// The error message. Will be present only if the status is 'Failed'.
ErrorMessage *string
}
PrometheusRangeQuery - Prometheus instant query enrichment object.
func (*PrometheusRangeQuery) GetAlertEnrichmentItem ¶ added in v0.11.0
func (p *PrometheusRangeQuery) GetAlertEnrichmentItem() *AlertEnrichmentItem
GetAlertEnrichmentItem implements the AlertEnrichmentItemClassification interface for type PrometheusRangeQuery.
func (*PrometheusRangeQuery) GetPrometheusEnrichmentItem ¶ added in v0.11.0
func (p *PrometheusRangeQuery) GetPrometheusEnrichmentItem() *PrometheusEnrichmentItem
GetPrometheusEnrichmentItem implements the PrometheusEnrichmentItemClassification interface for type PrometheusRangeQuery.
func (PrometheusRangeQuery) MarshalJSON ¶ added in v0.11.0
func (p PrometheusRangeQuery) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type PrometheusRangeQuery.
func (*PrometheusRangeQuery) UnmarshalJSON ¶ added in v0.11.0
func (p *PrometheusRangeQuery) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type PrometheusRangeQuery.
type PropertyChangeDetails ¶ added in v0.11.0
type PropertyChangeDetails struct {
// REQUIRED; Type of modification details
Type *AlertModificationType
// The comment
Comment *string
// The value after the change
NewValue *string
// The value before the change
OldValue *string
}
func (*PropertyChangeDetails) GetBaseDetails ¶ added in v0.11.0
func (p *PropertyChangeDetails) GetBaseDetails() *BaseDetails
GetBaseDetails implements the BaseDetailsClassification interface for type PropertyChangeDetails.
func (PropertyChangeDetails) MarshalJSON ¶ added in v0.11.0
func (p PropertyChangeDetails) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type PropertyChangeDetails.
func (*PropertyChangeDetails) UnmarshalJSON ¶ added in v0.11.0
func (p *PropertyChangeDetails) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type PropertyChangeDetails.
type ResultStatus ¶ added in v0.11.0
type ResultStatus string
ResultStatus - The status of the notification
const ( // ResultStatusFailed - Failed ResultStatusFailed ResultStatus = "Failed" // ResultStatusInline - Inline ResultStatusInline ResultStatus = "Inline" // ResultStatusNone - None ResultStatusNone ResultStatus = "None" // ResultStatusThrottled - Throttled ResultStatusThrottled ResultStatus = "Throttled" // ResultStatusThrottledByAlertRule - ThrottledByAlertRule ResultStatusThrottledByAlertRule ResultStatus = "ThrottledByAlertRule" // ResultStatusThrottledBySubscription - ThrottledBySubscription ResultStatusThrottledBySubscription ResultStatus = "ThrottledBySubscription" )
func PossibleResultStatusValues ¶ added in v0.11.0
func PossibleResultStatusValues() []ResultStatus
PossibleResultStatusValues returns the possible values for the ResultStatus const type.
type RuleType ¶ added in v0.11.0
type RuleType string
RuleType - The rule type
func PossibleRuleTypeValues ¶ added in v0.11.0
func PossibleRuleTypeValues() []RuleType
PossibleRuleTypeValues returns the possible values for the RuleType const type.
type Severity ¶
type Severity string
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 - Log SignalTypeLog SignalType = "Log" // SignalTypeMetric - Metric SignalTypeMetric SignalType = "Metric" // SignalTypeUnknown - Unknown SignalTypeUnknown SignalType = "Unknown" )
func PossibleSignalTypeValues ¶
func PossibleSignalTypeValues() []SignalType
PossibleSignalTypeValues returns the possible values for the SignalType const type.
type SortOrder ¶ added in v0.3.0
type SortOrder string
func PossibleSortOrderValues ¶ added in v0.3.0
func PossibleSortOrderValues() []SortOrder
PossibleSortOrderValues returns the possible values for the SortOrder const type.
type Status ¶ added in v0.11.0
type Status string
Status - The status of the evaluation of the enrichment.
func PossibleStatusValues ¶ added in v0.11.0
func PossibleStatusValues() []Status
PossibleStatusValues returns the possible values for the Status const type.
type SystemData ¶ added in v0.3.0
type SystemData struct {
// The timestamp of resource creation (UTC).
CreatedAt *time.Time
// The identity that created the resource.
CreatedBy *string
// The type of identity that created the resource.
CreatedByType *CreatedByType
// The timestamp of resource last modification (UTC)
LastModifiedAt *time.Time
// The identity that last modified the resource.
LastModifiedBy *string
// The type of identity that last modified the resource.
LastModifiedByType *CreatedByType
}
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
func PossibleTimeRangeValues ¶
func PossibleTimeRangeValues() []TimeRange
PossibleTimeRangeValues returns the possible values for the TimeRange const type.
type TriggeredRule ¶ added in v0.11.0
type TriggeredRule struct {
// The action group ID
ActionGroupID *string
// The rule ID
RuleID *string
// The rule type
RuleType *RuleType
}
func (TriggeredRule) MarshalJSON ¶ added in v0.11.0
func (t TriggeredRule) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type TriggeredRule.
func (*TriggeredRule) UnmarshalJSON ¶ added in v0.11.0
func (t *TriggeredRule) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type TriggeredRule.
type Type ¶ added in v0.11.0
type Type string
Type - The enrichment type.
const ( // TypePrometheusEnrichmentItem - PrometheusEnrichmentItem TypePrometheusEnrichmentItem Type = "PrometheusEnrichmentItem" // TypePrometheusInstantQuery - PrometheusInstantQuery TypePrometheusInstantQuery Type = "PrometheusInstantQuery" // TypePrometheusRangeQuery - PrometheusRangeQuery TypePrometheusRangeQuery Type = "PrometheusRangeQuery" )
func PossibleTypeValues ¶ added in v0.11.0
func PossibleTypeValues() []Type
PossibleTypeValues returns the possible values for the Type const type.