Documentation ¶
Index ¶
- type AccessMode
- type AccessModeSettings
- type AccessModeSettingsExclusion
- type ActionDetail
- type ActionGroup
- type ActionGroupAutoGenerated
- type ActionGroupList
- type ActionGroupPatch
- type ActionGroupPatchAutoGenerated
- type ActionGroupPatchBody
- type ActionGroupPatchBodyAutoGenerated
- type ActionGroupResource
- type ActionGroupsClient
- func (client *ActionGroupsClient) BeginCreateNotificationsAtActionGroupResourceLevel(ctx context.Context, resourceGroupName string, actionGroupName string, ...) (...)
- func (client *ActionGroupsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, actionGroupName string, ...) (ActionGroupsClientCreateOrUpdateResponse, error)
- func (client *ActionGroupsClient) Delete(ctx context.Context, resourceGroupName string, actionGroupName string, ...) (ActionGroupsClientDeleteResponse, error)
- func (client *ActionGroupsClient) EnableReceiver(ctx context.Context, resourceGroupName string, actionGroupName string, ...) (ActionGroupsClientEnableReceiverResponse, error)
- func (client *ActionGroupsClient) Get(ctx context.Context, resourceGroupName string, actionGroupName string, ...) (ActionGroupsClientGetResponse, error)
- func (client *ActionGroupsClient) GetTestNotificationsAtActionGroupResourceLevel(ctx context.Context, resourceGroupName string, actionGroupName string, ...) (ActionGroupsClientGetTestNotificationsAtActionGroupResourceLevelResponse, ...)
- func (client *ActionGroupsClient) NewListByResourceGroupPager(resourceGroupName string, ...) *runtime.Pager[ActionGroupsClientListByResourceGroupResponse]
- func (client *ActionGroupsClient) NewListBySubscriptionIDPager(options *ActionGroupsClientListBySubscriptionIDOptions) *runtime.Pager[ActionGroupsClientListBySubscriptionIDResponse]
- func (client *ActionGroupsClient) Update(ctx context.Context, resourceGroupName string, actionGroupName string, ...) (ActionGroupsClientUpdateResponse, error)
- type ActionGroupsClientBeginCreateNotificationsAtActionGroupResourceLevelOptions
- type ActionGroupsClientCreateNotificationsAtActionGroupResourceLevelResponse
- type ActionGroupsClientCreateOrUpdateOptions
- type ActionGroupsClientCreateOrUpdateResponse
- type ActionGroupsClientDeleteOptions
- type ActionGroupsClientDeleteResponse
- type ActionGroupsClientEnableReceiverOptions
- type ActionGroupsClientEnableReceiverResponse
- type ActionGroupsClientGetOptions
- type ActionGroupsClientGetResponse
- type ActionGroupsClientGetTestNotificationsAtActionGroupResourceLevelOptions
- type ActionGroupsClientGetTestNotificationsAtActionGroupResourceLevelResponse
- type ActionGroupsClientListByResourceGroupOptions
- type ActionGroupsClientListByResourceGroupResponse
- type ActionGroupsClientListBySubscriptionIDOptions
- type ActionGroupsClientListBySubscriptionIDResponse
- type ActionGroupsClientUpdateOptions
- type ActionGroupsClientUpdateResponse
- type ActionList
- type ActionType
- type Actions
- type ActivityLogAlertResource
- type ActivityLogAlertsClient
- func (client *ActivityLogAlertsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, activityLogAlertName string, ...) (ActivityLogAlertsClientCreateOrUpdateResponse, error)
- func (client *ActivityLogAlertsClient) Delete(ctx context.Context, resourceGroupName string, activityLogAlertName string, ...) (ActivityLogAlertsClientDeleteResponse, error)
- func (client *ActivityLogAlertsClient) Get(ctx context.Context, resourceGroupName string, activityLogAlertName string, ...) (ActivityLogAlertsClientGetResponse, error)
- func (client *ActivityLogAlertsClient) NewListByResourceGroupPager(resourceGroupName string, ...) *runtime.Pager[ActivityLogAlertsClientListByResourceGroupResponse]
- func (client *ActivityLogAlertsClient) NewListBySubscriptionIDPager(options *ActivityLogAlertsClientListBySubscriptionIDOptions) *runtime.Pager[ActivityLogAlertsClientListBySubscriptionIDResponse]
- func (client *ActivityLogAlertsClient) Update(ctx context.Context, resourceGroupName string, activityLogAlertName string, ...) (ActivityLogAlertsClientUpdateResponse, error)
- type ActivityLogAlertsClientCreateOrUpdateOptions
- type ActivityLogAlertsClientCreateOrUpdateResponse
- type ActivityLogAlertsClientDeleteOptions
- type ActivityLogAlertsClientDeleteResponse
- type ActivityLogAlertsClientGetOptions
- type ActivityLogAlertsClientGetResponse
- type ActivityLogAlertsClientListByResourceGroupOptions
- type ActivityLogAlertsClientListByResourceGroupResponse
- type ActivityLogAlertsClientListBySubscriptionIDOptions
- type ActivityLogAlertsClientListBySubscriptionIDResponse
- type ActivityLogAlertsClientUpdateOptions
- type ActivityLogAlertsClientUpdateResponse
- type ActivityLogsClient
- type ActivityLogsClientListOptions
- type ActivityLogsClientListResponse
- type AggregationType
- type AggregationTypeEnum
- type AlertRule
- type AlertRuleAllOfCondition
- type AlertRuleAnyOfOrLeafCondition
- type AlertRuleIncidentsClient
- func (client *AlertRuleIncidentsClient) Get(ctx context.Context, resourceGroupName string, ruleName string, ...) (AlertRuleIncidentsClientGetResponse, error)
- func (client *AlertRuleIncidentsClient) NewListByAlertRulePager(resourceGroupName string, ruleName string, ...) *runtime.Pager[AlertRuleIncidentsClientListByAlertRuleResponse]
- type AlertRuleIncidentsClientGetOptions
- type AlertRuleIncidentsClientGetResponse
- type AlertRuleIncidentsClientListByAlertRuleOptions
- type AlertRuleIncidentsClientListByAlertRuleResponse
- type AlertRuleLeafCondition
- type AlertRuleList
- type AlertRulePatchObject
- type AlertRulePatchProperties
- type AlertRuleProperties
- type AlertRuleResource
- type AlertRuleResourceCollection
- type AlertRuleResourcePatch
- type AlertRulesClient
- func (client *AlertRulesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, ruleName string, ...) (AlertRulesClientCreateOrUpdateResponse, error)
- func (client *AlertRulesClient) Delete(ctx context.Context, resourceGroupName string, ruleName string, ...) (AlertRulesClientDeleteResponse, error)
- func (client *AlertRulesClient) Get(ctx context.Context, resourceGroupName string, ruleName string, ...) (AlertRulesClientGetResponse, error)
- func (client *AlertRulesClient) NewListByResourceGroupPager(resourceGroupName string, options *AlertRulesClientListByResourceGroupOptions) *runtime.Pager[AlertRulesClientListByResourceGroupResponse]
- func (client *AlertRulesClient) NewListBySubscriptionPager(options *AlertRulesClientListBySubscriptionOptions) *runtime.Pager[AlertRulesClientListBySubscriptionResponse]
- func (client *AlertRulesClient) Update(ctx context.Context, resourceGroupName string, ruleName string, ...) (AlertRulesClientUpdateResponse, error)
- type AlertRulesClientCreateOrUpdateOptions
- type AlertRulesClientCreateOrUpdateResponse
- type AlertRulesClientDeleteOptions
- type AlertRulesClientDeleteResponse
- type AlertRulesClientGetOptions
- type AlertRulesClientGetResponse
- type AlertRulesClientListByResourceGroupOptions
- type AlertRulesClientListByResourceGroupResponse
- type AlertRulesClientListBySubscriptionOptions
- type AlertRulesClientListBySubscriptionResponse
- type AlertRulesClientUpdateOptions
- type AlertRulesClientUpdateResponse
- type AlertSeverity
- type ArmRoleReceiver
- type AutomationRunbookReceiver
- type AutoscaleErrorResponse
- type AutoscaleErrorResponseError
- type AutoscaleNotification
- type AutoscaleProfile
- type AutoscaleSetting
- type AutoscaleSettingResource
- type AutoscaleSettingResourceCollection
- type AutoscaleSettingResourcePatch
- type AutoscaleSettingsClient
- func (client *AutoscaleSettingsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, autoscaleSettingName string, ...) (AutoscaleSettingsClientCreateOrUpdateResponse, error)
- func (client *AutoscaleSettingsClient) Delete(ctx context.Context, resourceGroupName string, autoscaleSettingName string, ...) (AutoscaleSettingsClientDeleteResponse, error)
- func (client *AutoscaleSettingsClient) Get(ctx context.Context, resourceGroupName string, autoscaleSettingName string, ...) (AutoscaleSettingsClientGetResponse, error)
- func (client *AutoscaleSettingsClient) NewListByResourceGroupPager(resourceGroupName string, ...) *runtime.Pager[AutoscaleSettingsClientListByResourceGroupResponse]
- func (client *AutoscaleSettingsClient) NewListBySubscriptionPager(options *AutoscaleSettingsClientListBySubscriptionOptions) *runtime.Pager[AutoscaleSettingsClientListBySubscriptionResponse]
- func (client *AutoscaleSettingsClient) Update(ctx context.Context, resourceGroupName string, autoscaleSettingName string, ...) (AutoscaleSettingsClientUpdateResponse, error)
- type AutoscaleSettingsClientCreateOrUpdateOptions
- type AutoscaleSettingsClientCreateOrUpdateResponse
- type AutoscaleSettingsClientDeleteOptions
- type AutoscaleSettingsClientDeleteResponse
- type AutoscaleSettingsClientGetOptions
- type AutoscaleSettingsClientGetResponse
- type AutoscaleSettingsClientListByResourceGroupOptions
- type AutoscaleSettingsClientListByResourceGroupResponse
- type AutoscaleSettingsClientListBySubscriptionOptions
- type AutoscaleSettingsClientListBySubscriptionResponse
- type AutoscaleSettingsClientUpdateOptions
- type AutoscaleSettingsClientUpdateResponse
- type AzureAppPushReceiver
- type AzureAppPushReceiverAutoGenerated
- type AzureFunctionReceiver
- type AzureMonitorMetricsDestination
- type AzureMonitorPrivateLinkScope
- type AzureMonitorPrivateLinkScopeListResult
- type AzureMonitorPrivateLinkScopeProperties
- type AzureMonitorWorkspace
- type AzureMonitorWorkspaceDefaultIngestionSettings
- type AzureMonitorWorkspaceMetrics
- type AzureMonitorWorkspaceResource
- type AzureMonitorWorkspaceResourceForUpdate
- type AzureMonitorWorkspaceResourceListResult
- type AzureMonitorWorkspaceResourceProperties
- type AzureMonitorWorkspacesClient
- func (client *AzureMonitorWorkspacesClient) Create(ctx context.Context, resourceGroupName string, ...) (AzureMonitorWorkspacesClientCreateResponse, error)
- func (client *AzureMonitorWorkspacesClient) Delete(ctx context.Context, resourceGroupName string, ...) (AzureMonitorWorkspacesClientDeleteResponse, error)
- func (client *AzureMonitorWorkspacesClient) Get(ctx context.Context, resourceGroupName string, ...) (AzureMonitorWorkspacesClientGetResponse, error)
- func (client *AzureMonitorWorkspacesClient) NewListByResourceGroupPager(resourceGroupName string, ...) *runtime.Pager[AzureMonitorWorkspacesClientListByResourceGroupResponse]
- func (client *AzureMonitorWorkspacesClient) NewListBySubscriptionPager(options *AzureMonitorWorkspacesClientListBySubscriptionOptions) *runtime.Pager[AzureMonitorWorkspacesClientListBySubscriptionResponse]
- func (client *AzureMonitorWorkspacesClient) Update(ctx context.Context, resourceGroupName string, ...) (AzureMonitorWorkspacesClientUpdateResponse, error)
- type AzureMonitorWorkspacesClientCreateOptions
- type AzureMonitorWorkspacesClientCreateResponse
- type AzureMonitorWorkspacesClientDeleteOptions
- type AzureMonitorWorkspacesClientDeleteResponse
- type AzureMonitorWorkspacesClientGetOptions
- type AzureMonitorWorkspacesClientGetResponse
- type AzureMonitorWorkspacesClientListByResourceGroupOptions
- type AzureMonitorWorkspacesClientListByResourceGroupResponse
- type AzureMonitorWorkspacesClientListBySubscriptionOptions
- type AzureMonitorWorkspacesClientListBySubscriptionResponse
- type AzureMonitorWorkspacesClientUpdateOptions
- type AzureMonitorWorkspacesClientUpdateResponse
- type AzureResource
- type AzureResourceAutoGenerated
- type BaselineMetadata
- type BaselineSensitivity
- type BaselinesClient
- type BaselinesClientListOptions
- type BaselinesClientListResponse
- type CategoryType
- type ClientFactory
- func (c *ClientFactory) NewActionGroupsClient() *ActionGroupsClient
- func (c *ClientFactory) NewActivityLogAlertsClient() *ActivityLogAlertsClient
- func (c *ClientFactory) NewActivityLogsClient() *ActivityLogsClient
- func (c *ClientFactory) NewAlertRuleIncidentsClient() *AlertRuleIncidentsClient
- func (c *ClientFactory) NewAlertRulesClient() *AlertRulesClient
- func (c *ClientFactory) NewAutoscaleSettingsClient() *AutoscaleSettingsClient
- func (c *ClientFactory) NewAzureMonitorWorkspacesClient() *AzureMonitorWorkspacesClient
- func (c *ClientFactory) NewBaselinesClient() *BaselinesClient
- func (c *ClientFactory) NewDataCollectionEndpointsClient() *DataCollectionEndpointsClient
- func (c *ClientFactory) NewDataCollectionRuleAssociationsClient() *DataCollectionRuleAssociationsClient
- func (c *ClientFactory) NewDataCollectionRulesClient() *DataCollectionRulesClient
- func (c *ClientFactory) NewDiagnosticSettingsCategoryClient() *DiagnosticSettingsCategoryClient
- func (c *ClientFactory) NewDiagnosticSettingsClient() *DiagnosticSettingsClient
- func (c *ClientFactory) NewEventCategoriesClient() *EventCategoriesClient
- func (c *ClientFactory) NewLogProfilesClient() *LogProfilesClient
- func (c *ClientFactory) NewMetricAlertsClient() *MetricAlertsClient
- func (c *ClientFactory) NewMetricAlertsStatusClient() *MetricAlertsStatusClient
- func (c *ClientFactory) NewMetricDefinitionsClient() *MetricDefinitionsClient
- func (c *ClientFactory) NewMetricNamespacesClient() *MetricNamespacesClient
- func (c *ClientFactory) NewMetricsClient() *MetricsClient
- func (c *ClientFactory) NewOperationsClient() *OperationsClient
- func (c *ClientFactory) NewOperationsForMonitorClient() *OperationsForMonitorClient
- func (c *ClientFactory) NewPredictiveMetricClient() *PredictiveMetricClient
- func (c *ClientFactory) NewPrivateEndpointConnectionsClient() *PrivateEndpointConnectionsClient
- func (c *ClientFactory) NewPrivateLinkResourcesClient() *PrivateLinkResourcesClient
- func (c *ClientFactory) NewPrivateLinkScopeOperationStatusClient() *PrivateLinkScopeOperationStatusClient
- func (c *ClientFactory) NewPrivateLinkScopedResourcesClient() *PrivateLinkScopedResourcesClient
- func (c *ClientFactory) NewPrivateLinkScopesClient() *PrivateLinkScopesClient
- func (c *ClientFactory) NewScheduledQueryRulesClient() *ScheduledQueryRulesClient
- func (c *ClientFactory) NewTenantActionGroupsClient() *TenantActionGroupsClient
- func (c *ClientFactory) NewTenantActivityLogsClient() *TenantActivityLogsClient
- func (c *ClientFactory) NewVMInsightsClient() *VMInsightsClient
- type ColumnDefinition
- type ComparisonOperationType
- type Condition
- type ConditionFailingPeriods
- type ConditionOperator
- type ConfigurationAccessEndpointSpec
- type Context
- type CreatedByType
- type CriterionType
- type DataCollectionEndpoint
- type DataCollectionEndpointConfigurationAccess
- type DataCollectionEndpointFailoverConfiguration
- type DataCollectionEndpointLogsIngestion
- type DataCollectionEndpointMetadata
- type DataCollectionEndpointMetricsIngestion
- type DataCollectionEndpointNetworkACLs
- type DataCollectionEndpointResource
- type DataCollectionEndpointResourceIdentity
- type DataCollectionEndpointResourceListResult
- type DataCollectionEndpointResourceProperties
- type DataCollectionEndpointResourceSystemData
- type DataCollectionEndpointsClient
- func (client *DataCollectionEndpointsClient) Create(ctx context.Context, resourceGroupName string, ...) (DataCollectionEndpointsClientCreateResponse, error)
- func (client *DataCollectionEndpointsClient) Delete(ctx context.Context, resourceGroupName string, ...) (DataCollectionEndpointsClientDeleteResponse, error)
- func (client *DataCollectionEndpointsClient) Get(ctx context.Context, resourceGroupName string, ...) (DataCollectionEndpointsClientGetResponse, error)
- func (client *DataCollectionEndpointsClient) NewListByResourceGroupPager(resourceGroupName string, ...) *runtime.Pager[DataCollectionEndpointsClientListByResourceGroupResponse]
- func (client *DataCollectionEndpointsClient) NewListBySubscriptionPager(options *DataCollectionEndpointsClientListBySubscriptionOptions) *runtime.Pager[DataCollectionEndpointsClientListBySubscriptionResponse]
- func (client *DataCollectionEndpointsClient) Update(ctx context.Context, resourceGroupName string, ...) (DataCollectionEndpointsClientUpdateResponse, error)
- type DataCollectionEndpointsClientCreateOptions
- type DataCollectionEndpointsClientCreateResponse
- type DataCollectionEndpointsClientDeleteOptions
- type DataCollectionEndpointsClientDeleteResponse
- type DataCollectionEndpointsClientGetOptions
- type DataCollectionEndpointsClientGetResponse
- type DataCollectionEndpointsClientListByResourceGroupOptions
- type DataCollectionEndpointsClientListByResourceGroupResponse
- type DataCollectionEndpointsClientListBySubscriptionOptions
- type DataCollectionEndpointsClientListBySubscriptionResponse
- type DataCollectionEndpointsClientUpdateOptions
- type DataCollectionEndpointsClientUpdateResponse
- type DataCollectionRule
- type DataCollectionRuleAssociation
- type DataCollectionRuleAssociationMetadata
- type DataCollectionRuleAssociationProxyOnlyResource
- type DataCollectionRuleAssociationProxyOnlyResourceListResult
- type DataCollectionRuleAssociationProxyOnlyResourceProperties
- type DataCollectionRuleAssociationProxyOnlyResourceSystemData
- type DataCollectionRuleAssociationsClient
- func (client *DataCollectionRuleAssociationsClient) Create(ctx context.Context, resourceURI string, associationName string, ...) (DataCollectionRuleAssociationsClientCreateResponse, error)
- func (client *DataCollectionRuleAssociationsClient) Delete(ctx context.Context, resourceURI string, associationName string, ...) (DataCollectionRuleAssociationsClientDeleteResponse, error)
- func (client *DataCollectionRuleAssociationsClient) Get(ctx context.Context, resourceURI string, associationName string, ...) (DataCollectionRuleAssociationsClientGetResponse, error)
- func (client *DataCollectionRuleAssociationsClient) NewListByDataCollectionEndpointPager(resourceGroupName string, dataCollectionEndpointName string, ...) ...
- func (client *DataCollectionRuleAssociationsClient) NewListByResourcePager(resourceURI string, ...) *runtime.Pager[DataCollectionRuleAssociationsClientListByResourceResponse]
- func (client *DataCollectionRuleAssociationsClient) NewListByRulePager(resourceGroupName string, dataCollectionRuleName string, ...) *runtime.Pager[DataCollectionRuleAssociationsClientListByRuleResponse]
- type DataCollectionRuleAssociationsClientCreateOptions
- type DataCollectionRuleAssociationsClientCreateResponse
- type DataCollectionRuleAssociationsClientDeleteOptions
- type DataCollectionRuleAssociationsClientDeleteResponse
- type DataCollectionRuleAssociationsClientGetOptions
- type DataCollectionRuleAssociationsClientGetResponse
- type DataCollectionRuleAssociationsClientListByDataCollectionEndpointOptions
- type DataCollectionRuleAssociationsClientListByDataCollectionEndpointResponse
- type DataCollectionRuleAssociationsClientListByResourceOptions
- type DataCollectionRuleAssociationsClientListByResourceResponse
- type DataCollectionRuleAssociationsClientListByRuleOptions
- type DataCollectionRuleAssociationsClientListByRuleResponse
- type DataCollectionRuleDataSources
- type DataCollectionRuleDestinations
- type DataCollectionRuleMetadata
- type DataCollectionRuleResource
- type DataCollectionRuleResourceIdentity
- type DataCollectionRuleResourceListResult
- type DataCollectionRuleResourceProperties
- type DataCollectionRuleResourceSystemData
- type DataCollectionRulesClient
- func (client *DataCollectionRulesClient) Create(ctx context.Context, resourceGroupName string, dataCollectionRuleName string, ...) (DataCollectionRulesClientCreateResponse, error)
- func (client *DataCollectionRulesClient) Delete(ctx context.Context, resourceGroupName string, dataCollectionRuleName string, ...) (DataCollectionRulesClientDeleteResponse, error)
- func (client *DataCollectionRulesClient) Get(ctx context.Context, resourceGroupName string, dataCollectionRuleName string, ...) (DataCollectionRulesClientGetResponse, error)
- func (client *DataCollectionRulesClient) NewListByResourceGroupPager(resourceGroupName string, ...) *runtime.Pager[DataCollectionRulesClientListByResourceGroupResponse]
- func (client *DataCollectionRulesClient) NewListBySubscriptionPager(options *DataCollectionRulesClientListBySubscriptionOptions) *runtime.Pager[DataCollectionRulesClientListBySubscriptionResponse]
- func (client *DataCollectionRulesClient) Update(ctx context.Context, resourceGroupName string, dataCollectionRuleName string, ...) (DataCollectionRulesClientUpdateResponse, error)
- type DataCollectionRulesClientCreateOptions
- type DataCollectionRulesClientCreateResponse
- type DataCollectionRulesClientDeleteOptions
- type DataCollectionRulesClientDeleteResponse
- type DataCollectionRulesClientGetOptions
- type DataCollectionRulesClientGetResponse
- type DataCollectionRulesClientListByResourceGroupOptions
- type DataCollectionRulesClientListByResourceGroupResponse
- type DataCollectionRulesClientListBySubscriptionOptions
- type DataCollectionRulesClientListBySubscriptionResponse
- type DataCollectionRulesClientUpdateOptions
- type DataCollectionRulesClientUpdateResponse
- type DataContainer
- type DataFlow
- type DataImportSources
- type DataImportSourcesEventHub
- type DataSourcesSpec
- type DataSourcesSpecDataImports
- type DataStatus
- type DefaultErrorResponse
- type DestinationsSpec
- type DestinationsSpecAzureMonitorMetrics
- type DiagnosticSettings
- type DiagnosticSettingsCategory
- type DiagnosticSettingsCategoryClient
- func (client *DiagnosticSettingsCategoryClient) Get(ctx context.Context, resourceURI string, name string, ...) (DiagnosticSettingsCategoryClientGetResponse, error)
- func (client *DiagnosticSettingsCategoryClient) NewListPager(resourceURI string, options *DiagnosticSettingsCategoryClientListOptions) *runtime.Pager[DiagnosticSettingsCategoryClientListResponse]
- type DiagnosticSettingsCategoryClientGetOptions
- type DiagnosticSettingsCategoryClientGetResponse
- type DiagnosticSettingsCategoryClientListOptions
- type DiagnosticSettingsCategoryClientListResponse
- type DiagnosticSettingsCategoryResource
- type DiagnosticSettingsCategoryResourceCollection
- type DiagnosticSettingsClient
- func (client *DiagnosticSettingsClient) CreateOrUpdate(ctx context.Context, resourceURI string, name string, ...) (DiagnosticSettingsClientCreateOrUpdateResponse, error)
- func (client *DiagnosticSettingsClient) Delete(ctx context.Context, resourceURI string, name string, ...) (DiagnosticSettingsClientDeleteResponse, error)
- func (client *DiagnosticSettingsClient) Get(ctx context.Context, resourceURI string, name string, ...) (DiagnosticSettingsClientGetResponse, error)
- func (client *DiagnosticSettingsClient) NewListPager(resourceURI string, options *DiagnosticSettingsClientListOptions) *runtime.Pager[DiagnosticSettingsClientListResponse]
- type DiagnosticSettingsClientCreateOrUpdateOptions
- type DiagnosticSettingsClientCreateOrUpdateResponse
- type DiagnosticSettingsClientDeleteOptions
- type DiagnosticSettingsClientDeleteResponse
- type DiagnosticSettingsClientGetOptions
- type DiagnosticSettingsClientGetResponse
- type DiagnosticSettingsClientListOptions
- type DiagnosticSettingsClientListResponse
- type DiagnosticSettingsResource
- type DiagnosticSettingsResourceCollection
- type Dimension
- type DimensionOperator
- type DynamicMetricCriteria
- type DynamicThresholdFailingPeriods
- type DynamicThresholdOperator
- type DynamicThresholdSensitivity
- type EmailNotification
- type EmailReceiver
- type EmailReceiverAutoGenerated
- type EnableRequest
- type Error
- type ErrorAdditionalInfo
- type ErrorContract
- type ErrorContractAutoGenerated
- type ErrorDetail
- type ErrorDetailAutoGenerated
- type ErrorResponse
- type ErrorResponseAdditionalInfo
- type ErrorResponseAutoGenerated
- type ErrorResponseAutoGenerated2
- type ErrorResponseCommonV2
- type ErrorResponseDetails
- type EventCategoriesClient
- type EventCategoriesClientListOptions
- type EventCategoriesClientListResponse
- type EventCategoryCollection
- type EventData
- type EventDataCollection
- type EventHubDataSource
- type EventHubDestination
- type EventHubDirectDestination
- type EventHubReceiver
- type EventLevel
- type ExtensionDataSource
- type FailoverConfigurationSpec
- type HTTPRequestInfo
- type Identity
- type IdentityType
- type IisLogsDataSource
- type Incident
- type IncidentListResult
- type IngestionSettings
- type ItsmReceiver
- type Kind
- type KnownColumnDefinitionType
- type KnownDataCollectionEndpointProvisioningState
- type KnownDataCollectionEndpointResourceKind
- type KnownDataCollectionRuleAssociationProvisioningState
- type KnownDataCollectionRuleProvisioningState
- type KnownDataCollectionRuleResourceKind
- type KnownDataFlowStreams
- type KnownExtensionDataSourceStreams
- type KnownLocationSpecProvisioningStatus
- type KnownLogFileTextSettingsRecordStartTimestampFormat
- type KnownLogFilesDataSourceFormat
- type KnownPerfCounterDataSourceStreams
- type KnownPrometheusForwarderDataSourceStreams
- type KnownPublicNetworkAccessOptions
- type KnownSyslogDataSourceFacilityNames
- type KnownSyslogDataSourceLogLevels
- type KnownSyslogDataSourceStreams
- type KnownWindowsEventLogDataSourceStreams
- type LocalizableString
- type LocationSpec
- type LocationThresholdRuleCondition
- type LogAnalyticsDestination
- type LogFileSettings
- type LogFileSettingsText
- type LogFileTextSettings
- type LogFilesDataSource
- type LogFilesDataSourceSettings
- type LogProfileCollection
- type LogProfileProperties
- type LogProfileResource
- type LogProfileResourcePatch
- type LogProfilesClient
- func (client *LogProfilesClient) CreateOrUpdate(ctx context.Context, logProfileName string, parameters LogProfileResource, ...) (LogProfilesClientCreateOrUpdateResponse, error)
- func (client *LogProfilesClient) Delete(ctx context.Context, logProfileName string, ...) (LogProfilesClientDeleteResponse, error)
- func (client *LogProfilesClient) Get(ctx context.Context, logProfileName string, ...) (LogProfilesClientGetResponse, error)
- func (client *LogProfilesClient) NewListPager(options *LogProfilesClientListOptions) *runtime.Pager[LogProfilesClientListResponse]
- func (client *LogProfilesClient) Update(ctx context.Context, logProfileName string, ...) (LogProfilesClientUpdateResponse, error)
- type LogProfilesClientCreateOrUpdateOptions
- type LogProfilesClientCreateOrUpdateResponse
- type LogProfilesClientDeleteOptions
- type LogProfilesClientDeleteResponse
- type LogProfilesClientGetOptions
- type LogProfilesClientGetResponse
- type LogProfilesClientListOptions
- type LogProfilesClientListResponse
- type LogProfilesClientUpdateOptions
- type LogProfilesClientUpdateResponse
- type LogSettings
- type LogicAppReceiver
- type LogsIngestionEndpointSpec
- type ManagedServiceIdentity
- type ManagedServiceIdentityType
- type ManagementEventAggregationCondition
- type ManagementEventRuleCondition
- type Metadata
- type MetadataValue
- type Metric
- type MetricAggregationType
- type MetricAlertAction
- type MetricAlertCriteria
- type MetricAlertCriteriaClassification
- type MetricAlertMultipleResourceMultipleMetricCriteria
- type MetricAlertProperties
- type MetricAlertPropertiesPatch
- type MetricAlertResource
- type MetricAlertResourceCollection
- type MetricAlertResourcePatch
- type MetricAlertSingleResourceMultipleMetricCriteria
- type MetricAlertStatus
- type MetricAlertStatusCollection
- type MetricAlertStatusProperties
- type MetricAlertsClient
- func (client *MetricAlertsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, ruleName string, ...) (MetricAlertsClientCreateOrUpdateResponse, error)
- func (client *MetricAlertsClient) Delete(ctx context.Context, resourceGroupName string, ruleName string, ...) (MetricAlertsClientDeleteResponse, error)
- func (client *MetricAlertsClient) Get(ctx context.Context, resourceGroupName string, ruleName string, ...) (MetricAlertsClientGetResponse, error)
- func (client *MetricAlertsClient) NewListByResourceGroupPager(resourceGroupName string, ...) *runtime.Pager[MetricAlertsClientListByResourceGroupResponse]
- func (client *MetricAlertsClient) NewListBySubscriptionPager(options *MetricAlertsClientListBySubscriptionOptions) *runtime.Pager[MetricAlertsClientListBySubscriptionResponse]
- func (client *MetricAlertsClient) Update(ctx context.Context, resourceGroupName string, ruleName string, ...) (MetricAlertsClientUpdateResponse, error)
- type MetricAlertsClientCreateOrUpdateOptions
- type MetricAlertsClientCreateOrUpdateResponse
- type MetricAlertsClientDeleteOptions
- type MetricAlertsClientDeleteResponse
- type MetricAlertsClientGetOptions
- type MetricAlertsClientGetResponse
- type MetricAlertsClientListByResourceGroupOptions
- type MetricAlertsClientListByResourceGroupResponse
- type MetricAlertsClientListBySubscriptionOptions
- type MetricAlertsClientListBySubscriptionResponse
- type MetricAlertsClientUpdateOptions
- type MetricAlertsClientUpdateResponse
- type MetricAlertsStatusClient
- func (client *MetricAlertsStatusClient) List(ctx context.Context, resourceGroupName string, ruleName string, ...) (MetricAlertsStatusClientListResponse, error)
- func (client *MetricAlertsStatusClient) ListByName(ctx context.Context, resourceGroupName string, ruleName string, ...) (MetricAlertsStatusClientListByNameResponse, error)
- type MetricAlertsStatusClientListByNameOptions
- type MetricAlertsStatusClientListByNameResponse
- type MetricAlertsStatusClientListOptions
- type MetricAlertsStatusClientListResponse
- type MetricAvailability
- type MetricBaselinesProperties
- type MetricBaselinesResponse
- type MetricClass
- type MetricCriteria
- type MetricDefinition
- type MetricDefinitionCollection
- type MetricDefinitionsClient
- func (client *MetricDefinitionsClient) NewListAtSubscriptionScopePager(region string, options *MetricDefinitionsClientListAtSubscriptionScopeOptions) *runtime.Pager[MetricDefinitionsClientListAtSubscriptionScopeResponse]
- func (client *MetricDefinitionsClient) NewListPager(resourceURI string, options *MetricDefinitionsClientListOptions) *runtime.Pager[MetricDefinitionsClientListResponse]
- type MetricDefinitionsClientListAtSubscriptionScopeOptions
- type MetricDefinitionsClientListAtSubscriptionScopeResponse
- type MetricDefinitionsClientListOptions
- type MetricDefinitionsClientListResponse
- type MetricDimension
- type MetricNamespace
- type MetricNamespaceCollection
- type MetricNamespaceName
- type MetricNamespacesClient
- type MetricNamespacesClientListOptions
- type MetricNamespacesClientListResponse
- type MetricResultType
- type MetricSettings
- type MetricSingleDimension
- type MetricStatisticType
- type MetricTrigger
- type MetricUnit
- type MetricValue
- type Metrics
- type MetricsClient
- func (client *MetricsClient) List(ctx context.Context, resourceURI string, options *MetricsClientListOptions) (MetricsClientListResponse, error)
- func (client *MetricsClient) ListAtSubscriptionScope(ctx context.Context, region string, ...) (MetricsClientListAtSubscriptionScopeResponse, error)
- func (client *MetricsClient) ListAtSubscriptionScopePost(ctx context.Context, region string, ...) (MetricsClientListAtSubscriptionScopePostResponse, error)
- type MetricsClientListAtSubscriptionScopeOptions
- type MetricsClientListAtSubscriptionScopePostOptions
- type MetricsClientListAtSubscriptionScopePostResponse
- type MetricsClientListAtSubscriptionScopeResponse
- type MetricsClientListOptions
- type MetricsClientListResponse
- type MetricsIngestionEndpointSpec
- type MonitoringAccountDestination
- type MultiMetricCriteria
- type MultiMetricCriteriaClassification
- type NamespaceClassification
- type NetworkRuleSet
- type NotificationRequestBody
- type Odatatype
- type OnboardingStatus
- type Operation
- type OperationAutoGenerated
- type OperationDisplay
- type OperationDisplayAutoGenerated
- type OperationListResult
- type OperationListResultAutoGenerated
- type OperationStatus
- type OperationsClient
- type OperationsClientListOptions
- type OperationsClientListResponse
- type OperationsForMonitorClient
- type OperationsForMonitorClientListOptions
- type OperationsForMonitorClientListResponse
- type Operator
- type Origin
- type PerfCounterDataSource
- type PlatformTelemetryDataSource
- type PredictiveAutoscalePolicy
- type PredictiveAutoscalePolicyScaleMode
- type PredictiveMetricClient
- type PredictiveMetricClientGetOptions
- type PredictiveMetricClientGetResponse
- type PredictiveResponse
- type PredictiveValue
- type PrivateEndpoint
- type PrivateEndpointConnection
- type PrivateEndpointConnectionListResult
- type PrivateEndpointConnectionProperties
- type PrivateEndpointConnectionProvisioningState
- type PrivateEndpointConnectionsClient
- func (client *PrivateEndpointConnectionsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, scopeName string, ...) (*runtime.Poller[PrivateEndpointConnectionsClientCreateOrUpdateResponse], error)
- func (client *PrivateEndpointConnectionsClient) BeginDelete(ctx context.Context, resourceGroupName string, scopeName string, ...) (*runtime.Poller[PrivateEndpointConnectionsClientDeleteResponse], error)
- func (client *PrivateEndpointConnectionsClient) Get(ctx context.Context, resourceGroupName string, scopeName string, ...) (PrivateEndpointConnectionsClientGetResponse, error)
- func (client *PrivateEndpointConnectionsClient) ListByPrivateLinkScope(ctx context.Context, resourceGroupName string, scopeName string, ...) (PrivateEndpointConnectionsClientListByPrivateLinkScopeResponse, error)
- type PrivateEndpointConnectionsClientBeginCreateOrUpdateOptions
- type PrivateEndpointConnectionsClientBeginDeleteOptions
- type PrivateEndpointConnectionsClientCreateOrUpdateResponse
- type PrivateEndpointConnectionsClientDeleteResponse
- type PrivateEndpointConnectionsClientGetOptions
- type PrivateEndpointConnectionsClientGetResponse
- type PrivateEndpointConnectionsClientListByPrivateLinkScopeOptions
- type PrivateEndpointConnectionsClientListByPrivateLinkScopeResponse
- type PrivateEndpointServiceConnectionStatus
- type PrivateLinkResource
- type PrivateLinkResourceListResult
- type PrivateLinkResourceProperties
- type PrivateLinkResourcesClient
- func (client *PrivateLinkResourcesClient) Get(ctx context.Context, resourceGroupName string, scopeName string, ...) (PrivateLinkResourcesClientGetResponse, error)
- func (client *PrivateLinkResourcesClient) ListByPrivateLinkScope(ctx context.Context, resourceGroupName string, scopeName string, ...) (PrivateLinkResourcesClientListByPrivateLinkScopeResponse, error)
- type PrivateLinkResourcesClientGetOptions
- type PrivateLinkResourcesClientGetResponse
- type PrivateLinkResourcesClientListByPrivateLinkScopeOptions
- type PrivateLinkResourcesClientListByPrivateLinkScopeResponse
- type PrivateLinkScopeOperationStatusClient
- type PrivateLinkScopeOperationStatusClientGetOptions
- type PrivateLinkScopeOperationStatusClientGetResponse
- type PrivateLinkScopedResource
- type PrivateLinkScopedResourcesClient
- func (client *PrivateLinkScopedResourcesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, scopeName string, name string, ...) (*runtime.Poller[PrivateLinkScopedResourcesClientCreateOrUpdateResponse], error)
- func (client *PrivateLinkScopedResourcesClient) BeginDelete(ctx context.Context, resourceGroupName string, scopeName string, name string, ...) (*runtime.Poller[PrivateLinkScopedResourcesClientDeleteResponse], error)
- func (client *PrivateLinkScopedResourcesClient) Get(ctx context.Context, resourceGroupName string, scopeName string, name string, ...) (PrivateLinkScopedResourcesClientGetResponse, error)
- func (client *PrivateLinkScopedResourcesClient) NewListByPrivateLinkScopePager(resourceGroupName string, scopeName string, ...) *runtime.Pager[PrivateLinkScopedResourcesClientListByPrivateLinkScopeResponse]
- type PrivateLinkScopedResourcesClientBeginCreateOrUpdateOptions
- type PrivateLinkScopedResourcesClientBeginDeleteOptions
- type PrivateLinkScopedResourcesClientCreateOrUpdateResponse
- type PrivateLinkScopedResourcesClientDeleteResponse
- type PrivateLinkScopedResourcesClientGetOptions
- type PrivateLinkScopedResourcesClientGetResponse
- type PrivateLinkScopedResourcesClientListByPrivateLinkScopeOptions
- type PrivateLinkScopedResourcesClientListByPrivateLinkScopeResponse
- type PrivateLinkScopesClient
- func (client *PrivateLinkScopesClient) BeginDelete(ctx context.Context, resourceGroupName string, scopeName string, ...) (*runtime.Poller[PrivateLinkScopesClientDeleteResponse], error)
- func (client *PrivateLinkScopesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, scopeName string, ...) (PrivateLinkScopesClientCreateOrUpdateResponse, error)
- func (client *PrivateLinkScopesClient) Get(ctx context.Context, resourceGroupName string, scopeName string, ...) (PrivateLinkScopesClientGetResponse, error)
- func (client *PrivateLinkScopesClient) NewListByResourceGroupPager(resourceGroupName string, ...) *runtime.Pager[PrivateLinkScopesClientListByResourceGroupResponse]
- func (client *PrivateLinkScopesClient) NewListPager(options *PrivateLinkScopesClientListOptions) *runtime.Pager[PrivateLinkScopesClientListResponse]
- func (client *PrivateLinkScopesClient) UpdateTags(ctx context.Context, resourceGroupName string, scopeName string, ...) (PrivateLinkScopesClientUpdateTagsResponse, error)
- type PrivateLinkScopesClientBeginDeleteOptions
- type PrivateLinkScopesClientCreateOrUpdateOptions
- type PrivateLinkScopesClientCreateOrUpdateResponse
- type PrivateLinkScopesClientDeleteResponse
- type PrivateLinkScopesClientGetOptions
- type PrivateLinkScopesClientGetResponse
- type PrivateLinkScopesClientListByResourceGroupOptions
- type PrivateLinkScopesClientListByResourceGroupResponse
- type PrivateLinkScopesClientListOptions
- type PrivateLinkScopesClientListResponse
- type PrivateLinkScopesClientUpdateTagsOptions
- type PrivateLinkScopesClientUpdateTagsResponse
- type PrivateLinkServiceConnectionState
- type PrometheusForwarderDataSource
- type ProvisioningState
- type ProxyResource
- type ProxyResourceAutoGenerated
- type PublicNetworkAccess
- type ReceiverStatus
- type Recurrence
- type RecurrenceFrequency
- type RecurrentSchedule
- type Resource
- type ResourceAutoGenerated
- type ResourceAutoGenerated2
- type ResourceAutoGenerated3
- type ResourceAutoGenerated4
- type ResourceAutoGenerated5
- type ResourceForUpdate
- type ResourceForUpdateIdentity
- type Response
- type ResponseWithError
- type ResultType
- type RetentionPolicy
- type RuleAction
- type RuleActionClassification
- type RuleCondition
- type RuleConditionClassification
- type RuleDataSource
- type RuleDataSourceClassification
- type RuleEmailAction
- type RuleManagementEventClaimsDataSource
- type RuleManagementEventDataSource
- type RuleMetricDataSource
- type RuleResolveConfiguration
- type RuleWebhookAction
- type ScaleAction
- type ScaleCapacity
- type ScaleDirection
- type ScaleRule
- type ScaleRuleMetricDimension
- type ScaleRuleMetricDimensionOperationType
- type ScaleType
- type ScheduledQueryRuleCriteria
- type ScheduledQueryRuleProperties
- type ScheduledQueryRuleResource
- type ScheduledQueryRuleResourceCollection
- type ScheduledQueryRuleResourcePatch
- type ScheduledQueryRulesClient
- func (client *ScheduledQueryRulesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, ruleName string, ...) (ScheduledQueryRulesClientCreateOrUpdateResponse, error)
- func (client *ScheduledQueryRulesClient) Delete(ctx context.Context, resourceGroupName string, ruleName string, ...) (ScheduledQueryRulesClientDeleteResponse, error)
- func (client *ScheduledQueryRulesClient) Get(ctx context.Context, resourceGroupName string, ruleName string, ...) (ScheduledQueryRulesClientGetResponse, error)
- func (client *ScheduledQueryRulesClient) NewListByResourceGroupPager(resourceGroupName string, ...) *runtime.Pager[ScheduledQueryRulesClientListByResourceGroupResponse]
- func (client *ScheduledQueryRulesClient) NewListBySubscriptionPager(options *ScheduledQueryRulesClientListBySubscriptionOptions) *runtime.Pager[ScheduledQueryRulesClientListBySubscriptionResponse]
- func (client *ScheduledQueryRulesClient) Update(ctx context.Context, resourceGroupName string, ruleName string, ...) (ScheduledQueryRulesClientUpdateResponse, error)
- type ScheduledQueryRulesClientCreateOrUpdateOptions
- type ScheduledQueryRulesClientCreateOrUpdateResponse
- type ScheduledQueryRulesClientDeleteOptions
- type ScheduledQueryRulesClientDeleteResponse
- type ScheduledQueryRulesClientGetOptions
- type ScheduledQueryRulesClientGetResponse
- type ScheduledQueryRulesClientListByResourceGroupOptions
- type ScheduledQueryRulesClientListByResourceGroupResponse
- type ScheduledQueryRulesClientListBySubscriptionOptions
- type ScheduledQueryRulesClientListBySubscriptionResponse
- type ScheduledQueryRulesClientUpdateOptions
- type ScheduledQueryRulesClientUpdateResponse
- type ScopedResource
- type ScopedResourceListResult
- type ScopedResourceProperties
- type SenderAuthorization
- type SingleBaseline
- type SingleMetricBaseline
- type SmsReceiver
- type SmsReceiverAutoGenerated
- type StorageBlobDestination
- type StorageTableDestination
- type StreamDeclaration
- type SubscriptionScopeMetric
- type SubscriptionScopeMetricDefinition
- type SubscriptionScopeMetricDefinitionCollection
- type SubscriptionScopeMetricResponse
- type SubscriptionScopeMetricsRequestBodyParameters
- type SyslogDataSource
- type SystemData
- type TagsResource
- type TenantActionGroup
- type TenantActionGroupList
- type TenantActionGroupResource
- type TenantActionGroupsClient
- func (client *TenantActionGroupsClient) CreateOrUpdate(ctx context.Context, managementGroupID string, tenantActionGroupName string, ...) (TenantActionGroupsClientCreateOrUpdateResponse, error)
- func (client *TenantActionGroupsClient) Delete(ctx context.Context, managementGroupID string, tenantActionGroupName string, ...) (TenantActionGroupsClientDeleteResponse, error)
- func (client *TenantActionGroupsClient) Get(ctx context.Context, managementGroupID string, tenantActionGroupName string, ...) (TenantActionGroupsClientGetResponse, error)
- func (client *TenantActionGroupsClient) NewListByManagementGroupIDPager(managementGroupID string, xmsClientTenantID string, ...) *runtime.Pager[TenantActionGroupsClientListByManagementGroupIDResponse]
- func (client *TenantActionGroupsClient) Update(ctx context.Context, managementGroupID string, tenantActionGroupName string, ...) (TenantActionGroupsClientUpdateResponse, error)
- type TenantActionGroupsClientCreateOrUpdateOptions
- type TenantActionGroupsClientCreateOrUpdateResponse
- type TenantActionGroupsClientDeleteOptions
- type TenantActionGroupsClientDeleteResponse
- type TenantActionGroupsClientGetOptions
- type TenantActionGroupsClientGetResponse
- type TenantActionGroupsClientListByManagementGroupIDOptions
- type TenantActionGroupsClientListByManagementGroupIDResponse
- type TenantActionGroupsClientUpdateOptions
- type TenantActionGroupsClientUpdateResponse
- type TenantActivityLogsClient
- type TenantActivityLogsClientListOptions
- type TenantActivityLogsClientListResponse
- type TestNotificationDetailsResponse
- type ThresholdRuleCondition
- type TimeAggregation
- type TimeAggregationOperator
- type TimeAggregationType
- type TimeSeriesBaseline
- type TimeSeriesElement
- type TimeWindow
- type TrackedResource
- type TrackedResourceAutoGenerated
- type Unit
- type UserAssignedIdentity
- type UserIdentityProperties
- type VMInsightsClient
- type VMInsightsClientGetOnboardingStatusOptions
- type VMInsightsClientGetOnboardingStatusResponse
- type VMInsightsOnboardingStatus
- type VMInsightsOnboardingStatusProperties
- type VoiceReceiver
- type VoiceReceiverAutoGenerated
- type WebhookNotification
- type WebhookReceiver
- type WebhookReceiverAutoGenerated
- type WebtestLocationAvailabilityCriteria
- type WindowsEventLogDataSource
- type WindowsFirewallLogsDataSource
- type WorkspaceInfo
- type WorkspaceInfoProperties
Examples ¶
- ActionGroupsClient.BeginCreateNotificationsAtActionGroupResourceLevel
- ActionGroupsClient.CreateOrUpdate
- ActionGroupsClient.Delete
- ActionGroupsClient.EnableReceiver
- ActionGroupsClient.Get
- ActionGroupsClient.GetTestNotificationsAtActionGroupResourceLevel
- ActionGroupsClient.NewListBySubscriptionIDPager
- ActionGroupsClient.Update
- ActivityLogAlertsClient.CreateOrUpdate (CreateOrUpdateAnActivityLogAlertRule)
- ActivityLogAlertsClient.CreateOrUpdate (CreateOrUpdateAnActivityLogAlertRuleWithAnyOfCondition)
- ActivityLogAlertsClient.CreateOrUpdate (CreateOrUpdateAnActivityLogAlertRuleWithContainsAny)
- ActivityLogAlertsClient.Delete
- ActivityLogAlertsClient.Get
- ActivityLogAlertsClient.NewListByResourceGroupPager
- ActivityLogAlertsClient.NewListBySubscriptionIDPager
- ActivityLogAlertsClient.Update
- ActivityLogsClient.NewListPager (GetActivityLogsWithFilter)
- ActivityLogsClient.NewListPager (GetActivityLogsWithFilterAndSelect)
- AlertRuleIncidentsClient.Get
- AlertRuleIncidentsClient.NewListByAlertRulePager
- AlertRulesClient.CreateOrUpdate
- AlertRulesClient.Delete
- AlertRulesClient.Get
- AlertRulesClient.NewListByResourceGroupPager
- AlertRulesClient.NewListBySubscriptionPager
- AlertRulesClient.Update
- AutoscaleSettingsClient.CreateOrUpdate
- AutoscaleSettingsClient.Delete
- AutoscaleSettingsClient.Get
- AutoscaleSettingsClient.NewListByResourceGroupPager
- AutoscaleSettingsClient.NewListBySubscriptionPager
- AutoscaleSettingsClient.Update
- AzureMonitorWorkspacesClient.Create
- AzureMonitorWorkspacesClient.Delete
- AzureMonitorWorkspacesClient.Get
- AzureMonitorWorkspacesClient.NewListByResourceGroupPager
- AzureMonitorWorkspacesClient.NewListBySubscriptionPager
- AzureMonitorWorkspacesClient.Update
- BaselinesClient.NewListPager
- DataCollectionEndpointsClient.Create
- DataCollectionEndpointsClient.Delete
- DataCollectionEndpointsClient.Get
- DataCollectionEndpointsClient.NewListByResourceGroupPager
- DataCollectionEndpointsClient.NewListBySubscriptionPager
- DataCollectionEndpointsClient.Update
- DataCollectionRuleAssociationsClient.Create
- DataCollectionRuleAssociationsClient.Delete
- DataCollectionRuleAssociationsClient.Get
- DataCollectionRuleAssociationsClient.NewListByDataCollectionEndpointPager
- DataCollectionRuleAssociationsClient.NewListByResourcePager
- DataCollectionRuleAssociationsClient.NewListByRulePager
- DataCollectionRulesClient.Create
- DataCollectionRulesClient.Delete
- DataCollectionRulesClient.Get
- DataCollectionRulesClient.NewListByResourceGroupPager
- DataCollectionRulesClient.NewListBySubscriptionPager
- DataCollectionRulesClient.Update
- DiagnosticSettingsCategoryClient.Get
- DiagnosticSettingsCategoryClient.NewListPager
- DiagnosticSettingsClient.CreateOrUpdate (CreatesOrUpdatesTheDiagnosticSetting)
- DiagnosticSettingsClient.CreateOrUpdate (CreatesOrUpdatesTheDiagnosticSettingForCategory)
- DiagnosticSettingsClient.Delete
- DiagnosticSettingsClient.Get (GetsTheDiagnosticSetting)
- DiagnosticSettingsClient.Get (GetsTheDiagnosticSettingForCategory)
- DiagnosticSettingsClient.NewListPager (GetsTheDiagnosticSetting)
- DiagnosticSettingsClient.NewListPager (GetsTheDiagnosticSettingForCategory)
- EventCategoriesClient.NewListPager
- LogProfilesClient.CreateOrUpdate
- LogProfilesClient.Delete
- LogProfilesClient.Get
- LogProfilesClient.NewListPager
- LogProfilesClient.Update
- MetricAlertsClient.CreateOrUpdate (CreateOrUpdateADynamicAlertRuleForMultipleResources)
- MetricAlertsClient.CreateOrUpdate (CreateOrUpdateADynamicAlertRuleForSingleResource)
- MetricAlertsClient.CreateOrUpdate (CreateOrUpdateAWebTestAlertRule)
- MetricAlertsClient.CreateOrUpdate (CreateOrUpdateAnAlertRuleForMultipleResource)
- MetricAlertsClient.CreateOrUpdate (CreateOrUpdateAnAlertRuleForSingleResource)
- MetricAlertsClient.CreateOrUpdate (CreateOrUpdateAnAlertRuleOnResourceGroupS)
- MetricAlertsClient.CreateOrUpdate (CreateOrUpdateAnAlertRuleOnSubscription)
- MetricAlertsClient.CreateOrUpdate (CreateOrUpdateAnAlertRulesWithDimensions)
- MetricAlertsClient.Delete
- MetricAlertsClient.Get (GetADynamicAlertRuleForMultipleResources)
- MetricAlertsClient.Get (GetADynamicAlertRuleForSingleResource)
- MetricAlertsClient.Get (GetAWebTestAlertRule)
- MetricAlertsClient.Get (GetAnAlertRuleForMultipleResources)
- MetricAlertsClient.Get (GetAnAlertRuleForSingleResource)
- MetricAlertsClient.Get (GetAnAlertRuleOnResourceGroupS)
- MetricAlertsClient.Get (GetAnAlertRuleOnSubscription)
- MetricAlertsClient.NewListBySubscriptionPager
- MetricAlertsClient.Update
- MetricAlertsStatusClient.List
- MetricAlertsStatusClient.ListByName
- MetricDefinitionsClient.NewListAtSubscriptionScopePager
- MetricDefinitionsClient.NewListPager (GetApplicationInsightsMetricDefinitionsWithoutFilter)
- MetricDefinitionsClient.NewListPager (GetMetricDefinitionsWithoutFilter)
- MetricDefinitionsClient.NewListPager (GetStorageCacheMetricDefinitionsWithMetricClass)
- MetricNamespacesClient.NewListPager
- MetricsClient.List (GetMetricForData)
- MetricsClient.List (GetMetricForMetadata)
- MetricsClient.List (GetMetricWithError)
- MetricsClient.ListAtSubscriptionScope (GetSubscriptionLevelMetricData)
- MetricsClient.ListAtSubscriptionScope (GetSubscriptionLevelMetricMetadata)
- MetricsClient.ListAtSubscriptionScopePost (PostRequestForSubscriptionLevelMetricDataUsingBodyParams)
- OperationsClient.List
- OperationsForMonitorClient.NewListPager
- PredictiveMetricClient.Get
- PrivateEndpointConnectionsClient.BeginCreateOrUpdate
- PrivateEndpointConnectionsClient.BeginDelete
- PrivateEndpointConnectionsClient.Get
- PrivateEndpointConnectionsClient.ListByPrivateLinkScope
- PrivateLinkResourcesClient.Get
- PrivateLinkResourcesClient.ListByPrivateLinkScope
- PrivateLinkScopeOperationStatusClient.Get
- PrivateLinkScopedResourcesClient.BeginCreateOrUpdate
- PrivateLinkScopedResourcesClient.BeginDelete
- PrivateLinkScopedResourcesClient.Get
- PrivateLinkScopedResourcesClient.NewListByPrivateLinkScopePager
- PrivateLinkScopesClient.BeginDelete
- PrivateLinkScopesClient.CreateOrUpdate (PrivateLinkScopeCreate)
- PrivateLinkScopesClient.CreateOrUpdate (PrivateLinkScopeUpdate)
- PrivateLinkScopesClient.Get
- PrivateLinkScopesClient.NewListByResourceGroupPager
- PrivateLinkScopesClient.NewListPager
- PrivateLinkScopesClient.UpdateTags
- ScheduledQueryRulesClient.CreateOrUpdate (CreateOrUpdateAScheduledQueryRuleForSingleResource)
- ScheduledQueryRulesClient.CreateOrUpdate (CreateOrUpdateAScheduledQueryRuleOnResourceGroupS)
- ScheduledQueryRulesClient.CreateOrUpdate (CreateOrUpdateAScheduledQueryRuleOnSubscription)
- ScheduledQueryRulesClient.Delete
- ScheduledQueryRulesClient.Get
- ScheduledQueryRulesClient.NewListByResourceGroupPager
- ScheduledQueryRulesClient.NewListBySubscriptionPager
- ScheduledQueryRulesClient.Update
- TenantActionGroupsClient.CreateOrUpdate
- TenantActionGroupsClient.Delete
- TenantActionGroupsClient.Get
- TenantActionGroupsClient.NewListByManagementGroupIDPager
- TenantActionGroupsClient.Update
- TenantActivityLogsClient.NewListPager (GetTenantActivityLogsWithFilter)
- TenantActivityLogsClient.NewListPager (GetTenantActivityLogsWithFilterAndSelect)
- TenantActivityLogsClient.NewListPager (GetTenantActivityLogsWithSelect)
- TenantActivityLogsClient.NewListPager (GetTenantActivityLogsWithoutFilterOrSelect)
- VMInsightsClient.GetOnboardingStatus (GetStatusForAResourceGroupThatHasAtLeastOneVmThatIsActivelyReportingData)
- VMInsightsClient.GetOnboardingStatus (GetStatusForASubscriptionThatHasAtLeastOneVmThatIsActivelyReportingData)
- VMInsightsClient.GetOnboardingStatus (GetStatusForAVmScaleSetThatIsActivelyReportingData)
- VMInsightsClient.GetOnboardingStatus (GetStatusForAVmThatHasNotYetReportedData)
- VMInsightsClient.GetOnboardingStatus (GetStatusForAVmThatIsActivelyReportingData)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccessMode ¶ added in v0.8.0
type AccessMode string
AccessMode - Access mode types.
const ( AccessModeOpen AccessMode = "Open" AccessModePrivateOnly AccessMode = "PrivateOnly" )
func PossibleAccessModeValues ¶ added in v0.8.0
func PossibleAccessModeValues() []AccessMode
PossibleAccessModeValues returns the possible values for the AccessMode const type.
type AccessModeSettings ¶ added in v0.8.0
type AccessModeSettings struct { // REQUIRED; Specifies the default access mode of ingestion through associated private endpoints in scope. If not specified // default value is 'Open'. You can override this default setting for a specific private // endpoint connection by adding an exclusion in the 'exclusions' array. IngestionAccessMode *AccessMode // REQUIRED; Specifies the default access mode of queries through associated private endpoints in scope. If not specified // default value is 'Open'. You can override this default setting for a specific private // endpoint connection by adding an exclusion in the 'exclusions' array. QueryAccessMode *AccessMode // List of exclusions that override the default access mode settings for specific private endpoint connections. Exclusions []*AccessModeSettingsExclusion }
AccessModeSettings - Properties that define the scope private link mode settings.
func (AccessModeSettings) MarshalJSON ¶ added in v0.8.0
func (a AccessModeSettings) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type AccessModeSettings.
func (*AccessModeSettings) UnmarshalJSON ¶ added in v0.8.0
func (a *AccessModeSettings) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type AccessModeSettings.
type AccessModeSettingsExclusion ¶ added in v0.8.0
type AccessModeSettingsExclusion struct { // Specifies the access mode of ingestion through the specified private endpoint connection in the exclusion. IngestionAccessMode *AccessMode // The private endpoint connection name associated to the private endpoint on which we want to apply the specific access mode // settings. PrivateEndpointConnectionName *string // Specifies the access mode of queries through the specified private endpoint connection in the exclusion. QueryAccessMode *AccessMode }
AccessModeSettingsExclusion - Properties that define the scope private link mode settings exclusion item. This setting applies to a specific private endpoint connection and overrides the default settings for that private endpoint connection.
func (AccessModeSettingsExclusion) MarshalJSON ¶ added in v0.8.0
func (a AccessModeSettingsExclusion) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type AccessModeSettingsExclusion.
func (*AccessModeSettingsExclusion) UnmarshalJSON ¶ added in v0.8.0
func (a *AccessModeSettingsExclusion) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type AccessModeSettingsExclusion.
type ActionDetail ¶ added in v0.3.0
type ActionDetail struct { // The detail of the friendly error message Detail *string // The mechanism type MechanismType *string // The name of the action Name *string // The send time SendTime *string // The status of the action Status *string // The substatus of the action SubState *string }
ActionDetail - The action detail
func (ActionDetail) MarshalJSON ¶ added in v0.8.0
func (a ActionDetail) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ActionDetail.
func (*ActionDetail) UnmarshalJSON ¶ added in v0.8.0
func (a *ActionDetail) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ActionDetail.
type ActionGroup ¶
type ActionGroup struct { // REQUIRED; Indicates whether this action group is enabled. If an action group is not enabled, then none of its receivers // will receive communications. Enabled *bool // REQUIRED; The short name of the action group. This will be used in SMS messages. GroupShortName *string // The list of ARM role receivers that are part of this action group. Roles are Azure RBAC roles and only built-in roles are // supported. ArmRoleReceivers []*ArmRoleReceiver // The list of AutomationRunbook receivers that are part of this action group. AutomationRunbookReceivers []*AutomationRunbookReceiver // The list of AzureAppPush receivers that are part of this action group. AzureAppPushReceivers []*AzureAppPushReceiver // The list of azure function receivers that are part of this action group. AzureFunctionReceivers []*AzureFunctionReceiver // The list of email receivers that are part of this action group. EmailReceivers []*EmailReceiver // The list of event hub receivers that are part of this action group. EventHubReceivers []*EventHubReceiver // The list of ITSM receivers that are part of this action group. ItsmReceivers []*ItsmReceiver // The list of logic app receivers that are part of this action group. LogicAppReceivers []*LogicAppReceiver // The list of SMS receivers that are part of this action group. SmsReceivers []*SmsReceiver // The list of voice receivers that are part of this action group. VoiceReceivers []*VoiceReceiver // The list of webhook receivers that are part of this action group. WebhookReceivers []*WebhookReceiver }
ActionGroup - An Azure action group.
func (ActionGroup) MarshalJSON ¶
func (a ActionGroup) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ActionGroup.
func (*ActionGroup) UnmarshalJSON ¶ added in v0.8.0
func (a *ActionGroup) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ActionGroup.
type ActionGroupAutoGenerated ¶ added in v0.4.0
type ActionGroupAutoGenerated struct { // REQUIRED; The resource ID of the Action Group. This cannot be null or empty. ActionGroupID *string // the dictionary of custom properties to include with the post operation. These data are appended to the webhook payload. WebhookProperties map[string]*string }
ActionGroupAutoGenerated - A pointer to an Azure Action Group.
func (ActionGroupAutoGenerated) MarshalJSON ¶ added in v0.4.0
func (a ActionGroupAutoGenerated) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ActionGroupAutoGenerated.
func (*ActionGroupAutoGenerated) UnmarshalJSON ¶ added in v0.8.0
func (a *ActionGroupAutoGenerated) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ActionGroupAutoGenerated.
type ActionGroupList ¶
type ActionGroupList struct { // Provides the link to retrieve the next set of elements. NextLink *string // The list of action groups. Value []*ActionGroupResource }
ActionGroupList - A list of action groups.
func (ActionGroupList) MarshalJSON ¶
func (a ActionGroupList) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ActionGroupList.
func (*ActionGroupList) UnmarshalJSON ¶ added in v0.8.0
func (a *ActionGroupList) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ActionGroupList.
type ActionGroupPatch ¶
type ActionGroupPatch struct { // Indicates whether this action group is enabled. If an action group is not enabled, then none of its actions will be activated. Enabled *bool }
ActionGroupPatch - An Azure action group for patch operations.
func (ActionGroupPatch) MarshalJSON ¶ added in v0.8.0
func (a ActionGroupPatch) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ActionGroupPatch.
func (*ActionGroupPatch) UnmarshalJSON ¶ added in v0.8.0
func (a *ActionGroupPatch) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ActionGroupPatch.
type ActionGroupPatchAutoGenerated ¶ added in v0.9.0
type ActionGroupPatchAutoGenerated struct { // Indicates whether this tenant action group is enabled. If a tenant action group is not enabled, then none of its actions // will be activated. Enabled *bool }
ActionGroupPatchAutoGenerated - A tenant action group for patch operations.
func (ActionGroupPatchAutoGenerated) MarshalJSON ¶ added in v0.9.0
func (a ActionGroupPatchAutoGenerated) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ActionGroupPatchAutoGenerated.
func (*ActionGroupPatchAutoGenerated) UnmarshalJSON ¶ added in v0.9.0
func (a *ActionGroupPatchAutoGenerated) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ActionGroupPatchAutoGenerated.
type ActionGroupPatchBody ¶
type ActionGroupPatchBody struct { // The action group settings for an update operation. Properties *ActionGroupPatch // Resource tags Tags map[string]*string }
ActionGroupPatchBody - An action group object for the body of patch operations.
func (ActionGroupPatchBody) MarshalJSON ¶
func (a ActionGroupPatchBody) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ActionGroupPatchBody.
func (*ActionGroupPatchBody) UnmarshalJSON ¶ added in v0.8.0
func (a *ActionGroupPatchBody) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ActionGroupPatchBody.
type ActionGroupPatchBodyAutoGenerated ¶ added in v0.9.0
type ActionGroupPatchBodyAutoGenerated struct { // The action group settings for an update operation. Properties *ActionGroupPatchAutoGenerated // Resource tags Tags map[string]*string }
ActionGroupPatchBodyAutoGenerated - A tenant action group object for the body of patch operations.
func (ActionGroupPatchBodyAutoGenerated) MarshalJSON ¶ added in v0.9.0
func (a ActionGroupPatchBodyAutoGenerated) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ActionGroupPatchBodyAutoGenerated.
func (*ActionGroupPatchBodyAutoGenerated) UnmarshalJSON ¶ added in v0.9.0
func (a *ActionGroupPatchBodyAutoGenerated) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ActionGroupPatchBodyAutoGenerated.
type ActionGroupResource ¶
type ActionGroupResource struct { // REQUIRED; Resource location Location *string // The action groups properties of the resource. Properties *ActionGroup // Resource tags Tags map[string]*string // READ-ONLY; Azure resource Id ID *string // READ-ONLY; Azure resource name Name *string // READ-ONLY; Azure resource type Type *string }
ActionGroupResource - An action group resource.
func (ActionGroupResource) MarshalJSON ¶
func (a ActionGroupResource) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ActionGroupResource.
func (*ActionGroupResource) UnmarshalJSON ¶ added in v0.8.0
func (a *ActionGroupResource) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ActionGroupResource.
type ActionGroupsClient ¶
type ActionGroupsClient struct {
// contains filtered or unexported fields
}
ActionGroupsClient contains the methods for the ActionGroups group. Don't use this type directly, use NewActionGroupsClient() instead.
func NewActionGroupsClient ¶
func NewActionGroupsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ActionGroupsClient, error)
NewActionGroupsClient creates a new instance of ActionGroupsClient with the specified values.
- subscriptionID - The ID of the target subscription.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - pass nil to accept the default values.
func (*ActionGroupsClient) BeginCreateNotificationsAtActionGroupResourceLevel ¶ added in v0.7.0
func (client *ActionGroupsClient) BeginCreateNotificationsAtActionGroupResourceLevel(ctx context.Context, resourceGroupName string, actionGroupName string, notificationRequest NotificationRequestBody, options *ActionGroupsClientBeginCreateNotificationsAtActionGroupResourceLevelOptions) (*runtime.Poller[ActionGroupsClientCreateNotificationsAtActionGroupResourceLevelResponse], error)
BeginCreateNotificationsAtActionGroupResourceLevel - Send test notifications to a set of provided receivers If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2023-01-01
- resourceGroupName - The name of the resource group. The name is case insensitive.
- actionGroupName - The name of the action group.
- notificationRequest - The notification request body which includes the contact details
- options - ActionGroupsClientBeginCreateNotificationsAtActionGroupResourceLevelOptions contains the optional parameters for the ActionGroupsClient.BeginCreateNotificationsAtActionGroupResourceLevel method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Insights/stable/2023-01-01/examples/postTestNotificationsAtActionGroupResourceLevel.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewActionGroupsClient().BeginCreateNotificationsAtActionGroupResourceLevel(ctx, "TestRgName", "TestAgName", armmonitor.NotificationRequestBody{ AlertType: to.Ptr("budget"), ArmRoleReceivers: []*armmonitor.ArmRoleReceiver{ { Name: to.Ptr("ArmRole-Common"), RoleID: to.Ptr("11111111-1111-1111-1111-111111111111"), UseCommonAlertSchema: to.Ptr(true), }, { Name: to.Ptr("ArmRole-nonCommon"), RoleID: to.Ptr("11111111-1111-1111-1111-111111111111"), UseCommonAlertSchema: to.Ptr(false), }}, AutomationRunbookReceivers: []*armmonitor.AutomationRunbookReceiver{ { Name: to.Ptr("testRunbook"), AutomationAccountID: to.Ptr("/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/runbookTest/providers/Microsoft.Automation/automationAccounts/runbooktest"), IsGlobalRunbook: to.Ptr(false), RunbookName: to.Ptr("Sample runbook"), ServiceURI: to.Ptr("http://test.me"), UseCommonAlertSchema: to.Ptr(true), WebhookResourceID: to.Ptr("/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/runbookTest/providers/Microsoft.Automation/automationAccounts/runbooktest/webhooks/Alert1510184037084"), }}, AzureAppPushReceivers: []*armmonitor.AzureAppPushReceiver{ { Name: to.Ptr("Sample azureAppPush"), EmailAddress: to.Ptr("johndoe@email.com"), }}, AzureFunctionReceivers: []*armmonitor.AzureFunctionReceiver{ { Name: to.Ptr("Sample azureFunction"), FunctionAppResourceID: to.Ptr("/subscriptions/5def922a-3ed4-49c1-b9fd-05ec533819a3/resourceGroups/aznsTest/providers/Microsoft.Web/sites/testFunctionApp"), FunctionName: to.Ptr("HttpTriggerCSharp1"), HTTPTriggerURL: to.Ptr("http://test.me"), UseCommonAlertSchema: to.Ptr(true), }}, EmailReceivers: []*armmonitor.EmailReceiver{ { Name: to.Ptr("John Doe's email"), EmailAddress: to.Ptr("johndoe@email.com"), UseCommonAlertSchema: to.Ptr(false), }, { Name: to.Ptr("Jane Smith's email"), EmailAddress: to.Ptr("janesmith@email.com"), UseCommonAlertSchema: to.Ptr(true), }}, EventHubReceivers: []*armmonitor.EventHubReceiver{ { Name: to.Ptr("Sample eventHub"), EventHubName: to.Ptr("testEventHub"), EventHubNameSpace: to.Ptr("testEventHubNameSpace"), SubscriptionID: to.Ptr("187f412d-1758-44d9-b052-169e2564721d"), TenantID: to.Ptr("68a4459a-ccb8-493c-b9da-dd30457d1b84"), }}, ItsmReceivers: []*armmonitor.ItsmReceiver{ { Name: to.Ptr("Sample itsm"), ConnectionID: to.Ptr("a3b9076c-ce8e-434e-85b4-aff10cb3c8f1"), Region: to.Ptr("westcentralus"), TicketConfiguration: to.Ptr("{\"PayloadRevision\":0,\"WorkItemType\":\"Incident\",\"UseTemplate\":false,\"WorkItemData\":\"{}\",\"CreateOneWIPerCI\":false}"), WorkspaceID: to.Ptr("5def922a-3ed4-49c1-b9fd-05ec533819a3|55dfd1f8-7e59-4f89-bf56-4c82f5ace23c"), }}, LogicAppReceivers: []*armmonitor.LogicAppReceiver{ { Name: to.Ptr("Sample logicApp"), CallbackURL: to.Ptr("https://prod-27.northcentralus.logic.azure.com/workflows/68e572e818e5457ba898763b7db90877/triggers/manual/paths/invoke/azns/test?api-version=2016-10-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=Abpsb72UYJxPPvmDo937uzofupO5r_vIeWEx7KVHo7w"), ResourceID: to.Ptr("/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/LogicApp/providers/Microsoft.Logic/workflows/testLogicApp"), UseCommonAlertSchema: to.Ptr(false), }}, SmsReceivers: []*armmonitor.SmsReceiver{ { Name: to.Ptr("John Doe's mobile"), CountryCode: to.Ptr("1"), PhoneNumber: to.Ptr("1234567890"), }, { Name: to.Ptr("Jane Smith's mobile"), CountryCode: to.Ptr("1"), PhoneNumber: to.Ptr("0987654321"), }}, VoiceReceivers: []*armmonitor.VoiceReceiver{ { Name: to.Ptr("Sample voice"), CountryCode: to.Ptr("1"), PhoneNumber: to.Ptr("1234567890"), }}, WebhookReceivers: []*armmonitor.WebhookReceiver{ { Name: to.Ptr("Sample webhook 1"), ServiceURI: to.Ptr("http://www.example.com/webhook1"), UseCommonAlertSchema: to.Ptr(true), }, { Name: to.Ptr("Sample webhook 2"), IdentifierURI: to.Ptr("http://someidentifier/d7811ba3-7996-4a93-99b6-6b2f3f355f8a"), ObjectID: to.Ptr("d3bb868c-fe44-452c-aa26-769a6538c808"), ServiceURI: to.Ptr("http://www.example.com/webhook2"), TenantID: to.Ptr("68a4459a-ccb8-493c-b9da-dd30457d1b84"), UseAADAuth: to.Ptr(true), UseCommonAlertSchema: to.Ptr(true), }}, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %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.TestNotificationDetailsResponse = armmonitor.TestNotificationDetailsResponse{ // ActionDetails: []*armmonitor.ActionDetail{ // { // MechanismType: to.Ptr("AzureAppPush"), // Name: to.Ptr("AzureAppPush-name"), // SendTime: to.Ptr("2021-09-21T04:52:42.8620629+00:00"), // Status: to.Ptr("Completed"), // SubState: to.Ptr("Default"), // }, // { // MechanismType: to.Ptr("AzureFunction"), // Name: to.Ptr("AzureFunction-name"), // SendTime: to.Ptr("2021-09-21T04:52:42.0623319+00:00"), // Status: to.Ptr("Completed"), // SubState: to.Ptr("Default"), // }, // { // MechanismType: to.Ptr("Email"), // Name: to.Ptr("Email-name"), // SendTime: to.Ptr("2021-09-21T04:52:40.7480368+00:00"), // Status: to.Ptr("Completed"), // SubState: to.Ptr("Default"), // }, // { // MechanismType: to.Ptr("LogicApp"), // Name: to.Ptr("LogicApp-Name"), // SendTime: to.Ptr("2021-09-21T04:52:42.2473419+00:00"), // Status: to.Ptr("Completed"), // SubState: to.Ptr("Default"), // }, // { // MechanismType: to.Ptr("Webhook"), // Name: to.Ptr("Webhook-name"), // SendTime: to.Ptr("2021-09-21T04:52:42.0723479+00:00"), // Status: to.Ptr("Completed"), // SubState: to.Ptr("Default"), // }, // { // MechanismType: to.Ptr("SecureWebhook"), // Name: to.Ptr("SecureWebhook-name"), // SendTime: to.Ptr("2021-09-21T04:52:42.0723479+00:00"), // Status: to.Ptr("Completed"), // SubState: to.Ptr("Default"), // }, // { // MechanismType: to.Ptr("Sms"), // Name: to.Ptr("Sms-name"), // SendTime: to.Ptr("2021-09-21T04:52:41.353015+00:00"), // Status: to.Ptr("Completed"), // SubState: to.Ptr("Default"), // }, // { // MechanismType: to.Ptr("Voice"), // Name: to.Ptr("Voice-name"), // SendTime: to.Ptr("2021-09-21T04:52:41.6330734+00:00"), // Status: to.Ptr("Completed"), // SubState: to.Ptr("Default"), // }, // { // MechanismType: to.Ptr("EventHub"), // Name: to.Ptr("EventHub-name"), // SendTime: to.Ptr("2021-09-21T04:52:42.0723479+00:00"), // Status: to.Ptr("Completed"), // SubState: to.Ptr("Default"), // }, // { // MechanismType: to.Ptr("AutomationRunbook"), // Name: to.Ptr("AutomationRunbook-name"), // SendTime: to.Ptr("2021-09-21T04:52:42.0723479+00:00"), // Status: to.Ptr("Completed"), // SubState: to.Ptr("Default"), // }, // { // MechanismType: to.Ptr("Itsm"), // Name: to.Ptr("Itsm-name"), // SendTime: to.Ptr("2021-09-21T04:52:42.0723479+00:00"), // Status: to.Ptr("Completed"), // SubState: to.Ptr("Default"), // }}, // CompletedTime: to.Ptr("0001-01-01T00:00:00+00:00"), // Context: &armmonitor.Context{ // ContextType: to.Ptr("Microsoft.Insights/Budget"), // NotificationSource: to.Ptr("Microsoft.Insights/TestNotification"), // }, // CreatedTime: to.Ptr("2021-09-21T04:52:29.5091168+00:00"), // State: to.Ptr("Completed"), // } }
Output:
func (*ActionGroupsClient) CreateOrUpdate ¶
func (client *ActionGroupsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, actionGroupName string, actionGroup ActionGroupResource, options *ActionGroupsClientCreateOrUpdateOptions) (ActionGroupsClientCreateOrUpdateResponse, error)
CreateOrUpdate - Create a new action group or update an existing one. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2023-01-01
- resourceGroupName - The name of the resource group. The name is case insensitive.
- actionGroupName - The name of the action group.
- actionGroup - The action group to create or use for the update.
- options - ActionGroupsClientCreateOrUpdateOptions contains the optional parameters for the ActionGroupsClient.CreateOrUpdate method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Insights/stable/2023-01-01/examples/createOrUpdateActionGroup.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewActionGroupsClient().CreateOrUpdate(ctx, "Default-NotificationRules", "SampleActionGroup", armmonitor.ActionGroupResource{ Location: to.Ptr("Global"), Tags: map[string]*string{}, Properties: &armmonitor.ActionGroup{ ArmRoleReceivers: []*armmonitor.ArmRoleReceiver{ { Name: to.Ptr("Sample armRole"), RoleID: to.Ptr("8e3af657-a8ff-443c-a75c-2fe8c4bcb635"), UseCommonAlertSchema: to.Ptr(true), }}, AutomationRunbookReceivers: []*armmonitor.AutomationRunbookReceiver{ { Name: to.Ptr("testRunbook"), AutomationAccountID: to.Ptr("/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/runbookTest/providers/Microsoft.Automation/automationAccounts/runbooktest"), IsGlobalRunbook: to.Ptr(false), RunbookName: to.Ptr("Sample runbook"), ServiceURI: to.Ptr("<serviceUri>"), UseCommonAlertSchema: to.Ptr(true), WebhookResourceID: to.Ptr("/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/runbookTest/providers/Microsoft.Automation/automationAccounts/runbooktest/webhooks/Alert1510184037084"), }}, AzureAppPushReceivers: []*armmonitor.AzureAppPushReceiver{ { Name: to.Ptr("Sample azureAppPush"), EmailAddress: to.Ptr("johndoe@email.com"), }}, AzureFunctionReceivers: []*armmonitor.AzureFunctionReceiver{ { Name: to.Ptr("Sample azureFunction"), FunctionAppResourceID: to.Ptr("/subscriptions/5def922a-3ed4-49c1-b9fd-05ec533819a3/resourceGroups/aznsTest/providers/Microsoft.Web/sites/testFunctionApp"), FunctionName: to.Ptr("HttpTriggerCSharp1"), HTTPTriggerURL: to.Ptr("http://test.me"), UseCommonAlertSchema: to.Ptr(true), }}, EmailReceivers: []*armmonitor.EmailReceiver{ { Name: to.Ptr("John Doe's email"), EmailAddress: to.Ptr("johndoe@email.com"), UseCommonAlertSchema: to.Ptr(false), }, { Name: to.Ptr("Jane Smith's email"), EmailAddress: to.Ptr("janesmith@email.com"), UseCommonAlertSchema: to.Ptr(true), }}, Enabled: to.Ptr(true), EventHubReceivers: []*armmonitor.EventHubReceiver{ { Name: to.Ptr("Sample eventHub"), EventHubName: to.Ptr("testEventHub"), EventHubNameSpace: to.Ptr("testEventHubNameSpace"), SubscriptionID: to.Ptr("187f412d-1758-44d9-b052-169e2564721d"), TenantID: to.Ptr("68a4459a-ccb8-493c-b9da-dd30457d1b84"), }}, GroupShortName: to.Ptr("sample"), ItsmReceivers: []*armmonitor.ItsmReceiver{ { Name: to.Ptr("Sample itsm"), ConnectionID: to.Ptr("a3b9076c-ce8e-434e-85b4-aff10cb3c8f1"), Region: to.Ptr("westcentralus"), TicketConfiguration: to.Ptr("{\"PayloadRevision\":0,\"WorkItemType\":\"Incident\",\"UseTemplate\":false,\"WorkItemData\":\"{}\",\"CreateOneWIPerCI\":false}"), WorkspaceID: to.Ptr("5def922a-3ed4-49c1-b9fd-05ec533819a3|55dfd1f8-7e59-4f89-bf56-4c82f5ace23c"), }}, LogicAppReceivers: []*armmonitor.LogicAppReceiver{ { Name: to.Ptr("Sample logicApp"), CallbackURL: to.Ptr("https://prod-27.northcentralus.logic.azure.com/workflows/68e572e818e5457ba898763b7db90877/triggers/manual/paths/invoke/azns/test?api-version=2016-10-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=Abpsb72UYJxPPvmDo937uzofupO5r_vIeWEx7KVHo7w"), ResourceID: to.Ptr("/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/LogicApp/providers/Microsoft.Logic/workflows/testLogicApp"), UseCommonAlertSchema: to.Ptr(false), }}, SmsReceivers: []*armmonitor.SmsReceiver{ { Name: to.Ptr("John Doe's mobile"), CountryCode: to.Ptr("1"), PhoneNumber: to.Ptr("1234567890"), }, { Name: to.Ptr("Jane Smith's mobile"), CountryCode: to.Ptr("1"), PhoneNumber: to.Ptr("0987654321"), }}, VoiceReceivers: []*armmonitor.VoiceReceiver{ { Name: to.Ptr("Sample voice"), CountryCode: to.Ptr("1"), PhoneNumber: to.Ptr("1234567890"), }}, WebhookReceivers: []*armmonitor.WebhookReceiver{ { Name: to.Ptr("Sample webhook 1"), ServiceURI: to.Ptr("http://www.example.com/webhook1"), UseCommonAlertSchema: to.Ptr(true), }, { Name: to.Ptr("Sample webhook 2"), IdentifierURI: to.Ptr("http://someidentifier/d7811ba3-7996-4a93-99b6-6b2f3f355f8a"), ObjectID: to.Ptr("d3bb868c-fe44-452c-aa26-769a6538c808"), ServiceURI: to.Ptr("http://www.example.com/webhook2"), TenantID: to.Ptr("68a4459a-ccb8-493c-b9da-dd30457d1b84"), UseAADAuth: to.Ptr(true), UseCommonAlertSchema: to.Ptr(true), }}, }, }, 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.ActionGroupResource = armmonitor.ActionGroupResource{ // Name: to.Ptr("SampleActionGroup"), // Type: to.Ptr("Microsoft.Insights/ActionGroups"), // ID: to.Ptr("/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/Default-NotificationRules/providers/microsoft.insights/actionGroups/SampleActionGroup"), // Location: to.Ptr("Global"), // Tags: map[string]*string{ // }, // Properties: &armmonitor.ActionGroup{ // ArmRoleReceivers: []*armmonitor.ArmRoleReceiver{ // { // Name: to.Ptr("Sample armRole"), // RoleID: to.Ptr("8e3af657-a8ff-443c-a75c-2fe8c4bcb635"), // UseCommonAlertSchema: to.Ptr(true), // }}, // AutomationRunbookReceivers: []*armmonitor.AutomationRunbookReceiver{ // { // Name: to.Ptr("testRunbook"), // AutomationAccountID: to.Ptr("/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/runbookTest/providers/Microsoft.Automation/automationAccounts/runbooktest"), // IsGlobalRunbook: to.Ptr(false), // RunbookName: to.Ptr("Sample runbook"), // ServiceURI: to.Ptr("<serviceUri>"), // UseCommonAlertSchema: to.Ptr(true), // WebhookResourceID: to.Ptr("/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/runbookTest/providers/Microsoft.Automation/automationAccounts/runbooktest/webhooks/Alert1510184037084"), // }}, // AzureAppPushReceivers: []*armmonitor.AzureAppPushReceiver{ // { // Name: to.Ptr("Sample azureAppPush"), // EmailAddress: to.Ptr("johndoe@email.com"), // }}, // AzureFunctionReceivers: []*armmonitor.AzureFunctionReceiver{ // { // Name: to.Ptr("Sample azureFunction"), // FunctionAppResourceID: to.Ptr("/subscriptions/5def922a-3ed4-49c1-b9fd-05ec533819a3/resourceGroups/aznsTest/providers/Microsoft.Web/sites/testFunctionApp"), // FunctionName: to.Ptr("HttpTriggerCSharp1"), // HTTPTriggerURL: to.Ptr("<httpTriggerUrl>"), // UseCommonAlertSchema: to.Ptr(true), // }}, // EmailReceivers: []*armmonitor.EmailReceiver{ // { // Name: to.Ptr("John Doe's email"), // EmailAddress: to.Ptr("johndoe@email.com"), // Status: to.Ptr(armmonitor.ReceiverStatusEnabled), // UseCommonAlertSchema: to.Ptr(false), // }, // { // Name: to.Ptr("Jane Smith's email"), // EmailAddress: to.Ptr("janesmith@email.com"), // Status: to.Ptr(armmonitor.ReceiverStatusEnabled), // UseCommonAlertSchema: to.Ptr(true), // }}, // Enabled: to.Ptr(true), // EventHubReceivers: []*armmonitor.EventHubReceiver{ // { // Name: to.Ptr("Sample eventHub"), // EventHubName: to.Ptr("testEventHub"), // EventHubNameSpace: to.Ptr("testEventHubNameSpace"), // SubscriptionID: to.Ptr("187f412d-1758-44d9-b052-169e2564721d"), // TenantID: to.Ptr("68a4459a-ccb8-493c-b9da-dd30457d1b84"), // UseCommonAlertSchema: to.Ptr(false), // }}, // GroupShortName: to.Ptr("sample"), // ItsmReceivers: []*armmonitor.ItsmReceiver{ // { // Name: to.Ptr("Sample itsm"), // ConnectionID: to.Ptr("a3b9076c-ce8e-434e-85b4-aff10cb3c8f1"), // Region: to.Ptr("westcentralus"), // TicketConfiguration: to.Ptr("{\"PayloadRevision\":0,\"WorkItemType\":\"Incident\",\"UseTemplate\":false,\"WorkItemData\":\"{}\",\"CreateOneWIPerCI\":false}"), // WorkspaceID: to.Ptr("5def922a-3ed4-49c1-b9fd-05ec533819a3|55dfd1f8-7e59-4f89-bf56-4c82f5ace23c"), // }}, // LogicAppReceivers: []*armmonitor.LogicAppReceiver{ // { // Name: to.Ptr("Sample logicApp"), // CallbackURL: to.Ptr("https://prod-27.northcentralus.logic.azure.com/workflows/68e572e818e5457ba898763b7db90877/triggers/manual/paths/invoke/azns/test?api-version=2016-10-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=Abpsb72UYJxPPvmDo937uzofupO5r_vIeWEx7KVHo7w"), // ResourceID: to.Ptr("/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/LogicApp/providers/Microsoft.Logic/workflows/testLogicApp"), // UseCommonAlertSchema: to.Ptr(false), // }}, // SmsReceivers: []*armmonitor.SmsReceiver{ // { // Name: to.Ptr("John Doe's mobile"), // CountryCode: to.Ptr("1"), // PhoneNumber: to.Ptr("1234567890"), // Status: to.Ptr(armmonitor.ReceiverStatusEnabled), // }, // { // Name: to.Ptr("Jane Smith's mobile"), // CountryCode: to.Ptr("1"), // PhoneNumber: to.Ptr("0987654321"), // Status: to.Ptr(armmonitor.ReceiverStatusEnabled), // }}, // VoiceReceivers: []*armmonitor.VoiceReceiver{ // { // Name: to.Ptr("Sample voice"), // CountryCode: to.Ptr("1"), // PhoneNumber: to.Ptr("1234567890"), // }}, // WebhookReceivers: []*armmonitor.WebhookReceiver{ // { // Name: to.Ptr("Sample webhook 1"), // ServiceURI: to.Ptr("http://www.example.com/webhook1"), // UseCommonAlertSchema: to.Ptr(true), // }, // { // Name: to.Ptr("Sample webhook 2"), // IdentifierURI: to.Ptr("http://someidentifier/d7811ba3-7996-4a93-99b6-6b2f3f355f8a"), // ObjectID: to.Ptr("d3bb868c-fe44-452c-aa26-769a6538c808"), // ServiceURI: to.Ptr("http://www.example.com/webhook2"), // TenantID: to.Ptr("68a4459a-ccb8-493c-b9da-dd30457d1b84"), // UseAADAuth: to.Ptr(true), // UseCommonAlertSchema: to.Ptr(true), // }}, // }, // } }
Output:
func (*ActionGroupsClient) Delete ¶
func (client *ActionGroupsClient) Delete(ctx context.Context, resourceGroupName string, actionGroupName string, options *ActionGroupsClientDeleteOptions) (ActionGroupsClientDeleteResponse, error)
Delete - Delete an action group. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2023-01-01
- resourceGroupName - The name of the resource group. The name is case insensitive.
- actionGroupName - The name of the action group.
- options - ActionGroupsClientDeleteOptions contains the optional parameters for the ActionGroupsClient.Delete method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Insights/stable/2023-01-01/examples/deleteActionGroup.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } _, err = clientFactory.NewActionGroupsClient().Delete(ctx, "Default-NotificationRules", "SampleActionGroup", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } }
Output:
func (*ActionGroupsClient) EnableReceiver ¶
func (client *ActionGroupsClient) EnableReceiver(ctx context.Context, resourceGroupName string, actionGroupName string, enableRequest EnableRequest, options *ActionGroupsClientEnableReceiverOptions) (ActionGroupsClientEnableReceiverResponse, error)
EnableReceiver - Enable a receiver in an action group. This changes the receiver's status from Disabled to Enabled. This operation is only supported for Email or SMS receivers. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2023-01-01
- resourceGroupName - The name of the resource group. The name is case insensitive.
- actionGroupName - The name of the action group.
- enableRequest - The receiver to re-enable.
- options - ActionGroupsClientEnableReceiverOptions contains the optional parameters for the ActionGroupsClient.EnableReceiver method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Insights/stable/2023-01-01/examples/enableReceiver.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } _, err = clientFactory.NewActionGroupsClient().EnableReceiver(ctx, "Default-NotificationRules", "SampleActionGroup", armmonitor.EnableRequest{ ReceiverName: to.Ptr("John Doe's mobile"), }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } }
Output:
func (*ActionGroupsClient) Get ¶
func (client *ActionGroupsClient) Get(ctx context.Context, resourceGroupName string, actionGroupName string, options *ActionGroupsClientGetOptions) (ActionGroupsClientGetResponse, error)
Get - Get an action group. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2023-01-01
- resourceGroupName - The name of the resource group. The name is case insensitive.
- actionGroupName - The name of the action group.
- options - ActionGroupsClientGetOptions contains the optional parameters for the ActionGroupsClient.Get method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Insights/stable/2023-01-01/examples/getActionGroup.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewActionGroupsClient().Get(ctx, "Default-NotificationRules", "SampleActionGroup", 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.ActionGroupResource = armmonitor.ActionGroupResource{ // Name: to.Ptr("SampleActionGroup"), // Type: to.Ptr("Microsoft.Insights/ActionGroups"), // ID: to.Ptr("/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/Default-NotificationRules/providers/microsoft.insights/actionGroups/SampleActionGroup"), // Location: to.Ptr("Global"), // Tags: map[string]*string{ // }, // Properties: &armmonitor.ActionGroup{ // ArmRoleReceivers: []*armmonitor.ArmRoleReceiver{ // }, // AutomationRunbookReceivers: []*armmonitor.AutomationRunbookReceiver{ // }, // AzureAppPushReceivers: []*armmonitor.AzureAppPushReceiver{ // }, // AzureFunctionReceivers: []*armmonitor.AzureFunctionReceiver{ // }, // EmailReceivers: []*armmonitor.EmailReceiver{ // { // Name: to.Ptr("John Doe's email"), // EmailAddress: to.Ptr("johndoe@email.com"), // Status: to.Ptr(armmonitor.ReceiverStatusEnabled), // UseCommonAlertSchema: to.Ptr(true), // }, // { // Name: to.Ptr("Jane Smith's email"), // EmailAddress: to.Ptr("janesmith@email.com"), // Status: to.Ptr(armmonitor.ReceiverStatusDisabled), // UseCommonAlertSchema: to.Ptr(true), // }}, // Enabled: to.Ptr(true), // EventHubReceivers: []*armmonitor.EventHubReceiver{ // }, // GroupShortName: to.Ptr("sample"), // ItsmReceivers: []*armmonitor.ItsmReceiver{ // }, // LogicAppReceivers: []*armmonitor.LogicAppReceiver{ // }, // SmsReceivers: []*armmonitor.SmsReceiver{ // { // Name: to.Ptr("John Doe's mobile"), // CountryCode: to.Ptr("1"), // PhoneNumber: to.Ptr("1234567890"), // Status: to.Ptr(armmonitor.ReceiverStatusDisabled), // }, // { // Name: to.Ptr("Jane Smith's mobile"), // CountryCode: to.Ptr("1"), // PhoneNumber: to.Ptr("0987654321"), // Status: to.Ptr(armmonitor.ReceiverStatusEnabled), // }}, // VoiceReceivers: []*armmonitor.VoiceReceiver{ // }, // WebhookReceivers: []*armmonitor.WebhookReceiver{ // { // Name: to.Ptr("Sample webhook"), // ServiceURI: to.Ptr("http://www.example.com/webhook"), // UseCommonAlertSchema: to.Ptr(false), // }, // { // Name: to.Ptr("Sample webhook 2"), // IdentifierURI: to.Ptr("http://someidentifier/d7811ba3-7996-4a93-99b6-6b2f3f355f8a"), // ObjectID: to.Ptr("d3bb868c-fe44-452c-aa26-769a6538c808"), // ServiceURI: to.Ptr("http://www.example.com/webhook2"), // TenantID: to.Ptr("68a4459a-ccb8-493c-b9da-dd30457d1b84"), // UseAADAuth: to.Ptr(true), // UseCommonAlertSchema: to.Ptr(true), // }}, // }, // } }
Output:
func (*ActionGroupsClient) GetTestNotificationsAtActionGroupResourceLevel ¶ added in v0.7.0
func (client *ActionGroupsClient) GetTestNotificationsAtActionGroupResourceLevel(ctx context.Context, resourceGroupName string, actionGroupName string, notificationID string, options *ActionGroupsClientGetTestNotificationsAtActionGroupResourceLevelOptions) (ActionGroupsClientGetTestNotificationsAtActionGroupResourceLevelResponse, error)
GetTestNotificationsAtActionGroupResourceLevel - Get the test notifications by the notification id If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2023-01-01
- resourceGroupName - The name of the resource group. The name is case insensitive.
- actionGroupName - The name of the action group.
- notificationID - The notification id
- options - ActionGroupsClientGetTestNotificationsAtActionGroupResourceLevelOptions contains the optional parameters for the ActionGroupsClient.GetTestNotificationsAtActionGroupResourceLevel method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Insights/stable/2023-01-01/examples/getTestNotificationsAtActionGroupResourceLevel.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewActionGroupsClient().GetTestNotificationsAtActionGroupResourceLevel(ctx, "TestRgName", "TestAgName", "11000222191287", 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.TestNotificationDetailsResponse = armmonitor.TestNotificationDetailsResponse{ // ActionDetails: []*armmonitor.ActionDetail{ // { // MechanismType: to.Ptr("AzureAppPush"), // Name: to.Ptr("AzureAppPush-name"), // SendTime: to.Ptr("2021-09-21T04:52:42.8620629+00:00"), // Status: to.Ptr("Completed"), // SubState: to.Ptr("Default"), // }, // { // MechanismType: to.Ptr("AzureFunction"), // Name: to.Ptr("AzureFunction-name"), // SendTime: to.Ptr("2021-09-21T04:52:42.0623319+00:00"), // Status: to.Ptr("Completed"), // SubState: to.Ptr("Default"), // }, // { // MechanismType: to.Ptr("Email"), // Name: to.Ptr("Email-name"), // SendTime: to.Ptr("2021-09-21T04:52:40.7480368+00:00"), // Status: to.Ptr("Completed"), // SubState: to.Ptr("Default"), // }, // { // MechanismType: to.Ptr("LogicApp"), // Name: to.Ptr("LogicApp-name"), // SendTime: to.Ptr("2021-09-21T04:52:42.2473419+00:00"), // Status: to.Ptr("Completed"), // SubState: to.Ptr("Default"), // }, // { // MechanismType: to.Ptr("Webhook"), // Name: to.Ptr("Webhook-name"), // SendTime: to.Ptr("2021-09-21T04:52:42.0723479+00:00"), // Status: to.Ptr("Completed"), // SubState: to.Ptr("Default"), // }, // { // MechanismType: to.Ptr("SecureWebhook"), // Name: to.Ptr("SecureWebhook-name"), // SendTime: to.Ptr("2021-09-21T04:52:42.0723479+00:00"), // Status: to.Ptr("Completed"), // SubState: to.Ptr("Default"), // }, // { // MechanismType: to.Ptr("Sms"), // Name: to.Ptr("Sms-name"), // SendTime: to.Ptr("2021-09-21T04:52:41.353015+00:00"), // Status: to.Ptr("Completed"), // SubState: to.Ptr("Default"), // }, // { // MechanismType: to.Ptr("Voice"), // Name: to.Ptr("Voice-name"), // SendTime: to.Ptr("2021-09-21T04:52:41.6330734+00:00"), // Status: to.Ptr("Completed"), // SubState: to.Ptr("Default"), // }, // { // MechanismType: to.Ptr("EventHub"), // Name: to.Ptr("EventHub-name"), // SendTime: to.Ptr("2021-09-21T04:52:42.0723479+00:00"), // Status: to.Ptr("Completed"), // SubState: to.Ptr("Default"), // }, // { // MechanismType: to.Ptr("AutomationRunbook"), // Name: to.Ptr("AutomationRunbook-name"), // SendTime: to.Ptr("2021-09-21T04:52:42.0723479+00:00"), // Status: to.Ptr("Completed"), // SubState: to.Ptr("Default"), // }, // { // MechanismType: to.Ptr("Itsm"), // Name: to.Ptr("Itsm-name"), // SendTime: to.Ptr("2021-09-21T04:52:42.0723479+00:00"), // Status: to.Ptr("Completed"), // SubState: to.Ptr("Default"), // }}, // CompletedTime: to.Ptr("0001-01-01T00:00:00+00:00"), // Context: &armmonitor.Context{ // ContextType: to.Ptr("Microsoft.Insights/Budget"), // NotificationSource: to.Ptr("Microsoft.Insights/TestNotification"), // }, // CreatedTime: to.Ptr("2021-09-21T04:52:29.5091168+00:00"), // State: to.Ptr("Completed"), // } }
Output:
func (*ActionGroupsClient) NewListByResourceGroupPager ¶ added in v0.6.0
func (client *ActionGroupsClient) NewListByResourceGroupPager(resourceGroupName string, options *ActionGroupsClientListByResourceGroupOptions) *runtime.Pager[ActionGroupsClientListByResourceGroupResponse]
NewListByResourceGroupPager - Get a list of all action groups in a resource group.
Generated from API version 2023-01-01
- resourceGroupName - The name of the resource group. The name is case insensitive.
- options - ActionGroupsClientListByResourceGroupOptions contains the optional parameters for the ActionGroupsClient.NewListByResourceGroupPager method.
func (*ActionGroupsClient) NewListBySubscriptionIDPager ¶ added in v0.6.0
func (client *ActionGroupsClient) NewListBySubscriptionIDPager(options *ActionGroupsClientListBySubscriptionIDOptions) *runtime.Pager[ActionGroupsClientListBySubscriptionIDResponse]
NewListBySubscriptionIDPager - Get a list of all action groups in a subscription.
Generated from API version 2023-01-01
- options - ActionGroupsClientListBySubscriptionIDOptions contains the optional parameters for the ActionGroupsClient.NewListBySubscriptionIDPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Insights/stable/2023-01-01/examples/listActionGroups.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewActionGroupsClient().NewListBySubscriptionIDPager(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.ActionGroupList = armmonitor.ActionGroupList{ // Value: []*armmonitor.ActionGroupResource{ // { // Name: to.Ptr("SampleActionGroup"), // Type: to.Ptr("Microsoft.Insights/ActionGroups"), // ID: to.Ptr("/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/Default-NotificationRules/providers/microsoft.insights/actionGroups/SampleActionGroup"), // Location: to.Ptr("Global"), // Tags: map[string]*string{ // }, // Properties: &armmonitor.ActionGroup{ // ArmRoleReceivers: []*armmonitor.ArmRoleReceiver{ // }, // AutomationRunbookReceivers: []*armmonitor.AutomationRunbookReceiver{ // }, // AzureAppPushReceivers: []*armmonitor.AzureAppPushReceiver{ // }, // AzureFunctionReceivers: []*armmonitor.AzureFunctionReceiver{ // }, // EmailReceivers: []*armmonitor.EmailReceiver{ // { // Name: to.Ptr("John Doe's email"), // EmailAddress: to.Ptr("johndoe@email.com"), // Status: to.Ptr(armmonitor.ReceiverStatusEnabled), // UseCommonAlertSchema: to.Ptr(true), // }, // { // Name: to.Ptr("Jane Smith's email"), // EmailAddress: to.Ptr("janesmith@email.com"), // Status: to.Ptr(armmonitor.ReceiverStatusDisabled), // UseCommonAlertSchema: to.Ptr(true), // }}, // Enabled: to.Ptr(true), // EventHubReceivers: []*armmonitor.EventHubReceiver{ // }, // GroupShortName: to.Ptr("sample"), // ItsmReceivers: []*armmonitor.ItsmReceiver{ // }, // LogicAppReceivers: []*armmonitor.LogicAppReceiver{ // }, // SmsReceivers: []*armmonitor.SmsReceiver{ // { // Name: to.Ptr("John Doe's mobile"), // CountryCode: to.Ptr("1"), // PhoneNumber: to.Ptr("1234567890"), // Status: to.Ptr(armmonitor.ReceiverStatusDisabled), // }, // { // Name: to.Ptr("Jane Smith's mobile"), // CountryCode: to.Ptr("1"), // PhoneNumber: to.Ptr("0987654321"), // Status: to.Ptr(armmonitor.ReceiverStatusEnabled), // }}, // VoiceReceivers: []*armmonitor.VoiceReceiver{ // }, // WebhookReceivers: []*armmonitor.WebhookReceiver{ // { // Name: to.Ptr("Sample webhook"), // ServiceURI: to.Ptr("http://www.example.com/webhook"), // UseCommonAlertSchema: to.Ptr(false), // }, // { // Name: to.Ptr("Sample webhook 2"), // IdentifierURI: to.Ptr("http://someidentifier/d7811ba3-7996-4a93-99b6-6b2f3f355f8a"), // ObjectID: to.Ptr("d3bb868c-fe44-452c-aa26-769a6538c808"), // ServiceURI: to.Ptr("http://www.example.com/webhook2"), // TenantID: to.Ptr("68a4459a-ccb8-493c-b9da-dd30457d1b84"), // UseAADAuth: to.Ptr(true), // UseCommonAlertSchema: to.Ptr(true), // }}, // }, // }, // { // Name: to.Ptr("SampleActionGroup2"), // Type: to.Ptr("Microsoft.Insights/ActionGroups"), // ID: to.Ptr("/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/Default-NotificationRules/providers/microsoft.insights/actionGroups/SampleActionGroup2"), // Location: to.Ptr("Global"), // Tags: map[string]*string{ // }, // Properties: &armmonitor.ActionGroup{ // ArmRoleReceivers: []*armmonitor.ArmRoleReceiver{ // }, // AutomationRunbookReceivers: []*armmonitor.AutomationRunbookReceiver{ // }, // AzureAppPushReceivers: []*armmonitor.AzureAppPushReceiver{ // }, // AzureFunctionReceivers: []*armmonitor.AzureFunctionReceiver{ // }, // EmailReceivers: []*armmonitor.EmailReceiver{ // { // Name: to.Ptr("John Doe's email"), // EmailAddress: to.Ptr("johndoe@email.com"), // Status: to.Ptr(armmonitor.ReceiverStatusEnabled), // UseCommonAlertSchema: to.Ptr(true), // }}, // Enabled: to.Ptr(false), // EventHubReceivers: []*armmonitor.EventHubReceiver{ // }, // GroupShortName: to.Ptr("sample2"), // ItsmReceivers: []*armmonitor.ItsmReceiver{ // }, // LogicAppReceivers: []*armmonitor.LogicAppReceiver{ // }, // SmsReceivers: []*armmonitor.SmsReceiver{ // { // Name: to.Ptr("Jane Smith's mobile"), // CountryCode: to.Ptr("1"), // PhoneNumber: to.Ptr("0987654321"), // Status: to.Ptr(armmonitor.ReceiverStatusEnabled), // }}, // VoiceReceivers: []*armmonitor.VoiceReceiver{ // }, // WebhookReceivers: []*armmonitor.WebhookReceiver{ // }, // }, // }}, // } } }
Output:
func (*ActionGroupsClient) Update ¶
func (client *ActionGroupsClient) Update(ctx context.Context, resourceGroupName string, actionGroupName string, actionGroupPatch ActionGroupPatchBody, options *ActionGroupsClientUpdateOptions) (ActionGroupsClientUpdateResponse, error)
Update - Updates an existing action group's tags. To update other fields use the CreateOrUpdate method. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2023-01-01
- resourceGroupName - The name of the resource group. The name is case insensitive.
- actionGroupName - The name of the action group.
- actionGroupPatch - Parameters supplied to the operation.
- options - ActionGroupsClientUpdateOptions contains the optional parameters for the ActionGroupsClient.Update method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Insights/stable/2023-01-01/examples/patchActionGroup.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewActionGroupsClient().Update(ctx, "Default-NotificationRules", "SampleActionGroup", armmonitor.ActionGroupPatchBody{ Properties: &armmonitor.ActionGroupPatch{ Enabled: to.Ptr(false), }, Tags: map[string]*string{ "key1": to.Ptr("value1"), "key2": to.Ptr("value2"), }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // 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.ActionGroupResource = armmonitor.ActionGroupResource{ // Name: to.Ptr("SampleActionGroup"), // Type: to.Ptr("Microsoft.Insights/ActionGroups"), // ID: to.Ptr("/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/Default-NotificationRules/providers/microsoft.insights/actionGroups/SampleActionGroup"), // Location: to.Ptr("Global"), // Tags: map[string]*string{ // "key1": to.Ptr("value1"), // "key2": to.Ptr("value2"), // }, // Properties: &armmonitor.ActionGroup{ // ArmRoleReceivers: []*armmonitor.ArmRoleReceiver{ // }, // AutomationRunbookReceivers: []*armmonitor.AutomationRunbookReceiver{ // }, // AzureAppPushReceivers: []*armmonitor.AzureAppPushReceiver{ // }, // AzureFunctionReceivers: []*armmonitor.AzureFunctionReceiver{ // }, // EmailReceivers: []*armmonitor.EmailReceiver{ // { // Name: to.Ptr("John Doe's email"), // EmailAddress: to.Ptr("johndoe@email.com"), // Status: to.Ptr(armmonitor.ReceiverStatusEnabled), // UseCommonAlertSchema: to.Ptr(true), // }, // { // Name: to.Ptr("Jane Smith's email"), // EmailAddress: to.Ptr("janesmith@email.com"), // Status: to.Ptr(armmonitor.ReceiverStatusEnabled), // UseCommonAlertSchema: to.Ptr(true), // }}, // Enabled: to.Ptr(true), // EventHubReceivers: []*armmonitor.EventHubReceiver{ // }, // GroupShortName: to.Ptr("sample"), // ItsmReceivers: []*armmonitor.ItsmReceiver{ // }, // LogicAppReceivers: []*armmonitor.LogicAppReceiver{ // }, // SmsReceivers: []*armmonitor.SmsReceiver{ // { // Name: to.Ptr("John Doe's mobile"), // CountryCode: to.Ptr("1"), // PhoneNumber: to.Ptr("1234567890"), // Status: to.Ptr(armmonitor.ReceiverStatusEnabled), // }, // { // Name: to.Ptr("Jane Smith's mobile"), // CountryCode: to.Ptr("1"), // PhoneNumber: to.Ptr("0987654321"), // Status: to.Ptr(armmonitor.ReceiverStatusEnabled), // }}, // VoiceReceivers: []*armmonitor.VoiceReceiver{ // }, // WebhookReceivers: []*armmonitor.WebhookReceiver{ // { // Name: to.Ptr("Sample webhook"), // ServiceURI: to.Ptr("http://www.example.com/webhook"), // UseCommonAlertSchema: to.Ptr(false), // }, // { // Name: to.Ptr("Sample webhook 2"), // IdentifierURI: to.Ptr("http://someidentifier/d7811ba3-7996-4a93-99b6-6b2f3f355f8a"), // ObjectID: to.Ptr("d3bb868c-fe44-452c-aa26-769a6538c808"), // ServiceURI: to.Ptr("http://www.example.com/webhook2"), // TenantID: to.Ptr("68a4459a-ccb8-493c-b9da-dd30457d1b84"), // UseAADAuth: to.Ptr(true), // UseCommonAlertSchema: to.Ptr(true), // }}, // }, // } }
Output:
type ActionGroupsClientBeginCreateNotificationsAtActionGroupResourceLevelOptions ¶ added in v0.7.0
type ActionGroupsClientBeginCreateNotificationsAtActionGroupResourceLevelOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
ActionGroupsClientBeginCreateNotificationsAtActionGroupResourceLevelOptions contains the optional parameters for the ActionGroupsClient.BeginCreateNotificationsAtActionGroupResourceLevel method.
type ActionGroupsClientCreateNotificationsAtActionGroupResourceLevelResponse ¶ added in v0.7.0
type ActionGroupsClientCreateNotificationsAtActionGroupResourceLevelResponse struct { // The details of the test notification results. TestNotificationDetailsResponse }
ActionGroupsClientCreateNotificationsAtActionGroupResourceLevelResponse contains the response from method ActionGroupsClient.BeginCreateNotificationsAtActionGroupResourceLevel.
type ActionGroupsClientCreateOrUpdateOptions ¶ added in v0.4.0
type ActionGroupsClientCreateOrUpdateOptions struct { }
ActionGroupsClientCreateOrUpdateOptions contains the optional parameters for the ActionGroupsClient.CreateOrUpdate method.
type ActionGroupsClientCreateOrUpdateResponse ¶ added in v0.4.0
type ActionGroupsClientCreateOrUpdateResponse struct { // An action group resource. ActionGroupResource }
ActionGroupsClientCreateOrUpdateResponse contains the response from method ActionGroupsClient.CreateOrUpdate.
type ActionGroupsClientDeleteOptions ¶ added in v0.4.0
type ActionGroupsClientDeleteOptions struct { }
ActionGroupsClientDeleteOptions contains the optional parameters for the ActionGroupsClient.Delete method.
type ActionGroupsClientDeleteResponse ¶ added in v0.4.0
type ActionGroupsClientDeleteResponse struct { }
ActionGroupsClientDeleteResponse contains the response from method ActionGroupsClient.Delete.
type ActionGroupsClientEnableReceiverOptions ¶ added in v0.4.0
type ActionGroupsClientEnableReceiverOptions struct { }
ActionGroupsClientEnableReceiverOptions contains the optional parameters for the ActionGroupsClient.EnableReceiver method.
type ActionGroupsClientEnableReceiverResponse ¶ added in v0.4.0
type ActionGroupsClientEnableReceiverResponse struct { }
ActionGroupsClientEnableReceiverResponse contains the response from method ActionGroupsClient.EnableReceiver.
type ActionGroupsClientGetOptions ¶ added in v0.4.0
type ActionGroupsClientGetOptions struct { }
ActionGroupsClientGetOptions contains the optional parameters for the ActionGroupsClient.Get method.
type ActionGroupsClientGetResponse ¶ added in v0.4.0
type ActionGroupsClientGetResponse struct { // An action group resource. ActionGroupResource }
ActionGroupsClientGetResponse contains the response from method ActionGroupsClient.Get.
type ActionGroupsClientGetTestNotificationsAtActionGroupResourceLevelOptions ¶ added in v0.7.0
type ActionGroupsClientGetTestNotificationsAtActionGroupResourceLevelOptions struct { }
ActionGroupsClientGetTestNotificationsAtActionGroupResourceLevelOptions contains the optional parameters for the ActionGroupsClient.GetTestNotificationsAtActionGroupResourceLevel method.
type ActionGroupsClientGetTestNotificationsAtActionGroupResourceLevelResponse ¶ added in v0.7.0
type ActionGroupsClientGetTestNotificationsAtActionGroupResourceLevelResponse struct { // The details of the test notification results. TestNotificationDetailsResponse }
ActionGroupsClientGetTestNotificationsAtActionGroupResourceLevelResponse contains the response from method ActionGroupsClient.GetTestNotificationsAtActionGroupResourceLevel.
type ActionGroupsClientListByResourceGroupOptions ¶ added in v0.4.0
type ActionGroupsClientListByResourceGroupOptions struct { }
ActionGroupsClientListByResourceGroupOptions contains the optional parameters for the ActionGroupsClient.NewListByResourceGroupPager method.
type ActionGroupsClientListByResourceGroupResponse ¶ added in v0.4.0
type ActionGroupsClientListByResourceGroupResponse struct { // A list of action groups. ActionGroupList }
ActionGroupsClientListByResourceGroupResponse contains the response from method ActionGroupsClient.NewListByResourceGroupPager.
type ActionGroupsClientListBySubscriptionIDOptions ¶ added in v0.4.0
type ActionGroupsClientListBySubscriptionIDOptions struct { }
ActionGroupsClientListBySubscriptionIDOptions contains the optional parameters for the ActionGroupsClient.NewListBySubscriptionIDPager method.
type ActionGroupsClientListBySubscriptionIDResponse ¶ added in v0.4.0
type ActionGroupsClientListBySubscriptionIDResponse struct { // A list of action groups. ActionGroupList }
ActionGroupsClientListBySubscriptionIDResponse contains the response from method ActionGroupsClient.NewListBySubscriptionIDPager.
type ActionGroupsClientUpdateOptions ¶ added in v0.4.0
type ActionGroupsClientUpdateOptions struct { }
ActionGroupsClientUpdateOptions contains the optional parameters for the ActionGroupsClient.Update method.
type ActionGroupsClientUpdateResponse ¶ added in v0.4.0
type ActionGroupsClientUpdateResponse struct { // An action group resource. ActionGroupResource }
ActionGroupsClientUpdateResponse contains the response from method ActionGroupsClient.Update.
type ActionList ¶ added in v0.4.0
type ActionList struct { // The list of the Action Groups. ActionGroups []*ActionGroupAutoGenerated }
ActionList - A list of Activity Log Alert rule actions.
func (ActionList) MarshalJSON ¶ added in v0.4.0
func (a ActionList) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ActionList.
func (*ActionList) UnmarshalJSON ¶ added in v0.8.0
func (a *ActionList) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ActionList.
type ActionType ¶ added in v0.9.0
type ActionType string
ActionType - Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs.
const (
ActionTypeInternal ActionType = "Internal"
)
func PossibleActionTypeValues ¶ added in v0.9.0
func PossibleActionTypeValues() []ActionType
PossibleActionTypeValues returns the possible values for the ActionType const type.
type Actions ¶ added in v0.8.0
type Actions struct { // Action Group resource Ids to invoke when the alert fires. ActionGroups []*string // The properties of an alert payload. CustomProperties map[string]*string }
Actions to invoke when the alert fires.
func (Actions) MarshalJSON ¶ added in v0.8.0
MarshalJSON implements the json.Marshaller interface for type Actions.
func (*Actions) UnmarshalJSON ¶ added in v0.8.0
UnmarshalJSON implements the json.Unmarshaller interface for type Actions.
type ActivityLogAlertResource ¶
type ActivityLogAlertResource struct { // The location of the resource. Since Azure Activity Log Alerts is a global service, the location of the rules should always // be 'global'. Location *string // The Activity Log Alert rule properties of the resource. Properties *AlertRuleProperties // The tags of the resource. Tags map[string]*string // READ-ONLY; The resource Id. ID *string // READ-ONLY; The name of the resource. Name *string // READ-ONLY; The type of the resource. Type *string }
ActivityLogAlertResource - An Activity Log Alert rule resource.
func (ActivityLogAlertResource) MarshalJSON ¶
func (a ActivityLogAlertResource) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ActivityLogAlertResource.
func (*ActivityLogAlertResource) UnmarshalJSON ¶ added in v0.8.0
func (a *ActivityLogAlertResource) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ActivityLogAlertResource.
type ActivityLogAlertsClient ¶
type ActivityLogAlertsClient struct {
// contains filtered or unexported fields
}
ActivityLogAlertsClient contains the methods for the ActivityLogAlerts group. Don't use this type directly, use NewActivityLogAlertsClient() instead.
func NewActivityLogAlertsClient ¶
func NewActivityLogAlertsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ActivityLogAlertsClient, error)
NewActivityLogAlertsClient creates a new instance of ActivityLogAlertsClient with the specified values.
- subscriptionID - The ID of the target subscription.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - pass nil to accept the default values.
func (*ActivityLogAlertsClient) CreateOrUpdate ¶
func (client *ActivityLogAlertsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, activityLogAlertName string, activityLogAlertRule ActivityLogAlertResource, options *ActivityLogAlertsClientCreateOrUpdateOptions) (ActivityLogAlertsClientCreateOrUpdateResponse, error)
CreateOrUpdate - Create a new Activity Log Alert rule or update an existing one. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2020-10-01
- resourceGroupName - The name of the resource group. The name is case insensitive.
- activityLogAlertName - The name of the Activity Log Alert rule.
- activityLogAlertRule - The Activity Log Alert rule to create or use for the update.
- options - ActivityLogAlertsClientCreateOrUpdateOptions contains the optional parameters for the ActivityLogAlertsClient.CreateOrUpdate method.
Example (CreateOrUpdateAnActivityLogAlertRule) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Insights/stable/2020-10-01/examples/ActivityLogAlertRule_CreateOrUpdate.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewActivityLogAlertsClient().CreateOrUpdate(ctx, "MyResourceGroup", "SampleActivityLogAlertRule", armmonitor.ActivityLogAlertResource{ Location: to.Ptr("Global"), Tags: map[string]*string{}, Properties: &armmonitor.AlertRuleProperties{ Description: to.Ptr("Description of sample Activity Log Alert rule."), Actions: &armmonitor.ActionList{ ActionGroups: []*armmonitor.ActionGroupAutoGenerated{ { ActionGroupID: to.Ptr("/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/MyResourceGroup/providers/Microsoft.Insights/actionGroups/SampleActionGroup"), WebhookProperties: map[string]*string{ "sampleWebhookProperty": to.Ptr("SamplePropertyValue"), }, }}, }, Condition: &armmonitor.AlertRuleAllOfCondition{ AllOf: []*armmonitor.AlertRuleAnyOfOrLeafCondition{ { Equals: to.Ptr("Administrative"), Field: to.Ptr("category"), }, { Equals: to.Ptr("Error"), Field: to.Ptr("level"), }}, }, Enabled: to.Ptr(true), Scopes: []*string{ to.Ptr("/subscriptions/187f412d-1758-44d9-b052-169e2564721d")}, }, }, 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.ActivityLogAlertResource = armmonitor.ActivityLogAlertResource{ // Name: to.Ptr("SampleActivityLogAlertRule"), // Type: to.Ptr("Microsoft.Insights/ActivityLogAlerts"), // ID: to.Ptr("/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/MyResourceGroup/providers/microsoft.insights/activityLogAlerts/SampleActivityLogAlertRule"), // Location: to.Ptr("Global"), // Tags: map[string]*string{ // }, // Properties: &armmonitor.AlertRuleProperties{ // Description: to.Ptr("Description of sample Activity Log Alert rule."), // Actions: &armmonitor.ActionList{ // ActionGroups: []*armmonitor.ActionGroupAutoGenerated{ // { // ActionGroupID: to.Ptr("/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/MyResourceGroup/providers/microsoft.insights/actionGroups/SampleActionGroup"), // WebhookProperties: map[string]*string{ // "sampleWebhookProperty": to.Ptr("SamplePropertyValue"), // }, // }}, // }, // Condition: &armmonitor.AlertRuleAllOfCondition{ // AllOf: []*armmonitor.AlertRuleAnyOfOrLeafCondition{ // { // Equals: to.Ptr("Administrative"), // Field: to.Ptr("Category"), // }, // { // Equals: to.Ptr("Error"), // Field: to.Ptr("Level"), // }}, // }, // Enabled: to.Ptr(true), // Scopes: []*string{ // to.Ptr("subscriptions/187f412d-1758-44d9-b052-169e2564721d")}, // }, // } }
Output:
Example (CreateOrUpdateAnActivityLogAlertRuleWithAnyOfCondition) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Insights/stable/2020-10-01/examples/ActivityLogAlertRule_CreateOrUpdateRuleWithAnyOfCondition.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewActivityLogAlertsClient().CreateOrUpdate(ctx, "MyResourceGroup", "SampleActivityLogAlertRuleWithAnyOfCondition", armmonitor.ActivityLogAlertResource{ Location: to.Ptr("Global"), Tags: map[string]*string{}, Properties: &armmonitor.AlertRuleProperties{ Description: to.Ptr("Description of sample Activity Log Alert rule with 'anyOf' condition."), Actions: &armmonitor.ActionList{ ActionGroups: []*armmonitor.ActionGroupAutoGenerated{ { ActionGroupID: to.Ptr("/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/MyResourceGroup/providers/Microsoft.Insights/actionGroups/SampleActionGroup"), WebhookProperties: map[string]*string{ "sampleWebhookProperty": to.Ptr("SamplePropertyValue"), }, }}, }, Condition: &armmonitor.AlertRuleAllOfCondition{ AllOf: []*armmonitor.AlertRuleAnyOfOrLeafCondition{ { Equals: to.Ptr("ServiceHealth"), Field: to.Ptr("category"), }, { AnyOf: []*armmonitor.AlertRuleLeafCondition{ { Equals: to.Ptr("Incident"), Field: to.Ptr("properties.incidentType"), }, { Equals: to.Ptr("Maintenance"), Field: to.Ptr("properties.incidentType"), }}, }}, }, Enabled: to.Ptr(true), Scopes: []*string{ to.Ptr("subscriptions/187f412d-1758-44d9-b052-169e2564721d")}, }, }, 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.ActivityLogAlertResource = armmonitor.ActivityLogAlertResource{ // Name: to.Ptr("SampleActivityLogAlertRuleWithAnyOfCondition"), // Type: to.Ptr("Microsoft.Insights/ActivityLogAlerts"), // ID: to.Ptr("/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/MyResourceGroup/providers/microsoft.insights/activityLogAlerts/SampleActivityLogAlertRuleWithAnyOfCondition"), // Location: to.Ptr("Global"), // Tags: map[string]*string{ // }, // Properties: &armmonitor.AlertRuleProperties{ // Description: to.Ptr("Description of sample Activity Log Alert rule with 'anyOf' condition."), // Actions: &armmonitor.ActionList{ // ActionGroups: []*armmonitor.ActionGroupAutoGenerated{ // { // ActionGroupID: to.Ptr("/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/MyResourceGroup/providers/Microsoft.Insights/actionGroups/SampleActionGroup"), // WebhookProperties: map[string]*string{ // "sampleWebhookProperty": to.Ptr("SamplePropertyValue"), // }, // }}, // }, // Condition: &armmonitor.AlertRuleAllOfCondition{ // AllOf: []*armmonitor.AlertRuleAnyOfOrLeafCondition{ // { // Equals: to.Ptr("ServiceHealth"), // Field: to.Ptr("category"), // }, // { // AnyOf: []*armmonitor.AlertRuleLeafCondition{ // { // Equals: to.Ptr("Incident"), // Field: to.Ptr("properties.incidentType"), // }, // { // Equals: to.Ptr("Maintenance"), // Field: to.Ptr("properties.incidentType"), // }}, // }}, // }, // Enabled: to.Ptr(true), // Scopes: []*string{ // to.Ptr("subscriptions/187f412d-1758-44d9-b052-169e2564721d")}, // }, // } }
Output:
Example (CreateOrUpdateAnActivityLogAlertRuleWithContainsAny) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Insights/stable/2020-10-01/examples/ActivityLogAlertRule_CreateOrUpdateRuleWithContainsAny.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewActivityLogAlertsClient().CreateOrUpdate(ctx, "MyResourceGroup", "SampleActivityLogAlertRuleWithContainsAny", armmonitor.ActivityLogAlertResource{ Location: to.Ptr("Global"), Tags: map[string]*string{}, Properties: &armmonitor.AlertRuleProperties{ Description: to.Ptr("Description of sample Activity Log Alert rule with 'containsAny'."), Actions: &armmonitor.ActionList{ ActionGroups: []*armmonitor.ActionGroupAutoGenerated{ { ActionGroupID: to.Ptr("/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/MyResourceGroup/providers/Microsoft.Insights/actionGroups/SampleActionGroup"), WebhookProperties: map[string]*string{ "sampleWebhookProperty": to.Ptr("SamplePropertyValue"), }, }}, }, Condition: &armmonitor.AlertRuleAllOfCondition{ AllOf: []*armmonitor.AlertRuleAnyOfOrLeafCondition{ { Equals: to.Ptr("ServiceHealth"), Field: to.Ptr("category"), }, { ContainsAny: []*string{ to.Ptr("North Europe"), to.Ptr("West Europe")}, Field: to.Ptr("properties.impactedServices[*].ImpactedRegions[*].RegionName"), }}, }, Enabled: to.Ptr(true), Scopes: []*string{ to.Ptr("subscriptions/187f412d-1758-44d9-b052-169e2564721d")}, }, }, 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.ActivityLogAlertResource = armmonitor.ActivityLogAlertResource{ // Name: to.Ptr("SampleActivityLogAlertRuleWithContainsAny"), // Type: to.Ptr("Microsoft.Insights/ActivityLogAlerts"), // ID: to.Ptr("/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/MyResourceGroup/providers/microsoft.insights/activityLogAlerts/SampleActivityLogAlertRuleWithContainsAny"), // Location: to.Ptr("Global"), // Tags: map[string]*string{ // }, // Properties: &armmonitor.AlertRuleProperties{ // Description: to.Ptr("Description of sample Activity Log Alert rule with 'containsAny'."), // Actions: &armmonitor.ActionList{ // ActionGroups: []*armmonitor.ActionGroupAutoGenerated{ // { // ActionGroupID: to.Ptr("/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/MyResourceGroup/providers/Microsoft.Insights/actionGroups/SampleActionGroup"), // WebhookProperties: map[string]*string{ // "sampleWebhookProperty": to.Ptr("SamplePropertyValue"), // }, // }}, // }, // Condition: &armmonitor.AlertRuleAllOfCondition{ // AllOf: []*armmonitor.AlertRuleAnyOfOrLeafCondition{ // { // Equals: to.Ptr("ServiceHealth"), // Field: to.Ptr("category"), // }, // { // ContainsAny: []*string{ // to.Ptr("North Europe"), // to.Ptr("West Europe")}, // Field: to.Ptr("properties.impactedServices[*].ImpactedRegions[*].RegionName"), // }}, // }, // Enabled: to.Ptr(true), // Scopes: []*string{ // to.Ptr("subscriptions/187f412d-1758-44d9-b052-169e2564721d")}, // }, // } }
Output:
func (*ActivityLogAlertsClient) Delete ¶
func (client *ActivityLogAlertsClient) Delete(ctx context.Context, resourceGroupName string, activityLogAlertName string, options *ActivityLogAlertsClientDeleteOptions) (ActivityLogAlertsClientDeleteResponse, error)
Delete - Delete an Activity Log Alert rule. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2020-10-01
- resourceGroupName - The name of the resource group. The name is case insensitive.
- activityLogAlertName - The name of the Activity Log Alert rule.
- options - ActivityLogAlertsClientDeleteOptions contains the optional parameters for the ActivityLogAlertsClient.Delete method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Insights/stable/2020-10-01/examples/ActivityLogAlertRule_Delete.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } _, err = clientFactory.NewActivityLogAlertsClient().Delete(ctx, "MyResourceGroup", "SampleActivityLogAlertRule", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } }
Output:
func (*ActivityLogAlertsClient) Get ¶
func (client *ActivityLogAlertsClient) Get(ctx context.Context, resourceGroupName string, activityLogAlertName string, options *ActivityLogAlertsClientGetOptions) (ActivityLogAlertsClientGetResponse, error)
Get - Get an Activity Log Alert rule. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2020-10-01
- resourceGroupName - The name of the resource group. The name is case insensitive.
- activityLogAlertName - The name of the Activity Log Alert rule.
- options - ActivityLogAlertsClientGetOptions contains the optional parameters for the ActivityLogAlertsClient.Get method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Insights/stable/2020-10-01/examples/ActivityLogAlertRule_Get.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewActivityLogAlertsClient().Get(ctx, "MyResourceGroup", "SampleActivityLogAlertRule", 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.ActivityLogAlertResource = armmonitor.ActivityLogAlertResource{ // Name: to.Ptr("SampleActivityLogAlertRule"), // Type: to.Ptr("Microsoft.Insights/ActivityLogAlerts"), // ID: to.Ptr("/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/MyResourceGroup/providers/microsoft.insights/activityLogAlerts/SampleActivityLogAlertRule"), // Location: to.Ptr("Global"), // Tags: map[string]*string{ // }, // Properties: &armmonitor.AlertRuleProperties{ // Description: to.Ptr("Description of sample Activity Log Alert rule."), // Actions: &armmonitor.ActionList{ // ActionGroups: []*armmonitor.ActionGroupAutoGenerated{ // { // ActionGroupID: to.Ptr("/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/MyResourceGroup/providers/microsoft.insights/actionGroups/SampleActionGroup"), // WebhookProperties: map[string]*string{ // "sampleWebhookProperty": to.Ptr("SamplePropertyValue"), // }, // }}, // }, // Condition: &armmonitor.AlertRuleAllOfCondition{ // AllOf: []*armmonitor.AlertRuleAnyOfOrLeafCondition{ // { // Equals: to.Ptr("Administrative"), // Field: to.Ptr("category"), // }, // { // Equals: to.Ptr("Error"), // Field: to.Ptr("level"), // }}, // }, // Enabled: to.Ptr(true), // Scopes: []*string{ // to.Ptr("subscriptions/187f412d-1758-44d9-b052-169e2564721d")}, // }, // } }
Output:
func (*ActivityLogAlertsClient) NewListByResourceGroupPager ¶ added in v0.6.0
func (client *ActivityLogAlertsClient) NewListByResourceGroupPager(resourceGroupName string, options *ActivityLogAlertsClientListByResourceGroupOptions) *runtime.Pager[ActivityLogAlertsClientListByResourceGroupResponse]
NewListByResourceGroupPager - Get a list of all Activity Log Alert rules in a resource group.
Generated from API version 2020-10-01
- resourceGroupName - The name of the resource group. The name is case insensitive.
- options - ActivityLogAlertsClientListByResourceGroupOptions contains the optional parameters for the ActivityLogAlertsClient.NewListByResourceGroupPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Insights/stable/2020-10-01/examples/ActivityLogAlertRule_ListByResourceGroupName.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewActivityLogAlertsClient().NewListByResourceGroupPager("MyResourceGroup", 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.AlertRuleList = armmonitor.AlertRuleList{ // Value: []*armmonitor.ActivityLogAlertResource{ // { // Name: to.Ptr("SampleActivityLogAlertRule1"), // Type: to.Ptr("Microsoft.Insights/ActivityLogAlerts"), // ID: to.Ptr("/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/MyResourceGroup/providers/microsoft.insights/activityLogAlerts/SampleActivityLogAlertRule1"), // Location: to.Ptr("Global"), // Tags: map[string]*string{ // }, // Properties: &armmonitor.AlertRuleProperties{ // Description: to.Ptr("Description of sample Activity Log Alert rule."), // Actions: &armmonitor.ActionList{ // ActionGroups: []*armmonitor.ActionGroupAutoGenerated{ // { // ActionGroupID: to.Ptr("/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/MyResourceGroup/providers/microsoft.insights/actionGroups/SampleActionGroup"), // WebhookProperties: map[string]*string{ // "sampleWebhookProperty": to.Ptr("SamplePropertyValue"), // }, // }}, // }, // Condition: &armmonitor.AlertRuleAllOfCondition{ // AllOf: []*armmonitor.AlertRuleAnyOfOrLeafCondition{ // { // Equals: to.Ptr("Administrative"), // Field: to.Ptr("category"), // }, // { // Equals: to.Ptr("Error"), // Field: to.Ptr("level"), // }}, // }, // Enabled: to.Ptr(true), // Scopes: []*string{ // to.Ptr("subscriptions/187f412d-1758-44d9-b052-169e2564721d")}, // }, // }, // { // Name: to.Ptr("SampleActivityLogAlertRule2"), // Type: to.Ptr("Microsoft.Insights/ActivityLogAlerts"), // ID: to.Ptr("/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/MyResourceGroup/providers/microsoft.insights/activityLogAlerts/SampleActivityLogAlertRule2"), // Location: to.Ptr("Global"), // Tags: map[string]*string{ // }, // Properties: &armmonitor.AlertRuleProperties{ // Description: to.Ptr("Description of sample Activity Log Alert rule."), // Actions: &armmonitor.ActionList{ // ActionGroups: []*armmonitor.ActionGroupAutoGenerated{ // { // ActionGroupID: to.Ptr("/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/MyResourceGroup/providers/microsoft.insights/actionGroups/SampleActionGroup"), // WebhookProperties: map[string]*string{ // }, // }}, // }, // Condition: &armmonitor.AlertRuleAllOfCondition{ // AllOf: []*armmonitor.AlertRuleAnyOfOrLeafCondition{ // { // Equals: to.Ptr("Administrative"), // Field: to.Ptr("category"), // }, // { // Equals: to.Ptr("Succeeded"), // Field: to.Ptr("status"), // }}, // }, // Enabled: to.Ptr(true), // Scopes: []*string{ // to.Ptr("subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/MyResourceGroup")}, // }, // }}, // } } }
Output:
func (*ActivityLogAlertsClient) NewListBySubscriptionIDPager ¶ added in v0.6.0
func (client *ActivityLogAlertsClient) NewListBySubscriptionIDPager(options *ActivityLogAlertsClientListBySubscriptionIDOptions) *runtime.Pager[ActivityLogAlertsClientListBySubscriptionIDResponse]
NewListBySubscriptionIDPager - Get a list of all Activity Log Alert rules in a subscription.
Generated from API version 2020-10-01
- options - ActivityLogAlertsClientListBySubscriptionIDOptions contains the optional parameters for the ActivityLogAlertsClient.NewListBySubscriptionIDPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Insights/stable/2020-10-01/examples/ActivityLogAlertRule_ListBySubscriptionId.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewActivityLogAlertsClient().NewListBySubscriptionIDPager(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.AlertRuleList = armmonitor.AlertRuleList{ // Value: []*armmonitor.ActivityLogAlertResource{ // { // Name: to.Ptr("SampleActivityLogAlertRule1"), // Type: to.Ptr("Microsoft.Insights/ActivityLogAlerts"), // ID: to.Ptr("/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/MyResourceGroup1/providers/microsoft.insights/activityLogAlerts/SampleActivityLogAlertRule1"), // Location: to.Ptr("Global"), // Tags: map[string]*string{ // }, // Properties: &armmonitor.AlertRuleProperties{ // Description: to.Ptr("Description of sample Activity Log Alert rule."), // Actions: &armmonitor.ActionList{ // ActionGroups: []*armmonitor.ActionGroupAutoGenerated{ // { // ActionGroupID: to.Ptr("/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/MyResourceGroup1/providers/microsoft.insights/actionGroups/SampleActionGroup"), // WebhookProperties: map[string]*string{ // "sampleWebhookProperty": to.Ptr("SamplePropertyValue"), // }, // }}, // }, // Condition: &armmonitor.AlertRuleAllOfCondition{ // AllOf: []*armmonitor.AlertRuleAnyOfOrLeafCondition{ // { // Equals: to.Ptr("Administrative"), // Field: to.Ptr("category"), // }, // { // Equals: to.Ptr("Error"), // Field: to.Ptr("level"), // }}, // }, // Enabled: to.Ptr(true), // Scopes: []*string{ // to.Ptr("subscriptions/187f412d-1758-44d9-b052-169e2564721d")}, // }, // }, // { // Name: to.Ptr("SampleActivityLogAlertRule2"), // Type: to.Ptr("Microsoft.Insights/ActivityLogAlerts"), // ID: to.Ptr("/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/MyResourceGroup2/providers/microsoft.insights/activityLogAlerts/SampleActivityLogAlertRule2"), // Location: to.Ptr("Global"), // Tags: map[string]*string{ // }, // Properties: &armmonitor.AlertRuleProperties{ // Description: to.Ptr("Description of sample Activity Log Alert rule."), // Actions: &armmonitor.ActionList{ // ActionGroups: []*armmonitor.ActionGroupAutoGenerated{ // { // ActionGroupID: to.Ptr("/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/MyResourceGroup2/providers/microsoft.insights/actionGroups/SampleActionGroup"), // WebhookProperties: map[string]*string{ // }, // }}, // }, // Condition: &armmonitor.AlertRuleAllOfCondition{ // AllOf: []*armmonitor.AlertRuleAnyOfOrLeafCondition{ // { // Equals: to.Ptr("Administrative"), // Field: to.Ptr("category"), // }, // { // Equals: to.Ptr("Succeeded"), // Field: to.Ptr("status"), // }}, // }, // Enabled: to.Ptr(true), // Scopes: []*string{ // to.Ptr("subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/MyResourceGroup2")}, // }, // }}, // } } }
Output:
func (*ActivityLogAlertsClient) Update ¶
func (client *ActivityLogAlertsClient) Update(ctx context.Context, resourceGroupName string, activityLogAlertName string, activityLogAlertRulePatch AlertRulePatchObject, options *ActivityLogAlertsClientUpdateOptions) (ActivityLogAlertsClientUpdateResponse, error)
Update - Updates 'tags' and 'enabled' fields in an existing Alert rule. This method is used to update the Alert rule tags, and to enable or disable the Alert rule. To update other fields use CreateOrUpdate operation. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2020-10-01
- resourceGroupName - The name of the resource group. The name is case insensitive.
- activityLogAlertName - The name of the Activity Log Alert rule.
- activityLogAlertRulePatch - Parameters supplied to the operation.
- options - ActivityLogAlertsClientUpdateOptions contains the optional parameters for the ActivityLogAlertsClient.Update method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Insights/stable/2020-10-01/examples/ActivityLogAlertRule_Update.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewActivityLogAlertsClient().Update(ctx, "MyResourceGroup", "SampleActivityLogAlertRule", armmonitor.AlertRulePatchObject{ Properties: &armmonitor.AlertRulePatchProperties{ Enabled: to.Ptr(false), }, Tags: map[string]*string{ "key1": to.Ptr("value1"), "key2": to.Ptr("value2"), }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // 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.ActivityLogAlertResource = armmonitor.ActivityLogAlertResource{ // Name: to.Ptr("SampleActivityLogAlertRule"), // Type: to.Ptr("Microsoft.Insights/ActivityLogAlerts"), // ID: to.Ptr("/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/MyResourceGroup/providers/microsoft.insights/activityLogAlerts/SampleActivityLogAlertRule"), // Location: to.Ptr("Global"), // Tags: map[string]*string{ // "key1": to.Ptr("value1"), // "key2": to.Ptr("value2"), // }, // Properties: &armmonitor.AlertRuleProperties{ // Description: to.Ptr("Description of sample Activity Log Alert rule."), // Actions: &armmonitor.ActionList{ // ActionGroups: []*armmonitor.ActionGroupAutoGenerated{ // { // ActionGroupID: to.Ptr("/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/MyResourceGroup/providers/microsoft.insights/actionGroups/SampleActionGroup"), // WebhookProperties: map[string]*string{ // "sampleWebhookProperty": to.Ptr("SamplePropertyValue"), // }, // }}, // }, // Condition: &armmonitor.AlertRuleAllOfCondition{ // AllOf: []*armmonitor.AlertRuleAnyOfOrLeafCondition{ // { // Equals: to.Ptr("Administrative"), // Field: to.Ptr("category"), // }, // { // Equals: to.Ptr("Error"), // Field: to.Ptr("level"), // }}, // }, // Enabled: to.Ptr(false), // Scopes: []*string{ // to.Ptr("/subscriptions/187f412d-1758-44d9-b052-169e2564721d")}, // }, // } }
Output:
type ActivityLogAlertsClientCreateOrUpdateOptions ¶ added in v0.4.0
type ActivityLogAlertsClientCreateOrUpdateOptions struct { }
ActivityLogAlertsClientCreateOrUpdateOptions contains the optional parameters for the ActivityLogAlertsClient.CreateOrUpdate method.
type ActivityLogAlertsClientCreateOrUpdateResponse ¶ added in v0.4.0
type ActivityLogAlertsClientCreateOrUpdateResponse struct { // An Activity Log Alert rule resource. ActivityLogAlertResource }
ActivityLogAlertsClientCreateOrUpdateResponse contains the response from method ActivityLogAlertsClient.CreateOrUpdate.
type ActivityLogAlertsClientDeleteOptions ¶ added in v0.4.0
type ActivityLogAlertsClientDeleteOptions struct { }
ActivityLogAlertsClientDeleteOptions contains the optional parameters for the ActivityLogAlertsClient.Delete method.
type ActivityLogAlertsClientDeleteResponse ¶ added in v0.4.0
type ActivityLogAlertsClientDeleteResponse struct { }
ActivityLogAlertsClientDeleteResponse contains the response from method ActivityLogAlertsClient.Delete.
type ActivityLogAlertsClientGetOptions ¶ added in v0.4.0
type ActivityLogAlertsClientGetOptions struct { }
ActivityLogAlertsClientGetOptions contains the optional parameters for the ActivityLogAlertsClient.Get method.
type ActivityLogAlertsClientGetResponse ¶ added in v0.4.0
type ActivityLogAlertsClientGetResponse struct { // An Activity Log Alert rule resource. ActivityLogAlertResource }
ActivityLogAlertsClientGetResponse contains the response from method ActivityLogAlertsClient.Get.
type ActivityLogAlertsClientListByResourceGroupOptions ¶ added in v0.4.0
type ActivityLogAlertsClientListByResourceGroupOptions struct { }
ActivityLogAlertsClientListByResourceGroupOptions contains the optional parameters for the ActivityLogAlertsClient.NewListByResourceGroupPager method.
type ActivityLogAlertsClientListByResourceGroupResponse ¶ added in v0.4.0
type ActivityLogAlertsClientListByResourceGroupResponse struct { // A list of Activity Log Alert rules. AlertRuleList }
ActivityLogAlertsClientListByResourceGroupResponse contains the response from method ActivityLogAlertsClient.NewListByResourceGroupPager.
type ActivityLogAlertsClientListBySubscriptionIDOptions ¶ added in v0.4.0
type ActivityLogAlertsClientListBySubscriptionIDOptions struct { }
ActivityLogAlertsClientListBySubscriptionIDOptions contains the optional parameters for the ActivityLogAlertsClient.NewListBySubscriptionIDPager method.
type ActivityLogAlertsClientListBySubscriptionIDResponse ¶ added in v0.4.0
type ActivityLogAlertsClientListBySubscriptionIDResponse struct { // A list of Activity Log Alert rules. AlertRuleList }
ActivityLogAlertsClientListBySubscriptionIDResponse contains the response from method ActivityLogAlertsClient.NewListBySubscriptionIDPager.
type ActivityLogAlertsClientUpdateOptions ¶ added in v0.4.0
type ActivityLogAlertsClientUpdateOptions struct { }
ActivityLogAlertsClientUpdateOptions contains the optional parameters for the ActivityLogAlertsClient.Update method.
type ActivityLogAlertsClientUpdateResponse ¶ added in v0.4.0
type ActivityLogAlertsClientUpdateResponse struct { // An Activity Log Alert rule resource. ActivityLogAlertResource }
ActivityLogAlertsClientUpdateResponse contains the response from method ActivityLogAlertsClient.Update.
type ActivityLogsClient ¶
type ActivityLogsClient struct {
// contains filtered or unexported fields
}
ActivityLogsClient contains the methods for the ActivityLogs group. Don't use this type directly, use NewActivityLogsClient() instead.
func NewActivityLogsClient ¶
func NewActivityLogsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ActivityLogsClient, error)
NewActivityLogsClient creates a new instance of ActivityLogsClient with the specified values.
- subscriptionID - The ID of the target subscription.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - pass nil to accept the default values.
func (*ActivityLogsClient) NewListPager ¶ added in v0.6.0
func (client *ActivityLogsClient) NewListPager(filter string, options *ActivityLogsClientListOptions) *runtime.Pager[ActivityLogsClientListResponse]
NewListPager - Provides the list of records from the activity logs.
Generated from API version 2015-04-01
- filter - Reduces the set of data collected. This argument is required and it also requires at least the start date/time. The $filter argument is very restricted and allows only the following patterns.
- List events for a resource group: $filter=eventTimestamp ge '2014-07-16T04:36:37.6407898Z' and eventTimestamp le '2014-07-20T04:36:37.6407898Z' and resourceGroupName eq 'resourceGroupName'.
- List events for resource: $filter=eventTimestamp ge '2014-07-16T04:36:37.6407898Z' and eventTimestamp le '2014-07-20T04:36:37.6407898Z' and resourceUri eq 'resourceURI'.
- List events for a subscription in a time range: $filter=eventTimestamp ge '2014-07-16T04:36:37.6407898Z' and eventTimestamp le '2014-07-20T04:36:37.6407898Z'.
- List events for a resource provider: $filter=eventTimestamp ge '2014-07-16T04:36:37.6407898Z' and eventTimestamp le '2014-07-20T04:36:37.6407898Z' and resourceProvider eq 'resourceProviderName'.
- List events for a correlation Id: $filter=eventTimestamp ge '2014-07-16T04:36:37.6407898Z' and eventTimestamp le '2014-07-20T04:36:37.6407898Z' and correlationId eq 'correlationID'. NOTE: No other syntax is allowed.
- options - ActivityLogsClientListOptions contains the optional parameters for the ActivityLogsClient.NewListPager method.
Example (GetActivityLogsWithFilter) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Insights/stable/2015-04-01/examples/GetActivityLogsFiltered.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewActivityLogsClient().NewListPager("eventTimestamp ge '2015-01-21T20:00:00Z' and eventTimestamp le '2015-01-23T20:00:00Z' and resourceGroupName eq 'MSSupportGroup'", &armmonitor.ActivityLogsClientListOptions{Select: 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.EventDataCollection = armmonitor.EventDataCollection{ // Value: []*armmonitor.EventData{ // { // OperationID: to.Ptr("1e121103-0ba6-4300-ac9d-952bb5d0c80f"), // Description: to.Ptr(""), // Authorization: &armmonitor.SenderAuthorization{ // Action: to.Ptr("microsoft.support/supporttickets/write"), // Role: to.Ptr("Subscription Admin"), // Scope: to.Ptr("/subscriptions/089bd33f-d4ec-47fe-8ba5-0753aa5c5b33/resourceGroups/MSSupportGroup/providers/microsoft.support/supporttickets/115012112305841"), // }, // Caller: to.Ptr("admin@contoso.com"), // Claims: map[string]*string{ // "name": to.Ptr("John Smith"), // "appid": to.Ptr("c44b4083-3bq0-49c1-b47d-974e53cbdf3c"), // "appidacr": to.Ptr("2"), // "aud": to.Ptr("https://management.core.windows.net/"), // "exp": to.Ptr("1421880271"), // "groups": to.Ptr("cacfe77c-e058-4712-83qw-f9b08849fd60,7f71d11d-4c41-4b23-99d2-d32ce7aa621c,31522864-0578-4ea0-9gdc-e66cc564d18c"), // "http://schemas.microsoft.com/claims/authnclassreference": to.Ptr("1"), // "http://schemas.microsoft.com/claims/authnmethodsreferences": to.Ptr("pwd"), // "http://schemas.microsoft.com/identity/claims/objectidentifier": to.Ptr("2468adf0-8211-44e3-95xq-85137af64708"), // "http://schemas.microsoft.com/identity/claims/scope": to.Ptr("user_impersonation"), // "http://schemas.microsoft.com/identity/claims/tenantid": to.Ptr("1e8d8218-c5e7-4578-9acc-9abbd5d23315"), // "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/givenname": to.Ptr("John"), // "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name": to.Ptr("admin@contoso.com"), // "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier": to.Ptr("9vckmEGF7zDKk1YzIY8k0t1_EAPaXoeHyPRn6f413zM"), // "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/surname": to.Ptr("Smith"), // "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/upn": to.Ptr("admin@contoso.com"), // "iat": to.Ptr("1421876371"), // "iss": to.Ptr("https://sts.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47/"), // "nbf": to.Ptr("1421876371"), // "puid": to.Ptr("20030000801A118C"), // "ver": to.Ptr("1.0"), // }, // CorrelationID: to.Ptr("1e121103-0ba6-4300-ac9d-952bb5d0c80f"), // EventDataID: to.Ptr("44ade6b4-3813-45e6-ae27-7420a95fa2f8"), // EventName: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("End request"), // Value: to.Ptr("EndRequest"), // }, // EventTimestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-01-21T22:14:26.979Z"); return t}()), // HTTPRequest: &armmonitor.HTTPRequestInfo{ // Method: to.Ptr("PUT"), // ClientIPAddress: to.Ptr("192.168.35.115"), // ClientRequestID: to.Ptr("27003b25-91d3-418f-8eb1-29e537dcb249"), // }, // ID: to.Ptr("/subscriptions/089bd33f-d4ec-47fe-8ba5-0753aa5c5b33/resourceGroups/MSSupportGroup/providers/microsoft.support/supporttickets/115012112305841/events/44ade6b4-3813-45e6-ae27-7420a95fa2f8/ticks/635574752669792776"), // Level: to.Ptr(armmonitor.EventLevelInformational), // OperationName: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("microsoft.support/supporttickets/write"), // Value: to.Ptr("microsoft.support/supporttickets/write"), // }, // Properties: map[string]*string{ // "statusCode": to.Ptr("Created"), // }, // ResourceGroupName: to.Ptr("MSSupportGroup"), // ResourceProviderName: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("microsoft.support"), // Value: to.Ptr("microsoft.support"), // }, // Status: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("Succeeded"), // Value: to.Ptr("Succeeded"), // }, // SubStatus: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("Created (HTTP Status Code: 201)"), // Value: to.Ptr("Created"), // }, // SubmissionTimestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-01-21T22:14:39.993Z"); return t}()), // SubscriptionID: to.Ptr("089bd33f-d4ec-47fe-8ba5-0753aa5c5b33"), // }}, // } } }
Output:
Example (GetActivityLogsWithFilterAndSelect) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Insights/stable/2015-04-01/examples/GetActivityLogsFilteredAndSelected.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewActivityLogsClient().NewListPager("eventTimestamp ge '2015-01-21T20:00:00Z' and eventTimestamp le '2015-01-23T20:00:00Z' and resourceGroupName eq 'MSSupportGroup'", &armmonitor.ActivityLogsClientListOptions{Select: to.Ptr("eventName,id,resourceGroupName,resourceProviderName,operationName,status,eventTimestamp,correlationId,submissionTimestamp,level")}) 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.EventDataCollection = armmonitor.EventDataCollection{ // Value: []*armmonitor.EventData{ // { // CorrelationID: to.Ptr("1e121103-0ba6-4300-ac9d-952bb5d0c80f"), // EventName: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("End request"), // Value: to.Ptr("EndRequest"), // }, // EventTimestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-01-21T22:14:26.979Z"); return t}()), // ID: to.Ptr("/subscriptions/089bd33f-d4ec-47fe-8ba5-0753aa5c5b33/resourceGroups/MSSupportGroup/providers/microsoft.support/supporttickets/115012112305841/events/44ade6b4-3813-45e6-ae27-7420a95fa2f8/ticks/635574752669792776"), // Level: to.Ptr(armmonitor.EventLevelInformational), // OperationName: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("microsoft.support/supporttickets/write"), // Value: to.Ptr("microsoft.support/supporttickets/write"), // }, // ResourceGroupName: to.Ptr("MSSupportGroup"), // ResourceProviderName: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("microsoft.support"), // Value: to.Ptr("microsoft.support"), // }, // Status: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("Succeeded"), // Value: to.Ptr("Succeeded"), // }, // SubmissionTimestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-01-21T22:14:39.993Z"); return t}()), // }}, // } } }
Output:
type ActivityLogsClientListOptions ¶ added in v0.4.0
type ActivityLogsClientListOptions struct { // Used to fetch events with only the given properties. // The $select argument is a comma separated list of property names to be returned. Possible values are: authorization, claims, // correlationId, description, eventDataId, eventName, eventTimestamp, // httpRequest, level, operationId, operationName, properties, resourceGroupName, resourceProviderName, resourceId, status, // submissionTimestamp, subStatus, subscriptionId Select *string }
ActivityLogsClientListOptions contains the optional parameters for the ActivityLogsClient.NewListPager method.
type ActivityLogsClientListResponse ¶ added in v0.4.0
type ActivityLogsClientListResponse struct { // Represents collection of events. EventDataCollection }
ActivityLogsClientListResponse contains the response from method ActivityLogsClient.NewListPager.
type AggregationType ¶
type AggregationType string
AggregationType - the aggregation type of the metric.
const ( AggregationTypeAverage AggregationType = "Average" AggregationTypeCount AggregationType = "Count" AggregationTypeMaximum AggregationType = "Maximum" AggregationTypeMinimum AggregationType = "Minimum" AggregationTypeNone AggregationType = "None" AggregationTypeTotal AggregationType = "Total" )
func PossibleAggregationTypeValues ¶
func PossibleAggregationTypeValues() []AggregationType
PossibleAggregationTypeValues returns the possible values for the AggregationType const type.
type AggregationTypeEnum ¶
type AggregationTypeEnum string
AggregationTypeEnum - the criteria time aggregation types.
const ( AggregationTypeEnumAverage AggregationTypeEnum = "Average" AggregationTypeEnumCount AggregationTypeEnum = "Count" AggregationTypeEnumMaximum AggregationTypeEnum = "Maximum" AggregationTypeEnumMinimum AggregationTypeEnum = "Minimum" AggregationTypeEnumTotal AggregationTypeEnum = "Total" )
func PossibleAggregationTypeEnumValues ¶
func PossibleAggregationTypeEnumValues() []AggregationTypeEnum
PossibleAggregationTypeEnumValues returns the possible values for the AggregationTypeEnum const type.
type AlertRule ¶
type AlertRule struct { // REQUIRED; the condition that results in the alert rule being activated. Condition RuleConditionClassification // REQUIRED; the flag that indicates whether the alert rule is enabled. IsEnabled *bool // REQUIRED; the name of the alert rule. Name *string // action that is performed when the alert rule becomes active, and when an alert condition is resolved. Action RuleActionClassification // the array of actions that are performed when the alert rule becomes active, and when an alert condition is resolved. Actions []RuleActionClassification // the description of the alert rule that will be included in the alert email. Description *string // the provisioning state. ProvisioningState *string // READ-ONLY; Last time the rule was updated in ISO8601 format. LastUpdatedTime *time.Time }
AlertRule - An alert rule.
func (AlertRule) MarshalJSON ¶
MarshalJSON implements the json.Marshaller interface for type AlertRule.
func (*AlertRule) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaller interface for type AlertRule.
type AlertRuleAllOfCondition ¶ added in v0.4.0
type AlertRuleAllOfCondition struct { // REQUIRED; The list of Activity Log Alert rule conditions. AllOf []*AlertRuleAnyOfOrLeafCondition }
AlertRuleAllOfCondition - An Activity Log Alert rule condition that is met when all its member conditions are met.
func (AlertRuleAllOfCondition) MarshalJSON ¶ added in v0.4.0
func (a AlertRuleAllOfCondition) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type AlertRuleAllOfCondition.
func (*AlertRuleAllOfCondition) UnmarshalJSON ¶ added in v0.8.0
func (a *AlertRuleAllOfCondition) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type AlertRuleAllOfCondition.
type AlertRuleAnyOfOrLeafCondition ¶ added in v0.4.0
type AlertRuleAnyOfOrLeafCondition struct { // An Activity Log Alert rule condition that is met when at least one of its member leaf conditions are met. AnyOf []*AlertRuleLeafCondition // The value of the event's field will be compared to the values in this array (case-insensitive) to determine if the condition // is met. ContainsAny []*string // The value of the event's field will be compared to this value (case-insensitive) to determine if the condition is met. Equals *string // The name of the Activity Log event's field that this condition will examine. The possible values for this field are (case-insensitive): // 'resourceId', 'category', 'caller', 'level', 'operationName', // 'resourceGroup', 'resourceProvider', 'status', 'subStatus', 'resourceType', or anything beginning with 'properties'. Field *string }
AlertRuleAnyOfOrLeafCondition - An Activity Log Alert rule condition that is met when all its member conditions are met. Each condition can be of one of the following types:Important: Each type has its unique subset of properties. Properties from different types CANNOT exist in one condition. * Leaf Condition - must contain 'field' and either 'equals' or 'containsAny'.Please note, 'anyOf' should not be set in a Leaf Condition. * AnyOf Condition - must contain only 'anyOf' (which is an array of Leaf Conditions).Please note, 'field', 'equals' and 'containsAny' should not be set in an AnyOf Condition.
func (AlertRuleAnyOfOrLeafCondition) MarshalJSON ¶ added in v0.4.0
func (a AlertRuleAnyOfOrLeafCondition) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type AlertRuleAnyOfOrLeafCondition.
func (*AlertRuleAnyOfOrLeafCondition) UnmarshalJSON ¶ added in v0.8.0
func (a *AlertRuleAnyOfOrLeafCondition) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type AlertRuleAnyOfOrLeafCondition.
type AlertRuleIncidentsClient ¶
type AlertRuleIncidentsClient struct {
// contains filtered or unexported fields
}
AlertRuleIncidentsClient contains the methods for the AlertRuleIncidents group. Don't use this type directly, use NewAlertRuleIncidentsClient() instead.
func NewAlertRuleIncidentsClient ¶
func NewAlertRuleIncidentsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AlertRuleIncidentsClient, error)
NewAlertRuleIncidentsClient creates a new instance of AlertRuleIncidentsClient with the specified values.
- subscriptionID - The ID of the target subscription.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - pass nil to accept the default values.
func (*AlertRuleIncidentsClient) Get ¶
func (client *AlertRuleIncidentsClient) Get(ctx context.Context, resourceGroupName string, ruleName string, incidentName string, options *AlertRuleIncidentsClientGetOptions) (AlertRuleIncidentsClientGetResponse, error)
Get - Gets an incident associated to an alert rule If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2016-03-01
- resourceGroupName - The name of the resource group. The name is case insensitive.
- ruleName - The name of the rule.
- incidentName - The name of the incident to retrieve.
- options - AlertRuleIncidentsClientGetOptions contains the optional parameters for the AlertRuleIncidentsClient.Get method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/getAlertRuleIncident.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewAlertRuleIncidentsClient().Get(ctx, "Rac46PostSwapRG", "myRuleName", "Website_started", 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.Incident = armmonitor.Incident{ // Name: to.Ptr("Website_started"), // ActivatedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-09-13T15:45:26.979Z"); return t}()), // IsActive: to.Ptr(true), // ResolvedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-09-13T22:14:28.979Z"); return t}()), // RuleName: to.Ptr("myRuleName"), // } }
Output:
func (*AlertRuleIncidentsClient) NewListByAlertRulePager ¶ added in v0.6.0
func (client *AlertRuleIncidentsClient) NewListByAlertRulePager(resourceGroupName string, ruleName string, options *AlertRuleIncidentsClientListByAlertRuleOptions) *runtime.Pager[AlertRuleIncidentsClientListByAlertRuleResponse]
NewListByAlertRulePager - Gets a list of incidents associated to an alert rule
Generated from API version 2016-03-01
- resourceGroupName - The name of the resource group. The name is case insensitive.
- ruleName - The name of the rule.
- options - AlertRuleIncidentsClientListByAlertRuleOptions contains the optional parameters for the AlertRuleIncidentsClient.NewListByAlertRulePager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/listAlertRuleIncidents.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewAlertRuleIncidentsClient().NewListByAlertRulePager("Rac46PostSwapRG", "myRuleName", 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.IncidentListResult = armmonitor.IncidentListResult{ // Value: []*armmonitor.Incident{ // { // Name: to.Ptr("Website_started"), // ActivatedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-09-13T15:45:26.979Z"); return t}()), // IsActive: to.Ptr(true), // ResolvedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-09-13T22:14:28.979Z"); return t}()), // RuleName: to.Ptr("myRuleName"), // }}, // } } }
Output:
type AlertRuleIncidentsClientGetOptions ¶ added in v0.4.0
type AlertRuleIncidentsClientGetOptions struct { }
AlertRuleIncidentsClientGetOptions contains the optional parameters for the AlertRuleIncidentsClient.Get method.
type AlertRuleIncidentsClientGetResponse ¶ added in v0.4.0
type AlertRuleIncidentsClientGetResponse struct { // An alert incident indicates the activation status of an alert rule. Incident }
AlertRuleIncidentsClientGetResponse contains the response from method AlertRuleIncidentsClient.Get.
type AlertRuleIncidentsClientListByAlertRuleOptions ¶ added in v0.4.0
type AlertRuleIncidentsClientListByAlertRuleOptions struct { }
AlertRuleIncidentsClientListByAlertRuleOptions contains the optional parameters for the AlertRuleIncidentsClient.NewListByAlertRulePager method.
type AlertRuleIncidentsClientListByAlertRuleResponse ¶ added in v0.4.0
type AlertRuleIncidentsClientListByAlertRuleResponse struct { // The List incidents operation response. IncidentListResult }
AlertRuleIncidentsClientListByAlertRuleResponse contains the response from method AlertRuleIncidentsClient.NewListByAlertRulePager.
type AlertRuleLeafCondition ¶ added in v0.4.0
type AlertRuleLeafCondition struct { // The value of the event's field will be compared to the values in this array (case-insensitive) to determine if the condition // is met. ContainsAny []*string // The value of the event's field will be compared to this value (case-insensitive) to determine if the condition is met. Equals *string // The name of the Activity Log event's field that this condition will examine. The possible values for this field are (case-insensitive): // 'resourceId', 'category', 'caller', 'level', 'operationName', // 'resourceGroup', 'resourceProvider', 'status', 'subStatus', 'resourceType', or anything beginning with 'properties'. Field *string }
AlertRuleLeafCondition - An Activity Log Alert rule condition that is met by comparing the field and value of an Activity Log event. This condition must contain 'field' and either 'equals' or 'containsAny'.
func (AlertRuleLeafCondition) MarshalJSON ¶ added in v0.4.0
func (a AlertRuleLeafCondition) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type AlertRuleLeafCondition.
func (*AlertRuleLeafCondition) UnmarshalJSON ¶ added in v0.8.0
func (a *AlertRuleLeafCondition) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type AlertRuleLeafCondition.
type AlertRuleList ¶ added in v0.4.0
type AlertRuleList struct { // Provides the link to retrieve the next set of elements. NextLink *string // The list of Activity Log Alert rules. Value []*ActivityLogAlertResource }
AlertRuleList - A list of Activity Log Alert rules.
func (AlertRuleList) MarshalJSON ¶ added in v0.4.0
func (a AlertRuleList) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type AlertRuleList.
func (*AlertRuleList) UnmarshalJSON ¶ added in v0.8.0
func (a *AlertRuleList) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type AlertRuleList.
type AlertRulePatchObject ¶ added in v0.4.0
type AlertRulePatchObject struct { // The activity log alert settings for an update operation. Properties *AlertRulePatchProperties // The resource tags Tags map[string]*string }
AlertRulePatchObject - An Activity Log Alert rule object for the body of patch operations.
func (AlertRulePatchObject) MarshalJSON ¶ added in v0.4.0
func (a AlertRulePatchObject) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type AlertRulePatchObject.
func (*AlertRulePatchObject) UnmarshalJSON ¶ added in v0.8.0
func (a *AlertRulePatchObject) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type AlertRulePatchObject.
type AlertRulePatchProperties ¶ added in v0.4.0
type AlertRulePatchProperties struct { // Indicates whether this Activity Log Alert rule is enabled. If an Activity Log Alert rule is not enabled, then none of its // actions will be activated. Enabled *bool }
AlertRulePatchProperties - An Activity Log Alert rule properties for patch operations.
func (AlertRulePatchProperties) MarshalJSON ¶ added in v0.8.0
func (a AlertRulePatchProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type AlertRulePatchProperties.
func (*AlertRulePatchProperties) UnmarshalJSON ¶ added in v0.8.0
func (a *AlertRulePatchProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type AlertRulePatchProperties.
type AlertRuleProperties ¶ added in v0.4.0
type AlertRuleProperties struct { // REQUIRED; The actions that will activate when the condition is met. Actions *ActionList // REQUIRED; The condition that will cause this alert to activate. Condition *AlertRuleAllOfCondition // REQUIRED; A list of resource IDs that will be used as prefixes. The alert will only apply to Activity Log events with resource // IDs that fall under one of these prefixes. This list must include at least one // item. Scopes []*string // A description of this Activity Log Alert rule. Description *string // Indicates whether this Activity Log Alert rule is enabled. If an Activity Log Alert rule is not enabled, then none of its // actions will be activated. Enabled *bool }
AlertRuleProperties - An Azure Activity Log Alert rule.
func (AlertRuleProperties) MarshalJSON ¶ added in v0.4.0
func (a AlertRuleProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type AlertRuleProperties.
func (*AlertRuleProperties) UnmarshalJSON ¶ added in v0.8.0
func (a *AlertRuleProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type AlertRuleProperties.
type AlertRuleResource ¶
type AlertRuleResource struct { // REQUIRED; Resource location Location *string // REQUIRED; The alert rule properties of the resource. Properties *AlertRule // Resource tags Tags map[string]*string // READ-ONLY; Azure resource Id ID *string // READ-ONLY; Azure resource name Name *string // READ-ONLY; Azure resource type Type *string }
AlertRuleResource - The alert rule resource.
func (AlertRuleResource) MarshalJSON ¶
func (a AlertRuleResource) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type AlertRuleResource.
func (*AlertRuleResource) UnmarshalJSON ¶ added in v0.8.0
func (a *AlertRuleResource) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type AlertRuleResource.
type AlertRuleResourceCollection ¶
type AlertRuleResourceCollection struct { // the values for the alert rule resources. Value []*AlertRuleResource }
AlertRuleResourceCollection - Represents a collection of alert rule resources.
func (AlertRuleResourceCollection) MarshalJSON ¶
func (a AlertRuleResourceCollection) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type AlertRuleResourceCollection.
func (*AlertRuleResourceCollection) UnmarshalJSON ¶ added in v0.8.0
func (a *AlertRuleResourceCollection) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type AlertRuleResourceCollection.
type AlertRuleResourcePatch ¶
type AlertRuleResourcePatch struct { // The properties of an alert rule. Properties *AlertRule // Resource tags Tags map[string]*string }
AlertRuleResourcePatch - The alert rule object for patch operations.
func (AlertRuleResourcePatch) MarshalJSON ¶
func (a AlertRuleResourcePatch) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type AlertRuleResourcePatch.
func (*AlertRuleResourcePatch) UnmarshalJSON ¶ added in v0.8.0
func (a *AlertRuleResourcePatch) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type AlertRuleResourcePatch.
type AlertRulesClient ¶
type AlertRulesClient struct {
// contains filtered or unexported fields
}
AlertRulesClient contains the methods for the AlertRules group. Don't use this type directly, use NewAlertRulesClient() instead.
func NewAlertRulesClient ¶
func NewAlertRulesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AlertRulesClient, error)
NewAlertRulesClient creates a new instance of AlertRulesClient with the specified values.
- subscriptionID - The ID of the target subscription.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - pass nil to accept the default values.
func (*AlertRulesClient) CreateOrUpdate ¶
func (client *AlertRulesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, ruleName string, parameters AlertRuleResource, options *AlertRulesClientCreateOrUpdateOptions) (AlertRulesClientCreateOrUpdateResponse, error)
CreateOrUpdate - Creates or updates a classic metric alert rule. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2016-03-01
- resourceGroupName - The name of the resource group. The name is case insensitive.
- ruleName - The name of the rule.
- parameters - The parameters of the rule to create or update.
- options - AlertRulesClientCreateOrUpdateOptions contains the optional parameters for the AlertRulesClient.CreateOrUpdate method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/createOrUpdateAlertRule.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewAlertRulesClient().CreateOrUpdate(ctx, "Rac46PostSwapRG", "chiricutin", armmonitor.AlertRuleResource{ Location: to.Ptr("West US"), Tags: map[string]*string{}, Properties: &armmonitor.AlertRule{ Name: to.Ptr("chiricutin"), Description: to.Ptr("Pura Vida"), Actions: []armmonitor.RuleActionClassification{}, Condition: &armmonitor.ThresholdRuleCondition{ DataSource: &armmonitor.RuleMetricDataSource{ ODataType: to.Ptr("Microsoft.Azure.Management.Insights.Models.RuleMetricDataSource"), ResourceURI: to.Ptr("/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/leoalerttest"), MetricName: to.Ptr("Requests"), }, ODataType: to.Ptr("Microsoft.Azure.Management.Insights.Models.ThresholdRuleCondition"), Operator: to.Ptr(armmonitor.ConditionOperatorGreaterThan), Threshold: to.Ptr[float64](3), TimeAggregation: to.Ptr(armmonitor.TimeAggregationOperatorTotal), WindowSize: to.Ptr("PT5M"), }, IsEnabled: to.Ptr(true), }, }, 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.AlertRuleResource = armmonitor.AlertRuleResource{ // Name: to.Ptr("chiricutin"), // Type: to.Ptr("Microsoft.Insights/alertRules"), // ID: to.Ptr("/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/microsoft.insights/alertrules/chiricutin"), // Location: to.Ptr("West US"), // Tags: map[string]*string{ // "$type": to.Ptr("Microsoft.WindowsAzure.Management.Common.Storage.CasePreservedDictionary, Microsoft.WindowsAzure.Management.Common.Storage"), // "hidden-link:/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/leoalerttest": to.Ptr("Resource"), // }, // Properties: &armmonitor.AlertRule{ // Name: to.Ptr("chiricutin"), // Description: to.Ptr("Pura Vida"), // Actions: []armmonitor.RuleActionClassification{ // }, // Condition: &armmonitor.ThresholdRuleCondition{ // DataSource: &armmonitor.RuleMetricDataSource{ // ODataType: to.Ptr("Microsoft.Azure.Management.Insights.Models.RuleMetricDataSource"), // ResourceURI: to.Ptr("/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/leoalerttest"), // MetricName: to.Ptr("Requests"), // }, // ODataType: to.Ptr("Microsoft.Azure.Management.Insights.Models.ThresholdRuleCondition"), // Operator: to.Ptr(armmonitor.ConditionOperatorGreaterThan), // Threshold: to.Ptr[float64](3), // TimeAggregation: to.Ptr(armmonitor.TimeAggregationOperatorTotal), // WindowSize: to.Ptr("PT5M"), // }, // IsEnabled: to.Ptr(true), // LastUpdatedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-11-23T21:23:52.022Z"); return t}()), // }, // } }
Output:
func (*AlertRulesClient) Delete ¶
func (client *AlertRulesClient) Delete(ctx context.Context, resourceGroupName string, ruleName string, options *AlertRulesClientDeleteOptions) (AlertRulesClientDeleteResponse, error)
Delete - Deletes a classic metric alert rule If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2016-03-01
- resourceGroupName - The name of the resource group. The name is case insensitive.
- ruleName - The name of the rule.
- options - AlertRulesClientDeleteOptions contains the optional parameters for the AlertRulesClient.Delete method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/deleteAlertRule.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } _, err = clientFactory.NewAlertRulesClient().Delete(ctx, "Rac46PostSwapRG", "chiricutin", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } }
Output:
func (*AlertRulesClient) Get ¶
func (client *AlertRulesClient) Get(ctx context.Context, resourceGroupName string, ruleName string, options *AlertRulesClientGetOptions) (AlertRulesClientGetResponse, error)
Get - Gets a classic metric alert rule If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2016-03-01
- resourceGroupName - The name of the resource group. The name is case insensitive.
- ruleName - The name of the rule.
- options - AlertRulesClientGetOptions contains the optional parameters for the AlertRulesClient.Get method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/getAlertRule.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewAlertRulesClient().Get(ctx, "Rac46PostSwapRG", "chiricutin", 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.AlertRuleResource = armmonitor.AlertRuleResource{ // Name: to.Ptr("chiricutin"), // Type: to.Ptr("Microsoft.Insights/alertRules"), // ID: to.Ptr("/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/microsoft.insights/alertrules/chiricutin"), // Location: to.Ptr("West US"), // Tags: map[string]*string{ // "$type": to.Ptr("Microsoft.WindowsAzure.Management.Common.Storage.CasePreservedDictionary, Microsoft.WindowsAzure.Management.Common.Storage"), // "hidden-link:/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/leoalerttest": to.Ptr("Resource"), // }, // Properties: &armmonitor.AlertRule{ // Name: to.Ptr("chiricutin"), // Description: to.Ptr("Pura Vida"), // Actions: []armmonitor.RuleActionClassification{ // }, // Condition: &armmonitor.ThresholdRuleCondition{ // DataSource: &armmonitor.RuleMetricDataSource{ // ODataType: to.Ptr("Microsoft.Azure.Management.Insights.Models.RuleMetricDataSource"), // ResourceURI: to.Ptr("/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/leoalerttest"), // MetricName: to.Ptr("Requests"), // }, // ODataType: to.Ptr("Microsoft.Azure.Management.Insights.Models.ThresholdRuleCondition"), // Operator: to.Ptr(armmonitor.ConditionOperatorGreaterThan), // Threshold: to.Ptr[float64](3), // TimeAggregation: to.Ptr(armmonitor.TimeAggregationOperatorTotal), // WindowSize: to.Ptr("PT5M"), // }, // IsEnabled: to.Ptr(true), // LastUpdatedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-11-23T21:23:52.022Z"); return t}()), // }, // } }
Output:
func (*AlertRulesClient) NewListByResourceGroupPager ¶ added in v0.6.0
func (client *AlertRulesClient) NewListByResourceGroupPager(resourceGroupName string, options *AlertRulesClientListByResourceGroupOptions) *runtime.Pager[AlertRulesClientListByResourceGroupResponse]
NewListByResourceGroupPager - List the classic metric alert rules within a resource group.
Generated from API version 2016-03-01
- resourceGroupName - The name of the resource group. The name is case insensitive.
- options - AlertRulesClientListByResourceGroupOptions contains the optional parameters for the AlertRulesClient.NewListByResourceGroupPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/listAlertRule.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewAlertRulesClient().NewListByResourceGroupPager("Rac46PostSwapRG", 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.AlertRuleResourceCollection = armmonitor.AlertRuleResourceCollection{ // Value: []*armmonitor.AlertRuleResource{ // { // Name: to.Ptr("myRuleName"), // Type: to.Ptr("Microsoft.Insights/alertRules"), // ID: to.Ptr("/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/microsoft.insights/alertrules/myRuleName"), // Location: to.Ptr("West US"), // Tags: map[string]*string{ // "$type": to.Ptr("Microsoft.WindowsAzure.Management.Common.Storage.CasePreservedDictionary, Microsoft.WindowsAzure.Management.Common.Storage"), // "hidden-link:/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/leoalerttest": to.Ptr("Resource"), // }, // Properties: &armmonitor.AlertRule{ // Name: to.Ptr("myRuleName"), // Description: to.Ptr("Pura Vida"), // Actions: []armmonitor.RuleActionClassification{ // &armmonitor.RuleEmailAction{ // ODataType: to.Ptr("Microsoft.Azure.Management.Insights.Models.RuleEmailAction"), // CustomEmails: []*string{ // to.Ptr("gu@ms.com"), // to.Ptr("su@ms.net")}, // SendToServiceOwners: to.Ptr(true), // }}, // Condition: &armmonitor.ThresholdRuleCondition{ // DataSource: &armmonitor.RuleMetricDataSource{ // ODataType: to.Ptr("Microsoft.Azure.Management.Insights.Models.RuleMetricDataSource"), // ResourceURI: to.Ptr("/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/leoalerttest"), // MetricName: to.Ptr("Requests"), // }, // ODataType: to.Ptr("Microsoft.Azure.Management.Insights.Models.ThresholdRuleCondition"), // Operator: to.Ptr(armmonitor.ConditionOperatorGreaterThan), // Threshold: to.Ptr[float64](2), // TimeAggregation: to.Ptr(armmonitor.TimeAggregationOperatorTotal), // WindowSize: to.Ptr("PT5M"), // }, // IsEnabled: to.Ptr(true), // LastUpdatedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-11-10T21:04:39.000Z"); return t}()), // }, // }, // { // Name: to.Ptr("chiricutin0"), // Type: to.Ptr("Microsoft.Insights/alertRules"), // ID: to.Ptr("/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/microsoft.insights/alertrules/chiricutin0"), // Location: to.Ptr("West US"), // Tags: map[string]*string{ // "$type": to.Ptr("Microsoft.WindowsAzure.Management.Common.Storage.CasePreservedDictionary, Microsoft.WindowsAzure.Management.Common.Storage"), // "hidden-link:/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/leoalerttest": to.Ptr("Resource"), // }, // Properties: &armmonitor.AlertRule{ // Name: to.Ptr("chiricutin0"), // Description: to.Ptr("Pura Vida 0"), // Actions: []armmonitor.RuleActionClassification{ // }, // Condition: &armmonitor.ThresholdRuleCondition{ // DataSource: &armmonitor.RuleMetricDataSource{ // ODataType: to.Ptr("Microsoft.Azure.Management.Insights.Models.RuleMetricDataSource"), // ResourceURI: to.Ptr("/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/leoalerttest"), // MetricName: to.Ptr("Requests"), // }, // ODataType: to.Ptr("Microsoft.Azure.Management.Insights.Models.ThresholdRuleCondition"), // Operator: to.Ptr(armmonitor.ConditionOperatorGreaterThan), // Threshold: to.Ptr[float64](2), // TimeAggregation: to.Ptr(armmonitor.TimeAggregationOperatorTotal), // WindowSize: to.Ptr("PT5M"), // }, // IsEnabled: to.Ptr(true), // LastUpdatedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-11-10T21:04:39.108Z"); return t}()), // }, // }}, // } } }
Output:
func (*AlertRulesClient) NewListBySubscriptionPager ¶ added in v0.6.0
func (client *AlertRulesClient) NewListBySubscriptionPager(options *AlertRulesClientListBySubscriptionOptions) *runtime.Pager[AlertRulesClientListBySubscriptionResponse]
NewListBySubscriptionPager - List the classic metric alert rules within a subscription.
Generated from API version 2016-03-01
- options - AlertRulesClientListBySubscriptionOptions contains the optional parameters for the AlertRulesClient.NewListBySubscriptionPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/listAlertRuleBySubscription.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewAlertRulesClient().NewListBySubscriptionPager(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.AlertRuleResourceCollection = armmonitor.AlertRuleResourceCollection{ // Value: []*armmonitor.AlertRuleResource{ // { // Name: to.Ptr("myRuleName"), // Type: to.Ptr("Microsoft.Insights/alertRules"), // ID: to.Ptr("/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/microsoft.insights/alertrules/myRuleName"), // Location: to.Ptr("West US"), // Tags: map[string]*string{ // "$type": to.Ptr("Microsoft.WindowsAzure.Management.Common.Storage.CasePreservedDictionary, Microsoft.WindowsAzure.Management.Common.Storage"), // "hidden-link:/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/leoalerttest": to.Ptr("Resource"), // }, // Properties: &armmonitor.AlertRule{ // Name: to.Ptr("myRuleName"), // Description: to.Ptr("Pura Vida"), // Actions: []armmonitor.RuleActionClassification{ // &armmonitor.RuleEmailAction{ // ODataType: to.Ptr("Microsoft.Azure.Management.Insights.Models.RuleEmailAction"), // CustomEmails: []*string{ // to.Ptr("gu@ms.com"), // to.Ptr("su@ms.net")}, // SendToServiceOwners: to.Ptr(true), // }}, // Condition: &armmonitor.ThresholdRuleCondition{ // DataSource: &armmonitor.RuleMetricDataSource{ // ODataType: to.Ptr("Microsoft.Azure.Management.Insights.Models.RuleMetricDataSource"), // ResourceURI: to.Ptr("/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/leoalerttest"), // MetricName: to.Ptr("Requests"), // }, // ODataType: to.Ptr("Microsoft.Azure.Management.Insights.Models.ThresholdRuleCondition"), // Operator: to.Ptr(armmonitor.ConditionOperatorGreaterThan), // Threshold: to.Ptr[float64](2), // TimeAggregation: to.Ptr(armmonitor.TimeAggregationOperatorTotal), // WindowSize: to.Ptr("PT5M"), // }, // IsEnabled: to.Ptr(true), // LastUpdatedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-11-10T21:04:39.000Z"); return t}()), // }, // }, // { // Name: to.Ptr("chiricutin0"), // Type: to.Ptr("Microsoft.Insights/alertRules"), // ID: to.Ptr("/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/microsoft.insights/alertrules/chiricutin0"), // Location: to.Ptr("West US"), // Tags: map[string]*string{ // "$type": to.Ptr("Microsoft.WindowsAzure.Management.Common.Storage.CasePreservedDictionary, Microsoft.WindowsAzure.Management.Common.Storage"), // "hidden-link:/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/leoalerttest": to.Ptr("Resource"), // }, // Properties: &armmonitor.AlertRule{ // Name: to.Ptr("chiricutin0"), // Description: to.Ptr("Pura Vida 0"), // Actions: []armmonitor.RuleActionClassification{ // }, // Condition: &armmonitor.ThresholdRuleCondition{ // DataSource: &armmonitor.RuleMetricDataSource{ // ODataType: to.Ptr("Microsoft.Azure.Management.Insights.Models.RuleMetricDataSource"), // ResourceURI: to.Ptr("/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/leoalerttest"), // MetricName: to.Ptr("Requests"), // }, // ODataType: to.Ptr("Microsoft.Azure.Management.Insights.Models.ThresholdRuleCondition"), // Operator: to.Ptr(armmonitor.ConditionOperatorGreaterThan), // Threshold: to.Ptr[float64](2), // TimeAggregation: to.Ptr(armmonitor.TimeAggregationOperatorTotal), // WindowSize: to.Ptr("PT5M"), // }, // IsEnabled: to.Ptr(true), // LastUpdatedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-11-10T21:04:39.108Z"); return t}()), // }, // }}, // } } }
Output:
func (*AlertRulesClient) Update ¶
func (client *AlertRulesClient) Update(ctx context.Context, resourceGroupName string, ruleName string, alertRulesResource AlertRuleResourcePatch, options *AlertRulesClientUpdateOptions) (AlertRulesClientUpdateResponse, error)
Update - Updates an existing classic metric AlertRuleResource. To update other fields use the CreateOrUpdate method. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2016-03-01
- resourceGroupName - The name of the resource group. The name is case insensitive.
- ruleName - The name of the rule.
- alertRulesResource - Parameters supplied to the operation.
- options - AlertRulesClientUpdateOptions contains the optional parameters for the AlertRulesClient.Update method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/patchAlertRule.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewAlertRulesClient().Update(ctx, "Rac46PostSwapRG", "chiricutin", armmonitor.AlertRuleResourcePatch{ Properties: &armmonitor.AlertRule{ Name: to.Ptr("chiricutin"), Description: to.Ptr("Pura Vida"), Actions: []armmonitor.RuleActionClassification{}, Condition: &armmonitor.ThresholdRuleCondition{ DataSource: &armmonitor.RuleMetricDataSource{ ODataType: to.Ptr("Microsoft.Azure.Management.Insights.Models.RuleMetricDataSource"), ResourceURI: to.Ptr("/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/leoalerttest"), MetricName: to.Ptr("Requests"), }, ODataType: to.Ptr("Microsoft.Azure.Management.Insights.Models.ThresholdRuleCondition"), Operator: to.Ptr(armmonitor.ConditionOperatorGreaterThan), Threshold: to.Ptr[float64](3), TimeAggregation: to.Ptr(armmonitor.TimeAggregationOperatorTotal), WindowSize: to.Ptr("PT5M"), }, IsEnabled: to.Ptr(true), }, Tags: map[string]*string{ "$type": to.Ptr("Microsoft.WindowsAzure.Management.Common.Storage.CasePreservedDictionary"), }, }, 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.AlertRuleResource = armmonitor.AlertRuleResource{ // Name: to.Ptr("chiricutin"), // Type: to.Ptr("Microsoft.Insights/alertRules"), // ID: to.Ptr("/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/microsoft.insights/alertrules/chiricutin"), // Location: to.Ptr("West US"), // Tags: map[string]*string{ // "$type": to.Ptr("Microsoft.WindowsAzure.Management.Common.Storage.CasePreservedDictionary"), // }, // Properties: &armmonitor.AlertRule{ // Name: to.Ptr("chiricutin"), // Description: to.Ptr("Pura Vida"), // Actions: []armmonitor.RuleActionClassification{ // }, // Condition: &armmonitor.ThresholdRuleCondition{ // DataSource: &armmonitor.RuleMetricDataSource{ // ODataType: to.Ptr("Microsoft.Azure.Management.Insights.Models.RuleMetricDataSource"), // ResourceURI: to.Ptr("/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/leoalerttest"), // MetricName: to.Ptr("Requests"), // }, // ODataType: to.Ptr("Microsoft.Azure.Management.Insights.Models.ThresholdRuleCondition"), // Operator: to.Ptr(armmonitor.ConditionOperatorGreaterThan), // Threshold: to.Ptr[float64](3), // TimeAggregation: to.Ptr(armmonitor.TimeAggregationOperatorTotal), // WindowSize: to.Ptr("PT5M"), // }, // IsEnabled: to.Ptr(true), // LastUpdatedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-11-23T21:23:52.022Z"); return t}()), // }, // } }
Output:
type AlertRulesClientCreateOrUpdateOptions ¶ added in v0.4.0
type AlertRulesClientCreateOrUpdateOptions struct { }
AlertRulesClientCreateOrUpdateOptions contains the optional parameters for the AlertRulesClient.CreateOrUpdate method.
type AlertRulesClientCreateOrUpdateResponse ¶ added in v0.4.0
type AlertRulesClientCreateOrUpdateResponse struct { // The alert rule resource. AlertRuleResource }
AlertRulesClientCreateOrUpdateResponse contains the response from method AlertRulesClient.CreateOrUpdate.
type AlertRulesClientDeleteOptions ¶ added in v0.4.0
type AlertRulesClientDeleteOptions struct { }
AlertRulesClientDeleteOptions contains the optional parameters for the AlertRulesClient.Delete method.
type AlertRulesClientDeleteResponse ¶ added in v0.4.0
type AlertRulesClientDeleteResponse struct { }
AlertRulesClientDeleteResponse contains the response from method AlertRulesClient.Delete.
type AlertRulesClientGetOptions ¶ added in v0.4.0
type AlertRulesClientGetOptions struct { }
AlertRulesClientGetOptions contains the optional parameters for the AlertRulesClient.Get method.
type AlertRulesClientGetResponse ¶ added in v0.4.0
type AlertRulesClientGetResponse struct { // The alert rule resource. AlertRuleResource }
AlertRulesClientGetResponse contains the response from method AlertRulesClient.Get.
type AlertRulesClientListByResourceGroupOptions ¶ added in v0.4.0
type AlertRulesClientListByResourceGroupOptions struct { }
AlertRulesClientListByResourceGroupOptions contains the optional parameters for the AlertRulesClient.NewListByResourceGroupPager method.
type AlertRulesClientListByResourceGroupResponse ¶ added in v0.4.0
type AlertRulesClientListByResourceGroupResponse struct { // Represents a collection of alert rule resources. AlertRuleResourceCollection }
AlertRulesClientListByResourceGroupResponse contains the response from method AlertRulesClient.NewListByResourceGroupPager.
type AlertRulesClientListBySubscriptionOptions ¶ added in v0.4.0
type AlertRulesClientListBySubscriptionOptions struct { }
AlertRulesClientListBySubscriptionOptions contains the optional parameters for the AlertRulesClient.NewListBySubscriptionPager method.
type AlertRulesClientListBySubscriptionResponse ¶ added in v0.4.0
type AlertRulesClientListBySubscriptionResponse struct { // Represents a collection of alert rule resources. AlertRuleResourceCollection }
AlertRulesClientListBySubscriptionResponse contains the response from method AlertRulesClient.NewListBySubscriptionPager.
type AlertRulesClientUpdateOptions ¶ added in v0.4.0
type AlertRulesClientUpdateOptions struct { }
AlertRulesClientUpdateOptions contains the optional parameters for the AlertRulesClient.Update method.
type AlertRulesClientUpdateResponse ¶ added in v0.4.0
type AlertRulesClientUpdateResponse struct { // The alert rule resource. AlertRuleResource }
AlertRulesClientUpdateResponse contains the response from method AlertRulesClient.Update.
type AlertSeverity ¶
type AlertSeverity int64
AlertSeverity - Severity of the alert. Should be an integer between [0-4]. Value of 0 is severest. Relevant and required only for rules of the kind LogAlert.
const ( AlertSeverityFour AlertSeverity = 4 AlertSeverityOne AlertSeverity = 1 AlertSeverityThree AlertSeverity = 3 AlertSeverityTwo AlertSeverity = 2 AlertSeverityZero AlertSeverity = 0 )
func PossibleAlertSeverityValues ¶
func PossibleAlertSeverityValues() []AlertSeverity
PossibleAlertSeverityValues returns the possible values for the AlertSeverity const type.
type ArmRoleReceiver ¶
type ArmRoleReceiver struct { // REQUIRED; The name of the arm role receiver. Names must be unique across all receivers within an action group. Name *string // REQUIRED; The arm role id. RoleID *string // Indicates whether to use common alert schema. UseCommonAlertSchema *bool }
ArmRoleReceiver - An arm role receiver.
func (ArmRoleReceiver) MarshalJSON ¶ added in v0.8.0
func (a ArmRoleReceiver) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ArmRoleReceiver.
func (*ArmRoleReceiver) UnmarshalJSON ¶ added in v0.8.0
func (a *ArmRoleReceiver) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ArmRoleReceiver.
type AutomationRunbookReceiver ¶
type AutomationRunbookReceiver struct { // REQUIRED; The Azure automation account Id which holds this runbook and authenticate to Azure resource. AutomationAccountID *string // REQUIRED; Indicates whether this instance is global runbook. IsGlobalRunbook *bool // REQUIRED; The name for this runbook. RunbookName *string // REQUIRED; The resource id for webhook linked to this runbook. WebhookResourceID *string // Indicates name of the webhook. Name *string // The URI where webhooks should be sent. ServiceURI *string // Indicates whether to use common alert schema. UseCommonAlertSchema *bool }
AutomationRunbookReceiver - The Azure Automation Runbook notification receiver.
func (AutomationRunbookReceiver) MarshalJSON ¶ added in v0.8.0
func (a AutomationRunbookReceiver) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type AutomationRunbookReceiver.
func (*AutomationRunbookReceiver) UnmarshalJSON ¶ added in v0.8.0
func (a *AutomationRunbookReceiver) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type AutomationRunbookReceiver.
type AutoscaleErrorResponse ¶ added in v0.8.0
type AutoscaleErrorResponse struct { // The error object. Error *AutoscaleErrorResponseError // READ-ONLY; The system metadata related to the response. SystemData *SystemData }
AutoscaleErrorResponse - Describes the format of Error response.
func (AutoscaleErrorResponse) MarshalJSON ¶ added in v0.8.0
func (a AutoscaleErrorResponse) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type AutoscaleErrorResponse.
func (*AutoscaleErrorResponse) UnmarshalJSON ¶ added in v0.8.0
func (a *AutoscaleErrorResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type AutoscaleErrorResponse.
type AutoscaleErrorResponseError ¶ added in v0.8.0
type AutoscaleErrorResponseError struct { // One of a server-defined set of error codes. Code *string // A human-readable representation of the error's details. Details *string // A human-readable representation of the error. Message *string // The target of the particular error. Target *string }
AutoscaleErrorResponseError - The error object.
func (AutoscaleErrorResponseError) MarshalJSON ¶ added in v0.8.0
func (a AutoscaleErrorResponseError) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type AutoscaleErrorResponseError.
func (*AutoscaleErrorResponseError) UnmarshalJSON ¶ added in v0.8.0
func (a *AutoscaleErrorResponseError) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type AutoscaleErrorResponseError.
type AutoscaleNotification ¶
type AutoscaleNotification struct { // CONSTANT; the operation associated with the notification and its value must be "scale" // Field has constant value "Scale", any specified value is ignored. Operation *string // the email notification. Email *EmailNotification // the collection of webhook notifications. Webhooks []*WebhookNotification }
AutoscaleNotification - Autoscale notification.
func (AutoscaleNotification) MarshalJSON ¶
func (a AutoscaleNotification) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type AutoscaleNotification.
func (*AutoscaleNotification) UnmarshalJSON ¶ added in v0.8.0
func (a *AutoscaleNotification) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type AutoscaleNotification.
type AutoscaleProfile ¶
type AutoscaleProfile struct { // REQUIRED; the number of instances that can be used during this profile. Capacity *ScaleCapacity // REQUIRED; the name of the profile. Name *string // REQUIRED; the collection of rules that provide the triggers and parameters for the scaling action. A maximum of 10 rules // can be specified. Rules []*ScaleRule // the specific date-time for the profile. This element is not used if the Recurrence element is used. FixedDate *TimeWindow // the repeating times at which this profile begins. This element is not used if the FixedDate element is used. Recurrence *Recurrence }
AutoscaleProfile - Autoscale profile.
func (AutoscaleProfile) MarshalJSON ¶
func (a AutoscaleProfile) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type AutoscaleProfile.
func (*AutoscaleProfile) UnmarshalJSON ¶ added in v0.8.0
func (a *AutoscaleProfile) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type AutoscaleProfile.
type AutoscaleSetting ¶
type AutoscaleSetting struct { // REQUIRED; the collection of automatic scaling profiles that specify different scaling parameters for different time periods. // A maximum of 20 profiles can be specified. Profiles []*AutoscaleProfile // the enabled flag. Specifies whether automatic scaling is enabled for the resource. The default value is 'false'. Enabled *bool // the name of the autoscale setting. Name *string // the collection of notifications. Notifications []*AutoscaleNotification // the predictive autoscale policy mode. PredictiveAutoscalePolicy *PredictiveAutoscalePolicy // the location of the resource that the autoscale setting should be added to. TargetResourceLocation *string // the resource identifier of the resource that the autoscale setting should be added to. TargetResourceURI *string }
AutoscaleSetting - A setting that contains all of the configuration for the automatic scaling of a resource.
func (AutoscaleSetting) MarshalJSON ¶
func (a AutoscaleSetting) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type AutoscaleSetting.
func (*AutoscaleSetting) UnmarshalJSON ¶ added in v0.8.0
func (a *AutoscaleSetting) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type AutoscaleSetting.
type AutoscaleSettingResource ¶
type AutoscaleSettingResource struct { // REQUIRED; Resource location Location *string // REQUIRED; The autoscale setting of the resource. Properties *AutoscaleSetting // Gets or sets a list of key value pairs that describe the resource. These tags can be used in viewing and grouping this // resource (across resource groups). A maximum of 15 tags can be provided for a // resource. Each tag must have a key no greater in length than 128 characters and a value no greater in length than 256 characters. Tags map[string]*string // READ-ONLY; Azure resource Id ID *string // READ-ONLY; Azure resource name Name *string // READ-ONLY; The system metadata related to the response. SystemData *SystemData // READ-ONLY; Azure resource type Type *string }
AutoscaleSettingResource - The autoscale setting resource.
func (AutoscaleSettingResource) MarshalJSON ¶
func (a AutoscaleSettingResource) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type AutoscaleSettingResource.
func (*AutoscaleSettingResource) UnmarshalJSON ¶ added in v0.8.0
func (a *AutoscaleSettingResource) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type AutoscaleSettingResource.
type AutoscaleSettingResourceCollection ¶
type AutoscaleSettingResourceCollection struct { // REQUIRED; the values for the autoscale setting resources. Value []*AutoscaleSettingResource // URL to get the next set of results. NextLink *string }
AutoscaleSettingResourceCollection - Represents a collection of autoscale setting resources.
func (AutoscaleSettingResourceCollection) MarshalJSON ¶
func (a AutoscaleSettingResourceCollection) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type AutoscaleSettingResourceCollection.
func (*AutoscaleSettingResourceCollection) UnmarshalJSON ¶ added in v0.8.0
func (a *AutoscaleSettingResourceCollection) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type AutoscaleSettingResourceCollection.
type AutoscaleSettingResourcePatch ¶
type AutoscaleSettingResourcePatch struct { // The autoscale setting properties of the update operation. Properties *AutoscaleSetting // Resource tags Tags map[string]*string }
AutoscaleSettingResourcePatch - The autoscale setting object for patch operations.
func (AutoscaleSettingResourcePatch) MarshalJSON ¶
func (a AutoscaleSettingResourcePatch) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type AutoscaleSettingResourcePatch.
func (*AutoscaleSettingResourcePatch) UnmarshalJSON ¶ added in v0.8.0
func (a *AutoscaleSettingResourcePatch) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type AutoscaleSettingResourcePatch.
type AutoscaleSettingsClient ¶
type AutoscaleSettingsClient struct {
// contains filtered or unexported fields
}
AutoscaleSettingsClient contains the methods for the AutoscaleSettings group. Don't use this type directly, use NewAutoscaleSettingsClient() instead.
func NewAutoscaleSettingsClient ¶
func NewAutoscaleSettingsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AutoscaleSettingsClient, error)
NewAutoscaleSettingsClient creates a new instance of AutoscaleSettingsClient with the specified values.
- subscriptionID - The ID of the target subscription.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - pass nil to accept the default values.
func (*AutoscaleSettingsClient) CreateOrUpdate ¶
func (client *AutoscaleSettingsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, autoscaleSettingName string, parameters AutoscaleSettingResource, options *AutoscaleSettingsClientCreateOrUpdateOptions) (AutoscaleSettingsClientCreateOrUpdateResponse, error)
CreateOrUpdate - Creates or updates an autoscale setting. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2022-10-01
- resourceGroupName - The name of the resource group. The name is case insensitive.
- autoscaleSettingName - The autoscale setting name.
- parameters - Parameters supplied to the operation.
- options - AutoscaleSettingsClientCreateOrUpdateOptions contains the optional parameters for the AutoscaleSettingsClient.CreateOrUpdate method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Insights/stable/2022-10-01/examples/createOrUpdateAutoscaleSetting.json
package main import ( "context" "log" "time" "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/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewAutoscaleSettingsClient().CreateOrUpdate(ctx, "TestingMetricsScaleSet", "MySetting", armmonitor.AutoscaleSettingResource{ Location: to.Ptr("West US"), Tags: map[string]*string{ "key1": to.Ptr("value1"), "key2": to.Ptr("value2"), }, Properties: &armmonitor.AutoscaleSetting{ Enabled: to.Ptr(true), Notifications: []*armmonitor.AutoscaleNotification{ { Email: &armmonitor.EmailNotification{ CustomEmails: []*string{ to.Ptr("gu@ms.com"), to.Ptr("ge@ns.net")}, SendToSubscriptionAdministrator: to.Ptr(true), SendToSubscriptionCoAdministrators: to.Ptr(true), }, Operation: to.Ptr("Scale"), Webhooks: []*armmonitor.WebhookNotification{ { Properties: map[string]*string{}, ServiceURI: to.Ptr("http://myservice.com"), }}, }}, PredictiveAutoscalePolicy: &armmonitor.PredictiveAutoscalePolicy{ ScaleMode: to.Ptr(armmonitor.PredictiveAutoscalePolicyScaleModeEnabled), }, Profiles: []*armmonitor.AutoscaleProfile{ { Name: to.Ptr("adios"), Capacity: &armmonitor.ScaleCapacity{ Default: to.Ptr("1"), Maximum: to.Ptr("10"), Minimum: to.Ptr("1"), }, FixedDate: &armmonitor.TimeWindow{ End: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-03-05T14:30:00.000Z"); return t }()), Start: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-03-05T14:00:00.000Z"); return t }()), TimeZone: to.Ptr("UTC"), }, Rules: []*armmonitor.ScaleRule{ { MetricTrigger: &armmonitor.MetricTrigger{ DividePerInstance: to.Ptr(false), MetricName: to.Ptr("Percentage CPU"), MetricResourceURI: to.Ptr("/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc"), Operator: to.Ptr(armmonitor.ComparisonOperationTypeGreaterThan), Statistic: to.Ptr(armmonitor.MetricStatisticTypeAverage), Threshold: to.Ptr[float64](10), TimeAggregation: to.Ptr(armmonitor.TimeAggregationTypeAverage), TimeGrain: to.Ptr("PT1M"), TimeWindow: to.Ptr("PT5M"), }, ScaleAction: &armmonitor.ScaleAction{ Type: to.Ptr(armmonitor.ScaleTypeChangeCount), Cooldown: to.Ptr("PT5M"), Direction: to.Ptr(armmonitor.ScaleDirectionIncrease), Value: to.Ptr("1"), }, }, { MetricTrigger: &armmonitor.MetricTrigger{ DividePerInstance: to.Ptr(false), MetricName: to.Ptr("Percentage CPU"), MetricResourceURI: to.Ptr("/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc"), Operator: to.Ptr(armmonitor.ComparisonOperationTypeGreaterThan), Statistic: to.Ptr(armmonitor.MetricStatisticTypeAverage), Threshold: to.Ptr[float64](15), TimeAggregation: to.Ptr(armmonitor.TimeAggregationTypeAverage), TimeGrain: to.Ptr("PT2M"), TimeWindow: to.Ptr("PT5M"), }, ScaleAction: &armmonitor.ScaleAction{ Type: to.Ptr(armmonitor.ScaleTypeChangeCount), Cooldown: to.Ptr("PT6M"), Direction: to.Ptr(armmonitor.ScaleDirectionDecrease), Value: to.Ptr("2"), }, }}, }, { Name: to.Ptr("saludos"), Capacity: &armmonitor.ScaleCapacity{ Default: to.Ptr("1"), Maximum: to.Ptr("10"), Minimum: to.Ptr("1"), }, Recurrence: &armmonitor.Recurrence{ Frequency: to.Ptr(armmonitor.RecurrenceFrequencyWeek), Schedule: &armmonitor.RecurrentSchedule{ Days: []*string{ to.Ptr("1")}, Hours: []*int32{ to.Ptr[int32](5)}, Minutes: []*int32{ to.Ptr[int32](15)}, TimeZone: to.Ptr("UTC"), }, }, Rules: []*armmonitor.ScaleRule{ { MetricTrigger: &armmonitor.MetricTrigger{ DividePerInstance: to.Ptr(false), MetricName: to.Ptr("Percentage CPU"), MetricResourceURI: to.Ptr("/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc"), Operator: to.Ptr(armmonitor.ComparisonOperationTypeGreaterThan), Statistic: to.Ptr(armmonitor.MetricStatisticTypeAverage), Threshold: to.Ptr[float64](10), TimeAggregation: to.Ptr(armmonitor.TimeAggregationTypeAverage), TimeGrain: to.Ptr("PT1M"), TimeWindow: to.Ptr("PT5M"), }, ScaleAction: &armmonitor.ScaleAction{ Type: to.Ptr(armmonitor.ScaleTypeChangeCount), Cooldown: to.Ptr("PT5M"), Direction: to.Ptr(armmonitor.ScaleDirectionIncrease), Value: to.Ptr("1"), }, }, { MetricTrigger: &armmonitor.MetricTrigger{ DividePerInstance: to.Ptr(false), MetricName: to.Ptr("Percentage CPU"), MetricResourceURI: to.Ptr("/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc"), Operator: to.Ptr(armmonitor.ComparisonOperationTypeGreaterThan), Statistic: to.Ptr(armmonitor.MetricStatisticTypeAverage), Threshold: to.Ptr[float64](15), TimeAggregation: to.Ptr(armmonitor.TimeAggregationTypeAverage), TimeGrain: to.Ptr("PT2M"), TimeWindow: to.Ptr("PT5M"), }, ScaleAction: &armmonitor.ScaleAction{ Type: to.Ptr(armmonitor.ScaleTypeChangeCount), Cooldown: to.Ptr("PT6M"), Direction: to.Ptr(armmonitor.ScaleDirectionDecrease), Value: to.Ptr("2"), }, }}, }}, TargetResourceURI: to.Ptr("/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc"), }, }, 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.AutoscaleSettingResource = armmonitor.AutoscaleSettingResource{ // Name: to.Ptr("MySetting"), // Type: to.Ptr("Microsoft.Insights/autoscaleSettings"), // ID: to.Ptr("/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/microsoft.insights/autoscalesettings/MySetting"), // Location: to.Ptr("West US"), // Tags: map[string]*string{ // "key1": to.Ptr("value1"), // "key2": to.Ptr("value2"), // }, // Properties: &armmonitor.AutoscaleSetting{ // Name: to.Ptr("MySetting"), // Enabled: to.Ptr(true), // Notifications: []*armmonitor.AutoscaleNotification{ // { // Email: &armmonitor.EmailNotification{ // CustomEmails: []*string{ // to.Ptr("gu@ms.com"), // to.Ptr("ge@ns.net")}, // SendToSubscriptionAdministrator: to.Ptr(true), // SendToSubscriptionCoAdministrators: to.Ptr(true), // }, // Operation: to.Ptr("Scale"), // Webhooks: []*armmonitor.WebhookNotification{ // { // Properties: map[string]*string{ // }, // ServiceURI: to.Ptr("http://myservice.com"), // }}, // }}, // PredictiveAutoscalePolicy: &armmonitor.PredictiveAutoscalePolicy{ // ScaleMode: to.Ptr(armmonitor.PredictiveAutoscalePolicyScaleModeEnabled), // }, // Profiles: []*armmonitor.AutoscaleProfile{ // { // Name: to.Ptr("adios"), // Capacity: &armmonitor.ScaleCapacity{ // Default: to.Ptr("1"), // Maximum: to.Ptr("10"), // Minimum: to.Ptr("1"), // }, // FixedDate: &armmonitor.TimeWindow{ // End: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-03-05T14:30:00.000Z"); return t}()), // Start: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-03-05T14:00:00.000Z"); return t}()), // TimeZone: to.Ptr("UTC"), // }, // Rules: []*armmonitor.ScaleRule{ // { // MetricTrigger: &armmonitor.MetricTrigger{ // DividePerInstance: to.Ptr(false), // MetricName: to.Ptr("Percentage CPU"), // MetricResourceURI: to.Ptr("/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc"), // Operator: to.Ptr(armmonitor.ComparisonOperationTypeGreaterThan), // Statistic: to.Ptr(armmonitor.MetricStatisticTypeAverage), // Threshold: to.Ptr[float64](10), // TimeAggregation: to.Ptr(armmonitor.TimeAggregationTypeAverage), // TimeGrain: to.Ptr("PT1M"), // TimeWindow: to.Ptr("PT5M"), // }, // ScaleAction: &armmonitor.ScaleAction{ // Type: to.Ptr(armmonitor.ScaleTypeChangeCount), // Cooldown: to.Ptr("PT5M"), // Direction: to.Ptr(armmonitor.ScaleDirectionIncrease), // Value: to.Ptr("1"), // }, // }, // { // MetricTrigger: &armmonitor.MetricTrigger{ // DividePerInstance: to.Ptr(false), // MetricName: to.Ptr("Percentage CPU"), // MetricResourceURI: to.Ptr("/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc"), // Operator: to.Ptr(armmonitor.ComparisonOperationTypeGreaterThan), // Statistic: to.Ptr(armmonitor.MetricStatisticTypeAverage), // Threshold: to.Ptr[float64](15), // TimeAggregation: to.Ptr(armmonitor.TimeAggregationTypeAverage), // TimeGrain: to.Ptr("PT2M"), // TimeWindow: to.Ptr("PT5M"), // }, // ScaleAction: &armmonitor.ScaleAction{ // Type: to.Ptr(armmonitor.ScaleTypeChangeCount), // Cooldown: to.Ptr("PT6M"), // Direction: to.Ptr(armmonitor.ScaleDirectionDecrease), // Value: to.Ptr("2"), // }, // }}, // }, // { // Name: to.Ptr("saludos"), // Capacity: &armmonitor.ScaleCapacity{ // Default: to.Ptr("1"), // Maximum: to.Ptr("10"), // Minimum: to.Ptr("1"), // }, // Recurrence: &armmonitor.Recurrence{ // Frequency: to.Ptr(armmonitor.RecurrenceFrequencyWeek), // Schedule: &armmonitor.RecurrentSchedule{ // Days: []*string{ // to.Ptr("1")}, // Hours: []*int32{ // to.Ptr[int32](5)}, // Minutes: []*int32{ // to.Ptr[int32](15)}, // TimeZone: to.Ptr("UTC"), // }, // }, // Rules: []*armmonitor.ScaleRule{ // { // MetricTrigger: &armmonitor.MetricTrigger{ // DividePerInstance: to.Ptr(false), // MetricName: to.Ptr("Percentage CPU"), // MetricResourceURI: to.Ptr("/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc"), // Operator: to.Ptr(armmonitor.ComparisonOperationTypeGreaterThan), // Statistic: to.Ptr(armmonitor.MetricStatisticTypeAverage), // Threshold: to.Ptr[float64](10), // TimeAggregation: to.Ptr(armmonitor.TimeAggregationTypeAverage), // TimeGrain: to.Ptr("PT1M"), // TimeWindow: to.Ptr("PT5M"), // }, // ScaleAction: &armmonitor.ScaleAction{ // Type: to.Ptr(armmonitor.ScaleTypeChangeCount), // Cooldown: to.Ptr("PT5M"), // Direction: to.Ptr(armmonitor.ScaleDirectionIncrease), // Value: to.Ptr("1"), // }, // }, // { // MetricTrigger: &armmonitor.MetricTrigger{ // DividePerInstance: to.Ptr(false), // MetricName: to.Ptr("Percentage CPU"), // MetricResourceURI: to.Ptr("/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc"), // Operator: to.Ptr(armmonitor.ComparisonOperationTypeGreaterThan), // Statistic: to.Ptr(armmonitor.MetricStatisticTypeAverage), // Threshold: to.Ptr[float64](15), // TimeAggregation: to.Ptr(armmonitor.TimeAggregationTypeAverage), // TimeGrain: to.Ptr("PT2M"), // TimeWindow: to.Ptr("PT5M"), // }, // ScaleAction: &armmonitor.ScaleAction{ // Type: to.Ptr(armmonitor.ScaleTypeChangeCount), // Cooldown: to.Ptr("PT6M"), // Direction: to.Ptr(armmonitor.ScaleDirectionDecrease), // Value: to.Ptr("2"), // }, // }}, // }}, // TargetResourceURI: to.Ptr("/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc"), // }, // } }
Output:
func (*AutoscaleSettingsClient) Delete ¶
func (client *AutoscaleSettingsClient) Delete(ctx context.Context, resourceGroupName string, autoscaleSettingName string, options *AutoscaleSettingsClientDeleteOptions) (AutoscaleSettingsClientDeleteResponse, error)
Delete - Deletes and autoscale setting If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2022-10-01
- resourceGroupName - The name of the resource group. The name is case insensitive.
- autoscaleSettingName - The autoscale setting name.
- options - AutoscaleSettingsClientDeleteOptions contains the optional parameters for the AutoscaleSettingsClient.Delete method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Insights/stable/2022-10-01/examples/deleteAutoscaleSetting.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } _, err = clientFactory.NewAutoscaleSettingsClient().Delete(ctx, "TestingMetricsScaleSet", "MySetting", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } }
Output:
func (*AutoscaleSettingsClient) Get ¶
func (client *AutoscaleSettingsClient) Get(ctx context.Context, resourceGroupName string, autoscaleSettingName string, options *AutoscaleSettingsClientGetOptions) (AutoscaleSettingsClientGetResponse, error)
Get - Gets an autoscale setting If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2022-10-01
- resourceGroupName - The name of the resource group. The name is case insensitive.
- autoscaleSettingName - The autoscale setting name.
- options - AutoscaleSettingsClientGetOptions contains the optional parameters for the AutoscaleSettingsClient.Get method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Insights/stable/2022-10-01/examples/getAutoscaleSetting.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewAutoscaleSettingsClient().Get(ctx, "TestingMetricsScaleSet", "MySetting", 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.AutoscaleSettingResource = armmonitor.AutoscaleSettingResource{ // Name: to.Ptr("MySetting"), // Type: to.Ptr("Microsoft.Insights/autoscaleSettings"), // ID: to.Ptr("/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/microsoft.insights/autoscalesettings/MySetting"), // Location: to.Ptr("West US"), // Tags: map[string]*string{ // "key1": to.Ptr("value1"), // }, // Properties: &armmonitor.AutoscaleSetting{ // Name: to.Ptr("MySetting"), // Enabled: to.Ptr(true), // Notifications: []*armmonitor.AutoscaleNotification{ // { // Email: &armmonitor.EmailNotification{ // CustomEmails: []*string{ // to.Ptr("gu@ms.com"), // to.Ptr("ge@ns.net")}, // SendToSubscriptionAdministrator: to.Ptr(true), // SendToSubscriptionCoAdministrators: to.Ptr(true), // }, // Operation: to.Ptr("Scale"), // Webhooks: []*armmonitor.WebhookNotification{ // { // Properties: map[string]*string{ // }, // ServiceURI: to.Ptr("http://myservice.com"), // }}, // }}, // PredictiveAutoscalePolicy: &armmonitor.PredictiveAutoscalePolicy{ // ScaleMode: to.Ptr(armmonitor.PredictiveAutoscalePolicyScaleModeEnabled), // }, // Profiles: []*armmonitor.AutoscaleProfile{ // { // Name: to.Ptr("adios"), // Capacity: &armmonitor.ScaleCapacity{ // Default: to.Ptr("1"), // Maximum: to.Ptr("10"), // Minimum: to.Ptr("1"), // }, // FixedDate: &armmonitor.TimeWindow{ // End: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-03-05T14:30:00.000Z"); return t}()), // Start: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-03-05T14:00:00.000Z"); return t}()), // TimeZone: to.Ptr("UTC"), // }, // Rules: []*armmonitor.ScaleRule{ // { // MetricTrigger: &armmonitor.MetricTrigger{ // DividePerInstance: to.Ptr(false), // MetricName: to.Ptr("Percentage CPU"), // MetricResourceURI: to.Ptr("/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc"), // Operator: to.Ptr(armmonitor.ComparisonOperationTypeGreaterThan), // Statistic: to.Ptr(armmonitor.MetricStatisticTypeAverage), // Threshold: to.Ptr[float64](10), // TimeAggregation: to.Ptr(armmonitor.TimeAggregationTypeAverage), // TimeGrain: to.Ptr("PT1M"), // TimeWindow: to.Ptr("PT5M"), // }, // ScaleAction: &armmonitor.ScaleAction{ // Type: to.Ptr(armmonitor.ScaleTypeChangeCount), // Cooldown: to.Ptr("PT5M"), // Direction: to.Ptr(armmonitor.ScaleDirectionIncrease), // Value: to.Ptr("1"), // }, // }, // { // MetricTrigger: &armmonitor.MetricTrigger{ // DividePerInstance: to.Ptr(false), // MetricName: to.Ptr("Percentage CPU"), // MetricResourceURI: to.Ptr("/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc"), // Operator: to.Ptr(armmonitor.ComparisonOperationTypeGreaterThan), // Statistic: to.Ptr(armmonitor.MetricStatisticTypeAverage), // Threshold: to.Ptr[float64](15), // TimeAggregation: to.Ptr(armmonitor.TimeAggregationTypeAverage), // TimeGrain: to.Ptr("PT2M"), // TimeWindow: to.Ptr("PT5M"), // }, // ScaleAction: &armmonitor.ScaleAction{ // Type: to.Ptr(armmonitor.ScaleTypeChangeCount), // Cooldown: to.Ptr("PT6M"), // Direction: to.Ptr(armmonitor.ScaleDirectionDecrease), // Value: to.Ptr("2"), // }, // }}, // }, // { // Name: to.Ptr("saludos"), // Capacity: &armmonitor.ScaleCapacity{ // Default: to.Ptr("1"), // Maximum: to.Ptr("10"), // Minimum: to.Ptr("1"), // }, // Recurrence: &armmonitor.Recurrence{ // Frequency: to.Ptr(armmonitor.RecurrenceFrequencyWeek), // Schedule: &armmonitor.RecurrentSchedule{ // Days: []*string{ // to.Ptr("1")}, // Hours: []*int32{ // to.Ptr[int32](5)}, // Minutes: []*int32{ // to.Ptr[int32](15)}, // TimeZone: to.Ptr("UTC"), // }, // }, // Rules: []*armmonitor.ScaleRule{ // { // MetricTrigger: &armmonitor.MetricTrigger{ // DividePerInstance: to.Ptr(false), // MetricName: to.Ptr("Percentage CPU"), // MetricResourceURI: to.Ptr("/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc"), // Operator: to.Ptr(armmonitor.ComparisonOperationTypeGreaterThan), // Statistic: to.Ptr(armmonitor.MetricStatisticTypeAverage), // Threshold: to.Ptr[float64](10), // TimeAggregation: to.Ptr(armmonitor.TimeAggregationTypeAverage), // TimeGrain: to.Ptr("PT1M"), // TimeWindow: to.Ptr("PT5M"), // }, // ScaleAction: &armmonitor.ScaleAction{ // Type: to.Ptr(armmonitor.ScaleTypeChangeCount), // Cooldown: to.Ptr("PT5M"), // Direction: to.Ptr(armmonitor.ScaleDirectionIncrease), // Value: to.Ptr("1"), // }, // }, // { // MetricTrigger: &armmonitor.MetricTrigger{ // DividePerInstance: to.Ptr(false), // MetricName: to.Ptr("Percentage CPU"), // MetricResourceURI: to.Ptr("/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc"), // Operator: to.Ptr(armmonitor.ComparisonOperationTypeGreaterThan), // Statistic: to.Ptr(armmonitor.MetricStatisticTypeAverage), // Threshold: to.Ptr[float64](15), // TimeAggregation: to.Ptr(armmonitor.TimeAggregationTypeAverage), // TimeGrain: to.Ptr("PT2M"), // TimeWindow: to.Ptr("PT5M"), // }, // ScaleAction: &armmonitor.ScaleAction{ // Type: to.Ptr(armmonitor.ScaleTypeChangeCount), // Cooldown: to.Ptr("PT6M"), // Direction: to.Ptr(armmonitor.ScaleDirectionDecrease), // Value: to.Ptr("2"), // }, // }}, // }}, // TargetResourceURI: to.Ptr("/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc"), // }, // } }
Output:
func (*AutoscaleSettingsClient) NewListByResourceGroupPager ¶ added in v0.6.0
func (client *AutoscaleSettingsClient) NewListByResourceGroupPager(resourceGroupName string, options *AutoscaleSettingsClientListByResourceGroupOptions) *runtime.Pager[AutoscaleSettingsClientListByResourceGroupResponse]
NewListByResourceGroupPager - Lists the autoscale settings for a resource group
Generated from API version 2022-10-01
- resourceGroupName - The name of the resource group. The name is case insensitive.
- options - AutoscaleSettingsClientListByResourceGroupOptions contains the optional parameters for the AutoscaleSettingsClient.NewListByResourceGroupPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Insights/stable/2022-10-01/examples/listAutoscaleSetting.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewAutoscaleSettingsClient().NewListByResourceGroupPager("TestingMetricsScaleSet", 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.AutoscaleSettingResourceCollection = armmonitor.AutoscaleSettingResourceCollection{ // Value: []*armmonitor.AutoscaleSettingResource{ // { // Name: to.Ptr("MySetting"), // Type: to.Ptr("Microsoft.Insights/autoscaleSettings"), // ID: to.Ptr("/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/microsoft.insights/autoscalesettings/MySetting"), // Location: to.Ptr("West US"), // Tags: map[string]*string{ // "key1": to.Ptr("value1"), // "key2": to.Ptr("value2"), // }, // Properties: &armmonitor.AutoscaleSetting{ // Name: to.Ptr("MySetting"), // Enabled: to.Ptr(true), // Notifications: []*armmonitor.AutoscaleNotification{ // { // Email: &armmonitor.EmailNotification{ // CustomEmails: []*string{ // to.Ptr("gu@ms.com"), // to.Ptr("ge@ns.net")}, // SendToSubscriptionAdministrator: to.Ptr(true), // SendToSubscriptionCoAdministrators: to.Ptr(true), // }, // Operation: to.Ptr("Scale"), // Webhooks: []*armmonitor.WebhookNotification{ // { // Properties: map[string]*string{ // }, // ServiceURI: to.Ptr("http://myservice.com"), // }}, // }}, // PredictiveAutoscalePolicy: &armmonitor.PredictiveAutoscalePolicy{ // ScaleMode: to.Ptr(armmonitor.PredictiveAutoscalePolicyScaleModeEnabled), // }, // Profiles: []*armmonitor.AutoscaleProfile{ // { // Name: to.Ptr("adios"), // Capacity: &armmonitor.ScaleCapacity{ // Default: to.Ptr("1"), // Maximum: to.Ptr("10"), // Minimum: to.Ptr("1"), // }, // FixedDate: &armmonitor.TimeWindow{ // End: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-03-05T14:30:00.000Z"); return t}()), // Start: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-03-05T14:00:00.000Z"); return t}()), // TimeZone: to.Ptr("UTC"), // }, // Rules: []*armmonitor.ScaleRule{ // { // MetricTrigger: &armmonitor.MetricTrigger{ // DividePerInstance: to.Ptr(false), // MetricName: to.Ptr("Percentage CPU"), // MetricResourceURI: to.Ptr("/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc"), // Operator: to.Ptr(armmonitor.ComparisonOperationTypeGreaterThan), // Statistic: to.Ptr(armmonitor.MetricStatisticTypeAverage), // Threshold: to.Ptr[float64](10), // TimeAggregation: to.Ptr(armmonitor.TimeAggregationTypeAverage), // TimeGrain: to.Ptr("PT1M"), // TimeWindow: to.Ptr("PT5M"), // }, // ScaleAction: &armmonitor.ScaleAction{ // Type: to.Ptr(armmonitor.ScaleTypeChangeCount), // Cooldown: to.Ptr("PT5M"), // Direction: to.Ptr(armmonitor.ScaleDirectionIncrease), // Value: to.Ptr("1"), // }, // }, // { // MetricTrigger: &armmonitor.MetricTrigger{ // DividePerInstance: to.Ptr(false), // MetricName: to.Ptr("Percentage CPU"), // MetricResourceURI: to.Ptr("/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc"), // Operator: to.Ptr(armmonitor.ComparisonOperationTypeGreaterThan), // Statistic: to.Ptr(armmonitor.MetricStatisticTypeAverage), // Threshold: to.Ptr[float64](15), // TimeAggregation: to.Ptr(armmonitor.TimeAggregationTypeAverage), // TimeGrain: to.Ptr("PT2M"), // TimeWindow: to.Ptr("PT5M"), // }, // ScaleAction: &armmonitor.ScaleAction{ // Type: to.Ptr(armmonitor.ScaleTypeChangeCount), // Cooldown: to.Ptr("PT6M"), // Direction: to.Ptr(armmonitor.ScaleDirectionDecrease), // Value: to.Ptr("2"), // }, // }}, // }, // { // Name: to.Ptr("saludos"), // Capacity: &armmonitor.ScaleCapacity{ // Default: to.Ptr("1"), // Maximum: to.Ptr("10"), // Minimum: to.Ptr("1"), // }, // Recurrence: &armmonitor.Recurrence{ // Frequency: to.Ptr(armmonitor.RecurrenceFrequencyWeek), // Schedule: &armmonitor.RecurrentSchedule{ // Days: []*string{ // to.Ptr("1")}, // Hours: []*int32{ // to.Ptr[int32](5)}, // Minutes: []*int32{ // to.Ptr[int32](15)}, // TimeZone: to.Ptr("UTC"), // }, // }, // Rules: []*armmonitor.ScaleRule{ // { // MetricTrigger: &armmonitor.MetricTrigger{ // DividePerInstance: to.Ptr(false), // MetricName: to.Ptr("Percentage CPU"), // MetricResourceURI: to.Ptr("/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc"), // Operator: to.Ptr(armmonitor.ComparisonOperationTypeGreaterThan), // Statistic: to.Ptr(armmonitor.MetricStatisticTypeAverage), // Threshold: to.Ptr[float64](10), // TimeAggregation: to.Ptr(armmonitor.TimeAggregationTypeAverage), // TimeGrain: to.Ptr("PT1M"), // TimeWindow: to.Ptr("PT5M"), // }, // ScaleAction: &armmonitor.ScaleAction{ // Type: to.Ptr(armmonitor.ScaleTypeChangeCount), // Cooldown: to.Ptr("PT5M"), // Direction: to.Ptr(armmonitor.ScaleDirectionIncrease), // Value: to.Ptr("1"), // }, // }, // { // MetricTrigger: &armmonitor.MetricTrigger{ // DividePerInstance: to.Ptr(false), // MetricName: to.Ptr("Percentage CPU"), // MetricResourceURI: to.Ptr("/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc"), // Operator: to.Ptr(armmonitor.ComparisonOperationTypeGreaterThan), // Statistic: to.Ptr(armmonitor.MetricStatisticTypeAverage), // Threshold: to.Ptr[float64](15), // TimeAggregation: to.Ptr(armmonitor.TimeAggregationTypeAverage), // TimeGrain: to.Ptr("PT2M"), // TimeWindow: to.Ptr("PT5M"), // }, // ScaleAction: &armmonitor.ScaleAction{ // Type: to.Ptr(armmonitor.ScaleTypeChangeCount), // Cooldown: to.Ptr("PT6M"), // Direction: to.Ptr(armmonitor.ScaleDirectionDecrease), // Value: to.Ptr("2"), // }, // }}, // }}, // TargetResourceURI: to.Ptr("/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc"), // }, // }}, // } } }
Output:
func (*AutoscaleSettingsClient) NewListBySubscriptionPager ¶ added in v0.6.0
func (client *AutoscaleSettingsClient) NewListBySubscriptionPager(options *AutoscaleSettingsClientListBySubscriptionOptions) *runtime.Pager[AutoscaleSettingsClientListBySubscriptionResponse]
NewListBySubscriptionPager - Lists the autoscale settings for a subscription
Generated from API version 2022-10-01
- options - AutoscaleSettingsClientListBySubscriptionOptions contains the optional parameters for the AutoscaleSettingsClient.NewListBySubscriptionPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Insights/stable/2022-10-01/examples/listAutoscaleSettingBySubscription.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewAutoscaleSettingsClient().NewListBySubscriptionPager(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.AutoscaleSettingResourceCollection = armmonitor.AutoscaleSettingResourceCollection{ // Value: []*armmonitor.AutoscaleSettingResource{ // { // Name: to.Ptr("MySetting"), // Type: to.Ptr("Microsoft.Insights/autoscaleSettings"), // ID: to.Ptr("/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/microsoft.insights/autoscalesettings/MySetting"), // Location: to.Ptr("West US"), // Tags: map[string]*string{ // "key1": to.Ptr("value1"), // }, // Properties: &armmonitor.AutoscaleSetting{ // Name: to.Ptr("MySetting"), // Enabled: to.Ptr(true), // Notifications: []*armmonitor.AutoscaleNotification{ // { // Email: &armmonitor.EmailNotification{ // CustomEmails: []*string{ // to.Ptr("gu@ms.com"), // to.Ptr("ge@ns.net")}, // SendToSubscriptionAdministrator: to.Ptr(true), // SendToSubscriptionCoAdministrators: to.Ptr(true), // }, // Operation: to.Ptr("Scale"), // Webhooks: []*armmonitor.WebhookNotification{ // { // Properties: map[string]*string{ // }, // ServiceURI: to.Ptr("http://myservice.com"), // }}, // }}, // PredictiveAutoscalePolicy: &armmonitor.PredictiveAutoscalePolicy{ // ScaleMode: to.Ptr(armmonitor.PredictiveAutoscalePolicyScaleModeEnabled), // }, // Profiles: []*armmonitor.AutoscaleProfile{ // { // Name: to.Ptr("adios"), // Capacity: &armmonitor.ScaleCapacity{ // Default: to.Ptr("1"), // Maximum: to.Ptr("10"), // Minimum: to.Ptr("1"), // }, // FixedDate: &armmonitor.TimeWindow{ // End: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-03-05T14:30:00.000Z"); return t}()), // Start: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-03-05T14:00:00.000Z"); return t}()), // TimeZone: to.Ptr("UTC"), // }, // Rules: []*armmonitor.ScaleRule{ // { // MetricTrigger: &armmonitor.MetricTrigger{ // DividePerInstance: to.Ptr(false), // MetricName: to.Ptr("Percentage CPU"), // MetricResourceURI: to.Ptr("/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc"), // Operator: to.Ptr(armmonitor.ComparisonOperationTypeGreaterThan), // Statistic: to.Ptr(armmonitor.MetricStatisticTypeAverage), // Threshold: to.Ptr[float64](10), // TimeAggregation: to.Ptr(armmonitor.TimeAggregationTypeAverage), // TimeGrain: to.Ptr("PT1M"), // TimeWindow: to.Ptr("PT5M"), // }, // ScaleAction: &armmonitor.ScaleAction{ // Type: to.Ptr(armmonitor.ScaleTypeChangeCount), // Cooldown: to.Ptr("PT5M"), // Direction: to.Ptr(armmonitor.ScaleDirectionIncrease), // Value: to.Ptr("1"), // }, // }, // { // MetricTrigger: &armmonitor.MetricTrigger{ // DividePerInstance: to.Ptr(false), // MetricName: to.Ptr("Percentage CPU"), // MetricResourceURI: to.Ptr("/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc"), // Operator: to.Ptr(armmonitor.ComparisonOperationTypeGreaterThan), // Statistic: to.Ptr(armmonitor.MetricStatisticTypeAverage), // Threshold: to.Ptr[float64](15), // TimeAggregation: to.Ptr(armmonitor.TimeAggregationTypeAverage), // TimeGrain: to.Ptr("PT2M"), // TimeWindow: to.Ptr("PT5M"), // }, // ScaleAction: &armmonitor.ScaleAction{ // Type: to.Ptr(armmonitor.ScaleTypeChangeCount), // Cooldown: to.Ptr("PT6M"), // Direction: to.Ptr(armmonitor.ScaleDirectionDecrease), // Value: to.Ptr("2"), // }, // }}, // }, // { // Name: to.Ptr("saludos"), // Capacity: &armmonitor.ScaleCapacity{ // Default: to.Ptr("1"), // Maximum: to.Ptr("10"), // Minimum: to.Ptr("1"), // }, // Recurrence: &armmonitor.Recurrence{ // Frequency: to.Ptr(armmonitor.RecurrenceFrequencyWeek), // Schedule: &armmonitor.RecurrentSchedule{ // Days: []*string{ // to.Ptr("1")}, // Hours: []*int32{ // to.Ptr[int32](5)}, // Minutes: []*int32{ // to.Ptr[int32](15)}, // TimeZone: to.Ptr("UTC"), // }, // }, // Rules: []*armmonitor.ScaleRule{ // { // MetricTrigger: &armmonitor.MetricTrigger{ // DividePerInstance: to.Ptr(false), // MetricName: to.Ptr("Percentage CPU"), // MetricResourceURI: to.Ptr("/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc"), // Operator: to.Ptr(armmonitor.ComparisonOperationTypeGreaterThan), // Statistic: to.Ptr(armmonitor.MetricStatisticTypeAverage), // Threshold: to.Ptr[float64](10), // TimeAggregation: to.Ptr(armmonitor.TimeAggregationTypeAverage), // TimeGrain: to.Ptr("PT1M"), // TimeWindow: to.Ptr("PT5M"), // }, // ScaleAction: &armmonitor.ScaleAction{ // Type: to.Ptr(armmonitor.ScaleTypeChangeCount), // Cooldown: to.Ptr("PT5M"), // Direction: to.Ptr(armmonitor.ScaleDirectionIncrease), // Value: to.Ptr("1"), // }, // }, // { // MetricTrigger: &armmonitor.MetricTrigger{ // DividePerInstance: to.Ptr(false), // MetricName: to.Ptr("Percentage CPU"), // MetricResourceURI: to.Ptr("/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc"), // Operator: to.Ptr(armmonitor.ComparisonOperationTypeGreaterThan), // Statistic: to.Ptr(armmonitor.MetricStatisticTypeAverage), // Threshold: to.Ptr[float64](15), // TimeAggregation: to.Ptr(armmonitor.TimeAggregationTypeAverage), // TimeGrain: to.Ptr("PT2M"), // TimeWindow: to.Ptr("PT5M"), // }, // ScaleAction: &armmonitor.ScaleAction{ // Type: to.Ptr(armmonitor.ScaleTypeChangeCount), // Cooldown: to.Ptr("PT6M"), // Direction: to.Ptr(armmonitor.ScaleDirectionDecrease), // Value: to.Ptr("2"), // }, // }}, // }}, // TargetResourceURI: to.Ptr("/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc"), // }, // }}, // } } }
Output:
func (*AutoscaleSettingsClient) Update ¶
func (client *AutoscaleSettingsClient) Update(ctx context.Context, resourceGroupName string, autoscaleSettingName string, autoscaleSettingResource AutoscaleSettingResourcePatch, options *AutoscaleSettingsClientUpdateOptions) (AutoscaleSettingsClientUpdateResponse, error)
Update - Updates an existing AutoscaleSettingsResource. To update other fields use the CreateOrUpdate method. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2022-10-01
- resourceGroupName - The name of the resource group. The name is case insensitive.
- autoscaleSettingName - The autoscale setting name.
- autoscaleSettingResource - Parameters supplied to the operation.
- options - AutoscaleSettingsClientUpdateOptions contains the optional parameters for the AutoscaleSettingsClient.Update method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Insights/stable/2022-10-01/examples/patchAutoscaleSetting.json
package main import ( "context" "log" "time" "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/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewAutoscaleSettingsClient().Update(ctx, "TestingMetricsScaleSet", "MySetting", armmonitor.AutoscaleSettingResourcePatch{ Properties: &armmonitor.AutoscaleSetting{ Enabled: to.Ptr(true), Notifications: []*armmonitor.AutoscaleNotification{ { Email: &armmonitor.EmailNotification{ CustomEmails: []*string{ to.Ptr("gu@ms.com"), to.Ptr("ge@ns.net")}, SendToSubscriptionAdministrator: to.Ptr(true), SendToSubscriptionCoAdministrators: to.Ptr(true), }, Operation: to.Ptr("Scale"), Webhooks: []*armmonitor.WebhookNotification{ { Properties: map[string]*string{}, ServiceURI: to.Ptr("http://myservice.com"), }}, }}, PredictiveAutoscalePolicy: &armmonitor.PredictiveAutoscalePolicy{ ScaleMode: to.Ptr(armmonitor.PredictiveAutoscalePolicyScaleModeEnabled), }, Profiles: []*armmonitor.AutoscaleProfile{ { Name: to.Ptr("adios"), Capacity: &armmonitor.ScaleCapacity{ Default: to.Ptr("1"), Maximum: to.Ptr("10"), Minimum: to.Ptr("1"), }, FixedDate: &armmonitor.TimeWindow{ End: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-03-05T14:30:00.000Z"); return t }()), Start: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-03-05T14:00:00.000Z"); return t }()), TimeZone: to.Ptr("UTC"), }, Rules: []*armmonitor.ScaleRule{ { MetricTrigger: &armmonitor.MetricTrigger{ DividePerInstance: to.Ptr(false), MetricName: to.Ptr("Percentage CPU"), MetricResourceURI: to.Ptr("/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc"), Operator: to.Ptr(armmonitor.ComparisonOperationTypeGreaterThan), Statistic: to.Ptr(armmonitor.MetricStatisticTypeAverage), Threshold: to.Ptr[float64](10), TimeAggregation: to.Ptr(armmonitor.TimeAggregationTypeAverage), TimeGrain: to.Ptr("PT1M"), TimeWindow: to.Ptr("PT5M"), }, ScaleAction: &armmonitor.ScaleAction{ Type: to.Ptr(armmonitor.ScaleTypeChangeCount), Cooldown: to.Ptr("PT5M"), Direction: to.Ptr(armmonitor.ScaleDirectionIncrease), Value: to.Ptr("1"), }, }, { MetricTrigger: &armmonitor.MetricTrigger{ DividePerInstance: to.Ptr(false), MetricName: to.Ptr("Percentage CPU"), MetricResourceURI: to.Ptr("/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc"), Operator: to.Ptr(armmonitor.ComparisonOperationTypeGreaterThan), Statistic: to.Ptr(armmonitor.MetricStatisticTypeAverage), Threshold: to.Ptr[float64](15), TimeAggregation: to.Ptr(armmonitor.TimeAggregationTypeAverage), TimeGrain: to.Ptr("PT2M"), TimeWindow: to.Ptr("PT5M"), }, ScaleAction: &armmonitor.ScaleAction{ Type: to.Ptr(armmonitor.ScaleTypeChangeCount), Cooldown: to.Ptr("PT6M"), Direction: to.Ptr(armmonitor.ScaleDirectionDecrease), Value: to.Ptr("2"), }, }}, }, { Name: to.Ptr("saludos"), Capacity: &armmonitor.ScaleCapacity{ Default: to.Ptr("1"), Maximum: to.Ptr("10"), Minimum: to.Ptr("1"), }, Recurrence: &armmonitor.Recurrence{ Frequency: to.Ptr(armmonitor.RecurrenceFrequencyWeek), Schedule: &armmonitor.RecurrentSchedule{ Days: []*string{ to.Ptr("1")}, Hours: []*int32{ to.Ptr[int32](5)}, Minutes: []*int32{ to.Ptr[int32](15)}, TimeZone: to.Ptr("UTC"), }, }, Rules: []*armmonitor.ScaleRule{ { MetricTrigger: &armmonitor.MetricTrigger{ DividePerInstance: to.Ptr(false), MetricName: to.Ptr("Percentage CPU"), MetricResourceURI: to.Ptr("/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc"), Operator: to.Ptr(armmonitor.ComparisonOperationTypeGreaterThan), Statistic: to.Ptr(armmonitor.MetricStatisticTypeAverage), Threshold: to.Ptr[float64](10), TimeAggregation: to.Ptr(armmonitor.TimeAggregationTypeAverage), TimeGrain: to.Ptr("PT1M"), TimeWindow: to.Ptr("PT5M"), }, ScaleAction: &armmonitor.ScaleAction{ Type: to.Ptr(armmonitor.ScaleTypeChangeCount), Cooldown: to.Ptr("PT5M"), Direction: to.Ptr(armmonitor.ScaleDirectionIncrease), Value: to.Ptr("1"), }, }, { MetricTrigger: &armmonitor.MetricTrigger{ DividePerInstance: to.Ptr(false), MetricName: to.Ptr("Percentage CPU"), MetricResourceURI: to.Ptr("/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc"), Operator: to.Ptr(armmonitor.ComparisonOperationTypeGreaterThan), Statistic: to.Ptr(armmonitor.MetricStatisticTypeAverage), Threshold: to.Ptr[float64](15), TimeAggregation: to.Ptr(armmonitor.TimeAggregationTypeAverage), TimeGrain: to.Ptr("PT2M"), TimeWindow: to.Ptr("PT5M"), }, ScaleAction: &armmonitor.ScaleAction{ Type: to.Ptr(armmonitor.ScaleTypeChangeCount), Cooldown: to.Ptr("PT6M"), Direction: to.Ptr(armmonitor.ScaleDirectionDecrease), Value: to.Ptr("2"), }, }}, }}, TargetResourceURI: to.Ptr("/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc"), }, Tags: map[string]*string{ "key1": to.Ptr("value1"), }, }, 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.AutoscaleSettingResource = armmonitor.AutoscaleSettingResource{ // Name: to.Ptr("MySetting"), // Type: to.Ptr("Microsoft.Insights/autoscaleSettings"), // ID: to.Ptr("/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/microsoft.insights/autoscalesettings/MySetting"), // Location: to.Ptr("West US"), // Tags: map[string]*string{ // "$type": to.Ptr("Microsoft.WindowsAzure.Management.Common.Storage.CasePreservedDictionary"), // }, // Properties: &armmonitor.AutoscaleSetting{ // Name: to.Ptr("MySetting"), // Enabled: to.Ptr(true), // Notifications: []*armmonitor.AutoscaleNotification{ // { // Email: &armmonitor.EmailNotification{ // CustomEmails: []*string{ // to.Ptr("gu@ms.com"), // to.Ptr("ge@ns.net")}, // SendToSubscriptionAdministrator: to.Ptr(true), // SendToSubscriptionCoAdministrators: to.Ptr(true), // }, // Operation: to.Ptr("Scale"), // Webhooks: []*armmonitor.WebhookNotification{ // { // Properties: map[string]*string{ // }, // ServiceURI: to.Ptr("http://myservice.com"), // }}, // }}, // PredictiveAutoscalePolicy: &armmonitor.PredictiveAutoscalePolicy{ // ScaleMode: to.Ptr(armmonitor.PredictiveAutoscalePolicyScaleModeEnabled), // }, // Profiles: []*armmonitor.AutoscaleProfile{ // { // Name: to.Ptr("adios"), // Capacity: &armmonitor.ScaleCapacity{ // Default: to.Ptr("1"), // Maximum: to.Ptr("10"), // Minimum: to.Ptr("1"), // }, // FixedDate: &armmonitor.TimeWindow{ // End: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-03-05T14:30:00.000Z"); return t}()), // Start: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-03-05T14:00:00.000Z"); return t}()), // TimeZone: to.Ptr("UTC"), // }, // Rules: []*armmonitor.ScaleRule{ // { // MetricTrigger: &armmonitor.MetricTrigger{ // DividePerInstance: to.Ptr(false), // MetricName: to.Ptr("Percentage CPU"), // MetricResourceURI: to.Ptr("/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc"), // Operator: to.Ptr(armmonitor.ComparisonOperationTypeGreaterThan), // Statistic: to.Ptr(armmonitor.MetricStatisticTypeAverage), // Threshold: to.Ptr[float64](10), // TimeAggregation: to.Ptr(armmonitor.TimeAggregationTypeAverage), // TimeGrain: to.Ptr("PT1M"), // TimeWindow: to.Ptr("PT5M"), // }, // ScaleAction: &armmonitor.ScaleAction{ // Type: to.Ptr(armmonitor.ScaleTypeChangeCount), // Cooldown: to.Ptr("PT5M"), // Direction: to.Ptr(armmonitor.ScaleDirectionIncrease), // Value: to.Ptr("1"), // }, // }, // { // MetricTrigger: &armmonitor.MetricTrigger{ // DividePerInstance: to.Ptr(false), // MetricName: to.Ptr("Percentage CPU"), // MetricResourceURI: to.Ptr("/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc"), // Operator: to.Ptr(armmonitor.ComparisonOperationTypeGreaterThan), // Statistic: to.Ptr(armmonitor.MetricStatisticTypeAverage), // Threshold: to.Ptr[float64](15), // TimeAggregation: to.Ptr(armmonitor.TimeAggregationTypeAverage), // TimeGrain: to.Ptr("PT2M"), // TimeWindow: to.Ptr("PT5M"), // }, // ScaleAction: &armmonitor.ScaleAction{ // Type: to.Ptr(armmonitor.ScaleTypeChangeCount), // Cooldown: to.Ptr("PT6M"), // Direction: to.Ptr(armmonitor.ScaleDirectionDecrease), // Value: to.Ptr("2"), // }, // }}, // }, // { // Name: to.Ptr("saludos"), // Capacity: &armmonitor.ScaleCapacity{ // Default: to.Ptr("1"), // Maximum: to.Ptr("10"), // Minimum: to.Ptr("1"), // }, // Recurrence: &armmonitor.Recurrence{ // Frequency: to.Ptr(armmonitor.RecurrenceFrequencyWeek), // Schedule: &armmonitor.RecurrentSchedule{ // Days: []*string{ // to.Ptr("1")}, // Hours: []*int32{ // to.Ptr[int32](5)}, // Minutes: []*int32{ // to.Ptr[int32](15)}, // TimeZone: to.Ptr("UTC"), // }, // }, // Rules: []*armmonitor.ScaleRule{ // { // MetricTrigger: &armmonitor.MetricTrigger{ // DividePerInstance: to.Ptr(false), // MetricName: to.Ptr("Percentage CPU"), // MetricResourceURI: to.Ptr("/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc"), // Operator: to.Ptr(armmonitor.ComparisonOperationTypeGreaterThan), // Statistic: to.Ptr(armmonitor.MetricStatisticTypeAverage), // Threshold: to.Ptr[float64](10), // TimeAggregation: to.Ptr(armmonitor.TimeAggregationTypeAverage), // TimeGrain: to.Ptr("PT1M"), // TimeWindow: to.Ptr("PT5M"), // }, // ScaleAction: &armmonitor.ScaleAction{ // Type: to.Ptr(armmonitor.ScaleTypeChangeCount), // Cooldown: to.Ptr("PT5M"), // Direction: to.Ptr(armmonitor.ScaleDirectionIncrease), // Value: to.Ptr("1"), // }, // }, // { // MetricTrigger: &armmonitor.MetricTrigger{ // DividePerInstance: to.Ptr(false), // MetricName: to.Ptr("Percentage CPU"), // MetricResourceURI: to.Ptr("/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc"), // Operator: to.Ptr(armmonitor.ComparisonOperationTypeGreaterThan), // Statistic: to.Ptr(armmonitor.MetricStatisticTypeAverage), // Threshold: to.Ptr[float64](15), // TimeAggregation: to.Ptr(armmonitor.TimeAggregationTypeAverage), // TimeGrain: to.Ptr("PT2M"), // TimeWindow: to.Ptr("PT5M"), // }, // ScaleAction: &armmonitor.ScaleAction{ // Type: to.Ptr(armmonitor.ScaleTypeChangeCount), // Cooldown: to.Ptr("PT6M"), // Direction: to.Ptr(armmonitor.ScaleDirectionDecrease), // Value: to.Ptr("2"), // }, // }}, // }}, // TargetResourceURI: to.Ptr("/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc"), // }, // } }
Output:
type AutoscaleSettingsClientCreateOrUpdateOptions ¶ added in v0.4.0
type AutoscaleSettingsClientCreateOrUpdateOptions struct { }
AutoscaleSettingsClientCreateOrUpdateOptions contains the optional parameters for the AutoscaleSettingsClient.CreateOrUpdate method.
type AutoscaleSettingsClientCreateOrUpdateResponse ¶ added in v0.4.0
type AutoscaleSettingsClientCreateOrUpdateResponse struct { // The autoscale setting resource. AutoscaleSettingResource }
AutoscaleSettingsClientCreateOrUpdateResponse contains the response from method AutoscaleSettingsClient.CreateOrUpdate.
type AutoscaleSettingsClientDeleteOptions ¶ added in v0.4.0
type AutoscaleSettingsClientDeleteOptions struct { }
AutoscaleSettingsClientDeleteOptions contains the optional parameters for the AutoscaleSettingsClient.Delete method.
type AutoscaleSettingsClientDeleteResponse ¶ added in v0.4.0
type AutoscaleSettingsClientDeleteResponse struct { }
AutoscaleSettingsClientDeleteResponse contains the response from method AutoscaleSettingsClient.Delete.
type AutoscaleSettingsClientGetOptions ¶ added in v0.4.0
type AutoscaleSettingsClientGetOptions struct { }
AutoscaleSettingsClientGetOptions contains the optional parameters for the AutoscaleSettingsClient.Get method.
type AutoscaleSettingsClientGetResponse ¶ added in v0.4.0
type AutoscaleSettingsClientGetResponse struct { // The autoscale setting resource. AutoscaleSettingResource }
AutoscaleSettingsClientGetResponse contains the response from method AutoscaleSettingsClient.Get.
type AutoscaleSettingsClientListByResourceGroupOptions ¶ added in v0.4.0
type AutoscaleSettingsClientListByResourceGroupOptions struct { }
AutoscaleSettingsClientListByResourceGroupOptions contains the optional parameters for the AutoscaleSettingsClient.NewListByResourceGroupPager method.
type AutoscaleSettingsClientListByResourceGroupResponse ¶ added in v0.4.0
type AutoscaleSettingsClientListByResourceGroupResponse struct { // Represents a collection of autoscale setting resources. AutoscaleSettingResourceCollection }
AutoscaleSettingsClientListByResourceGroupResponse contains the response from method AutoscaleSettingsClient.NewListByResourceGroupPager.
type AutoscaleSettingsClientListBySubscriptionOptions ¶ added in v0.4.0
type AutoscaleSettingsClientListBySubscriptionOptions struct { }
AutoscaleSettingsClientListBySubscriptionOptions contains the optional parameters for the AutoscaleSettingsClient.NewListBySubscriptionPager method.
type AutoscaleSettingsClientListBySubscriptionResponse ¶ added in v0.4.0
type AutoscaleSettingsClientListBySubscriptionResponse struct { // Represents a collection of autoscale setting resources. AutoscaleSettingResourceCollection }
AutoscaleSettingsClientListBySubscriptionResponse contains the response from method AutoscaleSettingsClient.NewListBySubscriptionPager.
type AutoscaleSettingsClientUpdateOptions ¶ added in v0.4.0
type AutoscaleSettingsClientUpdateOptions struct { }
AutoscaleSettingsClientUpdateOptions contains the optional parameters for the AutoscaleSettingsClient.Update method.
type AutoscaleSettingsClientUpdateResponse ¶ added in v0.4.0
type AutoscaleSettingsClientUpdateResponse struct { // The autoscale setting resource. AutoscaleSettingResource }
AutoscaleSettingsClientUpdateResponse contains the response from method AutoscaleSettingsClient.Update.
type AzureAppPushReceiver ¶
type AzureAppPushReceiver struct { // REQUIRED; The email address registered for the Azure mobile app. EmailAddress *string // REQUIRED; The name of the Azure mobile app push receiver. Names must be unique across all receivers within an action group. Name *string }
AzureAppPushReceiver - The Azure mobile App push notification receiver.
func (AzureAppPushReceiver) MarshalJSON ¶ added in v0.8.0
func (a AzureAppPushReceiver) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type AzureAppPushReceiver.
func (*AzureAppPushReceiver) UnmarshalJSON ¶ added in v0.8.0
func (a *AzureAppPushReceiver) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type AzureAppPushReceiver.
type AzureAppPushReceiverAutoGenerated ¶ added in v0.9.0
type AzureAppPushReceiverAutoGenerated struct { // REQUIRED; The email address registered for the Azure mobile app. EmailAddress *string // REQUIRED; The name of the Azure mobile app push receiver. Names must be unique across all receivers within a tenant action // group. Name *string }
AzureAppPushReceiverAutoGenerated - The Azure mobile App push notification receiver.
func (AzureAppPushReceiverAutoGenerated) MarshalJSON ¶ added in v0.9.0
func (a AzureAppPushReceiverAutoGenerated) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type AzureAppPushReceiverAutoGenerated.
func (*AzureAppPushReceiverAutoGenerated) UnmarshalJSON ¶ added in v0.9.0
func (a *AzureAppPushReceiverAutoGenerated) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type AzureAppPushReceiverAutoGenerated.
type AzureFunctionReceiver ¶
type AzureFunctionReceiver struct { // REQUIRED; The azure resource id of the function app. FunctionAppResourceID *string // REQUIRED; The function name in the function app. FunctionName *string // REQUIRED; The http trigger url where http request sent to. HTTPTriggerURL *string // REQUIRED; The name of the azure function receiver. Names must be unique across all receivers within an action group. Name *string // Indicates whether to use common alert schema. UseCommonAlertSchema *bool }
AzureFunctionReceiver - An azure function receiver.
func (AzureFunctionReceiver) MarshalJSON ¶ added in v0.8.0
func (a AzureFunctionReceiver) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type AzureFunctionReceiver.
func (*AzureFunctionReceiver) UnmarshalJSON ¶ added in v0.8.0
func (a *AzureFunctionReceiver) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type AzureFunctionReceiver.
type AzureMonitorMetricsDestination ¶
type AzureMonitorMetricsDestination struct { // A friendly name for the destination. This name should be unique across all destinations (regardless of type) within the // data collection rule. Name *string }
AzureMonitorMetricsDestination - Azure Monitor Metrics destination.
func (AzureMonitorMetricsDestination) MarshalJSON ¶ added in v0.8.0
func (a AzureMonitorMetricsDestination) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type AzureMonitorMetricsDestination.
func (*AzureMonitorMetricsDestination) UnmarshalJSON ¶ added in v0.8.0
func (a *AzureMonitorMetricsDestination) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type AzureMonitorMetricsDestination.
type AzureMonitorPrivateLinkScope ¶
type AzureMonitorPrivateLinkScope struct { // REQUIRED; The geo-location where the resource lives Location *string // REQUIRED; Properties that define a Azure Monitor PrivateLinkScope resource. Properties *AzureMonitorPrivateLinkScopeProperties // Resource tags. Tags map[string]*string // 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; System data SystemData *SystemData // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string }
AzureMonitorPrivateLinkScope - An Azure Monitor PrivateLinkScope definition.
func (AzureMonitorPrivateLinkScope) MarshalJSON ¶
func (a AzureMonitorPrivateLinkScope) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type AzureMonitorPrivateLinkScope.
func (*AzureMonitorPrivateLinkScope) UnmarshalJSON ¶ added in v0.8.0
func (a *AzureMonitorPrivateLinkScope) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type AzureMonitorPrivateLinkScope.
type AzureMonitorPrivateLinkScopeListResult ¶
type AzureMonitorPrivateLinkScopeListResult struct { // REQUIRED; List of Azure Monitor PrivateLinkScope definitions. Value []*AzureMonitorPrivateLinkScope // The URI to get the next set of Azure Monitor PrivateLinkScope definitions if too many PrivateLinkScopes where returned // in the result set. NextLink *string }
AzureMonitorPrivateLinkScopeListResult - Describes the list of Azure Monitor PrivateLinkScope resources.
func (AzureMonitorPrivateLinkScopeListResult) MarshalJSON ¶
func (a AzureMonitorPrivateLinkScopeListResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type AzureMonitorPrivateLinkScopeListResult.
func (*AzureMonitorPrivateLinkScopeListResult) UnmarshalJSON ¶ added in v0.8.0
func (a *AzureMonitorPrivateLinkScopeListResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type AzureMonitorPrivateLinkScopeListResult.
type AzureMonitorPrivateLinkScopeProperties ¶
type AzureMonitorPrivateLinkScopeProperties struct { // REQUIRED; Access mode settings AccessModeSettings *AccessModeSettings // READ-ONLY; List of private endpoint connections. PrivateEndpointConnections []*PrivateEndpointConnection // READ-ONLY; Current state of this PrivateLinkScope: whether or not is has been provisioned within the resource group it // is defined. Users cannot change this value but are able to read from it. Values will include // Provisioning ,Succeeded, Canceled and Failed. ProvisioningState *string }
AzureMonitorPrivateLinkScopeProperties - Properties that define a Azure Monitor PrivateLinkScope resource.
func (AzureMonitorPrivateLinkScopeProperties) MarshalJSON ¶
func (a AzureMonitorPrivateLinkScopeProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type AzureMonitorPrivateLinkScopeProperties.
func (*AzureMonitorPrivateLinkScopeProperties) UnmarshalJSON ¶ added in v0.8.0
func (a *AzureMonitorPrivateLinkScopeProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type AzureMonitorPrivateLinkScopeProperties.
type AzureMonitorWorkspace ¶ added in v0.9.0
type AzureMonitorWorkspace struct { // READ-ONLY; The immutable ID of the Azure Monitor workspace. This property is read-only. AccountID *string // READ-ONLY; The Data Collection Rule and Endpoint used for ingestion by default. DefaultIngestionSettings *AzureMonitorWorkspaceDefaultIngestionSettings // READ-ONLY; Information about metrics for the Azure Monitor workspace Metrics *AzureMonitorWorkspaceMetrics // READ-ONLY; The provisioning state of the Azure Monitor workspace. Set to Succeeded if everything is healthy. ProvisioningState *ProvisioningState }
AzureMonitorWorkspace - Properties of an Azure Monitor workspace
func (AzureMonitorWorkspace) MarshalJSON ¶ added in v0.9.0
func (a AzureMonitorWorkspace) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type AzureMonitorWorkspace.
func (*AzureMonitorWorkspace) UnmarshalJSON ¶ added in v0.9.0
func (a *AzureMonitorWorkspace) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type AzureMonitorWorkspace.
type AzureMonitorWorkspaceDefaultIngestionSettings ¶ added in v0.9.0
type AzureMonitorWorkspaceDefaultIngestionSettings struct { // READ-ONLY; The Azure resource Id of the default data collection endpoint for this workspace. DataCollectionEndpointResourceID *string // READ-ONLY; The Azure resource Id of the default data collection rule for this workspace. DataCollectionRuleResourceID *string }
AzureMonitorWorkspaceDefaultIngestionSettings - The Data Collection Rule and Endpoint used for ingestion by default.
func (AzureMonitorWorkspaceDefaultIngestionSettings) MarshalJSON ¶ added in v0.9.0
func (a AzureMonitorWorkspaceDefaultIngestionSettings) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type AzureMonitorWorkspaceDefaultIngestionSettings.
func (*AzureMonitorWorkspaceDefaultIngestionSettings) UnmarshalJSON ¶ added in v0.9.0
func (a *AzureMonitorWorkspaceDefaultIngestionSettings) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type AzureMonitorWorkspaceDefaultIngestionSettings.
type AzureMonitorWorkspaceMetrics ¶ added in v0.9.0
type AzureMonitorWorkspaceMetrics struct { // READ-ONLY; An internal identifier for the metrics container. Only to be used by the system InternalID *string // READ-ONLY; The Prometheus query endpoint for the workspace PrometheusQueryEndpoint *string }
AzureMonitorWorkspaceMetrics - Information about metrics for the Azure Monitor workspace
func (AzureMonitorWorkspaceMetrics) MarshalJSON ¶ added in v0.9.0
func (a AzureMonitorWorkspaceMetrics) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type AzureMonitorWorkspaceMetrics.
func (*AzureMonitorWorkspaceMetrics) UnmarshalJSON ¶ added in v0.9.0
func (a *AzureMonitorWorkspaceMetrics) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type AzureMonitorWorkspaceMetrics.
type AzureMonitorWorkspaceResource ¶ added in v0.9.0
type AzureMonitorWorkspaceResource struct { // REQUIRED; The geo-location where the resource lives Location *string // Resource properties Properties *AzureMonitorWorkspaceResourceProperties // Resource tags. Tags map[string]*string // READ-ONLY; Resource entity tag (ETag) Etag *string // 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 }
AzureMonitorWorkspaceResource - An Azure Monitor Workspace definition
func (AzureMonitorWorkspaceResource) MarshalJSON ¶ added in v0.9.0
func (a AzureMonitorWorkspaceResource) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type AzureMonitorWorkspaceResource.
func (*AzureMonitorWorkspaceResource) UnmarshalJSON ¶ added in v0.9.0
func (a *AzureMonitorWorkspaceResource) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type AzureMonitorWorkspaceResource.
type AzureMonitorWorkspaceResourceForUpdate ¶ added in v0.9.0
AzureMonitorWorkspaceResourceForUpdate - Definition of ARM tracked top level resource properties for update operation
func (AzureMonitorWorkspaceResourceForUpdate) MarshalJSON ¶ added in v0.9.0
func (a AzureMonitorWorkspaceResourceForUpdate) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type AzureMonitorWorkspaceResourceForUpdate.
func (*AzureMonitorWorkspaceResourceForUpdate) UnmarshalJSON ¶ added in v0.9.0
func (a *AzureMonitorWorkspaceResourceForUpdate) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type AzureMonitorWorkspaceResourceForUpdate.
type AzureMonitorWorkspaceResourceListResult ¶ added in v0.9.0
type AzureMonitorWorkspaceResourceListResult struct { // REQUIRED; A list of resources Value []*AzureMonitorWorkspaceResource // The URL to use for getting the next set of results NextLink *string }
AzureMonitorWorkspaceResourceListResult - A pageable list of resources
func (AzureMonitorWorkspaceResourceListResult) MarshalJSON ¶ added in v0.9.0
func (a AzureMonitorWorkspaceResourceListResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type AzureMonitorWorkspaceResourceListResult.
func (*AzureMonitorWorkspaceResourceListResult) UnmarshalJSON ¶ added in v0.9.0
func (a *AzureMonitorWorkspaceResourceListResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type AzureMonitorWorkspaceResourceListResult.
type AzureMonitorWorkspaceResourceProperties ¶ added in v0.9.0
type AzureMonitorWorkspaceResourceProperties struct { // READ-ONLY; The immutable ID of the Azure Monitor workspace. This property is read-only. AccountID *string // READ-ONLY; The Data Collection Rule and Endpoint used for ingestion by default. DefaultIngestionSettings *AzureMonitorWorkspaceDefaultIngestionSettings // READ-ONLY; Information about metrics for the Azure Monitor workspace Metrics *AzureMonitorWorkspaceMetrics // READ-ONLY; The provisioning state of the Azure Monitor workspace. Set to Succeeded if everything is healthy. ProvisioningState *ProvisioningState }
AzureMonitorWorkspaceResourceProperties - Resource properties
func (AzureMonitorWorkspaceResourceProperties) MarshalJSON ¶ added in v0.9.0
func (a AzureMonitorWorkspaceResourceProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type AzureMonitorWorkspaceResourceProperties.
func (*AzureMonitorWorkspaceResourceProperties) UnmarshalJSON ¶ added in v0.9.0
func (a *AzureMonitorWorkspaceResourceProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type AzureMonitorWorkspaceResourceProperties.
type AzureMonitorWorkspacesClient ¶ added in v0.9.0
type AzureMonitorWorkspacesClient struct {
// contains filtered or unexported fields
}
AzureMonitorWorkspacesClient contains the methods for the AzureMonitorWorkspaces group. Don't use this type directly, use NewAzureMonitorWorkspacesClient() instead.
func NewAzureMonitorWorkspacesClient ¶ added in v0.9.0
func NewAzureMonitorWorkspacesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AzureMonitorWorkspacesClient, error)
NewAzureMonitorWorkspacesClient creates a new instance of AzureMonitorWorkspacesClient with the specified values.
- subscriptionID - The ID of the target subscription.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - pass nil to accept the default values.
func (*AzureMonitorWorkspacesClient) Create ¶ added in v0.9.0
func (client *AzureMonitorWorkspacesClient) Create(ctx context.Context, resourceGroupName string, azureMonitorWorkspaceName string, azureMonitorWorkspaceProperties AzureMonitorWorkspaceResource, options *AzureMonitorWorkspacesClientCreateOptions) (AzureMonitorWorkspacesClientCreateResponse, error)
Create - Create or update a workspace If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2021-06-03-preview
- resourceGroupName - The name of the resource group. The name is case insensitive.
- azureMonitorWorkspaceName - The name of the Azure Monitor workspace. The name is case insensitive
- azureMonitorWorkspaceProperties - Properties that need to be specified to create a new workspace
- options - AzureMonitorWorkspacesClientCreateOptions contains the optional parameters for the AzureMonitorWorkspacesClient.Create method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Monitor/preview/2021-06-03-preview/examples/AzureMonitorWorkspacesCreate.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewAzureMonitorWorkspacesClient().Create(ctx, "myResourceGroup", "myAzureMonitorWorkspace", armmonitor.AzureMonitorWorkspaceResource{ Location: to.Ptr("eastus"), }, 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.AzureMonitorWorkspaceResource = armmonitor.AzureMonitorWorkspaceResource{ // Name: to.Ptr("myAzureMonitorWorkspace"), // Type: to.Ptr("Microsoft.Monitor/accounts"), // ID: to.Ptr("/subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.Monitor/accounts/myAzureMonitorWorkspace"), // SystemData: &armmonitor.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-01T12:34:56.123Z"); return t}()), // CreatedBy: to.Ptr("user1"), // CreatedByType: to.Ptr(armmonitor.CreatedByTypeUser), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-02T12:34:56.123Z"); return t}()), // LastModifiedBy: to.Ptr("user2"), // LastModifiedByType: to.Ptr(armmonitor.CreatedByTypeUser), // }, // Location: to.Ptr("eastus"), // Tags: map[string]*string{ // "tag1": to.Ptr("A"), // "tag2": to.Ptr("B"), // }, // Etag: to.Ptr("070057da-0000-0000-0000-5ba70d6c0000"), // Properties: &armmonitor.AzureMonitorWorkspaceResourceProperties{ // AccountID: to.Ptr("2df515bf-c3ce-4920-84d4-1d9d16542d9f"), // DefaultIngestionSettings: &armmonitor.AzureMonitorWorkspaceDefaultIngestionSettings{ // DataCollectionEndpointResourceID: to.Ptr("/subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/MA_myAzureMonitorWorkspace_eastus_managed/providers/Microsoft.Insights/dataCollectionEndpoints/myAzureMonitorWorkspace"), // DataCollectionRuleResourceID: to.Ptr("/subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/MA_myAzureMonitorWorkspace_eastus_managed/providers/Microsoft.Insights/dataCollectionRules/myAzureMonitorWorkspace"), // }, // Metrics: &armmonitor.AzureMonitorWorkspaceMetrics{ // InternalID: to.Ptr("mac_2df515bf-c3ce-4920-84d4-1d9d16542d9f"), // PrometheusQueryEndpoint: to.Ptr("https://myAzureMonitorWorkspace-v8hx.eastus.prometheus.monitor.azure.com"), // }, // ProvisioningState: to.Ptr(armmonitor.ProvisioningStateSucceeded), // }, // } }
Output:
func (*AzureMonitorWorkspacesClient) Delete ¶ added in v0.9.0
func (client *AzureMonitorWorkspacesClient) Delete(ctx context.Context, resourceGroupName string, azureMonitorWorkspaceName string, options *AzureMonitorWorkspacesClientDeleteOptions) (AzureMonitorWorkspacesClientDeleteResponse, error)
Delete - Delete a workspace If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2021-06-03-preview
- resourceGroupName - The name of the resource group. The name is case insensitive.
- azureMonitorWorkspaceName - The name of the Azure Monitor workspace. The name is case insensitive
- options - AzureMonitorWorkspacesClientDeleteOptions contains the optional parameters for the AzureMonitorWorkspacesClient.Delete method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Monitor/preview/2021-06-03-preview/examples/AzureMonitorWorkspacesDelete.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } _, err = clientFactory.NewAzureMonitorWorkspacesClient().Delete(ctx, "myResourceGroup", "myAzureMonitorWorkspace", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } }
Output:
func (*AzureMonitorWorkspacesClient) Get ¶ added in v0.9.0
func (client *AzureMonitorWorkspacesClient) Get(ctx context.Context, resourceGroupName string, azureMonitorWorkspaceName string, options *AzureMonitorWorkspacesClientGetOptions) (AzureMonitorWorkspacesClientGetResponse, error)
Get - Returns the specific Azure Monitor workspace If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2021-06-03-preview
- resourceGroupName - The name of the resource group. The name is case insensitive.
- azureMonitorWorkspaceName - The name of the Azure Monitor workspace. The name is case insensitive
- options - AzureMonitorWorkspacesClientGetOptions contains the optional parameters for the AzureMonitorWorkspacesClient.Get method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Monitor/preview/2021-06-03-preview/examples/AzureMonitorWorkspacesGet.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewAzureMonitorWorkspacesClient().Get(ctx, "myResourceGroup", "myAzureMonitorWorkspace", 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.AzureMonitorWorkspaceResource = armmonitor.AzureMonitorWorkspaceResource{ // Name: to.Ptr("myAzureMonitorWorkspace"), // Type: to.Ptr("Microsoft.Monitor/accounts"), // ID: to.Ptr("/subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.Monitor/accounts/myAzureMonitorWorkspace"), // SystemData: &armmonitor.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-01T12:34:56.123Z"); return t}()), // CreatedBy: to.Ptr("user1"), // CreatedByType: to.Ptr(armmonitor.CreatedByTypeUser), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-02T12:34:56.123Z"); return t}()), // LastModifiedBy: to.Ptr("user2"), // LastModifiedByType: to.Ptr(armmonitor.CreatedByTypeUser), // }, // Location: to.Ptr("eastus"), // Tags: map[string]*string{ // "tag1": to.Ptr("A"), // "tag2": to.Ptr("B"), // }, // Etag: to.Ptr("070057da-0000-0000-0000-5ba70d6c0000"), // Properties: &armmonitor.AzureMonitorWorkspaceResourceProperties{ // AccountID: to.Ptr("2df515bf-c3ce-4920-84d4-1d9d16542d9f"), // DefaultIngestionSettings: &armmonitor.AzureMonitorWorkspaceDefaultIngestionSettings{ // DataCollectionEndpointResourceID: to.Ptr("/subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/MA_myAzureMonitorWorkspace_eastus_managed/providers/Microsoft.Insights/dataCollectionEndpoints/myAzureMonitorWorkspace"), // DataCollectionRuleResourceID: to.Ptr("/subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/MA_myAzureMonitorWorkspace_eastus_managed/providers/Microsoft.Insights/dataCollectionRules/myAzureMonitorWorkspace"), // }, // Metrics: &armmonitor.AzureMonitorWorkspaceMetrics{ // InternalID: to.Ptr("mac_2df515bf-c3ce-4920-84d4-1d9d16542d9f"), // PrometheusQueryEndpoint: to.Ptr("https://myAzureMonitorWorkspace-v8hx.eastus.prometheus.monitor.azure.com"), // }, // ProvisioningState: to.Ptr(armmonitor.ProvisioningStateSucceeded), // }, // } }
Output:
func (*AzureMonitorWorkspacesClient) NewListByResourceGroupPager ¶ added in v0.9.0
func (client *AzureMonitorWorkspacesClient) NewListByResourceGroupPager(resourceGroupName string, options *AzureMonitorWorkspacesClientListByResourceGroupOptions) *runtime.Pager[AzureMonitorWorkspacesClientListByResourceGroupResponse]
NewListByResourceGroupPager - Lists all workspaces in the specified resource group
Generated from API version 2021-06-03-preview
- resourceGroupName - The name of the resource group. The name is case insensitive.
- options - AzureMonitorWorkspacesClientListByResourceGroupOptions contains the optional parameters for the AzureMonitorWorkspacesClient.NewListByResourceGroupPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Monitor/preview/2021-06-03-preview/examples/AzureMonitorWorkspacesListByResourceGroup.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewAzureMonitorWorkspacesClient().NewListByResourceGroupPager("myResourceGroup", 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.AzureMonitorWorkspaceResourceListResult = armmonitor.AzureMonitorWorkspaceResourceListResult{ // Value: []*armmonitor.AzureMonitorWorkspaceResource{ // { // Name: to.Ptr("myAzureMonitorWorkspace"), // Type: to.Ptr("Microsoft.Monitor/accounts"), // ID: to.Ptr("/subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.Monitor/accounts/myAzureMonitorWorkspace"), // SystemData: &armmonitor.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-01T12:34:56.123Z"); return t}()), // CreatedBy: to.Ptr("user1"), // CreatedByType: to.Ptr(armmonitor.CreatedByTypeUser), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-02T12:34:56.123Z"); return t}()), // LastModifiedBy: to.Ptr("user2"), // LastModifiedByType: to.Ptr(armmonitor.CreatedByTypeUser), // }, // Location: to.Ptr("eastus"), // Tags: map[string]*string{ // "tag1": to.Ptr("A"), // "tag2": to.Ptr("B"), // }, // Etag: to.Ptr("070057da-0000-0000-0000-5ba70d6c0000"), // Properties: &armmonitor.AzureMonitorWorkspaceResourceProperties{ // AccountID: to.Ptr("2df515bf-c3ce-4920-84d4-1d9d16542d9f"), // DefaultIngestionSettings: &armmonitor.AzureMonitorWorkspaceDefaultIngestionSettings{ // DataCollectionEndpointResourceID: to.Ptr("/subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/MA_myAzureMonitorWorkspace_eastus_managed/providers/Microsoft.Insights/dataCollectionEndpoints/myAzureMonitorWorkspace"), // DataCollectionRuleResourceID: to.Ptr("/subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/MA_myAzureMonitorWorkspace_eastus_managed/providers/Microsoft.Insights/dataCollectionRules/myAzureMonitorWorkspace"), // }, // Metrics: &armmonitor.AzureMonitorWorkspaceMetrics{ // InternalID: to.Ptr("mac_2df515bf-c3ce-4920-84d4-1d9d16542d9f"), // PrometheusQueryEndpoint: to.Ptr("https://myAzureMonitorWorkspace-abcd.eastus.prometheus.monitor.azure.com"), // }, // ProvisioningState: to.Ptr(armmonitor.ProvisioningStateSucceeded), // }, // }, // { // Name: to.Ptr("herAzureMonitorWorkspace"), // Type: to.Ptr("Microsoft.Monitor/accounts"), // ID: to.Ptr("/subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.Monitor/accounts/herAzureMonitorWorkspace"), // SystemData: &armmonitor.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-01T12:34:56.123Z"); return t}()), // CreatedBy: to.Ptr("user1"), // CreatedByType: to.Ptr(armmonitor.CreatedByTypeUser), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-02T12:34:56.123Z"); return t}()), // LastModifiedBy: to.Ptr("user2"), // LastModifiedByType: to.Ptr(armmonitor.CreatedByTypeUser), // }, // Location: to.Ptr("westus"), // Tags: map[string]*string{ // "tag1": to.Ptr("A"), // "tag2": to.Ptr("B"), // }, // Etag: to.Ptr("070057da-0000-0000-0000-5ba70d6c0000"), // Properties: &armmonitor.AzureMonitorWorkspaceResourceProperties{ // AccountID: to.Ptr("823220c6-0415-44d8-bfb2-d5c1c9ea1172"), // DefaultIngestionSettings: &armmonitor.AzureMonitorWorkspaceDefaultIngestionSettings{ // DataCollectionEndpointResourceID: to.Ptr("/subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/MA_herAzureMonitorWorkspace_eastus_managed/providers/Microsoft.Insights/dataCollectionEndpoints/herAzureMonitorWorkspace"), // DataCollectionRuleResourceID: to.Ptr("/subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/MA_herAzureMonitorWorkspace_eastus_managed/providers/Microsoft.Insights/dataCollectionRules/herAzureMonitorWorkspace"), // }, // Metrics: &armmonitor.AzureMonitorWorkspaceMetrics{ // InternalID: to.Ptr("mac_823220c6-0415-44d8-bfb2-d5c1c9ea1172"), // PrometheusQueryEndpoint: to.Ptr("https://herAzureMonitorWorkspace-xywz.eastus.prometheus.monitor.azure.com"), // }, // ProvisioningState: to.Ptr(armmonitor.ProvisioningStateSucceeded), // }, // }}, // } } }
Output:
func (*AzureMonitorWorkspacesClient) NewListBySubscriptionPager ¶ added in v0.9.0
func (client *AzureMonitorWorkspacesClient) NewListBySubscriptionPager(options *AzureMonitorWorkspacesClientListBySubscriptionOptions) *runtime.Pager[AzureMonitorWorkspacesClientListBySubscriptionResponse]
NewListBySubscriptionPager - Lists all workspaces in the specified subscription
Generated from API version 2021-06-03-preview
- options - AzureMonitorWorkspacesClientListBySubscriptionOptions contains the optional parameters for the AzureMonitorWorkspacesClient.NewListBySubscriptionPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Monitor/preview/2021-06-03-preview/examples/AzureMonitorWorkspacesListBySubscription.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewAzureMonitorWorkspacesClient().NewListBySubscriptionPager(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.AzureMonitorWorkspaceResourceListResult = armmonitor.AzureMonitorWorkspaceResourceListResult{ // Value: []*armmonitor.AzureMonitorWorkspaceResource{ // { // Name: to.Ptr("myAzureMonitorWorkspace"), // Type: to.Ptr("Microsoft.Monitor/accounts"), // ID: to.Ptr("/subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.Monitor/accounts/myAzureMonitorWorkspace"), // SystemData: &armmonitor.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-01T12:34:56.123Z"); return t}()), // CreatedBy: to.Ptr("user1"), // CreatedByType: to.Ptr(armmonitor.CreatedByTypeUser), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-02T12:34:56.123Z"); return t}()), // LastModifiedBy: to.Ptr("user2"), // LastModifiedByType: to.Ptr(armmonitor.CreatedByTypeUser), // }, // Location: to.Ptr("eastus"), // Tags: map[string]*string{ // "tag1": to.Ptr("A"), // "tag2": to.Ptr("B"), // }, // Etag: to.Ptr("070057da-0000-0000-0000-5ba70d6c0000"), // Properties: &armmonitor.AzureMonitorWorkspaceResourceProperties{ // AccountID: to.Ptr("2df515bf-c3ce-4920-84d4-1d9d16542d9f"), // DefaultIngestionSettings: &armmonitor.AzureMonitorWorkspaceDefaultIngestionSettings{ // DataCollectionEndpointResourceID: to.Ptr("/subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/MA_myAzureMonitorWorkspace_eastus_managed/providers/Microsoft.Insights/dataCollectionEndpoints/myAzureMonitorWorkspace"), // DataCollectionRuleResourceID: to.Ptr("/subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/MA_myAzureMonitorWorkspace_eastus_managed/providers/Microsoft.Insights/dataCollectionRules/myAzureMonitorWorkspace"), // }, // Metrics: &armmonitor.AzureMonitorWorkspaceMetrics{ // InternalID: to.Ptr("mac_2df515bf-c3ce-4920-84d4-1d9d16542d9f"), // PrometheusQueryEndpoint: to.Ptr("https://myAzureMonitorWorkspace-v8hx.eastus.prometheus.monitor.azure.com"), // }, // ProvisioningState: to.Ptr(armmonitor.ProvisioningStateSucceeded), // }, // }, // { // Name: to.Ptr("herAzureMonitorWorkspace"), // Type: to.Ptr("Microsoft.Monitor/accounts"), // ID: to.Ptr("/subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/herResourceGroup/providers/Microsoft.Monitor/accounts/herAzureMonitorWorkspace"), // SystemData: &armmonitor.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-01T12:34:56.123Z"); return t}()), // CreatedBy: to.Ptr("user1"), // CreatedByType: to.Ptr(armmonitor.CreatedByTypeUser), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-02T12:34:56.123Z"); return t}()), // LastModifiedBy: to.Ptr("user2"), // LastModifiedByType: to.Ptr(armmonitor.CreatedByTypeUser), // }, // Location: to.Ptr("westus"), // Tags: map[string]*string{ // "tag1": to.Ptr("A"), // "tag2": to.Ptr("B"), // }, // Etag: to.Ptr("070057da-0000-0000-0000-5ba70d6c0000"), // Properties: &armmonitor.AzureMonitorWorkspaceResourceProperties{ // AccountID: to.Ptr("823220c6-0415-44d8-bfb2-d5c1c9ea1172"), // DefaultIngestionSettings: &armmonitor.AzureMonitorWorkspaceDefaultIngestionSettings{ // DataCollectionEndpointResourceID: to.Ptr("/subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/MA_herAzureMonitorWorkspace_eastus_managed/providers/Microsoft.Insights/dataCollectionEndpoints/herAzureMonitorWorkspace"), // DataCollectionRuleResourceID: to.Ptr("/subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/MA_herAzureMonitorWorkspace_eastus_managed/providers/Microsoft.Insights/dataCollectionRules/herAzureMonitorWorkspace"), // }, // Metrics: &armmonitor.AzureMonitorWorkspaceMetrics{ // InternalID: to.Ptr("mac_823220c6-0415-44d8-bfb2-d5c1c9ea1172"), // PrometheusQueryEndpoint: to.Ptr("https://herazuremonitorworkspace-xywz.eastus.prometheus.monitor.azure.com"), // }, // ProvisioningState: to.Ptr(armmonitor.ProvisioningStateSucceeded), // }, // }}, // } } }
Output:
func (*AzureMonitorWorkspacesClient) Update ¶ added in v0.9.0
func (client *AzureMonitorWorkspacesClient) Update(ctx context.Context, resourceGroupName string, azureMonitorWorkspaceName string, options *AzureMonitorWorkspacesClientUpdateOptions) (AzureMonitorWorkspacesClientUpdateResponse, error)
Update - Updates part of a workspace If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2021-06-03-preview
- resourceGroupName - The name of the resource group. The name is case insensitive.
- azureMonitorWorkspaceName - The name of the Azure Monitor workspace. The name is case insensitive
- options - AzureMonitorWorkspacesClientUpdateOptions contains the optional parameters for the AzureMonitorWorkspacesClient.Update method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Monitor/preview/2021-06-03-preview/examples/AzureMonitorWorkspacesUpdate.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewAzureMonitorWorkspacesClient().Update(ctx, "myResourceGroup", "myAzureMonitorWorkspace", &armmonitor.AzureMonitorWorkspacesClientUpdateOptions{AzureMonitorWorkspaceProperties: &armmonitor.AzureMonitorWorkspaceResourceForUpdate{ Tags: map[string]*string{ "tag1": to.Ptr("A"), "tag2": to.Ptr("B"), "tag3": to.Ptr("C"), }, }, }) 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.AzureMonitorWorkspaceResource = armmonitor.AzureMonitorWorkspaceResource{ // Name: to.Ptr("myAzureMonitorWorkspace"), // Type: to.Ptr("Microsoft.Monitor/accounts"), // ID: to.Ptr("/subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.Monitor/accounts/myAzureMonitorWorkspace"), // SystemData: &armmonitor.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-01T12:34:56.123Z"); return t}()), // CreatedBy: to.Ptr("user1"), // CreatedByType: to.Ptr(armmonitor.CreatedByTypeUser), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-02T12:34:56.123Z"); return t}()), // LastModifiedBy: to.Ptr("user2"), // LastModifiedByType: to.Ptr(armmonitor.CreatedByTypeUser), // }, // Location: to.Ptr("eastus"), // Tags: map[string]*string{ // "tag1": to.Ptr("A"), // "tag2": to.Ptr("B"), // "tag3": to.Ptr("C"), // }, // Etag: to.Ptr("070057da-0000-0000-0000-5ba70d6c0000"), // Properties: &armmonitor.AzureMonitorWorkspaceResourceProperties{ // AccountID: to.Ptr("2df515bf-c3ce-4920-84d4-1d9d16542d9f"), // DefaultIngestionSettings: &armmonitor.AzureMonitorWorkspaceDefaultIngestionSettings{ // DataCollectionEndpointResourceID: to.Ptr("/subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/MA_myAzureMonitorWorkspace_eastus_managed/providers/Microsoft.Insights/dataCollectionEndpoints/myAzureMonitorWorkspace"), // DataCollectionRuleResourceID: to.Ptr("/subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/MA_myAzureMonitorWorkspace_eastus_managed/providers/Microsoft.Insights/dataCollectionRules/myAzureMonitorWorkspace"), // }, // Metrics: &armmonitor.AzureMonitorWorkspaceMetrics{ // InternalID: to.Ptr("mac_2df515bf-c3ce-4920-84d4-1d9d16542d9f"), // PrometheusQueryEndpoint: to.Ptr("https://myAzureMonitorWorkspace-v8hx.eastus.prometheus.monitor.azure.com"), // }, // ProvisioningState: to.Ptr(armmonitor.ProvisioningStateSucceeded), // }, // } }
Output:
type AzureMonitorWorkspacesClientCreateOptions ¶ added in v0.9.0
type AzureMonitorWorkspacesClientCreateOptions struct { }
AzureMonitorWorkspacesClientCreateOptions contains the optional parameters for the AzureMonitorWorkspacesClient.Create method.
type AzureMonitorWorkspacesClientCreateResponse ¶ added in v0.9.0
type AzureMonitorWorkspacesClientCreateResponse struct { // An Azure Monitor Workspace definition AzureMonitorWorkspaceResource }
AzureMonitorWorkspacesClientCreateResponse contains the response from method AzureMonitorWorkspacesClient.Create.
type AzureMonitorWorkspacesClientDeleteOptions ¶ added in v0.9.0
type AzureMonitorWorkspacesClientDeleteOptions struct { }
AzureMonitorWorkspacesClientDeleteOptions contains the optional parameters for the AzureMonitorWorkspacesClient.Delete method.
type AzureMonitorWorkspacesClientDeleteResponse ¶ added in v0.9.0
type AzureMonitorWorkspacesClientDeleteResponse struct { }
AzureMonitorWorkspacesClientDeleteResponse contains the response from method AzureMonitorWorkspacesClient.Delete.
type AzureMonitorWorkspacesClientGetOptions ¶ added in v0.9.0
type AzureMonitorWorkspacesClientGetOptions struct { }
AzureMonitorWorkspacesClientGetOptions contains the optional parameters for the AzureMonitorWorkspacesClient.Get method.
type AzureMonitorWorkspacesClientGetResponse ¶ added in v0.9.0
type AzureMonitorWorkspacesClientGetResponse struct { // An Azure Monitor Workspace definition AzureMonitorWorkspaceResource }
AzureMonitorWorkspacesClientGetResponse contains the response from method AzureMonitorWorkspacesClient.Get.
type AzureMonitorWorkspacesClientListByResourceGroupOptions ¶ added in v0.9.0
type AzureMonitorWorkspacesClientListByResourceGroupOptions struct { }
AzureMonitorWorkspacesClientListByResourceGroupOptions contains the optional parameters for the AzureMonitorWorkspacesClient.NewListByResourceGroupPager method.
type AzureMonitorWorkspacesClientListByResourceGroupResponse ¶ added in v0.9.0
type AzureMonitorWorkspacesClientListByResourceGroupResponse struct { // A pageable list of resources AzureMonitorWorkspaceResourceListResult }
AzureMonitorWorkspacesClientListByResourceGroupResponse contains the response from method AzureMonitorWorkspacesClient.NewListByResourceGroupPager.
type AzureMonitorWorkspacesClientListBySubscriptionOptions ¶ added in v0.9.0
type AzureMonitorWorkspacesClientListBySubscriptionOptions struct { }
AzureMonitorWorkspacesClientListBySubscriptionOptions contains the optional parameters for the AzureMonitorWorkspacesClient.NewListBySubscriptionPager method.
type AzureMonitorWorkspacesClientListBySubscriptionResponse ¶ added in v0.9.0
type AzureMonitorWorkspacesClientListBySubscriptionResponse struct { // A pageable list of resources AzureMonitorWorkspaceResourceListResult }
AzureMonitorWorkspacesClientListBySubscriptionResponse contains the response from method AzureMonitorWorkspacesClient.NewListBySubscriptionPager.
type AzureMonitorWorkspacesClientUpdateOptions ¶ added in v0.9.0
type AzureMonitorWorkspacesClientUpdateOptions struct { // The payload AzureMonitorWorkspaceProperties *AzureMonitorWorkspaceResourceForUpdate }
AzureMonitorWorkspacesClientUpdateOptions contains the optional parameters for the AzureMonitorWorkspacesClient.Update method.
type AzureMonitorWorkspacesClientUpdateResponse ¶ added in v0.9.0
type AzureMonitorWorkspacesClientUpdateResponse struct { // An Azure Monitor Workspace definition AzureMonitorWorkspaceResource }
AzureMonitorWorkspacesClientUpdateResponse contains the response from method AzureMonitorWorkspacesClient.Update.
type AzureResource ¶
type AzureResource struct { // REQUIRED; Resource location Location *string // Resource tags Tags map[string]*string // READ-ONLY; Azure resource Id ID *string // READ-ONLY; Azure resource name Name *string // READ-ONLY; Azure resource type Type *string }
AzureResource - An azure resource object
func (AzureResource) MarshalJSON ¶
func (a AzureResource) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type AzureResource.
func (*AzureResource) UnmarshalJSON ¶ added in v0.8.0
func (a *AzureResource) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type AzureResource.
type AzureResourceAutoGenerated ¶ added in v0.4.0
type AzureResourceAutoGenerated struct { // The location of the resource. Since Azure Activity Log Alerts is a global service, the location of the rules should always // be 'global'. Location *string // The tags of the resource. Tags map[string]*string // READ-ONLY; The resource Id. ID *string // READ-ONLY; The name of the resource. Name *string // READ-ONLY; The type of the resource. Type *string }
AzureResourceAutoGenerated - An Azure resource object.
func (AzureResourceAutoGenerated) MarshalJSON ¶ added in v0.4.0
func (a AzureResourceAutoGenerated) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type AzureResourceAutoGenerated.
func (*AzureResourceAutoGenerated) UnmarshalJSON ¶ added in v0.8.0
func (a *AzureResourceAutoGenerated) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type AzureResourceAutoGenerated.
type BaselineMetadata ¶
type BaselineMetadata struct { // REQUIRED; Name of the baseline metadata. Name *string // REQUIRED; Value of the baseline metadata. Value *string }
BaselineMetadata - Represents a baseline metadata value.
func (BaselineMetadata) MarshalJSON ¶ added in v0.8.0
func (b BaselineMetadata) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type BaselineMetadata.
func (*BaselineMetadata) UnmarshalJSON ¶ added in v0.8.0
func (b *BaselineMetadata) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type BaselineMetadata.
type BaselineSensitivity ¶
type BaselineSensitivity string
BaselineSensitivity - the sensitivity of the baseline.
const ( BaselineSensitivityHigh BaselineSensitivity = "High" BaselineSensitivityLow BaselineSensitivity = "Low" BaselineSensitivityMedium BaselineSensitivity = "Medium" )
func PossibleBaselineSensitivityValues ¶
func PossibleBaselineSensitivityValues() []BaselineSensitivity
PossibleBaselineSensitivityValues returns the possible values for the BaselineSensitivity const type.
type BaselinesClient ¶
type BaselinesClient struct {
// contains filtered or unexported fields
}
BaselinesClient contains the methods for the Baselines group. Don't use this type directly, use NewBaselinesClient() instead.
func NewBaselinesClient ¶
func NewBaselinesClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*BaselinesClient, error)
NewBaselinesClient creates a new instance of BaselinesClient with the specified values.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - pass nil to accept the default values.
func (*BaselinesClient) NewListPager ¶ added in v0.6.0
func (client *BaselinesClient) NewListPager(resourceURI string, options *BaselinesClientListOptions) *runtime.Pager[BaselinesClientListResponse]
NewListPager - Lists the metric baseline values for a resource.
Generated from API version 2019-03-01
- resourceURI - The identifier of the resource.
- options - BaselinesClientListOptions contains the optional parameters for the BaselinesClient.NewListPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Insights/stable/2019-03-01/examples/metricBaselines.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewBaselinesClient().NewListPager("subscriptions/b368ca2f-e298-46b7-b0ab-012281956afa/resourceGroups/vms/providers/Microsoft.Compute/virtualMachines/vm1", &armmonitor.BaselinesClientListOptions{Metricnames: nil, Metricnamespace: nil, Timespan: to.Ptr("2019-03-12T11:00:00.000Z/2019-03-12T12:00:00.000Z"), Interval: to.Ptr("PT1H"), Aggregation: to.Ptr("average"), Sensitivities: to.Ptr("Low,Medium"), Filter: nil, ResultType: 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.MetricBaselinesResponse = armmonitor.MetricBaselinesResponse{ // Value: []*armmonitor.SingleMetricBaseline{ // { // Name: to.Ptr("Percentage CPU"), // Type: to.Ptr("microsoft.insights/metricBaselines"), // ID: to.Ptr("/subscriptions/11aeb0ed-456b-4ca0-8df5-b9fbdc63d0d3/resourceGroups/SmartAnalytics-DEV-VM/providers/Microsoft.Compute/virtualMachines/DemoVM1/providers/microsoft.insights/metricBaselines/Percentage CPU"), // Properties: &armmonitor.MetricBaselinesProperties{ // Baselines: []*armmonitor.TimeSeriesBaseline{ // { // Aggregation: to.Ptr("average"), // Data: []*armmonitor.SingleBaseline{ // { // HighThresholds: []*float64{ // to.Ptr[float64](90.3453), // to.Ptr[float64](91.3453)}, // LowThresholds: []*float64{ // to.Ptr[float64](30), // to.Ptr[float64](31.1)}, // Sensitivity: to.Ptr(armmonitor.BaselineSensitivityLow), // }, // { // HighThresholds: []*float64{ // to.Ptr[float64](70.3453), // to.Ptr[float64](71.3453)}, // LowThresholds: []*float64{ // to.Ptr[float64](50), // to.Ptr[float64](51.1)}, // Sensitivity: to.Ptr(armmonitor.BaselineSensitivityMedium), // }}, // Dimensions: []*armmonitor.MetricSingleDimension{ // }, // MetadataValues: []*armmonitor.BaselineMetadata{ // { // Name: to.Ptr("ErrorType"), // Value: to.Ptr("TooManyAnomalies"), // }, // { // Name: to.Ptr("SeasonalityFrequency"), // Value: to.Ptr("288"), // }}, // Timestamps: []*time.Time{ // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-03-12T11:00:00.000Z"); return t}()), // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-03-12T12:00:00.000Z"); return t}())}, // }}, // Interval: to.Ptr("PT1H"), // Namespace: to.Ptr("microsoft.compute/virtualmachines"), // Timespan: to.Ptr("2019-03-12T11:00:00.000Z/2019-03-12T12:00:00.000Z"), // }, // }}, // } } }
Output:
type BaselinesClientListOptions ¶ added in v0.4.0
type BaselinesClientListOptions struct { // The list of aggregation types (comma separated) to retrieve. Aggregation *string // The $filter is used to reduce the set of metric data returned. Example: Metric contains metadata A, B and C. - Return all // time series of C where A = a1 and B = b1 or b2 $filter=A eq 'a1' and B eq 'b1' // or B eq 'b2' and C eq ” - Invalid variant: $filter=A eq 'a1' and B eq 'b1' and C eq ” or B = 'b2' This is invalid because // the logical or operator cannot separate two different metadata names. - // Return all time series where A = a1, B = b1 and C = c1: $filter=A eq 'a1' and B eq 'b1' and C eq 'c1' - Return all time // series where A = a1 $filter=A eq 'a1' and B eq ” and C eq ”. Special case: // When dimension name or dimension value uses round brackets. Eg: When dimension name is dim (test) 1 Instead of using $filter= // "dim (test) 1 eq ” " use $filter= "dim %2528test%2529 1 eq ” " When // dimension name is dim (test) 3 and dimension value is dim3 (test) val Instead of using $filter= "dim (test) 3 eq 'dim3 // (test) val' " use $filter= "dim %2528test%2529 3 eq 'dim3 %2528test%2529 val' " Filter *string // The interval (i.e. timegrain) of the query. Interval *string // The names of the metrics (comma separated) to retrieve. Special case: If a metricname itself has a comma in it then use // %2 to indicate it. Eg: 'Metric,Name1' should be 'Metric%2Name1' Metricnames *string // Metric namespace to query metric definitions for. Metricnamespace *string // Allows retrieving only metadata of the baseline. On data request all information is retrieved. ResultType *ResultType // The list of sensitivities (comma separated) to retrieve. Sensitivities *string // The timespan of the query. It is a string with the following format 'startDateTimeISO/endDateTimeISO'. Timespan *string }
BaselinesClientListOptions contains the optional parameters for the BaselinesClient.NewListPager method.
type BaselinesClientListResponse ¶ added in v0.4.0
type BaselinesClientListResponse struct { // A list of metric baselines. MetricBaselinesResponse }
BaselinesClientListResponse contains the response from method BaselinesClient.NewListPager.
type CategoryType ¶
type CategoryType string
CategoryType - The type of the diagnostic settings category.
const ( CategoryTypeLogs CategoryType = "Logs" CategoryTypeMetrics CategoryType = "Metrics" )
func PossibleCategoryTypeValues ¶
func PossibleCategoryTypeValues() []CategoryType
PossibleCategoryTypeValues returns the possible values for the CategoryType const type.
type ClientFactory ¶ added in v0.9.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.9.0
func NewClientFactory(subscriptionID 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.
- subscriptionID - The ID of the target subscription.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - pass nil to accept the default values.
func (*ClientFactory) NewActionGroupsClient ¶ added in v0.9.0
func (c *ClientFactory) NewActionGroupsClient() *ActionGroupsClient
NewActionGroupsClient creates a new instance of ActionGroupsClient.
func (*ClientFactory) NewActivityLogAlertsClient ¶ added in v0.9.0
func (c *ClientFactory) NewActivityLogAlertsClient() *ActivityLogAlertsClient
NewActivityLogAlertsClient creates a new instance of ActivityLogAlertsClient.
func (*ClientFactory) NewActivityLogsClient ¶ added in v0.9.0
func (c *ClientFactory) NewActivityLogsClient() *ActivityLogsClient
NewActivityLogsClient creates a new instance of ActivityLogsClient.
func (*ClientFactory) NewAlertRuleIncidentsClient ¶ added in v0.9.0
func (c *ClientFactory) NewAlertRuleIncidentsClient() *AlertRuleIncidentsClient
NewAlertRuleIncidentsClient creates a new instance of AlertRuleIncidentsClient.
func (*ClientFactory) NewAlertRulesClient ¶ added in v0.9.0
func (c *ClientFactory) NewAlertRulesClient() *AlertRulesClient
NewAlertRulesClient creates a new instance of AlertRulesClient.
func (*ClientFactory) NewAutoscaleSettingsClient ¶ added in v0.9.0
func (c *ClientFactory) NewAutoscaleSettingsClient() *AutoscaleSettingsClient
NewAutoscaleSettingsClient creates a new instance of AutoscaleSettingsClient.
func (*ClientFactory) NewAzureMonitorWorkspacesClient ¶ added in v0.9.0
func (c *ClientFactory) NewAzureMonitorWorkspacesClient() *AzureMonitorWorkspacesClient
NewAzureMonitorWorkspacesClient creates a new instance of AzureMonitorWorkspacesClient.
func (*ClientFactory) NewBaselinesClient ¶ added in v0.9.0
func (c *ClientFactory) NewBaselinesClient() *BaselinesClient
NewBaselinesClient creates a new instance of BaselinesClient.
func (*ClientFactory) NewDataCollectionEndpointsClient ¶ added in v0.9.0
func (c *ClientFactory) NewDataCollectionEndpointsClient() *DataCollectionEndpointsClient
NewDataCollectionEndpointsClient creates a new instance of DataCollectionEndpointsClient.
func (*ClientFactory) NewDataCollectionRuleAssociationsClient ¶ added in v0.9.0
func (c *ClientFactory) NewDataCollectionRuleAssociationsClient() *DataCollectionRuleAssociationsClient
NewDataCollectionRuleAssociationsClient creates a new instance of DataCollectionRuleAssociationsClient.
func (*ClientFactory) NewDataCollectionRulesClient ¶ added in v0.9.0
func (c *ClientFactory) NewDataCollectionRulesClient() *DataCollectionRulesClient
NewDataCollectionRulesClient creates a new instance of DataCollectionRulesClient.
func (*ClientFactory) NewDiagnosticSettingsCategoryClient ¶ added in v0.9.0
func (c *ClientFactory) NewDiagnosticSettingsCategoryClient() *DiagnosticSettingsCategoryClient
NewDiagnosticSettingsCategoryClient creates a new instance of DiagnosticSettingsCategoryClient.
func (*ClientFactory) NewDiagnosticSettingsClient ¶ added in v0.9.0
func (c *ClientFactory) NewDiagnosticSettingsClient() *DiagnosticSettingsClient
NewDiagnosticSettingsClient creates a new instance of DiagnosticSettingsClient.
func (*ClientFactory) NewEventCategoriesClient ¶ added in v0.9.0
func (c *ClientFactory) NewEventCategoriesClient() *EventCategoriesClient
NewEventCategoriesClient creates a new instance of EventCategoriesClient.
func (*ClientFactory) NewLogProfilesClient ¶ added in v0.9.0
func (c *ClientFactory) NewLogProfilesClient() *LogProfilesClient
NewLogProfilesClient creates a new instance of LogProfilesClient.
func (*ClientFactory) NewMetricAlertsClient ¶ added in v0.9.0
func (c *ClientFactory) NewMetricAlertsClient() *MetricAlertsClient
NewMetricAlertsClient creates a new instance of MetricAlertsClient.
func (*ClientFactory) NewMetricAlertsStatusClient ¶ added in v0.9.0
func (c *ClientFactory) NewMetricAlertsStatusClient() *MetricAlertsStatusClient
NewMetricAlertsStatusClient creates a new instance of MetricAlertsStatusClient.
func (*ClientFactory) NewMetricDefinitionsClient ¶ added in v0.9.0
func (c *ClientFactory) NewMetricDefinitionsClient() *MetricDefinitionsClient
NewMetricDefinitionsClient creates a new instance of MetricDefinitionsClient.
func (*ClientFactory) NewMetricNamespacesClient ¶ added in v0.9.0
func (c *ClientFactory) NewMetricNamespacesClient() *MetricNamespacesClient
NewMetricNamespacesClient creates a new instance of MetricNamespacesClient.
func (*ClientFactory) NewMetricsClient ¶ added in v0.9.0
func (c *ClientFactory) NewMetricsClient() *MetricsClient
NewMetricsClient creates a new instance of MetricsClient.
func (*ClientFactory) NewOperationsClient ¶ added in v0.9.0
func (c *ClientFactory) NewOperationsClient() *OperationsClient
NewOperationsClient creates a new instance of OperationsClient.
func (*ClientFactory) NewOperationsForMonitorClient ¶ added in v0.9.0
func (c *ClientFactory) NewOperationsForMonitorClient() *OperationsForMonitorClient
NewOperationsForMonitorClient creates a new instance of OperationsForMonitorClient.
func (*ClientFactory) NewPredictiveMetricClient ¶ added in v0.9.0
func (c *ClientFactory) NewPredictiveMetricClient() *PredictiveMetricClient
NewPredictiveMetricClient creates a new instance of PredictiveMetricClient.
func (*ClientFactory) NewPrivateEndpointConnectionsClient ¶ added in v0.9.0
func (c *ClientFactory) NewPrivateEndpointConnectionsClient() *PrivateEndpointConnectionsClient
NewPrivateEndpointConnectionsClient creates a new instance of PrivateEndpointConnectionsClient.
func (*ClientFactory) NewPrivateLinkResourcesClient ¶ added in v0.9.0
func (c *ClientFactory) NewPrivateLinkResourcesClient() *PrivateLinkResourcesClient
NewPrivateLinkResourcesClient creates a new instance of PrivateLinkResourcesClient.
func (*ClientFactory) NewPrivateLinkScopeOperationStatusClient ¶ added in v0.9.0
func (c *ClientFactory) NewPrivateLinkScopeOperationStatusClient() *PrivateLinkScopeOperationStatusClient
NewPrivateLinkScopeOperationStatusClient creates a new instance of PrivateLinkScopeOperationStatusClient.
func (*ClientFactory) NewPrivateLinkScopedResourcesClient ¶ added in v0.9.0
func (c *ClientFactory) NewPrivateLinkScopedResourcesClient() *PrivateLinkScopedResourcesClient
NewPrivateLinkScopedResourcesClient creates a new instance of PrivateLinkScopedResourcesClient.
func (*ClientFactory) NewPrivateLinkScopesClient ¶ added in v0.9.0
func (c *ClientFactory) NewPrivateLinkScopesClient() *PrivateLinkScopesClient
NewPrivateLinkScopesClient creates a new instance of PrivateLinkScopesClient.
func (*ClientFactory) NewScheduledQueryRulesClient ¶ added in v0.9.0
func (c *ClientFactory) NewScheduledQueryRulesClient() *ScheduledQueryRulesClient
NewScheduledQueryRulesClient creates a new instance of ScheduledQueryRulesClient.
func (*ClientFactory) NewTenantActionGroupsClient ¶ added in v0.9.0
func (c *ClientFactory) NewTenantActionGroupsClient() *TenantActionGroupsClient
NewTenantActionGroupsClient creates a new instance of TenantActionGroupsClient.
func (*ClientFactory) NewTenantActivityLogsClient ¶ added in v0.9.0
func (c *ClientFactory) NewTenantActivityLogsClient() *TenantActivityLogsClient
NewTenantActivityLogsClient creates a new instance of TenantActivityLogsClient.
func (*ClientFactory) NewVMInsightsClient ¶ added in v0.9.0
func (c *ClientFactory) NewVMInsightsClient() *VMInsightsClient
NewVMInsightsClient creates a new instance of VMInsightsClient.
type ColumnDefinition ¶ added in v0.5.0
type ColumnDefinition struct { // The name of the column. Name *string // The type of the column data. Type *KnownColumnDefinitionType }
ColumnDefinition - Definition of custom data column.
func (ColumnDefinition) MarshalJSON ¶ added in v0.8.0
func (c ColumnDefinition) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ColumnDefinition.
func (*ColumnDefinition) UnmarshalJSON ¶ added in v0.8.0
func (c *ColumnDefinition) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ColumnDefinition.
type ComparisonOperationType ¶
type ComparisonOperationType string
ComparisonOperationType - the operator that is used to compare the metric data and the threshold.
const ( ComparisonOperationTypeEquals ComparisonOperationType = "Equals" ComparisonOperationTypeGreaterThan ComparisonOperationType = "GreaterThan" ComparisonOperationTypeGreaterThanOrEqual ComparisonOperationType = "GreaterThanOrEqual" ComparisonOperationTypeLessThan ComparisonOperationType = "LessThan" ComparisonOperationTypeLessThanOrEqual ComparisonOperationType = "LessThanOrEqual" ComparisonOperationTypeNotEquals ComparisonOperationType = "NotEquals" )
func PossibleComparisonOperationTypeValues ¶
func PossibleComparisonOperationTypeValues() []ComparisonOperationType
PossibleComparisonOperationTypeValues returns the possible values for the ComparisonOperationType const type.
type Condition ¶ added in v0.8.0
type Condition struct { // List of Dimensions conditions Dimensions []*Dimension // The minimum number of violations required within the selected lookback time window required to raise an alert. Relevant // only for rules of the kind LogAlert. FailingPeriods *ConditionFailingPeriods // The column containing the metric measure number. Relevant only for rules of the kind LogAlert. MetricMeasureColumn *string // The name of the metric to be sent. Relevant and required only for rules of the kind LogToMetric. MetricName *string // The criteria operator. Relevant and required only for rules of the kind LogAlert. Operator *ConditionOperator // Log query alert Query *string // The column containing the resource id. The content of the column must be a uri formatted as resource id. Relevant only // for rules of the kind LogAlert. ResourceIDColumn *string // the criteria threshold value that activates the alert. Relevant and required only for rules of the kind LogAlert. Threshold *float64 // Aggregation type. Relevant and required only for rules of the kind LogAlert. TimeAggregation *TimeAggregation }
Condition - A condition of the scheduled query rule.
func (Condition) MarshalJSON ¶ added in v0.8.0
MarshalJSON implements the json.Marshaller interface for type Condition.
func (*Condition) UnmarshalJSON ¶ added in v0.8.0
UnmarshalJSON implements the json.Unmarshaller interface for type Condition.
type ConditionFailingPeriods ¶ added in v0.8.0
type ConditionFailingPeriods struct { // The number of violations to trigger an alert. Should be smaller or equal to numberOfEvaluationPeriods. Default value is // 1 MinFailingPeriodsToAlert *int64 // The number of aggregated lookback points. The lookback time window is calculated based on the aggregation granularity (windowSize) // and the selected number of aggregated points. Default value is 1 NumberOfEvaluationPeriods *int64 }
ConditionFailingPeriods - The minimum number of violations required within the selected lookback time window required to raise an alert. Relevant only for rules of the kind LogAlert.
func (ConditionFailingPeriods) MarshalJSON ¶ added in v0.8.0
func (c ConditionFailingPeriods) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ConditionFailingPeriods.
func (*ConditionFailingPeriods) UnmarshalJSON ¶ added in v0.8.0
func (c *ConditionFailingPeriods) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ConditionFailingPeriods.
type ConditionOperator ¶
type ConditionOperator string
ConditionOperator - Operators allowed in the rule condition.
const ( ConditionOperatorEquals ConditionOperator = "Equals" ConditionOperatorGreaterThan ConditionOperator = "GreaterThan" ConditionOperatorGreaterThanOrEqual ConditionOperator = "GreaterThanOrEqual" ConditionOperatorLessThan ConditionOperator = "LessThan" ConditionOperatorLessThanOrEqual ConditionOperator = "LessThanOrEqual" )
func PossibleConditionOperatorValues ¶
func PossibleConditionOperatorValues() []ConditionOperator
PossibleConditionOperatorValues returns the possible values for the ConditionOperator const type.
type ConfigurationAccessEndpointSpec ¶
type ConfigurationAccessEndpointSpec struct { // READ-ONLY; The endpoint. This property is READ-ONLY. Endpoint *string }
ConfigurationAccessEndpointSpec - Definition of the endpoint used for accessing configuration.
func (ConfigurationAccessEndpointSpec) MarshalJSON ¶ added in v0.8.0
func (c ConfigurationAccessEndpointSpec) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ConfigurationAccessEndpointSpec.
func (*ConfigurationAccessEndpointSpec) UnmarshalJSON ¶ added in v0.8.0
func (c *ConfigurationAccessEndpointSpec) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ConfigurationAccessEndpointSpec.
type Context ¶ added in v0.3.0
type Context struct { // The context id type ContextType *string // The source of the notification request NotificationSource *string }
Context - The context info
func (Context) MarshalJSON ¶ added in v0.8.0
MarshalJSON implements the json.Marshaller interface for type Context.
func (*Context) UnmarshalJSON ¶ added in v0.8.0
UnmarshalJSON implements the json.Unmarshaller interface for type Context.
type CreatedByType ¶
type CreatedByType string
CreatedByType - The type of identity that created the resource.
const ( CreatedByTypeApplication CreatedByType = "Application" CreatedByTypeKey CreatedByType = "Key" CreatedByTypeManagedIdentity CreatedByType = "ManagedIdentity" CreatedByTypeUser CreatedByType = "User" )
func PossibleCreatedByTypeValues ¶
func PossibleCreatedByTypeValues() []CreatedByType
PossibleCreatedByTypeValues returns the possible values for the CreatedByType const type.
type CriterionType ¶
type CriterionType string
CriterionType - Specifies the type of threshold criteria
const ( CriterionTypeDynamicThresholdCriterion CriterionType = "DynamicThresholdCriterion" CriterionTypeStaticThresholdCriterion CriterionType = "StaticThresholdCriterion" )
func PossibleCriterionTypeValues ¶
func PossibleCriterionTypeValues() []CriterionType
PossibleCriterionTypeValues returns the possible values for the CriterionType const type.
type DataCollectionEndpoint ¶
type DataCollectionEndpoint struct { // The endpoint used by clients to access their configuration. ConfigurationAccess *DataCollectionEndpointConfigurationAccess // Description of the data collection endpoint. Description *string // The immutable ID of this data collection endpoint resource. This property is READ-ONLY. ImmutableID *string // The endpoint used by clients to ingest logs. LogsIngestion *DataCollectionEndpointLogsIngestion // The endpoint used by clients to ingest metrics. MetricsIngestion *DataCollectionEndpointMetricsIngestion // Network access control rules for the endpoints. NetworkACLs *DataCollectionEndpointNetworkACLs // READ-ONLY; Failover configuration on this endpoint. This property is READ-ONLY. FailoverConfiguration *DataCollectionEndpointFailoverConfiguration // READ-ONLY; Metadata for the resource. This property is READ-ONLY. Metadata *DataCollectionEndpointMetadata // READ-ONLY; List of Azure Monitor Private Link Scope Resources to which this data collection endpoint resource is associated. // This property is READ-ONLY. PrivateLinkScopedResources []*PrivateLinkScopedResource // READ-ONLY; The resource provisioning state. This property is READ-ONLY. ProvisioningState *KnownDataCollectionEndpointProvisioningState }
DataCollectionEndpoint - Definition of data collection endpoint.
func (DataCollectionEndpoint) MarshalJSON ¶ added in v0.8.0
func (d DataCollectionEndpoint) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DataCollectionEndpoint.
func (*DataCollectionEndpoint) UnmarshalJSON ¶ added in v0.8.0
func (d *DataCollectionEndpoint) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DataCollectionEndpoint.
type DataCollectionEndpointConfigurationAccess ¶
type DataCollectionEndpointConfigurationAccess struct { // READ-ONLY; The endpoint. This property is READ-ONLY. Endpoint *string }
DataCollectionEndpointConfigurationAccess - The endpoint used by clients to access their configuration.
func (DataCollectionEndpointConfigurationAccess) MarshalJSON ¶ added in v0.8.0
func (d DataCollectionEndpointConfigurationAccess) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DataCollectionEndpointConfigurationAccess.
func (*DataCollectionEndpointConfigurationAccess) UnmarshalJSON ¶ added in v0.8.0
func (d *DataCollectionEndpointConfigurationAccess) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DataCollectionEndpointConfigurationAccess.
type DataCollectionEndpointFailoverConfiguration ¶ added in v0.9.0
type DataCollectionEndpointFailoverConfiguration struct { // Active location where data flow will occur. ActiveLocation *string // Locations that are configured for failover. Locations []*LocationSpec }
DataCollectionEndpointFailoverConfiguration - Failover configuration on this endpoint. This property is READ-ONLY.
func (DataCollectionEndpointFailoverConfiguration) MarshalJSON ¶ added in v0.9.0
func (d DataCollectionEndpointFailoverConfiguration) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DataCollectionEndpointFailoverConfiguration.
func (*DataCollectionEndpointFailoverConfiguration) UnmarshalJSON ¶ added in v0.9.0
func (d *DataCollectionEndpointFailoverConfiguration) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DataCollectionEndpointFailoverConfiguration.
type DataCollectionEndpointLogsIngestion ¶
type DataCollectionEndpointLogsIngestion struct { // READ-ONLY; The endpoint. This property is READ-ONLY. Endpoint *string }
DataCollectionEndpointLogsIngestion - The endpoint used by clients to ingest logs.
func (DataCollectionEndpointLogsIngestion) MarshalJSON ¶ added in v0.8.0
func (d DataCollectionEndpointLogsIngestion) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DataCollectionEndpointLogsIngestion.
func (*DataCollectionEndpointLogsIngestion) UnmarshalJSON ¶ added in v0.8.0
func (d *DataCollectionEndpointLogsIngestion) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DataCollectionEndpointLogsIngestion.
type DataCollectionEndpointMetadata ¶ added in v0.9.0
type DataCollectionEndpointMetadata struct { // READ-ONLY; Azure offering managing this resource on-behalf-of customer. ProvisionedBy *string // READ-ONLY; Resource Id of azure offering managing this resource on-behalf-of customer. ProvisionedByResourceID *string }
DataCollectionEndpointMetadata - Metadata for the resource. This property is READ-ONLY.
func (DataCollectionEndpointMetadata) MarshalJSON ¶ added in v0.9.0
func (d DataCollectionEndpointMetadata) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DataCollectionEndpointMetadata.
func (*DataCollectionEndpointMetadata) UnmarshalJSON ¶ added in v0.9.0
func (d *DataCollectionEndpointMetadata) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DataCollectionEndpointMetadata.
type DataCollectionEndpointMetricsIngestion ¶ added in v0.9.0
type DataCollectionEndpointMetricsIngestion struct { // READ-ONLY; The endpoint. This property is READ-ONLY. Endpoint *string }
DataCollectionEndpointMetricsIngestion - The endpoint used by clients to ingest metrics.
func (DataCollectionEndpointMetricsIngestion) MarshalJSON ¶ added in v0.9.0
func (d DataCollectionEndpointMetricsIngestion) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DataCollectionEndpointMetricsIngestion.
func (*DataCollectionEndpointMetricsIngestion) UnmarshalJSON ¶ added in v0.9.0
func (d *DataCollectionEndpointMetricsIngestion) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DataCollectionEndpointMetricsIngestion.
type DataCollectionEndpointNetworkACLs ¶
type DataCollectionEndpointNetworkACLs struct { // The configuration to set whether network access from public internet to the endpoints are allowed. PublicNetworkAccess *KnownPublicNetworkAccessOptions }
DataCollectionEndpointNetworkACLs - Network access control rules for the endpoints.
func (DataCollectionEndpointNetworkACLs) MarshalJSON ¶ added in v0.8.0
func (d DataCollectionEndpointNetworkACLs) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DataCollectionEndpointNetworkACLs.
func (*DataCollectionEndpointNetworkACLs) UnmarshalJSON ¶ added in v0.8.0
func (d *DataCollectionEndpointNetworkACLs) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DataCollectionEndpointNetworkACLs.
type DataCollectionEndpointResource ¶
type DataCollectionEndpointResource struct { // REQUIRED; The geo-location where the resource lives. Location *string // Managed service identity of the resource. Identity *DataCollectionEndpointResourceIdentity // The kind of the resource. Kind *KnownDataCollectionEndpointResourceKind // Resource properties. Properties *DataCollectionEndpointResourceProperties // Resource tags. Tags map[string]*string // READ-ONLY; Resource entity tag (ETag). Etag *string // READ-ONLY; Fully qualified ID of the resource. ID *string // READ-ONLY; The name of the resource. Name *string // READ-ONLY; Metadata pertaining to creation and last modification of the resource. SystemData *DataCollectionEndpointResourceSystemData // READ-ONLY; The type of the resource. Type *string }
DataCollectionEndpointResource - Definition of ARM tracked top level resource.
func (DataCollectionEndpointResource) MarshalJSON ¶
func (d DataCollectionEndpointResource) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DataCollectionEndpointResource.
func (*DataCollectionEndpointResource) UnmarshalJSON ¶ added in v0.8.0
func (d *DataCollectionEndpointResource) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DataCollectionEndpointResource.
type DataCollectionEndpointResourceIdentity ¶ added in v0.9.0
type DataCollectionEndpointResourceIdentity struct { // REQUIRED; Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). Type *ManagedServiceIdentityType // The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM // resource ids in the form: // '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. // The dictionary values can be empty objects ({}) in // requests. UserAssignedIdentities map[string]*UserAssignedIdentity // READ-ONLY; The service principal ID of the system assigned identity. This property will only be provided for a system assigned // identity. PrincipalID *string // READ-ONLY; The tenant ID of the system assigned identity. This property will only be provided for a system assigned identity. TenantID *string }
DataCollectionEndpointResourceIdentity - Managed service identity of the resource.
func (DataCollectionEndpointResourceIdentity) MarshalJSON ¶ added in v0.9.0
func (d DataCollectionEndpointResourceIdentity) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DataCollectionEndpointResourceIdentity.
func (*DataCollectionEndpointResourceIdentity) UnmarshalJSON ¶ added in v0.9.0
func (d *DataCollectionEndpointResourceIdentity) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DataCollectionEndpointResourceIdentity.
type DataCollectionEndpointResourceListResult ¶
type DataCollectionEndpointResourceListResult struct { // REQUIRED; A list of resources. Value []*DataCollectionEndpointResource // The URL to use for getting the next set of results. NextLink *string }
DataCollectionEndpointResourceListResult - A pageable list of resources.
func (DataCollectionEndpointResourceListResult) MarshalJSON ¶
func (d DataCollectionEndpointResourceListResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DataCollectionEndpointResourceListResult.
func (*DataCollectionEndpointResourceListResult) UnmarshalJSON ¶ added in v0.8.0
func (d *DataCollectionEndpointResourceListResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DataCollectionEndpointResourceListResult.
type DataCollectionEndpointResourceProperties ¶
type DataCollectionEndpointResourceProperties struct { // The endpoint used by clients to access their configuration. ConfigurationAccess *DataCollectionEndpointConfigurationAccess // Description of the data collection endpoint. Description *string // The immutable ID of this data collection endpoint resource. This property is READ-ONLY. ImmutableID *string // The endpoint used by clients to ingest logs. LogsIngestion *DataCollectionEndpointLogsIngestion // The endpoint used by clients to ingest metrics. MetricsIngestion *DataCollectionEndpointMetricsIngestion // Network access control rules for the endpoints. NetworkACLs *DataCollectionEndpointNetworkACLs // READ-ONLY; Failover configuration on this endpoint. This property is READ-ONLY. FailoverConfiguration *DataCollectionEndpointFailoverConfiguration // READ-ONLY; Metadata for the resource. This property is READ-ONLY. Metadata *DataCollectionEndpointMetadata // READ-ONLY; List of Azure Monitor Private Link Scope Resources to which this data collection endpoint resource is associated. // This property is READ-ONLY. PrivateLinkScopedResources []*PrivateLinkScopedResource // READ-ONLY; The resource provisioning state. This property is READ-ONLY. ProvisioningState *KnownDataCollectionEndpointProvisioningState }
DataCollectionEndpointResourceProperties - Resource properties.
func (DataCollectionEndpointResourceProperties) MarshalJSON ¶ added in v0.8.0
func (d DataCollectionEndpointResourceProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DataCollectionEndpointResourceProperties.
func (*DataCollectionEndpointResourceProperties) UnmarshalJSON ¶ added in v0.8.0
func (d *DataCollectionEndpointResourceProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DataCollectionEndpointResourceProperties.
type DataCollectionEndpointResourceSystemData ¶
type DataCollectionEndpointResourceSystemData 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 }
DataCollectionEndpointResourceSystemData - Metadata pertaining to creation and last modification of the resource.
func (DataCollectionEndpointResourceSystemData) MarshalJSON ¶ added in v0.4.0
func (d DataCollectionEndpointResourceSystemData) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DataCollectionEndpointResourceSystemData.
func (*DataCollectionEndpointResourceSystemData) UnmarshalJSON ¶ added in v0.4.0
func (d *DataCollectionEndpointResourceSystemData) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DataCollectionEndpointResourceSystemData.
type DataCollectionEndpointsClient ¶
type DataCollectionEndpointsClient struct {
// contains filtered or unexported fields
}
DataCollectionEndpointsClient contains the methods for the DataCollectionEndpoints group. Don't use this type directly, use NewDataCollectionEndpointsClient() instead.
func NewDataCollectionEndpointsClient ¶
func NewDataCollectionEndpointsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DataCollectionEndpointsClient, error)
NewDataCollectionEndpointsClient creates a new instance of DataCollectionEndpointsClient with the specified values.
- subscriptionID - The ID of the target subscription.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - pass nil to accept the default values.
func (*DataCollectionEndpointsClient) Create ¶
func (client *DataCollectionEndpointsClient) Create(ctx context.Context, resourceGroupName string, dataCollectionEndpointName string, options *DataCollectionEndpointsClientCreateOptions) (DataCollectionEndpointsClientCreateResponse, error)
Create - Creates or updates a data collection endpoint. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2022-06-01
- resourceGroupName - The name of the resource group. The name is case insensitive.
- dataCollectionEndpointName - The name of the data collection endpoint. The name is case insensitive.
- options - DataCollectionEndpointsClientCreateOptions contains the optional parameters for the DataCollectionEndpointsClient.Create method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/DataCollectionEndpointsCreate.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewDataCollectionEndpointsClient().Create(ctx, "myResourceGroup", "myCollectionEndpoint", &armmonitor.DataCollectionEndpointsClientCreateOptions{Body: &armmonitor.DataCollectionEndpointResource{ Location: to.Ptr("eastus"), Properties: &armmonitor.DataCollectionEndpointResourceProperties{ NetworkACLs: &armmonitor.DataCollectionEndpointNetworkACLs{ PublicNetworkAccess: to.Ptr(armmonitor.KnownPublicNetworkAccessOptionsEnabled), }, }, }, }) 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.DataCollectionEndpointResource = armmonitor.DataCollectionEndpointResource{ // Name: to.Ptr("myCollectionEndpoint"), // Type: to.Ptr("Microsoft.Insights/dataCollectionEndpoints"), // Etag: to.Ptr("070057da-0000-0000-0000-5ba70d6c0000"), // ID: to.Ptr("/subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.Insights/dataCollectionEndpoints/myCollectionEndpoint"), // Location: to.Ptr("eastus"), // Properties: &armmonitor.DataCollectionEndpointResourceProperties{ // ConfigurationAccess: &armmonitor.DataCollectionEndpointConfigurationAccess{ // Endpoint: to.Ptr("https://mycollectionendpoint-abcd.eastus-1.control.monitor.azure.com"), // }, // LogsIngestion: &armmonitor.DataCollectionEndpointLogsIngestion{ // Endpoint: to.Ptr("https://mycollectionendpoint-abcd.eastus-1.ingest.monitor.azure.com"), // }, // NetworkACLs: &armmonitor.DataCollectionEndpointNetworkACLs{ // PublicNetworkAccess: to.Ptr(armmonitor.KnownPublicNetworkAccessOptionsEnabled), // }, // }, // SystemData: &armmonitor.DataCollectionEndpointResourceSystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-01T12:34:56.123Z"); return t}()), // CreatedBy: to.Ptr("user1"), // CreatedByType: to.Ptr(armmonitor.CreatedByTypeUser), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-02T12:34:56.123Z"); return t}()), // LastModifiedBy: to.Ptr("user2"), // LastModifiedByType: to.Ptr(armmonitor.CreatedByTypeUser), // }, // Tags: map[string]*string{ // "tag1": to.Ptr("A"), // "tag2": to.Ptr("B"), // }, // } }
Output:
func (*DataCollectionEndpointsClient) Delete ¶
func (client *DataCollectionEndpointsClient) Delete(ctx context.Context, resourceGroupName string, dataCollectionEndpointName string, options *DataCollectionEndpointsClientDeleteOptions) (DataCollectionEndpointsClientDeleteResponse, error)
Delete - Deletes a data collection endpoint. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2022-06-01
- resourceGroupName - The name of the resource group. The name is case insensitive.
- dataCollectionEndpointName - The name of the data collection endpoint. The name is case insensitive.
- options - DataCollectionEndpointsClientDeleteOptions contains the optional parameters for the DataCollectionEndpointsClient.Delete method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/DataCollectionEndpointsDelete.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } _, err = clientFactory.NewDataCollectionEndpointsClient().Delete(ctx, "myResourceGroup", "myCollectionEndpoint", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } }
Output:
func (*DataCollectionEndpointsClient) Get ¶
func (client *DataCollectionEndpointsClient) Get(ctx context.Context, resourceGroupName string, dataCollectionEndpointName string, options *DataCollectionEndpointsClientGetOptions) (DataCollectionEndpointsClientGetResponse, error)
Get - Returns the specified data collection endpoint. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2022-06-01
- resourceGroupName - The name of the resource group. The name is case insensitive.
- dataCollectionEndpointName - The name of the data collection endpoint. The name is case insensitive.
- options - DataCollectionEndpointsClientGetOptions contains the optional parameters for the DataCollectionEndpointsClient.Get method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/DataCollectionEndpointsGet.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewDataCollectionEndpointsClient().Get(ctx, "myResourceGroup", "myCollectionEndpoint", 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.DataCollectionEndpointResource = armmonitor.DataCollectionEndpointResource{ // Name: to.Ptr("myCollectionEndpoint"), // Type: to.Ptr("Microsoft.Insights/dataCollectionEndpoints"), // Etag: to.Ptr("070057da-0000-0000-0000-5ba70d6c0000"), // ID: to.Ptr("/subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.Insights/dataCollectionEndpoints/myCollectionEndpoint"), // Location: to.Ptr("eastus"), // Properties: &armmonitor.DataCollectionEndpointResourceProperties{ // ConfigurationAccess: &armmonitor.DataCollectionEndpointConfigurationAccess{ // Endpoint: to.Ptr("https://mycollectionendpoint-abcd.eastus-1.control.monitor.azure.com"), // }, // LogsIngestion: &armmonitor.DataCollectionEndpointLogsIngestion{ // Endpoint: to.Ptr("https://mycollectionendpoint-abcd.eastus-1.ingest.monitor.azure.com"), // }, // NetworkACLs: &armmonitor.DataCollectionEndpointNetworkACLs{ // PublicNetworkAccess: to.Ptr(armmonitor.KnownPublicNetworkAccessOptionsEnabled), // }, // }, // SystemData: &armmonitor.DataCollectionEndpointResourceSystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-01T12:34:56.123Z"); return t}()), // CreatedBy: to.Ptr("user1"), // CreatedByType: to.Ptr(armmonitor.CreatedByTypeUser), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-02T12:34:56.123Z"); return t}()), // LastModifiedBy: to.Ptr("user2"), // LastModifiedByType: to.Ptr(armmonitor.CreatedByTypeUser), // }, // Tags: map[string]*string{ // "tag1": to.Ptr("A"), // "tag2": to.Ptr("B"), // }, // } }
Output:
func (*DataCollectionEndpointsClient) NewListByResourceGroupPager ¶ added in v0.6.0
func (client *DataCollectionEndpointsClient) NewListByResourceGroupPager(resourceGroupName string, options *DataCollectionEndpointsClientListByResourceGroupOptions) *runtime.Pager[DataCollectionEndpointsClientListByResourceGroupResponse]
NewListByResourceGroupPager - Lists all data collection endpoints in the specified resource group.
Generated from API version 2022-06-01
- resourceGroupName - The name of the resource group. The name is case insensitive.
- options - DataCollectionEndpointsClientListByResourceGroupOptions contains the optional parameters for the DataCollectionEndpointsClient.NewListByResourceGroupPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/DataCollectionEndpointsListByResourceGroup.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewDataCollectionEndpointsClient().NewListByResourceGroupPager("myResourceGroup", 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.DataCollectionEndpointResourceListResult = armmonitor.DataCollectionEndpointResourceListResult{ // Value: []*armmonitor.DataCollectionEndpointResource{ // { // Name: to.Ptr("myCollectionEndpoint"), // Type: to.Ptr("Microsoft.Insights/dataCollectionEndpoints"), // Etag: to.Ptr("070057da-0000-0000-0000-5ba70d6c0000"), // ID: to.Ptr("/subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.Insights/dataCollectionEndpoints/myCollectionEndpoint"), // Location: to.Ptr("eastus"), // Properties: &armmonitor.DataCollectionEndpointResourceProperties{ // ConfigurationAccess: &armmonitor.DataCollectionEndpointConfigurationAccess{ // Endpoint: to.Ptr("https://mycollectionendpoint-abcd.eastus-1.control.monitor.azure.com"), // }, // LogsIngestion: &armmonitor.DataCollectionEndpointLogsIngestion{ // Endpoint: to.Ptr("https://mycollectionendpoint-abcd.eastus-1.ingest.monitor.azure.com"), // }, // NetworkACLs: &armmonitor.DataCollectionEndpointNetworkACLs{ // PublicNetworkAccess: to.Ptr(armmonitor.KnownPublicNetworkAccessOptionsEnabled), // }, // }, // SystemData: &armmonitor.DataCollectionEndpointResourceSystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-01T12:34:56.123Z"); return t}()), // CreatedBy: to.Ptr("user1"), // CreatedByType: to.Ptr(armmonitor.CreatedByTypeUser), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-02T12:34:56.123Z"); return t}()), // LastModifiedBy: to.Ptr("user2"), // LastModifiedByType: to.Ptr(armmonitor.CreatedByTypeUser), // }, // Tags: map[string]*string{ // "tag1": to.Ptr("A"), // "tag2": to.Ptr("B"), // }, // }, // { // Name: to.Ptr("herCollectionEndpoint"), // Type: to.Ptr("Microsoft.Insights/dataCollectionEndpoints"), // Etag: to.Ptr("070057da-0000-0000-0000-5ba70d6c0000"), // ID: to.Ptr("/subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.Insights/dataCollectionEndpoints/herCollectionEndpoint"), // Location: to.Ptr("westus"), // Properties: &armmonitor.DataCollectionEndpointResourceProperties{ // ConfigurationAccess: &armmonitor.DataCollectionEndpointConfigurationAccess{ // Endpoint: to.Ptr("https://hercollectionendpoint-xywz.eastus-1.control.monitor.azure.com"), // }, // LogsIngestion: &armmonitor.DataCollectionEndpointLogsIngestion{ // Endpoint: to.Ptr("https://hercollectionendpoint-xywz.eastus-1.ingest.monitor.azure.com"), // }, // NetworkACLs: &armmonitor.DataCollectionEndpointNetworkACLs{ // PublicNetworkAccess: to.Ptr(armmonitor.KnownPublicNetworkAccessOptionsDisabled), // }, // }, // SystemData: &armmonitor.DataCollectionEndpointResourceSystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-01T12:34:56.123Z"); return t}()), // CreatedBy: to.Ptr("user1"), // CreatedByType: to.Ptr(armmonitor.CreatedByTypeUser), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-02T12:34:56.123Z"); return t}()), // LastModifiedBy: to.Ptr("user2"), // LastModifiedByType: to.Ptr(armmonitor.CreatedByTypeUser), // }, // Tags: map[string]*string{ // "tag1": to.Ptr("A"), // "tag2": to.Ptr("B"), // }, // }}, // } } }
Output:
func (*DataCollectionEndpointsClient) NewListBySubscriptionPager ¶ added in v0.6.0
func (client *DataCollectionEndpointsClient) NewListBySubscriptionPager(options *DataCollectionEndpointsClientListBySubscriptionOptions) *runtime.Pager[DataCollectionEndpointsClientListBySubscriptionResponse]
NewListBySubscriptionPager - Lists all data collection endpoints in the specified subscription
Generated from API version 2022-06-01
- options - DataCollectionEndpointsClientListBySubscriptionOptions contains the optional parameters for the DataCollectionEndpointsClient.NewListBySubscriptionPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/DataCollectionEndpointsListBySubscription.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewDataCollectionEndpointsClient().NewListBySubscriptionPager(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.DataCollectionEndpointResourceListResult = armmonitor.DataCollectionEndpointResourceListResult{ // Value: []*armmonitor.DataCollectionEndpointResource{ // { // Name: to.Ptr("myCollectionEndpoint"), // Type: to.Ptr("Microsoft.Insights/dataCollectionEndpoints"), // Etag: to.Ptr("070057da-0000-0000-0000-5ba70d6c0000"), // ID: to.Ptr("/subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.Insights/dataCollectionEndpoints/myCollectionEndpoint"), // Location: to.Ptr("eastus"), // Properties: &armmonitor.DataCollectionEndpointResourceProperties{ // ConfigurationAccess: &armmonitor.DataCollectionEndpointConfigurationAccess{ // Endpoint: to.Ptr("https://mycollectionendpoint-abcd.eastus-1.control.monitor.azure.com"), // }, // LogsIngestion: &armmonitor.DataCollectionEndpointLogsIngestion{ // Endpoint: to.Ptr("https://mycollectionendpoint-abcd.eastus-1.ingest.monitor.azure.com"), // }, // NetworkACLs: &armmonitor.DataCollectionEndpointNetworkACLs{ // PublicNetworkAccess: to.Ptr(armmonitor.KnownPublicNetworkAccessOptionsEnabled), // }, // }, // SystemData: &armmonitor.DataCollectionEndpointResourceSystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-01T12:34:56.123Z"); return t}()), // CreatedBy: to.Ptr("user1"), // CreatedByType: to.Ptr(armmonitor.CreatedByTypeUser), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-02T12:34:56.123Z"); return t}()), // LastModifiedBy: to.Ptr("user2"), // LastModifiedByType: to.Ptr(armmonitor.CreatedByTypeUser), // }, // Tags: map[string]*string{ // "tag1": to.Ptr("A"), // "tag2": to.Ptr("B"), // }, // }, // { // Name: to.Ptr("herCollectionEndpoint"), // Type: to.Ptr("Microsoft.Insights/dataCollectionEndpoints"), // Etag: to.Ptr("070057da-0000-0000-0000-5ba70d6c0000"), // ID: to.Ptr("/subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/herResourceGroup/providers/Microsoft.Insights/dataCollectionEndpoints/herCollectionEndpoint"), // Location: to.Ptr("westus"), // Properties: &armmonitor.DataCollectionEndpointResourceProperties{ // ConfigurationAccess: &armmonitor.DataCollectionEndpointConfigurationAccess{ // Endpoint: to.Ptr("https://hercollectionendpoint-xywz.eastus-1.control.monitor.azure.com"), // }, // LogsIngestion: &armmonitor.DataCollectionEndpointLogsIngestion{ // Endpoint: to.Ptr("https://hercollectionendpoint-xywz.eastus-1.ingest.monitor.azure.com"), // }, // NetworkACLs: &armmonitor.DataCollectionEndpointNetworkACLs{ // PublicNetworkAccess: to.Ptr(armmonitor.KnownPublicNetworkAccessOptionsDisabled), // }, // }, // SystemData: &armmonitor.DataCollectionEndpointResourceSystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-01T12:34:56.123Z"); return t}()), // CreatedBy: to.Ptr("user1"), // CreatedByType: to.Ptr(armmonitor.CreatedByTypeUser), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-02T12:34:56.123Z"); return t}()), // LastModifiedBy: to.Ptr("user2"), // LastModifiedByType: to.Ptr(armmonitor.CreatedByTypeUser), // }, // Tags: map[string]*string{ // "tag1": to.Ptr("A"), // "tag2": to.Ptr("B"), // }, // }}, // } } }
Output:
func (*DataCollectionEndpointsClient) Update ¶
func (client *DataCollectionEndpointsClient) Update(ctx context.Context, resourceGroupName string, dataCollectionEndpointName string, options *DataCollectionEndpointsClientUpdateOptions) (DataCollectionEndpointsClientUpdateResponse, error)
Update - Updates part of a data collection endpoint. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2022-06-01
- resourceGroupName - The name of the resource group. The name is case insensitive.
- dataCollectionEndpointName - The name of the data collection endpoint. The name is case insensitive.
- options - DataCollectionEndpointsClientUpdateOptions contains the optional parameters for the DataCollectionEndpointsClient.Update method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/DataCollectionEndpointsUpdate.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewDataCollectionEndpointsClient().Update(ctx, "myResourceGroup", "myCollectionEndpoint", &armmonitor.DataCollectionEndpointsClientUpdateOptions{Body: &armmonitor.ResourceForUpdate{ Tags: map[string]*string{ "tag1": to.Ptr("A"), "tag2": to.Ptr("B"), "tag3": to.Ptr("C"), }, }, }) 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.DataCollectionEndpointResource = armmonitor.DataCollectionEndpointResource{ // Name: to.Ptr("myCollectionEndpoint"), // Type: to.Ptr("Microsoft.Insights/dataCollectionEndpoints"), // Etag: to.Ptr("070057da-0000-0000-0000-5ba70d6c0000"), // ID: to.Ptr("/subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.Insights/dataCollectionEndpoints/myCollectionEndpoint"), // Location: to.Ptr("eastus"), // Properties: &armmonitor.DataCollectionEndpointResourceProperties{ // ConfigurationAccess: &armmonitor.DataCollectionEndpointConfigurationAccess{ // Endpoint: to.Ptr("https://mycollectionendpoint-abcd.eastus-1.control.monitor.azure.com"), // }, // LogsIngestion: &armmonitor.DataCollectionEndpointLogsIngestion{ // Endpoint: to.Ptr("https://mycollectionendpoint-abcd.eastus-1.ingest.monitor.azure.com"), // }, // NetworkACLs: &armmonitor.DataCollectionEndpointNetworkACLs{ // PublicNetworkAccess: to.Ptr(armmonitor.KnownPublicNetworkAccessOptionsEnabled), // }, // }, // SystemData: &armmonitor.DataCollectionEndpointResourceSystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-01T12:34:56.123Z"); return t}()), // CreatedBy: to.Ptr("user1"), // CreatedByType: to.Ptr(armmonitor.CreatedByTypeUser), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-02T12:34:56.123Z"); return t}()), // LastModifiedBy: to.Ptr("user2"), // LastModifiedByType: to.Ptr(armmonitor.CreatedByTypeUser), // }, // Tags: map[string]*string{ // "tag1": to.Ptr("A"), // "tag2": to.Ptr("B"), // "tag3": to.Ptr("C"), // }, // } }
Output:
type DataCollectionEndpointsClientCreateOptions ¶ added in v0.4.0
type DataCollectionEndpointsClientCreateOptions struct { // The payload Body *DataCollectionEndpointResource }
DataCollectionEndpointsClientCreateOptions contains the optional parameters for the DataCollectionEndpointsClient.Create method.
type DataCollectionEndpointsClientCreateResponse ¶ added in v0.4.0
type DataCollectionEndpointsClientCreateResponse struct { // Definition of ARM tracked top level resource. DataCollectionEndpointResource }
DataCollectionEndpointsClientCreateResponse contains the response from method DataCollectionEndpointsClient.Create.
type DataCollectionEndpointsClientDeleteOptions ¶ added in v0.4.0
type DataCollectionEndpointsClientDeleteOptions struct { }
DataCollectionEndpointsClientDeleteOptions contains the optional parameters for the DataCollectionEndpointsClient.Delete method.
type DataCollectionEndpointsClientDeleteResponse ¶ added in v0.4.0
type DataCollectionEndpointsClientDeleteResponse struct { }
DataCollectionEndpointsClientDeleteResponse contains the response from method DataCollectionEndpointsClient.Delete.
type DataCollectionEndpointsClientGetOptions ¶ added in v0.4.0
type DataCollectionEndpointsClientGetOptions struct { }
DataCollectionEndpointsClientGetOptions contains the optional parameters for the DataCollectionEndpointsClient.Get method.
type DataCollectionEndpointsClientGetResponse ¶ added in v0.4.0
type DataCollectionEndpointsClientGetResponse struct { // Definition of ARM tracked top level resource. DataCollectionEndpointResource }
DataCollectionEndpointsClientGetResponse contains the response from method DataCollectionEndpointsClient.Get.
type DataCollectionEndpointsClientListByResourceGroupOptions ¶ added in v0.4.0
type DataCollectionEndpointsClientListByResourceGroupOptions struct { }
DataCollectionEndpointsClientListByResourceGroupOptions contains the optional parameters for the DataCollectionEndpointsClient.NewListByResourceGroupPager method.
type DataCollectionEndpointsClientListByResourceGroupResponse ¶ added in v0.4.0
type DataCollectionEndpointsClientListByResourceGroupResponse struct { // A pageable list of resources. DataCollectionEndpointResourceListResult }
DataCollectionEndpointsClientListByResourceGroupResponse contains the response from method DataCollectionEndpointsClient.NewListByResourceGroupPager.
type DataCollectionEndpointsClientListBySubscriptionOptions ¶ added in v0.4.0
type DataCollectionEndpointsClientListBySubscriptionOptions struct { }
DataCollectionEndpointsClientListBySubscriptionOptions contains the optional parameters for the DataCollectionEndpointsClient.NewListBySubscriptionPager method.
type DataCollectionEndpointsClientListBySubscriptionResponse ¶ added in v0.4.0
type DataCollectionEndpointsClientListBySubscriptionResponse struct { // A pageable list of resources. DataCollectionEndpointResourceListResult }
DataCollectionEndpointsClientListBySubscriptionResponse contains the response from method DataCollectionEndpointsClient.NewListBySubscriptionPager.
type DataCollectionEndpointsClientUpdateOptions ¶ added in v0.4.0
type DataCollectionEndpointsClientUpdateOptions struct { // The payload Body *ResourceForUpdate }
DataCollectionEndpointsClientUpdateOptions contains the optional parameters for the DataCollectionEndpointsClient.Update method.
type DataCollectionEndpointsClientUpdateResponse ¶ added in v0.4.0
type DataCollectionEndpointsClientUpdateResponse struct { // Definition of ARM tracked top level resource. DataCollectionEndpointResource }
DataCollectionEndpointsClientUpdateResponse contains the response from method DataCollectionEndpointsClient.Update.
type DataCollectionRule ¶
type DataCollectionRule struct { // The resource ID of the data collection endpoint that this rule can be used with. DataCollectionEndpointID *string // The specification of data flows. DataFlows []*DataFlow // The specification of data sources. This property is optional and can be omitted if the rule is meant to be used via direct // calls to the provisioned endpoint. DataSources *DataCollectionRuleDataSources // Description of the data collection rule. Description *string // The specification of destinations. Destinations *DataCollectionRuleDestinations // Declaration of custom streams used in this rule. StreamDeclarations map[string]*StreamDeclaration // READ-ONLY; The immutable ID of this data collection rule. This property is READ-ONLY. ImmutableID *string // READ-ONLY; Metadata about the resource Metadata *DataCollectionRuleMetadata // READ-ONLY; The resource provisioning state. ProvisioningState *KnownDataCollectionRuleProvisioningState }
DataCollectionRule - Definition of what monitoring data to collect and where that data should be sent.
func (DataCollectionRule) MarshalJSON ¶
func (d DataCollectionRule) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DataCollectionRule.
func (*DataCollectionRule) UnmarshalJSON ¶ added in v0.8.0
func (d *DataCollectionRule) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DataCollectionRule.
type DataCollectionRuleAssociation ¶
type DataCollectionRuleAssociation struct { // The resource ID of the data collection endpoint that is to be associated. DataCollectionEndpointID *string // The resource ID of the data collection rule that is to be associated. DataCollectionRuleID *string // Description of the association. Description *string // READ-ONLY; Metadata about the resource Metadata *DataCollectionRuleAssociationMetadata // READ-ONLY; The resource provisioning state. ProvisioningState *KnownDataCollectionRuleAssociationProvisioningState }
DataCollectionRuleAssociation - Definition of association of a data collection rule with a monitored Azure resource.
func (DataCollectionRuleAssociation) MarshalJSON ¶ added in v0.8.0
func (d DataCollectionRuleAssociation) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DataCollectionRuleAssociation.
func (*DataCollectionRuleAssociation) UnmarshalJSON ¶ added in v0.8.0
func (d *DataCollectionRuleAssociation) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DataCollectionRuleAssociation.
type DataCollectionRuleAssociationMetadata ¶ added in v0.5.0
type DataCollectionRuleAssociationMetadata struct { // READ-ONLY; Azure offering managing this resource on-behalf-of customer. ProvisionedBy *string // READ-ONLY; Resource Id of azure offering managing this resource on-behalf-of customer. ProvisionedByResourceID *string }
DataCollectionRuleAssociationMetadata - Metadata about the resource
func (DataCollectionRuleAssociationMetadata) MarshalJSON ¶ added in v0.8.0
func (d DataCollectionRuleAssociationMetadata) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DataCollectionRuleAssociationMetadata.
func (*DataCollectionRuleAssociationMetadata) UnmarshalJSON ¶ added in v0.8.0
func (d *DataCollectionRuleAssociationMetadata) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DataCollectionRuleAssociationMetadata.
type DataCollectionRuleAssociationProxyOnlyResource ¶
type DataCollectionRuleAssociationProxyOnlyResource struct { // Resource properties. Properties *DataCollectionRuleAssociationProxyOnlyResourceProperties // READ-ONLY; Resource entity tag (ETag). Etag *string // READ-ONLY; Fully qualified ID of the resource. ID *string // READ-ONLY; The name of the resource. Name *string // READ-ONLY; Metadata pertaining to creation and last modification of the resource. SystemData *DataCollectionRuleAssociationProxyOnlyResourceSystemData // READ-ONLY; The type of the resource. Type *string }
DataCollectionRuleAssociationProxyOnlyResource - Definition of generic ARM proxy resource.
func (DataCollectionRuleAssociationProxyOnlyResource) MarshalJSON ¶ added in v0.8.0
func (d DataCollectionRuleAssociationProxyOnlyResource) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DataCollectionRuleAssociationProxyOnlyResource.
func (*DataCollectionRuleAssociationProxyOnlyResource) UnmarshalJSON ¶ added in v0.8.0
func (d *DataCollectionRuleAssociationProxyOnlyResource) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DataCollectionRuleAssociationProxyOnlyResource.
type DataCollectionRuleAssociationProxyOnlyResourceListResult ¶
type DataCollectionRuleAssociationProxyOnlyResourceListResult struct { // REQUIRED; A list of resources. Value []*DataCollectionRuleAssociationProxyOnlyResource // The URL to use for getting the next set of results. NextLink *string }
DataCollectionRuleAssociationProxyOnlyResourceListResult - A pageable list of resources.
func (DataCollectionRuleAssociationProxyOnlyResourceListResult) MarshalJSON ¶
func (d DataCollectionRuleAssociationProxyOnlyResourceListResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DataCollectionRuleAssociationProxyOnlyResourceListResult.
func (*DataCollectionRuleAssociationProxyOnlyResourceListResult) UnmarshalJSON ¶ added in v0.8.0
func (d *DataCollectionRuleAssociationProxyOnlyResourceListResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DataCollectionRuleAssociationProxyOnlyResourceListResult.
type DataCollectionRuleAssociationProxyOnlyResourceProperties ¶
type DataCollectionRuleAssociationProxyOnlyResourceProperties struct { // The resource ID of the data collection endpoint that is to be associated. DataCollectionEndpointID *string // The resource ID of the data collection rule that is to be associated. DataCollectionRuleID *string // Description of the association. Description *string // READ-ONLY; Metadata about the resource Metadata *DataCollectionRuleAssociationMetadata // READ-ONLY; The resource provisioning state. ProvisioningState *KnownDataCollectionRuleAssociationProvisioningState }
DataCollectionRuleAssociationProxyOnlyResourceProperties - Resource properties.
func (DataCollectionRuleAssociationProxyOnlyResourceProperties) MarshalJSON ¶ added in v0.8.0
func (d DataCollectionRuleAssociationProxyOnlyResourceProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DataCollectionRuleAssociationProxyOnlyResourceProperties.
func (*DataCollectionRuleAssociationProxyOnlyResourceProperties) UnmarshalJSON ¶ added in v0.8.0
func (d *DataCollectionRuleAssociationProxyOnlyResourceProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DataCollectionRuleAssociationProxyOnlyResourceProperties.
type DataCollectionRuleAssociationProxyOnlyResourceSystemData ¶
type DataCollectionRuleAssociationProxyOnlyResourceSystemData 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 }
DataCollectionRuleAssociationProxyOnlyResourceSystemData - Metadata pertaining to creation and last modification of the resource.
func (DataCollectionRuleAssociationProxyOnlyResourceSystemData) MarshalJSON ¶ added in v0.4.0
func (d DataCollectionRuleAssociationProxyOnlyResourceSystemData) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DataCollectionRuleAssociationProxyOnlyResourceSystemData.
func (*DataCollectionRuleAssociationProxyOnlyResourceSystemData) UnmarshalJSON ¶ added in v0.4.0
func (d *DataCollectionRuleAssociationProxyOnlyResourceSystemData) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DataCollectionRuleAssociationProxyOnlyResourceSystemData.
type DataCollectionRuleAssociationsClient ¶
type DataCollectionRuleAssociationsClient struct {
// contains filtered or unexported fields
}
DataCollectionRuleAssociationsClient contains the methods for the DataCollectionRuleAssociations group. Don't use this type directly, use NewDataCollectionRuleAssociationsClient() instead.
func NewDataCollectionRuleAssociationsClient ¶
func NewDataCollectionRuleAssociationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DataCollectionRuleAssociationsClient, error)
NewDataCollectionRuleAssociationsClient creates a new instance of DataCollectionRuleAssociationsClient with the specified values.
- subscriptionID - The ID of the target subscription.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - pass nil to accept the default values.
func (*DataCollectionRuleAssociationsClient) Create ¶
func (client *DataCollectionRuleAssociationsClient) Create(ctx context.Context, resourceURI string, associationName string, options *DataCollectionRuleAssociationsClientCreateOptions) (DataCollectionRuleAssociationsClientCreateResponse, error)
Create - Creates or updates an association. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2022-06-01
- resourceURI - The identifier of the resource.
- associationName - The name of the association. The name is case insensitive.
- options - DataCollectionRuleAssociationsClientCreateOptions contains the optional parameters for the DataCollectionRuleAssociationsClient.Create method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/DataCollectionRuleAssociationsCreate.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewDataCollectionRuleAssociationsClient().Create(ctx, "subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVm", "myAssociation", &armmonitor.DataCollectionRuleAssociationsClientCreateOptions{Body: &armmonitor.DataCollectionRuleAssociationProxyOnlyResource{ Properties: &armmonitor.DataCollectionRuleAssociationProxyOnlyResourceProperties{ DataCollectionRuleID: to.Ptr("/subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.Insights/dataCollectionRules/myCollectionRule"), }, }, }) 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.DataCollectionRuleAssociationProxyOnlyResource = armmonitor.DataCollectionRuleAssociationProxyOnlyResource{ // Name: to.Ptr("myAssociation"), // Type: to.Ptr("Microsoft.Insights/dataCollectionRuleAssociations"), // Etag: to.Ptr("070057da-0000-0000-0000-5ba70d6c0000"), // ID: to.Ptr("/subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVm/providers/Microsoft.Insights/dataCollectionRuleAssociations/myAssociation"), // Properties: &armmonitor.DataCollectionRuleAssociationProxyOnlyResourceProperties{ // DataCollectionRuleID: to.Ptr("/subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.Insights/dataCollectionRules/myCollectionRule"), // ProvisioningState: to.Ptr(armmonitor.KnownDataCollectionRuleAssociationProvisioningStateSucceeded), // }, // SystemData: &armmonitor.DataCollectionRuleAssociationProxyOnlyResourceSystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-01T12:34:56.123Z"); return t}()), // CreatedBy: to.Ptr("user1"), // CreatedByType: to.Ptr(armmonitor.CreatedByTypeUser), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-02T12:34:56.123Z"); return t}()), // LastModifiedBy: to.Ptr("user2"), // LastModifiedByType: to.Ptr(armmonitor.CreatedByTypeUser), // }, // } }
Output:
func (*DataCollectionRuleAssociationsClient) Delete ¶
func (client *DataCollectionRuleAssociationsClient) Delete(ctx context.Context, resourceURI string, associationName string, options *DataCollectionRuleAssociationsClientDeleteOptions) (DataCollectionRuleAssociationsClientDeleteResponse, error)
Delete - Deletes an association. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2022-06-01
- resourceURI - The identifier of the resource.
- associationName - The name of the association. The name is case insensitive.
- options - DataCollectionRuleAssociationsClientDeleteOptions contains the optional parameters for the DataCollectionRuleAssociationsClient.Delete method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/DataCollectionRuleAssociationsDelete.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } _, err = clientFactory.NewDataCollectionRuleAssociationsClient().Delete(ctx, "subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVm", "myAssociation", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } }
Output:
func (*DataCollectionRuleAssociationsClient) Get ¶
func (client *DataCollectionRuleAssociationsClient) Get(ctx context.Context, resourceURI string, associationName string, options *DataCollectionRuleAssociationsClientGetOptions) (DataCollectionRuleAssociationsClientGetResponse, error)
Get - Returns the specified association. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2022-06-01
- resourceURI - The identifier of the resource.
- associationName - The name of the association. The name is case insensitive.
- options - DataCollectionRuleAssociationsClientGetOptions contains the optional parameters for the DataCollectionRuleAssociationsClient.Get method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/DataCollectionRuleAssociationsGet.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewDataCollectionRuleAssociationsClient().Get(ctx, "subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVm", "myAssociation", 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.DataCollectionRuleAssociationProxyOnlyResource = armmonitor.DataCollectionRuleAssociationProxyOnlyResource{ // Name: to.Ptr("myAssociation"), // Type: to.Ptr("Microsoft.Insights/dataCollectionRuleAssociations"), // Etag: to.Ptr("070057da-0000-0000-0000-5ba70d6c0000"), // ID: to.Ptr("/subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVm/providers/Microsoft.Insights/dataCollectionRuleAssociations/myAssociation"), // Properties: &armmonitor.DataCollectionRuleAssociationProxyOnlyResourceProperties{ // DataCollectionRuleID: to.Ptr("/subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.Insights/dataCollectionRules/myCollectionRule"), // ProvisioningState: to.Ptr(armmonitor.KnownDataCollectionRuleAssociationProvisioningStateSucceeded), // }, // SystemData: &armmonitor.DataCollectionRuleAssociationProxyOnlyResourceSystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-01T12:34:56.123Z"); return t}()), // CreatedBy: to.Ptr("user1"), // CreatedByType: to.Ptr(armmonitor.CreatedByTypeUser), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-02T12:34:56.123Z"); return t}()), // LastModifiedBy: to.Ptr("user2"), // LastModifiedByType: to.Ptr(armmonitor.CreatedByTypeUser), // }, // } }
Output:
func (*DataCollectionRuleAssociationsClient) NewListByDataCollectionEndpointPager ¶ added in v0.6.0
func (client *DataCollectionRuleAssociationsClient) NewListByDataCollectionEndpointPager(resourceGroupName string, dataCollectionEndpointName string, options *DataCollectionRuleAssociationsClientListByDataCollectionEndpointOptions) *runtime.Pager[DataCollectionRuleAssociationsClientListByDataCollectionEndpointResponse]
NewListByDataCollectionEndpointPager - Lists associations for the specified data collection endpoint.
Generated from API version 2022-06-01
- resourceGroupName - The name of the resource group. The name is case insensitive.
- dataCollectionEndpointName - The name of the data collection endpoint. The name is case insensitive.
- options - DataCollectionRuleAssociationsClientListByDataCollectionEndpointOptions contains the optional parameters for the DataCollectionRuleAssociationsClient.NewListByDataCollectionEndpointPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/DataCollectionRuleAssociationsListByDataCollectionEndpoint.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewDataCollectionRuleAssociationsClient().NewListByDataCollectionEndpointPager("myResourceGroup", "myDataCollectionEndpointName", 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.DataCollectionRuleAssociationProxyOnlyResourceListResult = armmonitor.DataCollectionRuleAssociationProxyOnlyResourceListResult{ // Value: []*armmonitor.DataCollectionRuleAssociationProxyOnlyResource{ // { // Name: to.Ptr("myAssociation"), // Type: to.Ptr("Microsoft.Insights/dataCollectionRuleAssociations"), // Etag: to.Ptr("070057da-0000-0000-0000-5ba70d6c0000"), // ID: to.Ptr("/subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVm/providers/Microsoft.Insights/dataCollectionRuleAssociations/myAssociation"), // Properties: &armmonitor.DataCollectionRuleAssociationProxyOnlyResourceProperties{ // DataCollectionRuleID: to.Ptr("/subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.Insights/dataCollectionRules/myCollectionRule"), // ProvisioningState: to.Ptr(armmonitor.KnownDataCollectionRuleAssociationProvisioningStateSucceeded), // }, // SystemData: &armmonitor.DataCollectionRuleAssociationProxyOnlyResourceSystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-01T12:34:56.123Z"); return t}()), // CreatedBy: to.Ptr("user1"), // CreatedByType: to.Ptr(armmonitor.CreatedByTypeUser), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-02T12:34:56.123Z"); return t}()), // LastModifiedBy: to.Ptr("user2"), // LastModifiedByType: to.Ptr(armmonitor.CreatedByTypeUser), // }, // }}, // } } }
Output:
func (*DataCollectionRuleAssociationsClient) NewListByResourcePager ¶ added in v0.6.0
func (client *DataCollectionRuleAssociationsClient) NewListByResourcePager(resourceURI string, options *DataCollectionRuleAssociationsClientListByResourceOptions) *runtime.Pager[DataCollectionRuleAssociationsClientListByResourceResponse]
NewListByResourcePager - Lists associations for the specified resource.
Generated from API version 2022-06-01
- resourceURI - The identifier of the resource.
- options - DataCollectionRuleAssociationsClientListByResourceOptions contains the optional parameters for the DataCollectionRuleAssociationsClient.NewListByResourcePager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/DataCollectionRuleAssociationsListByResource.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewDataCollectionRuleAssociationsClient().NewListByResourcePager("subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVm", 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.DataCollectionRuleAssociationProxyOnlyResourceListResult = armmonitor.DataCollectionRuleAssociationProxyOnlyResourceListResult{ // Value: []*armmonitor.DataCollectionRuleAssociationProxyOnlyResource{ // { // Name: to.Ptr("myRuleAssociation"), // Type: to.Ptr("Microsoft.Insights/dataCollectionRuleAssociations"), // Etag: to.Ptr("070057da-0000-0000-0000-5ba70d6c0000"), // ID: to.Ptr("/subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVm/providers/Microsoft.Insights/dataCollectionRuleAssociations/myRuleAssociation"), // Properties: &armmonitor.DataCollectionRuleAssociationProxyOnlyResourceProperties{ // DataCollectionRuleID: to.Ptr("/subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.Insights/dataCollectionRules/myCollectionRule"), // ProvisioningState: to.Ptr(armmonitor.KnownDataCollectionRuleAssociationProvisioningStateSucceeded), // }, // SystemData: &armmonitor.DataCollectionRuleAssociationProxyOnlyResourceSystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-01T12:34:56.123Z"); return t}()), // CreatedBy: to.Ptr("user1"), // CreatedByType: to.Ptr(armmonitor.CreatedByTypeUser), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-02T12:34:56.123Z"); return t}()), // LastModifiedBy: to.Ptr("user2"), // LastModifiedByType: to.Ptr(armmonitor.CreatedByTypeUser), // }, // }, // { // Name: to.Ptr("herRuleAssociation"), // Type: to.Ptr("Microsoft.Insights/dataCollectionRuleAssociations"), // Etag: to.Ptr("3afa167b-3255-432b-b66d-e74a348468af"), // ID: to.Ptr("/subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVm/providers/Microsoft.Insights/dataCollectionRuleAssociations/herRuleAssociation"), // Properties: &armmonitor.DataCollectionRuleAssociationProxyOnlyResourceProperties{ // DataCollectionRuleID: to.Ptr("/subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.Insights/dataCollectionRules/herCollectionRule"), // ProvisioningState: to.Ptr(armmonitor.KnownDataCollectionRuleAssociationProvisioningStateSucceeded), // }, // SystemData: &armmonitor.DataCollectionRuleAssociationProxyOnlyResourceSystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-01T12:34:56.123Z"); return t}()), // CreatedBy: to.Ptr("user1"), // CreatedByType: to.Ptr(armmonitor.CreatedByTypeUser), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-02T12:34:56.123Z"); return t}()), // LastModifiedBy: to.Ptr("user2"), // LastModifiedByType: to.Ptr(armmonitor.CreatedByTypeUser), // }, // }, // { // Name: to.Ptr("myEndpointAssociation"), // Type: to.Ptr("Microsoft.Insights/dataCollectionRuleAssociations"), // Etag: to.Ptr("562d96b1-29e9-4250-b2fd-8bebfdf77a9d"), // ID: to.Ptr("/subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVm/providers/Microsoft.Insights/dataCollectionRuleAssociations/myEndpointAssociation"), // Properties: &armmonitor.DataCollectionRuleAssociationProxyOnlyResourceProperties{ // DataCollectionEndpointID: to.Ptr("/subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.Insights/dataCollectionEndpoints/myCollectionEndpoint"), // ProvisioningState: to.Ptr(armmonitor.KnownDataCollectionRuleAssociationProvisioningStateSucceeded), // }, // SystemData: &armmonitor.DataCollectionRuleAssociationProxyOnlyResourceSystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-01T12:34:56.123Z"); return t}()), // CreatedBy: to.Ptr("user1"), // CreatedByType: to.Ptr(armmonitor.CreatedByTypeUser), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-02T12:34:56.123Z"); return t}()), // LastModifiedBy: to.Ptr("user2"), // LastModifiedByType: to.Ptr(armmonitor.CreatedByTypeUser), // }, // }}, // } } }
Output:
func (*DataCollectionRuleAssociationsClient) NewListByRulePager ¶ added in v0.6.0
func (client *DataCollectionRuleAssociationsClient) NewListByRulePager(resourceGroupName string, dataCollectionRuleName string, options *DataCollectionRuleAssociationsClientListByRuleOptions) *runtime.Pager[DataCollectionRuleAssociationsClientListByRuleResponse]
NewListByRulePager - Lists associations for the specified data collection rule.
Generated from API version 2022-06-01
- resourceGroupName - The name of the resource group. The name is case insensitive.
- dataCollectionRuleName - The name of the data collection rule. The name is case insensitive.
- options - DataCollectionRuleAssociationsClientListByRuleOptions contains the optional parameters for the DataCollectionRuleAssociationsClient.NewListByRulePager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/DataCollectionRuleAssociationsListByRule.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewDataCollectionRuleAssociationsClient().NewListByRulePager("myResourceGroup", "myCollectionRule", 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.DataCollectionRuleAssociationProxyOnlyResourceListResult = armmonitor.DataCollectionRuleAssociationProxyOnlyResourceListResult{ // Value: []*armmonitor.DataCollectionRuleAssociationProxyOnlyResource{ // { // Name: to.Ptr("myAssociation"), // Type: to.Ptr("Microsoft.Insights/dataCollectionRuleAssociations"), // Etag: to.Ptr("070057da-0000-0000-0000-5ba70d6c0000"), // ID: to.Ptr("/subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVm/providers/Microsoft.Insights/dataCollectionRuleAssociations/myAssociation"), // Properties: &armmonitor.DataCollectionRuleAssociationProxyOnlyResourceProperties{ // DataCollectionRuleID: to.Ptr("/subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.Insights/dataCollectionRules/myCollectionRule"), // ProvisioningState: to.Ptr(armmonitor.KnownDataCollectionRuleAssociationProvisioningStateSucceeded), // }, // SystemData: &armmonitor.DataCollectionRuleAssociationProxyOnlyResourceSystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-01T12:34:56.123Z"); return t}()), // CreatedBy: to.Ptr("user1"), // CreatedByType: to.Ptr(armmonitor.CreatedByTypeUser), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-02T12:34:56.123Z"); return t}()), // LastModifiedBy: to.Ptr("user2"), // LastModifiedByType: to.Ptr(armmonitor.CreatedByTypeUser), // }, // }}, // } } }
Output:
type DataCollectionRuleAssociationsClientCreateOptions ¶ added in v0.4.0
type DataCollectionRuleAssociationsClientCreateOptions struct { // The payload Body *DataCollectionRuleAssociationProxyOnlyResource }
DataCollectionRuleAssociationsClientCreateOptions contains the optional parameters for the DataCollectionRuleAssociationsClient.Create method.
type DataCollectionRuleAssociationsClientCreateResponse ¶ added in v0.4.0
type DataCollectionRuleAssociationsClientCreateResponse struct { // Definition of generic ARM proxy resource. DataCollectionRuleAssociationProxyOnlyResource }
DataCollectionRuleAssociationsClientCreateResponse contains the response from method DataCollectionRuleAssociationsClient.Create.
type DataCollectionRuleAssociationsClientDeleteOptions ¶ added in v0.4.0
type DataCollectionRuleAssociationsClientDeleteOptions struct { }
DataCollectionRuleAssociationsClientDeleteOptions contains the optional parameters for the DataCollectionRuleAssociationsClient.Delete method.
type DataCollectionRuleAssociationsClientDeleteResponse ¶ added in v0.4.0
type DataCollectionRuleAssociationsClientDeleteResponse struct { }
DataCollectionRuleAssociationsClientDeleteResponse contains the response from method DataCollectionRuleAssociationsClient.Delete.
type DataCollectionRuleAssociationsClientGetOptions ¶ added in v0.4.0
type DataCollectionRuleAssociationsClientGetOptions struct { }
DataCollectionRuleAssociationsClientGetOptions contains the optional parameters for the DataCollectionRuleAssociationsClient.Get method.
type DataCollectionRuleAssociationsClientGetResponse ¶ added in v0.4.0
type DataCollectionRuleAssociationsClientGetResponse struct { // Definition of generic ARM proxy resource. DataCollectionRuleAssociationProxyOnlyResource }
DataCollectionRuleAssociationsClientGetResponse contains the response from method DataCollectionRuleAssociationsClient.Get.
type DataCollectionRuleAssociationsClientListByDataCollectionEndpointOptions ¶ added in v0.5.0
type DataCollectionRuleAssociationsClientListByDataCollectionEndpointOptions struct { }
DataCollectionRuleAssociationsClientListByDataCollectionEndpointOptions contains the optional parameters for the DataCollectionRuleAssociationsClient.NewListByDataCollectionEndpointPager method.
type DataCollectionRuleAssociationsClientListByDataCollectionEndpointResponse ¶ added in v0.5.0
type DataCollectionRuleAssociationsClientListByDataCollectionEndpointResponse struct { // A pageable list of resources. DataCollectionRuleAssociationProxyOnlyResourceListResult }
DataCollectionRuleAssociationsClientListByDataCollectionEndpointResponse contains the response from method DataCollectionRuleAssociationsClient.NewListByDataCollectionEndpointPager.
type DataCollectionRuleAssociationsClientListByResourceOptions ¶ added in v0.4.0
type DataCollectionRuleAssociationsClientListByResourceOptions struct { }
DataCollectionRuleAssociationsClientListByResourceOptions contains the optional parameters for the DataCollectionRuleAssociationsClient.NewListByResourcePager method.
type DataCollectionRuleAssociationsClientListByResourceResponse ¶ added in v0.4.0
type DataCollectionRuleAssociationsClientListByResourceResponse struct { // A pageable list of resources. DataCollectionRuleAssociationProxyOnlyResourceListResult }
DataCollectionRuleAssociationsClientListByResourceResponse contains the response from method DataCollectionRuleAssociationsClient.NewListByResourcePager.
type DataCollectionRuleAssociationsClientListByRuleOptions ¶ added in v0.4.0
type DataCollectionRuleAssociationsClientListByRuleOptions struct { }
DataCollectionRuleAssociationsClientListByRuleOptions contains the optional parameters for the DataCollectionRuleAssociationsClient.NewListByRulePager method.
type DataCollectionRuleAssociationsClientListByRuleResponse ¶ added in v0.4.0
type DataCollectionRuleAssociationsClientListByRuleResponse struct { // A pageable list of resources. DataCollectionRuleAssociationProxyOnlyResourceListResult }
DataCollectionRuleAssociationsClientListByRuleResponse contains the response from method DataCollectionRuleAssociationsClient.NewListByRulePager.
type DataCollectionRuleDataSources ¶
type DataCollectionRuleDataSources struct { // Specifications of pull based data sources DataImports *DataSourcesSpecDataImports // The list of Azure VM extension data source configurations. Extensions []*ExtensionDataSource // The list of IIS logs source configurations. IisLogs []*IisLogsDataSource // The list of Log files source configurations. LogFiles []*LogFilesDataSource // The list of performance counter data source configurations. PerformanceCounters []*PerfCounterDataSource // The list of platform telemetry configurations PlatformTelemetry []*PlatformTelemetryDataSource // The list of Prometheus forwarder data source configurations. PrometheusForwarder []*PrometheusForwarderDataSource // The list of Syslog data source configurations. Syslog []*SyslogDataSource // The list of Windows Event Log data source configurations. WindowsEventLogs []*WindowsEventLogDataSource // The list of Windows Firewall logs source configurations. WindowsFirewallLogs []*WindowsFirewallLogsDataSource }
DataCollectionRuleDataSources - The specification of data sources. This property is optional and can be omitted if the rule is meant to be used via direct calls to the provisioned endpoint.
func (DataCollectionRuleDataSources) MarshalJSON ¶ added in v0.4.0
func (d DataCollectionRuleDataSources) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DataCollectionRuleDataSources.
func (*DataCollectionRuleDataSources) UnmarshalJSON ¶ added in v0.8.0
func (d *DataCollectionRuleDataSources) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DataCollectionRuleDataSources.
type DataCollectionRuleDestinations ¶
type DataCollectionRuleDestinations struct { // Azure Monitor Metrics destination. AzureMonitorMetrics *DestinationsSpecAzureMonitorMetrics // List of Event Hubs destinations. EventHubs []*EventHubDestination // List of Event Hubs Direct destinations. EventHubsDirect []*EventHubDirectDestination // List of Log Analytics destinations. LogAnalytics []*LogAnalyticsDestination // List of monitoring account destinations. MonitoringAccounts []*MonitoringAccountDestination // List of storage accounts destinations. StorageAccounts []*StorageBlobDestination // List of Storage Blob Direct destinations. To be used only for sending data directly to store from the agent. StorageBlobsDirect []*StorageBlobDestination // List of Storage Table Direct destinations. StorageTablesDirect []*StorageTableDestination }
DataCollectionRuleDestinations - The specification of destinations.
func (DataCollectionRuleDestinations) MarshalJSON ¶ added in v0.4.0
func (d DataCollectionRuleDestinations) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DataCollectionRuleDestinations.
func (*DataCollectionRuleDestinations) UnmarshalJSON ¶ added in v0.8.0
func (d *DataCollectionRuleDestinations) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DataCollectionRuleDestinations.
type DataCollectionRuleMetadata ¶ added in v0.5.0
type DataCollectionRuleMetadata struct { // READ-ONLY; Azure offering managing this resource on-behalf-of customer. ProvisionedBy *string // READ-ONLY; Resource Id of azure offering managing this resource on-behalf-of customer. ProvisionedByResourceID *string }
DataCollectionRuleMetadata - Metadata about the resource
func (DataCollectionRuleMetadata) MarshalJSON ¶ added in v0.8.0
func (d DataCollectionRuleMetadata) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DataCollectionRuleMetadata.
func (*DataCollectionRuleMetadata) UnmarshalJSON ¶ added in v0.8.0
func (d *DataCollectionRuleMetadata) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DataCollectionRuleMetadata.
type DataCollectionRuleResource ¶
type DataCollectionRuleResource struct { // REQUIRED; The geo-location where the resource lives. Location *string // Managed service identity of the resource. Identity *DataCollectionRuleResourceIdentity // The kind of the resource. Kind *KnownDataCollectionRuleResourceKind // Resource properties. Properties *DataCollectionRuleResourceProperties // Resource tags. Tags map[string]*string // READ-ONLY; Resource entity tag (ETag). Etag *string // READ-ONLY; Fully qualified ID of the resource. ID *string // READ-ONLY; The name of the resource. Name *string // READ-ONLY; Metadata pertaining to creation and last modification of the resource. SystemData *DataCollectionRuleResourceSystemData // READ-ONLY; The type of the resource. Type *string }
DataCollectionRuleResource - Definition of ARM tracked top level resource.
func (DataCollectionRuleResource) MarshalJSON ¶
func (d DataCollectionRuleResource) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DataCollectionRuleResource.
func (*DataCollectionRuleResource) UnmarshalJSON ¶ added in v0.8.0
func (d *DataCollectionRuleResource) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DataCollectionRuleResource.
type DataCollectionRuleResourceIdentity ¶ added in v0.9.0
type DataCollectionRuleResourceIdentity struct { // REQUIRED; Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). Type *ManagedServiceIdentityType // The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM // resource ids in the form: // '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. // The dictionary values can be empty objects ({}) in // requests. UserAssignedIdentities map[string]*UserAssignedIdentity // READ-ONLY; The service principal ID of the system assigned identity. This property will only be provided for a system assigned // identity. PrincipalID *string // READ-ONLY; The tenant ID of the system assigned identity. This property will only be provided for a system assigned identity. TenantID *string }
DataCollectionRuleResourceIdentity - Managed service identity of the resource.
func (DataCollectionRuleResourceIdentity) MarshalJSON ¶ added in v0.9.0
func (d DataCollectionRuleResourceIdentity) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DataCollectionRuleResourceIdentity.
func (*DataCollectionRuleResourceIdentity) UnmarshalJSON ¶ added in v0.9.0
func (d *DataCollectionRuleResourceIdentity) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DataCollectionRuleResourceIdentity.
type DataCollectionRuleResourceListResult ¶
type DataCollectionRuleResourceListResult struct { // REQUIRED; A list of resources. Value []*DataCollectionRuleResource // The URL to use for getting the next set of results. NextLink *string }
DataCollectionRuleResourceListResult - A pageable list of resources.
func (DataCollectionRuleResourceListResult) MarshalJSON ¶
func (d DataCollectionRuleResourceListResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DataCollectionRuleResourceListResult.
func (*DataCollectionRuleResourceListResult) UnmarshalJSON ¶ added in v0.8.0
func (d *DataCollectionRuleResourceListResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DataCollectionRuleResourceListResult.
type DataCollectionRuleResourceProperties ¶
type DataCollectionRuleResourceProperties struct { // The resource ID of the data collection endpoint that this rule can be used with. DataCollectionEndpointID *string // The specification of data flows. DataFlows []*DataFlow // The specification of data sources. This property is optional and can be omitted if the rule is meant to be used via direct // calls to the provisioned endpoint. DataSources *DataCollectionRuleDataSources // Description of the data collection rule. Description *string // The specification of destinations. Destinations *DataCollectionRuleDestinations // Declaration of custom streams used in this rule. StreamDeclarations map[string]*StreamDeclaration // READ-ONLY; The immutable ID of this data collection rule. This property is READ-ONLY. ImmutableID *string // READ-ONLY; Metadata about the resource Metadata *DataCollectionRuleMetadata // READ-ONLY; The resource provisioning state. ProvisioningState *KnownDataCollectionRuleProvisioningState }
DataCollectionRuleResourceProperties - Resource properties.
func (DataCollectionRuleResourceProperties) MarshalJSON ¶ added in v0.4.0
func (d DataCollectionRuleResourceProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DataCollectionRuleResourceProperties.
func (*DataCollectionRuleResourceProperties) UnmarshalJSON ¶ added in v0.8.0
func (d *DataCollectionRuleResourceProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DataCollectionRuleResourceProperties.
type DataCollectionRuleResourceSystemData ¶
type DataCollectionRuleResourceSystemData 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 }
DataCollectionRuleResourceSystemData - Metadata pertaining to creation and last modification of the resource.
func (DataCollectionRuleResourceSystemData) MarshalJSON ¶ added in v0.4.0
func (d DataCollectionRuleResourceSystemData) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DataCollectionRuleResourceSystemData.
func (*DataCollectionRuleResourceSystemData) UnmarshalJSON ¶ added in v0.4.0
func (d *DataCollectionRuleResourceSystemData) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DataCollectionRuleResourceSystemData.
type DataCollectionRulesClient ¶
type DataCollectionRulesClient struct {
// contains filtered or unexported fields
}
DataCollectionRulesClient contains the methods for the DataCollectionRules group. Don't use this type directly, use NewDataCollectionRulesClient() instead.
func NewDataCollectionRulesClient ¶
func NewDataCollectionRulesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DataCollectionRulesClient, error)
NewDataCollectionRulesClient creates a new instance of DataCollectionRulesClient with the specified values.
- subscriptionID - The ID of the target subscription.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - pass nil to accept the default values.
func (*DataCollectionRulesClient) Create ¶
func (client *DataCollectionRulesClient) Create(ctx context.Context, resourceGroupName string, dataCollectionRuleName string, options *DataCollectionRulesClientCreateOptions) (DataCollectionRulesClientCreateResponse, error)
Create - Creates or updates a data collection rule. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2022-06-01
- resourceGroupName - The name of the resource group. The name is case insensitive.
- dataCollectionRuleName - The name of the data collection rule. The name is case insensitive.
- options - DataCollectionRulesClientCreateOptions contains the optional parameters for the DataCollectionRulesClient.Create method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/DataCollectionRulesCreate.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewDataCollectionRulesClient().Create(ctx, "myResourceGroup", "myCollectionRule", &armmonitor.DataCollectionRulesClientCreateOptions{Body: &armmonitor.DataCollectionRuleResource{ Location: to.Ptr("eastus"), Properties: &armmonitor.DataCollectionRuleResourceProperties{ DataFlows: []*armmonitor.DataFlow{ { Destinations: []*string{ to.Ptr("centralWorkspace")}, Streams: []*armmonitor.KnownDataFlowStreams{ to.Ptr(armmonitor.KnownDataFlowStreamsMicrosoftPerf), to.Ptr(armmonitor.KnownDataFlowStreamsMicrosoftSyslog), to.Ptr(armmonitor.KnownDataFlowStreamsMicrosoftWindowsEvent)}, }}, DataSources: &armmonitor.DataCollectionRuleDataSources{ PerformanceCounters: []*armmonitor.PerfCounterDataSource{ { Name: to.Ptr("cloudTeamCoreCounters"), CounterSpecifiers: []*string{ to.Ptr("\\Processor(_Total)\\% Processor Time"), to.Ptr("\\Memory\\Committed Bytes"), to.Ptr("\\LogicalDisk(_Total)\\Free Megabytes"), to.Ptr("\\PhysicalDisk(_Total)\\Avg. Disk Queue Length")}, SamplingFrequencyInSeconds: to.Ptr[int32](15), Streams: []*armmonitor.KnownPerfCounterDataSourceStreams{ to.Ptr(armmonitor.KnownPerfCounterDataSourceStreamsMicrosoftPerf)}, }, { Name: to.Ptr("appTeamExtraCounters"), CounterSpecifiers: []*string{ to.Ptr("\\Process(_Total)\\Thread Count")}, SamplingFrequencyInSeconds: to.Ptr[int32](30), Streams: []*armmonitor.KnownPerfCounterDataSourceStreams{ to.Ptr(armmonitor.KnownPerfCounterDataSourceStreamsMicrosoftPerf)}, }}, Syslog: []*armmonitor.SyslogDataSource{ { Name: to.Ptr("cronSyslog"), FacilityNames: []*armmonitor.KnownSyslogDataSourceFacilityNames{ to.Ptr(armmonitor.KnownSyslogDataSourceFacilityNamesCron)}, LogLevels: []*armmonitor.KnownSyslogDataSourceLogLevels{ to.Ptr(armmonitor.KnownSyslogDataSourceLogLevelsDebug), to.Ptr(armmonitor.KnownSyslogDataSourceLogLevelsCritical), to.Ptr(armmonitor.KnownSyslogDataSourceLogLevelsEmergency)}, Streams: []*armmonitor.KnownSyslogDataSourceStreams{ to.Ptr(armmonitor.KnownSyslogDataSourceStreamsMicrosoftSyslog)}, }, { Name: to.Ptr("syslogBase"), FacilityNames: []*armmonitor.KnownSyslogDataSourceFacilityNames{ to.Ptr(armmonitor.KnownSyslogDataSourceFacilityNamesSyslog)}, LogLevels: []*armmonitor.KnownSyslogDataSourceLogLevels{ to.Ptr(armmonitor.KnownSyslogDataSourceLogLevelsAlert), to.Ptr(armmonitor.KnownSyslogDataSourceLogLevelsCritical), to.Ptr(armmonitor.KnownSyslogDataSourceLogLevelsEmergency)}, Streams: []*armmonitor.KnownSyslogDataSourceStreams{ to.Ptr(armmonitor.KnownSyslogDataSourceStreamsMicrosoftSyslog)}, }}, WindowsEventLogs: []*armmonitor.WindowsEventLogDataSource{ { Name: to.Ptr("cloudSecurityTeamEvents"), Streams: []*armmonitor.KnownWindowsEventLogDataSourceStreams{ to.Ptr(armmonitor.KnownWindowsEventLogDataSourceStreamsMicrosoftWindowsEvent)}, XPathQueries: []*string{ to.Ptr("Security!")}, }, { Name: to.Ptr("appTeam1AppEvents"), Streams: []*armmonitor.KnownWindowsEventLogDataSourceStreams{ to.Ptr(armmonitor.KnownWindowsEventLogDataSourceStreamsMicrosoftWindowsEvent)}, XPathQueries: []*string{ to.Ptr("System![System[(Level = 1 or Level = 2 or Level = 3)]]"), to.Ptr("Application!*[System[(Level = 1 or Level = 2 or Level = 3)]]")}, }}, }, Destinations: &armmonitor.DataCollectionRuleDestinations{ LogAnalytics: []*armmonitor.LogAnalyticsDestination{ { Name: to.Ptr("centralWorkspace"), WorkspaceResourceID: to.Ptr("/subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.OperationalInsights/workspaces/centralTeamWorkspace"), }}, }, }, }, }) 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.DataCollectionRuleResource = armmonitor.DataCollectionRuleResource{ // Name: to.Ptr("myCollectionRule"), // Type: to.Ptr("Microsoft.Insights/dataCollectionRules"), // Etag: to.Ptr("070057da-0000-0000-0000-5ba70d6c0000"), // ID: to.Ptr("/subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.Insights/dataCollectionRules/myCollectionRule"), // Location: to.Ptr("eastus"), // Properties: &armmonitor.DataCollectionRuleResourceProperties{ // DataFlows: []*armmonitor.DataFlow{ // { // Destinations: []*string{ // to.Ptr("centralWorkspace")}, // Streams: []*armmonitor.KnownDataFlowStreams{ // to.Ptr(armmonitor.KnownDataFlowStreamsMicrosoftPerf), // to.Ptr(armmonitor.KnownDataFlowStreamsMicrosoftSyslog), // to.Ptr(armmonitor.KnownDataFlowStreamsMicrosoftWindowsEvent)}, // }}, // DataSources: &armmonitor.DataCollectionRuleDataSources{ // PerformanceCounters: []*armmonitor.PerfCounterDataSource{ // { // Name: to.Ptr("cloudTeamCoreCounters"), // CounterSpecifiers: []*string{ // to.Ptr("\\Processor(_Total)\\% Processor Time"), // to.Ptr("\\Memory\\Committed Bytes"), // to.Ptr("\\LogicalDisk(_Total)\\Free Megabytes"), // to.Ptr("\\PhysicalDisk(_Total)\\Avg. Disk Queue Length")}, // SamplingFrequencyInSeconds: to.Ptr[int32](15), // Streams: []*armmonitor.KnownPerfCounterDataSourceStreams{ // to.Ptr(armmonitor.KnownPerfCounterDataSourceStreamsMicrosoftPerf)}, // }, // { // Name: to.Ptr("appTeamExtraCounters"), // CounterSpecifiers: []*string{ // to.Ptr("\\Process(_Total)\\Thread Count")}, // SamplingFrequencyInSeconds: to.Ptr[int32](30), // Streams: []*armmonitor.KnownPerfCounterDataSourceStreams{ // to.Ptr(armmonitor.KnownPerfCounterDataSourceStreamsMicrosoftPerf)}, // }}, // Syslog: []*armmonitor.SyslogDataSource{ // { // Name: to.Ptr("cronSyslog"), // FacilityNames: []*armmonitor.KnownSyslogDataSourceFacilityNames{ // to.Ptr(armmonitor.KnownSyslogDataSourceFacilityNamesCron)}, // LogLevels: []*armmonitor.KnownSyslogDataSourceLogLevels{ // to.Ptr(armmonitor.KnownSyslogDataSourceLogLevelsDebug), // to.Ptr(armmonitor.KnownSyslogDataSourceLogLevelsCritical), // to.Ptr(armmonitor.KnownSyslogDataSourceLogLevelsEmergency)}, // Streams: []*armmonitor.KnownSyslogDataSourceStreams{ // to.Ptr(armmonitor.KnownSyslogDataSourceStreamsMicrosoftSyslog)}, // }, // { // Name: to.Ptr("syslogBase"), // FacilityNames: []*armmonitor.KnownSyslogDataSourceFacilityNames{ // to.Ptr(armmonitor.KnownSyslogDataSourceFacilityNamesSyslog)}, // LogLevels: []*armmonitor.KnownSyslogDataSourceLogLevels{ // to.Ptr(armmonitor.KnownSyslogDataSourceLogLevelsAlert), // to.Ptr(armmonitor.KnownSyslogDataSourceLogLevelsCritical), // to.Ptr(armmonitor.KnownSyslogDataSourceLogLevelsEmergency)}, // Streams: []*armmonitor.KnownSyslogDataSourceStreams{ // to.Ptr(armmonitor.KnownSyslogDataSourceStreamsMicrosoftSyslog)}, // }}, // WindowsEventLogs: []*armmonitor.WindowsEventLogDataSource{ // { // Name: to.Ptr("cloudSecurityTeamEvents"), // Streams: []*armmonitor.KnownWindowsEventLogDataSourceStreams{ // to.Ptr(armmonitor.KnownWindowsEventLogDataSourceStreamsMicrosoftWindowsEvent)}, // XPathQueries: []*string{ // to.Ptr("Security!")}, // }, // { // Name: to.Ptr("appTeam1AppEvents"), // Streams: []*armmonitor.KnownWindowsEventLogDataSourceStreams{ // to.Ptr(armmonitor.KnownWindowsEventLogDataSourceStreamsMicrosoftWindowsEvent)}, // XPathQueries: []*string{ // to.Ptr("System![System[(Level = 1 or Level = 2 or Level = 3)]]"), // to.Ptr("Application!*[System[(Level = 1 or Level = 2 or Level = 3)]]")}, // }}, // }, // Destinations: &armmonitor.DataCollectionRuleDestinations{ // LogAnalytics: []*armmonitor.LogAnalyticsDestination{ // { // Name: to.Ptr("centralWorkspace"), // WorkspaceID: to.Ptr("9ba8bc53-bd36-4156-8667-e983e7ae0e4f"), // WorkspaceResourceID: to.Ptr("/subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.OperationalInsights/workspaces/centralTeamWorkspace"), // }}, // }, // ImmutableID: to.Ptr("dcr-b74e0d383fc9415abaa584ec41adece3"), // }, // SystemData: &armmonitor.DataCollectionRuleResourceSystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-01T12:34:56.123Z"); return t}()), // CreatedBy: to.Ptr("user1"), // CreatedByType: to.Ptr(armmonitor.CreatedByTypeUser), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-02T12:34:56.123Z"); return t}()), // LastModifiedBy: to.Ptr("user2"), // LastModifiedByType: to.Ptr(armmonitor.CreatedByTypeUser), // }, // Tags: map[string]*string{ // "tag1": to.Ptr("A"), // "tag2": to.Ptr("B"), // }, // } }
Output:
func (*DataCollectionRulesClient) Delete ¶
func (client *DataCollectionRulesClient) Delete(ctx context.Context, resourceGroupName string, dataCollectionRuleName string, options *DataCollectionRulesClientDeleteOptions) (DataCollectionRulesClientDeleteResponse, error)
Delete - Deletes a data collection rule. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2022-06-01
- resourceGroupName - The name of the resource group. The name is case insensitive.
- dataCollectionRuleName - The name of the data collection rule. The name is case insensitive.
- options - DataCollectionRulesClientDeleteOptions contains the optional parameters for the DataCollectionRulesClient.Delete method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/DataCollectionRulesDelete.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } _, err = clientFactory.NewDataCollectionRulesClient().Delete(ctx, "myResourceGroup", "myCollectionRule", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } }
Output:
func (*DataCollectionRulesClient) Get ¶
func (client *DataCollectionRulesClient) Get(ctx context.Context, resourceGroupName string, dataCollectionRuleName string, options *DataCollectionRulesClientGetOptions) (DataCollectionRulesClientGetResponse, error)
Get - Returns the specified data collection rule. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2022-06-01
- resourceGroupName - The name of the resource group. The name is case insensitive.
- dataCollectionRuleName - The name of the data collection rule. The name is case insensitive.
- options - DataCollectionRulesClientGetOptions contains the optional parameters for the DataCollectionRulesClient.Get method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/DataCollectionRulesGet.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewDataCollectionRulesClient().Get(ctx, "myResourceGroup", "myCollectionRule", 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.DataCollectionRuleResource = armmonitor.DataCollectionRuleResource{ // Name: to.Ptr("myCollectionRule"), // Type: to.Ptr("Microsoft.Insights/dataCollectionRules"), // Etag: to.Ptr("070057da-0000-0000-0000-5ba70d6c0000"), // ID: to.Ptr("/subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.Insights/dataCollectionRules/myCollectionRule"), // Location: to.Ptr("eastus"), // Properties: &armmonitor.DataCollectionRuleResourceProperties{ // DataFlows: []*armmonitor.DataFlow{ // { // Destinations: []*string{ // to.Ptr("centralWorkspace")}, // Streams: []*armmonitor.KnownDataFlowStreams{ // to.Ptr(armmonitor.KnownDataFlowStreamsMicrosoftPerf), // to.Ptr(armmonitor.KnownDataFlowStreamsMicrosoftSyslog), // to.Ptr(armmonitor.KnownDataFlowStreamsMicrosoftWindowsEvent)}, // }}, // DataSources: &armmonitor.DataCollectionRuleDataSources{ // PerformanceCounters: []*armmonitor.PerfCounterDataSource{ // { // Name: to.Ptr("cloudTeamCoreCounters"), // CounterSpecifiers: []*string{ // to.Ptr("\\Processor(_Total)\\% Processor Time"), // to.Ptr("\\Memory\\Committed Bytes"), // to.Ptr("\\LogicalDisk(_Total)\\Free Megabytes"), // to.Ptr("\\PhysicalDisk(_Total)\\Avg. Disk Queue Length")}, // SamplingFrequencyInSeconds: to.Ptr[int32](15), // Streams: []*armmonitor.KnownPerfCounterDataSourceStreams{ // to.Ptr(armmonitor.KnownPerfCounterDataSourceStreamsMicrosoftPerf)}, // }, // { // Name: to.Ptr("appTeamExtraCounters"), // CounterSpecifiers: []*string{ // to.Ptr("\\Process(_Total)\\Thread Count")}, // SamplingFrequencyInSeconds: to.Ptr[int32](30), // Streams: []*armmonitor.KnownPerfCounterDataSourceStreams{ // to.Ptr(armmonitor.KnownPerfCounterDataSourceStreamsMicrosoftPerf)}, // }}, // Syslog: []*armmonitor.SyslogDataSource{ // { // Name: to.Ptr("cronSyslog"), // FacilityNames: []*armmonitor.KnownSyslogDataSourceFacilityNames{ // to.Ptr(armmonitor.KnownSyslogDataSourceFacilityNamesCron)}, // LogLevels: []*armmonitor.KnownSyslogDataSourceLogLevels{ // to.Ptr(armmonitor.KnownSyslogDataSourceLogLevelsDebug), // to.Ptr(armmonitor.KnownSyslogDataSourceLogLevelsCritical), // to.Ptr(armmonitor.KnownSyslogDataSourceLogLevelsEmergency)}, // Streams: []*armmonitor.KnownSyslogDataSourceStreams{ // to.Ptr(armmonitor.KnownSyslogDataSourceStreamsMicrosoftSyslog)}, // }, // { // Name: to.Ptr("syslogBase"), // FacilityNames: []*armmonitor.KnownSyslogDataSourceFacilityNames{ // to.Ptr(armmonitor.KnownSyslogDataSourceFacilityNamesSyslog)}, // LogLevels: []*armmonitor.KnownSyslogDataSourceLogLevels{ // to.Ptr(armmonitor.KnownSyslogDataSourceLogLevelsAlert), // to.Ptr(armmonitor.KnownSyslogDataSourceLogLevelsCritical), // to.Ptr(armmonitor.KnownSyslogDataSourceLogLevelsEmergency)}, // Streams: []*armmonitor.KnownSyslogDataSourceStreams{ // to.Ptr(armmonitor.KnownSyslogDataSourceStreamsMicrosoftSyslog)}, // }}, // WindowsEventLogs: []*armmonitor.WindowsEventLogDataSource{ // { // Name: to.Ptr("cloudSecurityTeamEvents"), // Streams: []*armmonitor.KnownWindowsEventLogDataSourceStreams{ // to.Ptr(armmonitor.KnownWindowsEventLogDataSourceStreamsMicrosoftWindowsEvent)}, // XPathQueries: []*string{ // to.Ptr("Security!")}, // }, // { // Name: to.Ptr("appTeam1AppEvents"), // Streams: []*armmonitor.KnownWindowsEventLogDataSourceStreams{ // to.Ptr(armmonitor.KnownWindowsEventLogDataSourceStreamsMicrosoftWindowsEvent)}, // XPathQueries: []*string{ // to.Ptr("System![System[(Level = 1 or Level = 2 or Level = 3)]]"), // to.Ptr("Application!*[System[(Level = 1 or Level = 2 or Level = 3)]]")}, // }}, // }, // Destinations: &armmonitor.DataCollectionRuleDestinations{ // LogAnalytics: []*armmonitor.LogAnalyticsDestination{ // { // Name: to.Ptr("centralWorkspace"), // WorkspaceID: to.Ptr("9ba8bc53-bd36-4156-8667-e983e7ae0e4f"), // WorkspaceResourceID: to.Ptr("/subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.OperationalInsights/workspaces/centralTeamWorkspace"), // }}, // }, // ImmutableID: to.Ptr("dcr-b74e0d383fc9415abaa584ec41adece3"), // }, // SystemData: &armmonitor.DataCollectionRuleResourceSystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-01T12:34:56.123Z"); return t}()), // CreatedBy: to.Ptr("user1"), // CreatedByType: to.Ptr(armmonitor.CreatedByTypeUser), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-02T12:34:56.123Z"); return t}()), // LastModifiedBy: to.Ptr("user2"), // LastModifiedByType: to.Ptr(armmonitor.CreatedByTypeUser), // }, // Tags: map[string]*string{ // "tag1": to.Ptr("A"), // "tag2": to.Ptr("B"), // }, // } }
Output:
func (*DataCollectionRulesClient) NewListByResourceGroupPager ¶ added in v0.6.0
func (client *DataCollectionRulesClient) NewListByResourceGroupPager(resourceGroupName string, options *DataCollectionRulesClientListByResourceGroupOptions) *runtime.Pager[DataCollectionRulesClientListByResourceGroupResponse]
NewListByResourceGroupPager - Lists all data collection rules in the specified resource group.
Generated from API version 2022-06-01
- resourceGroupName - The name of the resource group. The name is case insensitive.
- options - DataCollectionRulesClientListByResourceGroupOptions contains the optional parameters for the DataCollectionRulesClient.NewListByResourceGroupPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/DataCollectionRulesListByResourceGroup.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewDataCollectionRulesClient().NewListByResourceGroupPager("myResourceGroup", 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.DataCollectionRuleResourceListResult = armmonitor.DataCollectionRuleResourceListResult{ // Value: []*armmonitor.DataCollectionRuleResource{ // { // Name: to.Ptr("myCollectionRule"), // Type: to.Ptr("Microsoft.Insights/dataCollectionRules"), // Etag: to.Ptr("070057da-0000-0000-0000-5ba70d6c0000"), // ID: to.Ptr("/subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.Insights/dataCollectionRules/myCollectionRule"), // Location: to.Ptr("eastus"), // Properties: &armmonitor.DataCollectionRuleResourceProperties{ // DataFlows: []*armmonitor.DataFlow{ // { // Destinations: []*string{ // to.Ptr("centralWorkspace")}, // Streams: []*armmonitor.KnownDataFlowStreams{ // to.Ptr(armmonitor.KnownDataFlowStreamsMicrosoftPerf), // to.Ptr(armmonitor.KnownDataFlowStreamsMicrosoftSyslog), // to.Ptr(armmonitor.KnownDataFlowStreamsMicrosoftWindowsEvent)}, // }}, // DataSources: &armmonitor.DataCollectionRuleDataSources{ // PerformanceCounters: []*armmonitor.PerfCounterDataSource{ // { // Name: to.Ptr("cloudTeamCoreCounters"), // CounterSpecifiers: []*string{ // to.Ptr("\\Processor(_Total)\\% Processor Time"), // to.Ptr("\\Memory\\Committed Bytes"), // to.Ptr("\\LogicalDisk(_Total)\\Free Megabytes"), // to.Ptr("\\PhysicalDisk(_Total)\\Avg. Disk Queue Length")}, // SamplingFrequencyInSeconds: to.Ptr[int32](15), // Streams: []*armmonitor.KnownPerfCounterDataSourceStreams{ // to.Ptr(armmonitor.KnownPerfCounterDataSourceStreamsMicrosoftPerf)}, // }, // { // Name: to.Ptr("appTeamExtraCounters"), // CounterSpecifiers: []*string{ // to.Ptr("\\Process(_Total)\\Thread Count")}, // SamplingFrequencyInSeconds: to.Ptr[int32](30), // Streams: []*armmonitor.KnownPerfCounterDataSourceStreams{ // to.Ptr(armmonitor.KnownPerfCounterDataSourceStreamsMicrosoftPerf)}, // }}, // Syslog: []*armmonitor.SyslogDataSource{ // { // Name: to.Ptr("cronSyslog"), // FacilityNames: []*armmonitor.KnownSyslogDataSourceFacilityNames{ // to.Ptr(armmonitor.KnownSyslogDataSourceFacilityNamesCron)}, // LogLevels: []*armmonitor.KnownSyslogDataSourceLogLevels{ // to.Ptr(armmonitor.KnownSyslogDataSourceLogLevelsDebug), // to.Ptr(armmonitor.KnownSyslogDataSourceLogLevelsCritical), // to.Ptr(armmonitor.KnownSyslogDataSourceLogLevelsEmergency)}, // Streams: []*armmonitor.KnownSyslogDataSourceStreams{ // to.Ptr(armmonitor.KnownSyslogDataSourceStreamsMicrosoftSyslog)}, // }, // { // Name: to.Ptr("syslogBase"), // FacilityNames: []*armmonitor.KnownSyslogDataSourceFacilityNames{ // to.Ptr(armmonitor.KnownSyslogDataSourceFacilityNamesSyslog)}, // LogLevels: []*armmonitor.KnownSyslogDataSourceLogLevels{ // to.Ptr(armmonitor.KnownSyslogDataSourceLogLevelsAlert), // to.Ptr(armmonitor.KnownSyslogDataSourceLogLevelsCritical), // to.Ptr(armmonitor.KnownSyslogDataSourceLogLevelsEmergency)}, // Streams: []*armmonitor.KnownSyslogDataSourceStreams{ // to.Ptr(armmonitor.KnownSyslogDataSourceStreamsMicrosoftSyslog)}, // }}, // WindowsEventLogs: []*armmonitor.WindowsEventLogDataSource{ // { // Name: to.Ptr("cloudSecurityTeamEvents"), // Streams: []*armmonitor.KnownWindowsEventLogDataSourceStreams{ // to.Ptr(armmonitor.KnownWindowsEventLogDataSourceStreamsMicrosoftWindowsEvent)}, // XPathQueries: []*string{ // to.Ptr("Security!")}, // }, // { // Name: to.Ptr("appTeam1AppEvents"), // Streams: []*armmonitor.KnownWindowsEventLogDataSourceStreams{ // to.Ptr(armmonitor.KnownWindowsEventLogDataSourceStreamsMicrosoftWindowsEvent)}, // XPathQueries: []*string{ // to.Ptr("System![System[(Level = 1 or Level = 2 or Level = 3)]]"), // to.Ptr("Application!*[System[(Level = 1 or Level = 2 or Level = 3)]]")}, // }}, // }, // Destinations: &armmonitor.DataCollectionRuleDestinations{ // LogAnalytics: []*armmonitor.LogAnalyticsDestination{ // { // Name: to.Ptr("centralWorkspace"), // WorkspaceID: to.Ptr("9ba8bc53-bd36-4156-8667-e983e7ae0e4f"), // WorkspaceResourceID: to.Ptr("/subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.OperationalInsights/workspaces/centralTeamWorkspace"), // }}, // }, // ImmutableID: to.Ptr("dcr-b74e0d383fc9415abaa584ec41adece3"), // }, // SystemData: &armmonitor.DataCollectionRuleResourceSystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-01T12:34:56.123Z"); return t}()), // CreatedBy: to.Ptr("user1"), // CreatedByType: to.Ptr(armmonitor.CreatedByTypeUser), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-02T12:34:56.123Z"); return t}()), // LastModifiedBy: to.Ptr("user2"), // LastModifiedByType: to.Ptr(armmonitor.CreatedByTypeUser), // }, // Tags: map[string]*string{ // "tag1": to.Ptr("A"), // "tag2": to.Ptr("B"), // }, // }, // { // Name: to.Ptr("herCollectionRule"), // Type: to.Ptr("Microsoft.Insights/dataCollectionRules"), // Etag: to.Ptr("3afa167b-3255-432b-b66d-e74a348468af"), // ID: to.Ptr("/subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.Insights/dataCollectionRules/herCollectionRule"), // Location: to.Ptr("westus"), // Properties: &armmonitor.DataCollectionRuleResourceProperties{ // DataFlows: []*armmonitor.DataFlow{ // { // Destinations: []*string{ // to.Ptr("herWorkspace")}, // Streams: []*armmonitor.KnownDataFlowStreams{ // to.Ptr(armmonitor.KnownDataFlowStreamsMicrosoftPerf), // to.Ptr(armmonitor.KnownDataFlowStreamsMicrosoftWindowsEvent)}, // }}, // DataSources: &armmonitor.DataCollectionRuleDataSources{ // PerformanceCounters: []*armmonitor.PerfCounterDataSource{ // { // Name: to.Ptr("herPerfCounters"), // CounterSpecifiers: []*string{ // to.Ptr("\\Processor(_Total)\\% Processor Time"), // to.Ptr("\\LogicalDisk(_Total)\\Free Megabytes"), // to.Ptr("\\PhysicalDisk(_Total)\\Avg. Disk Queue Length")}, // SamplingFrequencyInSeconds: to.Ptr[int32](30), // Streams: []*armmonitor.KnownPerfCounterDataSourceStreams{ // to.Ptr(armmonitor.KnownPerfCounterDataSourceStreamsMicrosoftPerf)}, // }}, // WindowsEventLogs: []*armmonitor.WindowsEventLogDataSource{ // { // Name: to.Ptr("herWindowsEventLogs"), // Streams: []*armmonitor.KnownWindowsEventLogDataSourceStreams{ // to.Ptr(armmonitor.KnownWindowsEventLogDataSourceStreamsMicrosoftWindowsEvent)}, // XPathQueries: []*string{ // to.Ptr("Security!*"), // to.Ptr("System!*[System[(Level = 1 or Level = 2 or Level = 3)]]"), // to.Ptr("Application!*[System[(Level = 1 or Level = 2 or Level = 3)]]")}, // }}, // }, // Destinations: &armmonitor.DataCollectionRuleDestinations{ // LogAnalytics: []*armmonitor.LogAnalyticsDestination{ // { // Name: to.Ptr("herWorkspace"), // WorkspaceID: to.Ptr("c49b982a-c4f7-40c4-bd13-d6588f1b4015"), // WorkspaceResourceID: to.Ptr("/subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/herResourceGroup/providers/Microsoft.OperationalInsights/workspaces/herTeamWorkspace"), // }}, // }, // ImmutableID: to.Ptr("dcr-ca1e6d9dad844b2c94e7961c42af917a"), // ProvisioningState: to.Ptr(armmonitor.KnownDataCollectionRuleProvisioningStateSucceeded), // }, // SystemData: &armmonitor.DataCollectionRuleResourceSystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-01T12:34:56.123Z"); return t}()), // CreatedBy: to.Ptr("user1"), // CreatedByType: to.Ptr(armmonitor.CreatedByTypeUser), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-02T12:34:56.123Z"); return t}()), // LastModifiedBy: to.Ptr("user2"), // LastModifiedByType: to.Ptr(armmonitor.CreatedByTypeUser), // }, // Tags: map[string]*string{ // "tag1": to.Ptr("C"), // }, // }}, // } } }
Output:
func (*DataCollectionRulesClient) NewListBySubscriptionPager ¶ added in v0.6.0
func (client *DataCollectionRulesClient) NewListBySubscriptionPager(options *DataCollectionRulesClientListBySubscriptionOptions) *runtime.Pager[DataCollectionRulesClientListBySubscriptionResponse]
NewListBySubscriptionPager - Lists all data collection rules in the specified subscription.
Generated from API version 2022-06-01
- options - DataCollectionRulesClientListBySubscriptionOptions contains the optional parameters for the DataCollectionRulesClient.NewListBySubscriptionPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/DataCollectionRulesListBySubscription.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewDataCollectionRulesClient().NewListBySubscriptionPager(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.DataCollectionRuleResourceListResult = armmonitor.DataCollectionRuleResourceListResult{ // Value: []*armmonitor.DataCollectionRuleResource{ // { // Name: to.Ptr("myCollectionRule"), // Type: to.Ptr("Microsoft.Insights/dataCollectionRules"), // Etag: to.Ptr("070057da-0000-0000-0000-5ba70d6c0000"), // ID: to.Ptr("/subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.Insights/dataCollectionRules/myCollectionRule"), // Location: to.Ptr("eastus"), // Properties: &armmonitor.DataCollectionRuleResourceProperties{ // DataFlows: []*armmonitor.DataFlow{ // { // Destinations: []*string{ // to.Ptr("centralWorkspace")}, // Streams: []*armmonitor.KnownDataFlowStreams{ // to.Ptr(armmonitor.KnownDataFlowStreamsMicrosoftPerf), // to.Ptr(armmonitor.KnownDataFlowStreamsMicrosoftSyslog), // to.Ptr(armmonitor.KnownDataFlowStreamsMicrosoftWindowsEvent)}, // }}, // DataSources: &armmonitor.DataCollectionRuleDataSources{ // PerformanceCounters: []*armmonitor.PerfCounterDataSource{ // { // Name: to.Ptr("cloudTeamCoreCounters"), // CounterSpecifiers: []*string{ // to.Ptr("\\Processor(_Total)\\% Processor Time"), // to.Ptr("\\Memory\\Committed Bytes"), // to.Ptr("\\LogicalDisk(_Total)\\Free Megabytes"), // to.Ptr("\\PhysicalDisk(_Total)\\Avg. Disk Queue Length")}, // SamplingFrequencyInSeconds: to.Ptr[int32](15), // Streams: []*armmonitor.KnownPerfCounterDataSourceStreams{ // to.Ptr(armmonitor.KnownPerfCounterDataSourceStreamsMicrosoftPerf)}, // }, // { // Name: to.Ptr("appTeamExtraCounters"), // CounterSpecifiers: []*string{ // to.Ptr("\\Process(_Total)\\Thread Count")}, // SamplingFrequencyInSeconds: to.Ptr[int32](30), // Streams: []*armmonitor.KnownPerfCounterDataSourceStreams{ // to.Ptr(armmonitor.KnownPerfCounterDataSourceStreamsMicrosoftPerf)}, // }}, // Syslog: []*armmonitor.SyslogDataSource{ // { // Name: to.Ptr("cronSyslog"), // FacilityNames: []*armmonitor.KnownSyslogDataSourceFacilityNames{ // to.Ptr(armmonitor.KnownSyslogDataSourceFacilityNamesCron)}, // LogLevels: []*armmonitor.KnownSyslogDataSourceLogLevels{ // to.Ptr(armmonitor.KnownSyslogDataSourceLogLevelsDebug), // to.Ptr(armmonitor.KnownSyslogDataSourceLogLevelsCritical), // to.Ptr(armmonitor.KnownSyslogDataSourceLogLevelsEmergency)}, // Streams: []*armmonitor.KnownSyslogDataSourceStreams{ // to.Ptr(armmonitor.KnownSyslogDataSourceStreamsMicrosoftSyslog)}, // }, // { // Name: to.Ptr("syslogBase"), // FacilityNames: []*armmonitor.KnownSyslogDataSourceFacilityNames{ // to.Ptr(armmonitor.KnownSyslogDataSourceFacilityNamesSyslog)}, // LogLevels: []*armmonitor.KnownSyslogDataSourceLogLevels{ // to.Ptr(armmonitor.KnownSyslogDataSourceLogLevelsAlert), // to.Ptr(armmonitor.KnownSyslogDataSourceLogLevelsCritical), // to.Ptr(armmonitor.KnownSyslogDataSourceLogLevelsEmergency)}, // Streams: []*armmonitor.KnownSyslogDataSourceStreams{ // to.Ptr(armmonitor.KnownSyslogDataSourceStreamsMicrosoftSyslog)}, // }}, // WindowsEventLogs: []*armmonitor.WindowsEventLogDataSource{ // { // Name: to.Ptr("cloudSecurityTeamEvents"), // Streams: []*armmonitor.KnownWindowsEventLogDataSourceStreams{ // to.Ptr(armmonitor.KnownWindowsEventLogDataSourceStreamsMicrosoftWindowsEvent)}, // XPathQueries: []*string{ // to.Ptr("Security!")}, // }, // { // Name: to.Ptr("appTeam1AppEvents"), // Streams: []*armmonitor.KnownWindowsEventLogDataSourceStreams{ // to.Ptr(armmonitor.KnownWindowsEventLogDataSourceStreamsMicrosoftWindowsEvent)}, // XPathQueries: []*string{ // to.Ptr("System![System[(Level = 1 or Level = 2 or Level = 3)]]"), // to.Ptr("Application!*[System[(Level = 1 or Level = 2 or Level = 3)]]")}, // }}, // }, // Destinations: &armmonitor.DataCollectionRuleDestinations{ // LogAnalytics: []*armmonitor.LogAnalyticsDestination{ // { // Name: to.Ptr("centralWorkspace"), // WorkspaceID: to.Ptr("9ba8bc53-bd36-4156-8667-e983e7ae0e4f"), // WorkspaceResourceID: to.Ptr("/subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.OperationalInsights/workspaces/centralTeamWorkspace"), // }}, // }, // ImmutableID: to.Ptr("dcr-b74e0d383fc9415abaa584ec41adece3"), // }, // SystemData: &armmonitor.DataCollectionRuleResourceSystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-01T12:34:56.123Z"); return t}()), // CreatedBy: to.Ptr("user1"), // CreatedByType: to.Ptr(armmonitor.CreatedByTypeUser), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-02T12:34:56.123Z"); return t}()), // LastModifiedBy: to.Ptr("user2"), // LastModifiedByType: to.Ptr(armmonitor.CreatedByTypeUser), // }, // Tags: map[string]*string{ // "tag1": to.Ptr("A"), // "tag2": to.Ptr("B"), // }, // }, // { // Name: to.Ptr("herCollectionRule"), // Type: to.Ptr("Microsoft.Insights/dataCollectionRules"), // Etag: to.Ptr("3afa167b-3255-432b-b66d-e74a348468af"), // ID: to.Ptr("/subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/herResourceGroup/providers/Microsoft.Insights/dataCollectionRules/herCollectionRule"), // Location: to.Ptr("westus"), // Properties: &armmonitor.DataCollectionRuleResourceProperties{ // DataFlows: []*armmonitor.DataFlow{ // { // Destinations: []*string{ // to.Ptr("herWorkspace")}, // Streams: []*armmonitor.KnownDataFlowStreams{ // to.Ptr(armmonitor.KnownDataFlowStreamsMicrosoftPerf), // to.Ptr(armmonitor.KnownDataFlowStreamsMicrosoftWindowsEvent)}, // }}, // DataSources: &armmonitor.DataCollectionRuleDataSources{ // PerformanceCounters: []*armmonitor.PerfCounterDataSource{ // { // Name: to.Ptr("herPerfCounters"), // CounterSpecifiers: []*string{ // to.Ptr("\\Processor(_Total)\\% Processor Time"), // to.Ptr("\\LogicalDisk(_Total)\\Free Megabytes"), // to.Ptr("\\PhysicalDisk(_Total)\\Avg. Disk Queue Length")}, // SamplingFrequencyInSeconds: to.Ptr[int32](30), // Streams: []*armmonitor.KnownPerfCounterDataSourceStreams{ // to.Ptr(armmonitor.KnownPerfCounterDataSourceStreamsMicrosoftPerf)}, // }}, // WindowsEventLogs: []*armmonitor.WindowsEventLogDataSource{ // { // Name: to.Ptr("herWindowsEventLogs"), // Streams: []*armmonitor.KnownWindowsEventLogDataSourceStreams{ // to.Ptr(armmonitor.KnownWindowsEventLogDataSourceStreamsMicrosoftWindowsEvent)}, // XPathQueries: []*string{ // to.Ptr("Security!*"), // to.Ptr("System!*[System[(Level = 1 or Level = 2 or Level = 3)]]"), // to.Ptr("Application!*[System[(Level = 1 or Level = 2 or Level = 3)]]")}, // }}, // }, // Destinations: &armmonitor.DataCollectionRuleDestinations{ // LogAnalytics: []*armmonitor.LogAnalyticsDestination{ // { // Name: to.Ptr("herWorkspace"), // WorkspaceID: to.Ptr("c49b982a-c4f7-40c4-bd13-d6588f1b4015"), // WorkspaceResourceID: to.Ptr("/subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/herResourceGroup/providers/Microsoft.OperationalInsights/workspaces/herTeamWorkspace"), // }}, // }, // ImmutableID: to.Ptr("dcr-ca1e6d9dad844b2c94e7961c42af917a"), // ProvisioningState: to.Ptr(armmonitor.KnownDataCollectionRuleProvisioningStateSucceeded), // }, // SystemData: &armmonitor.DataCollectionRuleResourceSystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-01T12:34:56.123Z"); return t}()), // CreatedBy: to.Ptr("user1"), // CreatedByType: to.Ptr(armmonitor.CreatedByTypeUser), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-02T12:34:56.123Z"); return t}()), // LastModifiedBy: to.Ptr("user2"), // LastModifiedByType: to.Ptr(armmonitor.CreatedByTypeUser), // }, // Tags: map[string]*string{ // "tag1": to.Ptr("C"), // }, // }}, // } } }
Output:
func (*DataCollectionRulesClient) Update ¶
func (client *DataCollectionRulesClient) Update(ctx context.Context, resourceGroupName string, dataCollectionRuleName string, options *DataCollectionRulesClientUpdateOptions) (DataCollectionRulesClientUpdateResponse, error)
Update - Updates part of a data collection rule. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2022-06-01
- resourceGroupName - The name of the resource group. The name is case insensitive.
- dataCollectionRuleName - The name of the data collection rule. The name is case insensitive.
- options - DataCollectionRulesClientUpdateOptions contains the optional parameters for the DataCollectionRulesClient.Update method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/examples/DataCollectionRulesUpdate.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewDataCollectionRulesClient().Update(ctx, "myResourceGroup", "myCollectionRule", &armmonitor.DataCollectionRulesClientUpdateOptions{Body: &armmonitor.ResourceForUpdate{ Tags: map[string]*string{ "tag1": to.Ptr("A"), "tag2": to.Ptr("B"), "tag3": to.Ptr("C"), }, }, }) 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.DataCollectionRuleResource = armmonitor.DataCollectionRuleResource{ // Name: to.Ptr("myCollectionRule"), // Type: to.Ptr("Microsoft.Insights/dataCollectionRules"), // Etag: to.Ptr("070057da-0000-0000-0000-5ba70d6c0000"), // ID: to.Ptr("/subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.Insights/dataCollectionRules/myCollectionRule"), // Location: to.Ptr("eastus"), // Properties: &armmonitor.DataCollectionRuleResourceProperties{ // DataFlows: []*armmonitor.DataFlow{ // { // Destinations: []*string{ // to.Ptr("centralWorkspace")}, // Streams: []*armmonitor.KnownDataFlowStreams{ // to.Ptr(armmonitor.KnownDataFlowStreamsMicrosoftPerf), // to.Ptr(armmonitor.KnownDataFlowStreamsMicrosoftSyslog), // to.Ptr(armmonitor.KnownDataFlowStreamsMicrosoftWindowsEvent)}, // }}, // DataSources: &armmonitor.DataCollectionRuleDataSources{ // PerformanceCounters: []*armmonitor.PerfCounterDataSource{ // { // Name: to.Ptr("cloudTeamCoreCounters"), // CounterSpecifiers: []*string{ // to.Ptr("\\Processor(_Total)\\% Processor Time"), // to.Ptr("\\Memory\\Committed Bytes"), // to.Ptr("\\LogicalDisk(_Total)\\Free Megabytes"), // to.Ptr("\\PhysicalDisk(_Total)\\Avg. Disk Queue Length")}, // SamplingFrequencyInSeconds: to.Ptr[int32](15), // Streams: []*armmonitor.KnownPerfCounterDataSourceStreams{ // to.Ptr(armmonitor.KnownPerfCounterDataSourceStreamsMicrosoftPerf)}, // }, // { // Name: to.Ptr("appTeamExtraCounters"), // CounterSpecifiers: []*string{ // to.Ptr("\\Process(_Total)\\Thread Count")}, // SamplingFrequencyInSeconds: to.Ptr[int32](30), // Streams: []*armmonitor.KnownPerfCounterDataSourceStreams{ // to.Ptr(armmonitor.KnownPerfCounterDataSourceStreamsMicrosoftPerf)}, // }}, // Syslog: []*armmonitor.SyslogDataSource{ // { // Name: to.Ptr("cronSyslog"), // FacilityNames: []*armmonitor.KnownSyslogDataSourceFacilityNames{ // to.Ptr(armmonitor.KnownSyslogDataSourceFacilityNamesCron)}, // LogLevels: []*armmonitor.KnownSyslogDataSourceLogLevels{ // to.Ptr(armmonitor.KnownSyslogDataSourceLogLevelsDebug), // to.Ptr(armmonitor.KnownSyslogDataSourceLogLevelsCritical), // to.Ptr(armmonitor.KnownSyslogDataSourceLogLevelsEmergency)}, // Streams: []*armmonitor.KnownSyslogDataSourceStreams{ // to.Ptr(armmonitor.KnownSyslogDataSourceStreamsMicrosoftSyslog)}, // }, // { // Name: to.Ptr("syslogBase"), // FacilityNames: []*armmonitor.KnownSyslogDataSourceFacilityNames{ // to.Ptr(armmonitor.KnownSyslogDataSourceFacilityNamesSyslog)}, // LogLevels: []*armmonitor.KnownSyslogDataSourceLogLevels{ // to.Ptr(armmonitor.KnownSyslogDataSourceLogLevelsAlert), // to.Ptr(armmonitor.KnownSyslogDataSourceLogLevelsCritical), // to.Ptr(armmonitor.KnownSyslogDataSourceLogLevelsEmergency)}, // Streams: []*armmonitor.KnownSyslogDataSourceStreams{ // to.Ptr(armmonitor.KnownSyslogDataSourceStreamsMicrosoftSyslog)}, // }}, // WindowsEventLogs: []*armmonitor.WindowsEventLogDataSource{ // { // Name: to.Ptr("cloudSecurityTeamEvents"), // Streams: []*armmonitor.KnownWindowsEventLogDataSourceStreams{ // to.Ptr(armmonitor.KnownWindowsEventLogDataSourceStreamsMicrosoftWindowsEvent)}, // XPathQueries: []*string{ // to.Ptr("Security!")}, // }, // { // Name: to.Ptr("appTeam1AppEvents"), // Streams: []*armmonitor.KnownWindowsEventLogDataSourceStreams{ // to.Ptr(armmonitor.KnownWindowsEventLogDataSourceStreamsMicrosoftWindowsEvent)}, // XPathQueries: []*string{ // to.Ptr("System![System[(Level = 1 or Level = 2 or Level = 3)]]"), // to.Ptr("Application!*[System[(Level = 1 or Level = 2 or Level = 3)]]")}, // }}, // }, // Destinations: &armmonitor.DataCollectionRuleDestinations{ // LogAnalytics: []*armmonitor.LogAnalyticsDestination{ // { // Name: to.Ptr("centralWorkspace"), // WorkspaceID: to.Ptr("9ba8bc53-bd36-4156-8667-e983e7ae0e4f"), // WorkspaceResourceID: to.Ptr("/subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.OperationalInsights/workspaces/centralTeamWorkspace"), // }}, // }, // ImmutableID: to.Ptr("dcr-b74e0d383fc9415abaa584ec41adece3"), // }, // SystemData: &armmonitor.DataCollectionRuleResourceSystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-01T12:34:56.123Z"); return t}()), // CreatedBy: to.Ptr("user1"), // CreatedByType: to.Ptr(armmonitor.CreatedByTypeUser), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-02T12:34:56.123Z"); return t}()), // LastModifiedBy: to.Ptr("user2"), // LastModifiedByType: to.Ptr(armmonitor.CreatedByTypeUser), // }, // Tags: map[string]*string{ // "tag1": to.Ptr("A"), // "tag2": to.Ptr("B"), // "tag3": to.Ptr("C"), // }, // } }
Output:
type DataCollectionRulesClientCreateOptions ¶ added in v0.4.0
type DataCollectionRulesClientCreateOptions struct { // The payload Body *DataCollectionRuleResource }
DataCollectionRulesClientCreateOptions contains the optional parameters for the DataCollectionRulesClient.Create method.
type DataCollectionRulesClientCreateResponse ¶ added in v0.4.0
type DataCollectionRulesClientCreateResponse struct { // Definition of ARM tracked top level resource. DataCollectionRuleResource }
DataCollectionRulesClientCreateResponse contains the response from method DataCollectionRulesClient.Create.
type DataCollectionRulesClientDeleteOptions ¶ added in v0.4.0
type DataCollectionRulesClientDeleteOptions struct { }
DataCollectionRulesClientDeleteOptions contains the optional parameters for the DataCollectionRulesClient.Delete method.
type DataCollectionRulesClientDeleteResponse ¶ added in v0.4.0
type DataCollectionRulesClientDeleteResponse struct { }
DataCollectionRulesClientDeleteResponse contains the response from method DataCollectionRulesClient.Delete.
type DataCollectionRulesClientGetOptions ¶ added in v0.4.0
type DataCollectionRulesClientGetOptions struct { }
DataCollectionRulesClientGetOptions contains the optional parameters for the DataCollectionRulesClient.Get method.
type DataCollectionRulesClientGetResponse ¶ added in v0.4.0
type DataCollectionRulesClientGetResponse struct { // Definition of ARM tracked top level resource. DataCollectionRuleResource }
DataCollectionRulesClientGetResponse contains the response from method DataCollectionRulesClient.Get.
type DataCollectionRulesClientListByResourceGroupOptions ¶ added in v0.4.0
type DataCollectionRulesClientListByResourceGroupOptions struct { }
DataCollectionRulesClientListByResourceGroupOptions contains the optional parameters for the DataCollectionRulesClient.NewListByResourceGroupPager method.
type DataCollectionRulesClientListByResourceGroupResponse ¶ added in v0.4.0
type DataCollectionRulesClientListByResourceGroupResponse struct { // A pageable list of resources. DataCollectionRuleResourceListResult }
DataCollectionRulesClientListByResourceGroupResponse contains the response from method DataCollectionRulesClient.NewListByResourceGroupPager.
type DataCollectionRulesClientListBySubscriptionOptions ¶ added in v0.4.0
type DataCollectionRulesClientListBySubscriptionOptions struct { }
DataCollectionRulesClientListBySubscriptionOptions contains the optional parameters for the DataCollectionRulesClient.NewListBySubscriptionPager method.
type DataCollectionRulesClientListBySubscriptionResponse ¶ added in v0.4.0
type DataCollectionRulesClientListBySubscriptionResponse struct { // A pageable list of resources. DataCollectionRuleResourceListResult }
DataCollectionRulesClientListBySubscriptionResponse contains the response from method DataCollectionRulesClient.NewListBySubscriptionPager.
type DataCollectionRulesClientUpdateOptions ¶ added in v0.4.0
type DataCollectionRulesClientUpdateOptions struct { // The payload Body *ResourceForUpdate }
DataCollectionRulesClientUpdateOptions contains the optional parameters for the DataCollectionRulesClient.Update method.
type DataCollectionRulesClientUpdateResponse ¶ added in v0.4.0
type DataCollectionRulesClientUpdateResponse struct { // Definition of ARM tracked top level resource. DataCollectionRuleResource }
DataCollectionRulesClientUpdateResponse contains the response from method DataCollectionRulesClient.Update.
type DataContainer ¶
type DataContainer struct { // REQUIRED; Log Analytics workspace information. Workspace *WorkspaceInfo }
DataContainer - Information about a container with data for a given resource.
func (DataContainer) MarshalJSON ¶ added in v0.8.0
func (d DataContainer) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DataContainer.
func (*DataContainer) UnmarshalJSON ¶ added in v0.8.0
func (d *DataContainer) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DataContainer.
type DataFlow ¶
type DataFlow struct { // The builtIn transform to transform stream data BuiltInTransform *string // List of destinations for this data flow. Destinations []*string // The output stream of the transform. Only required if the transform changes data to a different stream. OutputStream *string // List of streams for this data flow. Streams []*KnownDataFlowStreams // The KQL query to transform stream data. TransformKql *string }
DataFlow - Definition of which streams are sent to which destinations.
func (DataFlow) MarshalJSON ¶
MarshalJSON implements the json.Marshaller interface for type DataFlow.
func (*DataFlow) UnmarshalJSON ¶ added in v0.8.0
UnmarshalJSON implements the json.Unmarshaller interface for type DataFlow.
type DataImportSources ¶ added in v0.9.0
type DataImportSources struct { // Definition of Event Hub configuration. EventHub *DataImportSourcesEventHub }
func (DataImportSources) MarshalJSON ¶ added in v0.9.0
func (d DataImportSources) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DataImportSources.
func (*DataImportSources) UnmarshalJSON ¶ added in v0.9.0
func (d *DataImportSources) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DataImportSources.
type DataImportSourcesEventHub ¶ added in v0.9.0
type DataImportSourcesEventHub struct { // Event Hub consumer group name ConsumerGroup *string // A friendly name for the data source. This name should be unique across all data sources (regardless of type) within the // data collection rule. Name *string // The stream to collect from EventHub Stream *string }
DataImportSourcesEventHub - Definition of Event Hub configuration.
func (DataImportSourcesEventHub) MarshalJSON ¶ added in v0.9.0
func (d DataImportSourcesEventHub) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DataImportSourcesEventHub.
func (*DataImportSourcesEventHub) UnmarshalJSON ¶ added in v0.9.0
func (d *DataImportSourcesEventHub) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DataImportSourcesEventHub.
type DataSourcesSpec ¶
type DataSourcesSpec struct { // Specifications of pull based data sources DataImports *DataSourcesSpecDataImports // The list of Azure VM extension data source configurations. Extensions []*ExtensionDataSource // The list of IIS logs source configurations. IisLogs []*IisLogsDataSource // The list of Log files source configurations. LogFiles []*LogFilesDataSource // The list of performance counter data source configurations. PerformanceCounters []*PerfCounterDataSource // The list of platform telemetry configurations PlatformTelemetry []*PlatformTelemetryDataSource // The list of Prometheus forwarder data source configurations. PrometheusForwarder []*PrometheusForwarderDataSource // The list of Syslog data source configurations. Syslog []*SyslogDataSource // The list of Windows Event Log data source configurations. WindowsEventLogs []*WindowsEventLogDataSource // The list of Windows Firewall logs source configurations. WindowsFirewallLogs []*WindowsFirewallLogsDataSource }
DataSourcesSpec - Specification of data sources that will be collected.
func (DataSourcesSpec) MarshalJSON ¶
func (d DataSourcesSpec) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DataSourcesSpec.
func (*DataSourcesSpec) UnmarshalJSON ¶ added in v0.8.0
func (d *DataSourcesSpec) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DataSourcesSpec.
type DataSourcesSpecDataImports ¶ added in v0.9.0
type DataSourcesSpecDataImports struct { // Definition of Event Hub configuration. EventHub *DataImportSourcesEventHub }
DataSourcesSpecDataImports - Specifications of pull based data sources
func (DataSourcesSpecDataImports) MarshalJSON ¶ added in v0.9.0
func (d DataSourcesSpecDataImports) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DataSourcesSpecDataImports.
func (*DataSourcesSpecDataImports) UnmarshalJSON ¶ added in v0.9.0
func (d *DataSourcesSpecDataImports) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DataSourcesSpecDataImports.
type DataStatus ¶
type DataStatus string
DataStatus - The status of VM Insights data from the resource. When reported as present the data array will contain information about the data containers to which data for the specified resource is being routed.
const ( DataStatusNotPresent DataStatus = "notPresent" DataStatusPresent DataStatus = "present" )
func PossibleDataStatusValues ¶
func PossibleDataStatusValues() []DataStatus
PossibleDataStatusValues returns the possible values for the DataStatus const type.
type DefaultErrorResponse ¶ added in v0.8.0
type DefaultErrorResponse struct { // The error object. Error *ErrorDetail }
DefaultErrorResponse - Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.).
func (DefaultErrorResponse) MarshalJSON ¶ added in v0.8.0
func (d DefaultErrorResponse) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DefaultErrorResponse.
func (*DefaultErrorResponse) UnmarshalJSON ¶ added in v0.8.0
func (d *DefaultErrorResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DefaultErrorResponse.
type DestinationsSpec ¶
type DestinationsSpec struct { // Azure Monitor Metrics destination. AzureMonitorMetrics *DestinationsSpecAzureMonitorMetrics // List of Event Hubs destinations. EventHubs []*EventHubDestination // List of Event Hubs Direct destinations. EventHubsDirect []*EventHubDirectDestination // List of Log Analytics destinations. LogAnalytics []*LogAnalyticsDestination // List of monitoring account destinations. MonitoringAccounts []*MonitoringAccountDestination // List of storage accounts destinations. StorageAccounts []*StorageBlobDestination // List of Storage Blob Direct destinations. To be used only for sending data directly to store from the agent. StorageBlobsDirect []*StorageBlobDestination // List of Storage Table Direct destinations. StorageTablesDirect []*StorageTableDestination }
DestinationsSpec - Specification of destinations that can be used in data flows.
func (DestinationsSpec) MarshalJSON ¶
func (d DestinationsSpec) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DestinationsSpec.
func (*DestinationsSpec) UnmarshalJSON ¶ added in v0.8.0
func (d *DestinationsSpec) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DestinationsSpec.
type DestinationsSpecAzureMonitorMetrics ¶
type DestinationsSpecAzureMonitorMetrics struct { // A friendly name for the destination. This name should be unique across all destinations (regardless of type) within the // data collection rule. Name *string }
DestinationsSpecAzureMonitorMetrics - Azure Monitor Metrics destination.
func (DestinationsSpecAzureMonitorMetrics) MarshalJSON ¶ added in v0.8.0
func (d DestinationsSpecAzureMonitorMetrics) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DestinationsSpecAzureMonitorMetrics.
func (*DestinationsSpecAzureMonitorMetrics) UnmarshalJSON ¶ added in v0.8.0
func (d *DestinationsSpecAzureMonitorMetrics) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DestinationsSpecAzureMonitorMetrics.
type DiagnosticSettings ¶
type DiagnosticSettings struct { // The resource Id for the event hub authorization rule. EventHubAuthorizationRuleID *string // The name of the event hub. If none is specified, the default event hub will be selected. EventHubName *string // A string indicating whether the export to Log Analytics should use the default destination type, i.e. AzureDiagnostics, // or use a destination type constructed as follows: _. Possible values are: // Dedicated and null (null is default.) LogAnalyticsDestinationType *string // The list of logs settings. Logs []*LogSettings // The full ARM resource ID of the Marketplace resource to which you would like to send Diagnostic Logs. MarketplacePartnerID *string // The list of metric settings. Metrics []*MetricSettings // The service bus rule Id of the diagnostic setting. This is here to maintain backwards compatibility. ServiceBusRuleID *string // The resource ID of the storage account to which you would like to send Diagnostic Logs. StorageAccountID *string // The full ARM resource ID of the Log Analytics workspace to which you would like to send Diagnostic Logs. Example: // /subscriptions/4b9e8510-67ab-4e9a-95a9-e2f1e570ea9c/resourceGroups/insights-integration/providers/Microsoft.OperationalInsights/workspaces/viruela2 WorkspaceID *string }
DiagnosticSettings - The diagnostic settings.
func (DiagnosticSettings) MarshalJSON ¶
func (d DiagnosticSettings) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DiagnosticSettings.
func (*DiagnosticSettings) UnmarshalJSON ¶ added in v0.8.0
func (d *DiagnosticSettings) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DiagnosticSettings.
type DiagnosticSettingsCategory ¶
type DiagnosticSettingsCategory struct { // the collection of what category groups are supported. CategoryGroups []*string // The type of the diagnostic settings category. CategoryType *CategoryType }
DiagnosticSettingsCategory - The diagnostic settings Category.
func (DiagnosticSettingsCategory) MarshalJSON ¶ added in v0.8.0
func (d DiagnosticSettingsCategory) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DiagnosticSettingsCategory.
func (*DiagnosticSettingsCategory) UnmarshalJSON ¶ added in v0.8.0
func (d *DiagnosticSettingsCategory) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DiagnosticSettingsCategory.
type DiagnosticSettingsCategoryClient ¶
type DiagnosticSettingsCategoryClient struct {
// contains filtered or unexported fields
}
DiagnosticSettingsCategoryClient contains the methods for the DiagnosticSettingsCategory group. Don't use this type directly, use NewDiagnosticSettingsCategoryClient() instead.
func NewDiagnosticSettingsCategoryClient ¶
func NewDiagnosticSettingsCategoryClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*DiagnosticSettingsCategoryClient, error)
NewDiagnosticSettingsCategoryClient creates a new instance of DiagnosticSettingsCategoryClient with the specified values.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - pass nil to accept the default values.
func (*DiagnosticSettingsCategoryClient) Get ¶
func (client *DiagnosticSettingsCategoryClient) Get(ctx context.Context, resourceURI string, name string, options *DiagnosticSettingsCategoryClientGetOptions) (DiagnosticSettingsCategoryClientGetResponse, error)
Get - Gets the diagnostic settings category for the specified resource. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2021-05-01-preview
- resourceURI - The identifier of the resource.
- name - The name of the diagnostic setting.
- options - DiagnosticSettingsCategoryClientGetOptions contains the optional parameters for the DiagnosticSettingsCategoryClient.Get method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/getDiagnosticSettingsCategory.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewDiagnosticSettingsCategoryClient().Get(ctx, "subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourcegroups/viruela1/providers/microsoft.logic/workflows/viruela6", "WorkflowRuntime", 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.DiagnosticSettingsCategoryResource = armmonitor.DiagnosticSettingsCategoryResource{ // Name: to.Ptr("WorkflowRuntime"), // Type: to.Ptr("microsoft.insights/diagnosticSettingsCategories"), // ID: to.Ptr("/subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourcegroups/viruela1/providers/microsoft.logic/workflows/viruela6/providers/microsoft.insights/diagnosticSettingsCategories/WorkflowRuntime"), // Properties: &armmonitor.DiagnosticSettingsCategory{ // CategoryGroups: []*string{ // to.Ptr("allLogs")}, // CategoryType: to.Ptr(armmonitor.CategoryTypeLogs), // }, // } }
Output:
func (*DiagnosticSettingsCategoryClient) NewListPager ¶ added in v0.8.0
func (client *DiagnosticSettingsCategoryClient) NewListPager(resourceURI string, options *DiagnosticSettingsCategoryClientListOptions) *runtime.Pager[DiagnosticSettingsCategoryClientListResponse]
NewListPager - Lists the diagnostic settings categories for the specified resource.
Generated from API version 2021-05-01-preview
- resourceURI - The identifier of the resource.
- options - DiagnosticSettingsCategoryClientListOptions contains the optional parameters for the DiagnosticSettingsCategoryClient.NewListPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/listDiagnosticSettingsCategories.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewDiagnosticSettingsCategoryClient().NewListPager("subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourcegroups/viruela1/providers/microsoft.logic/workflows/viruela6", 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.DiagnosticSettingsCategoryResourceCollection = armmonitor.DiagnosticSettingsCategoryResourceCollection{ // Value: []*armmonitor.DiagnosticSettingsCategoryResource{ // { // Name: to.Ptr("WorkflowRuntime"), // Type: to.Ptr("microsoft.insights/diagnosticSettingsCategories"), // ID: to.Ptr("/subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourcegroups/viruela1/providers/microsoft.logic/workflows/viruela6/providers/microsoft.insights/diagnosticSettingsCategories/WorkflowRuntime"), // Properties: &armmonitor.DiagnosticSettingsCategory{ // CategoryGroups: []*string{ // to.Ptr("allLogs")}, // CategoryType: to.Ptr(armmonitor.CategoryTypeLogs), // }, // }, // { // Name: to.Ptr("WorkflowMetric"), // Type: to.Ptr("microsoft.insights/diagnosticSettingsCategories"), // ID: to.Ptr("/subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourcegroups/viruela1/providers/microsoft.logic/workflows/viruela6/providers/microsoft.insights/diagnosticSettingsCategories/WorkflowMetric"), // Properties: &armmonitor.DiagnosticSettingsCategory{ // CategoryType: to.Ptr(armmonitor.CategoryTypeMetrics), // }, // }}, // } } }
Output:
type DiagnosticSettingsCategoryClientGetOptions ¶ added in v0.4.0
type DiagnosticSettingsCategoryClientGetOptions struct { }
DiagnosticSettingsCategoryClientGetOptions contains the optional parameters for the DiagnosticSettingsCategoryClient.Get method.
type DiagnosticSettingsCategoryClientGetResponse ¶ added in v0.4.0
type DiagnosticSettingsCategoryClientGetResponse struct { // The diagnostic settings category resource. DiagnosticSettingsCategoryResource }
DiagnosticSettingsCategoryClientGetResponse contains the response from method DiagnosticSettingsCategoryClient.Get.
type DiagnosticSettingsCategoryClientListOptions ¶ added in v0.4.0
type DiagnosticSettingsCategoryClientListOptions struct { }
DiagnosticSettingsCategoryClientListOptions contains the optional parameters for the DiagnosticSettingsCategoryClient.NewListPager method.
type DiagnosticSettingsCategoryClientListResponse ¶ added in v0.4.0
type DiagnosticSettingsCategoryClientListResponse struct { // Represents a collection of diagnostic setting category resources. DiagnosticSettingsCategoryResourceCollection }
DiagnosticSettingsCategoryClientListResponse contains the response from method DiagnosticSettingsCategoryClient.NewListPager.
type DiagnosticSettingsCategoryResource ¶
type DiagnosticSettingsCategoryResource struct { // 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; The properties of a Diagnostic Settings Category. Properties *DiagnosticSettingsCategory // READ-ONLY; The system metadata related to this resource. SystemData *SystemData // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string }
DiagnosticSettingsCategoryResource - The diagnostic settings category resource.
func (DiagnosticSettingsCategoryResource) MarshalJSON ¶ added in v0.8.0
func (d DiagnosticSettingsCategoryResource) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DiagnosticSettingsCategoryResource.
func (*DiagnosticSettingsCategoryResource) UnmarshalJSON ¶ added in v0.8.0
func (d *DiagnosticSettingsCategoryResource) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DiagnosticSettingsCategoryResource.
type DiagnosticSettingsCategoryResourceCollection ¶
type DiagnosticSettingsCategoryResourceCollection struct { // The collection of diagnostic settings category resources. Value []*DiagnosticSettingsCategoryResource }
DiagnosticSettingsCategoryResourceCollection - Represents a collection of diagnostic setting category resources.
func (DiagnosticSettingsCategoryResourceCollection) MarshalJSON ¶
func (d DiagnosticSettingsCategoryResourceCollection) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DiagnosticSettingsCategoryResourceCollection.
func (*DiagnosticSettingsCategoryResourceCollection) UnmarshalJSON ¶ added in v0.8.0
func (d *DiagnosticSettingsCategoryResourceCollection) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DiagnosticSettingsCategoryResourceCollection.
type DiagnosticSettingsClient ¶
type DiagnosticSettingsClient struct {
// contains filtered or unexported fields
}
DiagnosticSettingsClient contains the methods for the DiagnosticSettings group. Don't use this type directly, use NewDiagnosticSettingsClient() instead.
func NewDiagnosticSettingsClient ¶
func NewDiagnosticSettingsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*DiagnosticSettingsClient, error)
NewDiagnosticSettingsClient creates a new instance of DiagnosticSettingsClient with the specified values.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - pass nil to accept the default values.
func (*DiagnosticSettingsClient) CreateOrUpdate ¶
func (client *DiagnosticSettingsClient) CreateOrUpdate(ctx context.Context, resourceURI string, name string, parameters DiagnosticSettingsResource, options *DiagnosticSettingsClientCreateOrUpdateOptions) (DiagnosticSettingsClientCreateOrUpdateResponse, error)
CreateOrUpdate - Creates or updates diagnostic settings for the specified resource. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2021-05-01-preview
- resourceURI - The identifier of the resource.
- name - The name of the diagnostic setting.
- parameters - Parameters supplied to the operation.
- options - DiagnosticSettingsClientCreateOrUpdateOptions contains the optional parameters for the DiagnosticSettingsClient.CreateOrUpdate method.
Example (CreatesOrUpdatesTheDiagnosticSetting) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/createOrUpdateDiagnosticSetting.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewDiagnosticSettingsClient().CreateOrUpdate(ctx, "subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourcegroups/viruela1/providers/microsoft.logic/workflows/viruela6", "mysetting", armmonitor.DiagnosticSettingsResource{ Properties: &armmonitor.DiagnosticSettings{ EventHubAuthorizationRuleID: to.Ptr("/subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourceGroups/montest/providers/microsoft.eventhub/namespaces/mynamespace/authorizationrules/myrule"), EventHubName: to.Ptr("myeventhub"), LogAnalyticsDestinationType: to.Ptr("Dedicated"), Logs: []*armmonitor.LogSettings{ { CategoryGroup: to.Ptr("allLogs"), Enabled: to.Ptr(true), RetentionPolicy: &armmonitor.RetentionPolicy{ Days: to.Ptr[int32](0), Enabled: to.Ptr(false), }, }}, MarketplacePartnerID: to.Ptr("/subscriptions/abcdeabc-1234-1234-ab12-123a1234567a/resourceGroups/test-rg/providers/Microsoft.Datadog/monitors/dd1"), Metrics: []*armmonitor.MetricSettings{ { Category: to.Ptr("WorkflowMetrics"), Enabled: to.Ptr(true), RetentionPolicy: &armmonitor.RetentionPolicy{ Days: to.Ptr[int32](0), Enabled: to.Ptr(false), }, }}, StorageAccountID: to.Ptr("/subscriptions/df602c9c-7aa0-407d-a6fb-eb20c8bd1192/resourceGroups/apptest/providers/Microsoft.Storage/storageAccounts/appteststorage1"), WorkspaceID: to.Ptr(""), }, }, 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.DiagnosticSettingsResource = armmonitor.DiagnosticSettingsResource{ // Name: to.Ptr("mysetting"), // Type: to.Ptr("Microsoft.Insights/diagnosticSettings"), // ID: to.Ptr("/subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourcegroups/viruela1/providers/microsoft.logic/workflows/viruela6/providers/microsoft.insights/diagnosticSettings/mysetting"), // Properties: &armmonitor.DiagnosticSettings{ // EventHubAuthorizationRuleID: to.Ptr("/subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourceGroups/montest/providers/microsoft.eventhub/namespaces/mynamespace/authorizationrules/myrule"), // EventHubName: to.Ptr("myeventhub"), // LogAnalyticsDestinationType: to.Ptr("Dedicated"), // Logs: []*armmonitor.LogSettings{ // { // CategoryGroup: to.Ptr("allLogs"), // Enabled: to.Ptr(true), // RetentionPolicy: &armmonitor.RetentionPolicy{ // Days: to.Ptr[int32](0), // Enabled: to.Ptr(false), // }, // }}, // MarketplacePartnerID: to.Ptr("/subscriptions/abcdeabc-1234-1234-ab12-123a1234567a/resourceGroups/test-rg/providers/Microsoft.Datadog/monitors/dd1"), // Metrics: []*armmonitor.MetricSettings{ // { // Category: to.Ptr("WorkflowMetrics"), // Enabled: to.Ptr(true), // RetentionPolicy: &armmonitor.RetentionPolicy{ // Days: to.Ptr[int32](0), // Enabled: to.Ptr(false), // }, // }}, // StorageAccountID: to.Ptr("/subscriptions/df602c9c-7aa0-407d-a6fb-eb20c8bd1192/resourceGroups/apptest/providers/Microsoft.Storage/storageAccounts/appteststorage1"), // WorkspaceID: to.Ptr(""), // }, // } }
Output:
Example (CreatesOrUpdatesTheDiagnosticSettingForCategory) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/createOrUpdateDiagnosticSettingCategory.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewDiagnosticSettingsClient().CreateOrUpdate(ctx, "subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourcegroups/viruela1/providers/microsoft.logic/workflows/viruela6", "mysetting", armmonitor.DiagnosticSettingsResource{ Properties: &armmonitor.DiagnosticSettings{ EventHubAuthorizationRuleID: to.Ptr("/subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourceGroups/montest/providers/microsoft.eventhub/namespaces/mynamespace/authorizationrules/myrule"), EventHubName: to.Ptr("myeventhub"), LogAnalyticsDestinationType: to.Ptr("Dedicated"), Logs: []*armmonitor.LogSettings{ { Category: to.Ptr("WorkflowRuntime"), Enabled: to.Ptr(true), RetentionPolicy: &armmonitor.RetentionPolicy{ Days: to.Ptr[int32](0), Enabled: to.Ptr(false), }, }}, MarketplacePartnerID: to.Ptr("/subscriptions/abcdeabc-1234-1234-ab12-123a1234567a/resourceGroups/test-rg/providers/Microsoft.Datadog/monitors/dd1"), Metrics: []*armmonitor.MetricSettings{ { Category: to.Ptr("WorkflowMetrics"), Enabled: to.Ptr(true), RetentionPolicy: &armmonitor.RetentionPolicy{ Days: to.Ptr[int32](0), Enabled: to.Ptr(false), }, }}, StorageAccountID: to.Ptr("/subscriptions/df602c9c-7aa0-407d-a6fb-eb20c8bd1192/resourceGroups/apptest/providers/Microsoft.Storage/storageAccounts/appteststorage1"), WorkspaceID: to.Ptr(""), }, }, 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.DiagnosticSettingsResource = armmonitor.DiagnosticSettingsResource{ // Name: to.Ptr("mysetting"), // Type: to.Ptr(""), // ID: to.Ptr("/subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourcegroups/viruela1/providers/microsoft.logic/workflows/viruela6/diagnosticSettings/mysetting"), // Properties: &armmonitor.DiagnosticSettings{ // EventHubAuthorizationRuleID: to.Ptr("/subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourceGroups/montest/providers/microsoft.eventhub/namespaces/mynamespace/authorizationrules/myrule"), // EventHubName: to.Ptr("myeventhub"), // LogAnalyticsDestinationType: to.Ptr("Dedicated"), // Logs: []*armmonitor.LogSettings{ // { // Category: to.Ptr("WorkflowRuntime"), // Enabled: to.Ptr(true), // RetentionPolicy: &armmonitor.RetentionPolicy{ // Days: to.Ptr[int32](0), // Enabled: to.Ptr(false), // }, // }}, // MarketplacePartnerID: to.Ptr("/subscriptions/abcdeabc-1234-1234-ab12-123a1234567a/resourceGroups/test-rg/providers/Microsoft.Datadog/monitors/dd1"), // Metrics: []*armmonitor.MetricSettings{ // { // Category: to.Ptr("WorkflowMetrics"), // Enabled: to.Ptr(true), // RetentionPolicy: &armmonitor.RetentionPolicy{ // Days: to.Ptr[int32](0), // Enabled: to.Ptr(false), // }, // }}, // StorageAccountID: to.Ptr("/subscriptions/df602c9c-7aa0-407d-a6fb-eb20c8bd1192/resourceGroups/apptest/providers/Microsoft.Storage/storageAccounts/appteststorage1"), // WorkspaceID: to.Ptr(""), // }, // } }
Output:
func (*DiagnosticSettingsClient) Delete ¶
func (client *DiagnosticSettingsClient) Delete(ctx context.Context, resourceURI string, name string, options *DiagnosticSettingsClientDeleteOptions) (DiagnosticSettingsClientDeleteResponse, error)
Delete - Deletes existing diagnostic settings for the specified resource. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2021-05-01-preview
- resourceURI - The identifier of the resource.
- name - The name of the diagnostic setting.
- options - DiagnosticSettingsClientDeleteOptions contains the optional parameters for the DiagnosticSettingsClient.Delete method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/deleteDiagnosticSetting.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } _, err = clientFactory.NewDiagnosticSettingsClient().Delete(ctx, "subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourcegroups/viruela1/providers/microsoft.logic/workflows/viruela6", "mysetting", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } }
Output:
func (*DiagnosticSettingsClient) Get ¶
func (client *DiagnosticSettingsClient) Get(ctx context.Context, resourceURI string, name string, options *DiagnosticSettingsClientGetOptions) (DiagnosticSettingsClientGetResponse, error)
Get - Gets the active diagnostic settings for the specified resource. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2021-05-01-preview
- resourceURI - The identifier of the resource.
- name - The name of the diagnostic setting.
- options - DiagnosticSettingsClientGetOptions contains the optional parameters for the DiagnosticSettingsClient.Get method.
Example (GetsTheDiagnosticSetting) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/getDiagnosticSetting.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewDiagnosticSettingsClient().Get(ctx, "subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourcegroups/viruela1/providers/microsoft.logic/workflows/viruela6", "mysetting", 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.DiagnosticSettingsResource = armmonitor.DiagnosticSettingsResource{ // Name: to.Ptr("mysetting"), // Type: to.Ptr("Microsoft.Insights/diagnosticSettings"), // ID: to.Ptr("/subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourcegroups/viruela1/providers/microsoft.logic/workflows/viruela6/providers/microsoft.insights/diagnosticSettings/mysetting"), // Properties: &armmonitor.DiagnosticSettings{ // EventHubAuthorizationRuleID: to.Ptr("/subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourceGroups/montest/providers/microsoft.eventhub/namespaces/mynamespace/authorizationrules/myrule"), // Logs: []*armmonitor.LogSettings{ // { // CategoryGroup: to.Ptr("allLogs"), // Enabled: to.Ptr(true), // RetentionPolicy: &armmonitor.RetentionPolicy{ // Days: to.Ptr[int32](0), // Enabled: to.Ptr(false), // }, // }}, // MarketplacePartnerID: to.Ptr("/subscriptions/abcdeabc-1234-1234-ab12-123a1234567a/resourceGroups/test-rg/providers/Microsoft.Datadog/monitors/dd1"), // Metrics: []*armmonitor.MetricSettings{ // { // Category: to.Ptr("WorkflowMetrics"), // Enabled: to.Ptr(true), // RetentionPolicy: &armmonitor.RetentionPolicy{ // Days: to.Ptr[int32](0), // Enabled: to.Ptr(false), // }, // }}, // StorageAccountID: to.Ptr("/subscriptions/df602c9c-7aa0-407d-a6fb-eb20c8bd1192/resourceGroups/apptest/providers/Microsoft.Storage/storageAccounts/appteststorage1"), // WorkspaceID: to.Ptr(""), // }, // } }
Output:
Example (GetsTheDiagnosticSettingForCategory) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/getDiagnosticSettingCategory.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewDiagnosticSettingsClient().Get(ctx, "subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourcegroups/viruela1/providers/microsoft.logic/workflows/viruela6", "mysetting", 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.DiagnosticSettingsResource = armmonitor.DiagnosticSettingsResource{ // Name: to.Ptr("mysetting"), // Type: to.Ptr(""), // ID: to.Ptr("/subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourcegroups/viruela1/providers/microsoft.logic/workflows/viruela6/diagnosticSettings/service"), // Properties: &armmonitor.DiagnosticSettings{ // EventHubAuthorizationRuleID: to.Ptr("/subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourceGroups/montest/providers/microsoft.eventhub/namespaces/mynamespace/authorizationrules/myrule"), // Logs: []*armmonitor.LogSettings{ // { // Category: to.Ptr("WorkflowRuntime"), // Enabled: to.Ptr(true), // RetentionPolicy: &armmonitor.RetentionPolicy{ // Days: to.Ptr[int32](0), // Enabled: to.Ptr(false), // }, // }}, // MarketplacePartnerID: to.Ptr("/subscriptions/abcdeabc-1234-1234-ab12-123a1234567a/resourceGroups/test-rg/providers/Microsoft.Datadog/monitors/dd1"), // Metrics: []*armmonitor.MetricSettings{ // { // Category: to.Ptr("WorkflowMetrics"), // Enabled: to.Ptr(true), // RetentionPolicy: &armmonitor.RetentionPolicy{ // Days: to.Ptr[int32](0), // Enabled: to.Ptr(false), // }, // }}, // StorageAccountID: to.Ptr("/subscriptions/df602c9c-7aa0-407d-a6fb-eb20c8bd1192/resourceGroups/apptest/providers/Microsoft.Storage/storageAccounts/appteststorage1"), // WorkspaceID: to.Ptr(""), // }, // } }
Output:
func (*DiagnosticSettingsClient) NewListPager ¶ added in v0.8.0
func (client *DiagnosticSettingsClient) NewListPager(resourceURI string, options *DiagnosticSettingsClientListOptions) *runtime.Pager[DiagnosticSettingsClientListResponse]
NewListPager - Gets the active diagnostic settings list for the specified resource.
Generated from API version 2021-05-01-preview
- resourceURI - The identifier of the resource.
- options - DiagnosticSettingsClientListOptions contains the optional parameters for the DiagnosticSettingsClient.NewListPager method.
Example (GetsTheDiagnosticSetting) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/listDiagnosticSettings.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewDiagnosticSettingsClient().NewListPager("subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourcegroups/viruela1/providers/microsoft.logic/workflows/viruela6", 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.DiagnosticSettingsResourceCollection = armmonitor.DiagnosticSettingsResourceCollection{ // Value: []*armmonitor.DiagnosticSettingsResource{ // { // Name: to.Ptr("mysetting"), // Type: to.Ptr("Microsoft.Insights/diagnosticSettings"), // ID: to.Ptr("/subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourcegroups/viruela1/providers/microsoft.logic/workflows/viruela6/providers/microsoft.insights/diagnosticSettings/mysetting"), // Properties: &armmonitor.DiagnosticSettings{ // EventHubAuthorizationRuleID: to.Ptr("/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/andy1101/providers/Microsoft.EventHub/namespaces/andy1101/authorizationrules/RootManageSharedAccessKey"), // Logs: []*armmonitor.LogSettings{ // { // CategoryGroup: to.Ptr("allLogs"), // Enabled: to.Ptr(true), // RetentionPolicy: &armmonitor.RetentionPolicy{ // Days: to.Ptr[int32](0), // Enabled: to.Ptr(false), // }, // }}, // MarketplacePartnerID: to.Ptr("/subscriptions/abcdeabc-1234-1234-ab12-123a1234567a/resourceGroups/test-rg/providers/Microsoft.Datadog/monitors/dd1"), // Metrics: []*armmonitor.MetricSettings{ // { // Category: to.Ptr("WorkflowMetrics"), // Enabled: to.Ptr(true), // RetentionPolicy: &armmonitor.RetentionPolicy{ // Days: to.Ptr[int32](0), // Enabled: to.Ptr(false), // }, // }}, // StorageAccountID: to.Ptr("/subscriptions/df602c9c-7aa0-407d-a6fb-eb20c8bd1192/resourceGroups/apptest/providers/Microsoft.Storage/storageAccounts/appteststorage1"), // WorkspaceID: to.Ptr(""), // }, // }}, // } } }
Output:
Example (GetsTheDiagnosticSettingForCategory) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/listDiagnosticSettingsCategory.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewDiagnosticSettingsClient().NewListPager("subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourcegroups/viruela1/providers/microsoft.logic/workflows/viruela6", 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.DiagnosticSettingsResourceCollection = armmonitor.DiagnosticSettingsResourceCollection{ // Value: []*armmonitor.DiagnosticSettingsResource{ // { // Name: to.Ptr("mysetting"), // Type: to.Ptr("microsoft.logic/workflows"), // ID: to.Ptr("/subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourcegroups/viruela1/providers/microsoft.logic/workflows/viruela6/diagnosticSettings/mysetting"), // Properties: &armmonitor.DiagnosticSettings{ // EventHubAuthorizationRuleID: to.Ptr("/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/andy1101/providers/Microsoft.EventHub/namespaces/andy1101/authorizationrules/RootManageSharedAccessKey"), // Logs: []*armmonitor.LogSettings{ // { // Category: to.Ptr("WorkflowRuntime"), // Enabled: to.Ptr(true), // RetentionPolicy: &armmonitor.RetentionPolicy{ // Days: to.Ptr[int32](0), // Enabled: to.Ptr(false), // }, // }}, // MarketplacePartnerID: to.Ptr("/subscriptions/abcdeabc-1234-1234-ab12-123a1234567a/resourceGroups/test-rg/providers/Microsoft.Datadog/monitors/dd1"), // Metrics: []*armmonitor.MetricSettings{ // { // Category: to.Ptr("WorkflowMetrics"), // Enabled: to.Ptr(true), // RetentionPolicy: &armmonitor.RetentionPolicy{ // Days: to.Ptr[int32](0), // Enabled: to.Ptr(false), // }, // }}, // StorageAccountID: to.Ptr("/subscriptions/df602c9c-7aa0-407d-a6fb-eb20c8bd1192/resourceGroups/apptest/providers/Microsoft.Storage/storageAccounts/appteststorage1"), // WorkspaceID: to.Ptr(""), // }, // }}, // } } }
Output:
type DiagnosticSettingsClientCreateOrUpdateOptions ¶ added in v0.4.0
type DiagnosticSettingsClientCreateOrUpdateOptions struct { }
DiagnosticSettingsClientCreateOrUpdateOptions contains the optional parameters for the DiagnosticSettingsClient.CreateOrUpdate method.
type DiagnosticSettingsClientCreateOrUpdateResponse ¶ added in v0.4.0
type DiagnosticSettingsClientCreateOrUpdateResponse struct { // The diagnostic setting resource. DiagnosticSettingsResource }
DiagnosticSettingsClientCreateOrUpdateResponse contains the response from method DiagnosticSettingsClient.CreateOrUpdate.
type DiagnosticSettingsClientDeleteOptions ¶ added in v0.4.0
type DiagnosticSettingsClientDeleteOptions struct { }
DiagnosticSettingsClientDeleteOptions contains the optional parameters for the DiagnosticSettingsClient.Delete method.
type DiagnosticSettingsClientDeleteResponse ¶ added in v0.4.0
type DiagnosticSettingsClientDeleteResponse struct { }
DiagnosticSettingsClientDeleteResponse contains the response from method DiagnosticSettingsClient.Delete.
type DiagnosticSettingsClientGetOptions ¶ added in v0.4.0
type DiagnosticSettingsClientGetOptions struct { }
DiagnosticSettingsClientGetOptions contains the optional parameters for the DiagnosticSettingsClient.Get method.
type DiagnosticSettingsClientGetResponse ¶ added in v0.4.0
type DiagnosticSettingsClientGetResponse struct { // The diagnostic setting resource. DiagnosticSettingsResource }
DiagnosticSettingsClientGetResponse contains the response from method DiagnosticSettingsClient.Get.
type DiagnosticSettingsClientListOptions ¶ added in v0.4.0
type DiagnosticSettingsClientListOptions struct { }
DiagnosticSettingsClientListOptions contains the optional parameters for the DiagnosticSettingsClient.NewListPager method.
type DiagnosticSettingsClientListResponse ¶ added in v0.4.0
type DiagnosticSettingsClientListResponse struct { // Represents a collection of alert rule resources. DiagnosticSettingsResourceCollection }
DiagnosticSettingsClientListResponse contains the response from method DiagnosticSettingsClient.NewListPager.
type DiagnosticSettingsResource ¶
type DiagnosticSettingsResource struct { // Properties of a Diagnostic Settings Resource. Properties *DiagnosticSettings // 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; The system metadata related to this resource. SystemData *SystemData // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string }
DiagnosticSettingsResource - The diagnostic setting resource.
func (DiagnosticSettingsResource) MarshalJSON ¶ added in v0.8.0
func (d DiagnosticSettingsResource) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DiagnosticSettingsResource.
func (*DiagnosticSettingsResource) UnmarshalJSON ¶ added in v0.8.0
func (d *DiagnosticSettingsResource) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DiagnosticSettingsResource.
type DiagnosticSettingsResourceCollection ¶
type DiagnosticSettingsResourceCollection struct { // The collection of diagnostic settings resources;. Value []*DiagnosticSettingsResource }
DiagnosticSettingsResourceCollection - Represents a collection of alert rule resources.
func (DiagnosticSettingsResourceCollection) MarshalJSON ¶
func (d DiagnosticSettingsResourceCollection) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DiagnosticSettingsResourceCollection.
func (*DiagnosticSettingsResourceCollection) UnmarshalJSON ¶ added in v0.8.0
func (d *DiagnosticSettingsResourceCollection) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DiagnosticSettingsResourceCollection.
type Dimension ¶
type Dimension struct { // REQUIRED; Name of the dimension Name *string // REQUIRED; Operator for dimension values Operator *DimensionOperator // REQUIRED; List of dimension values Values []*string }
Dimension splitting and filtering definition
func (Dimension) MarshalJSON ¶
MarshalJSON implements the json.Marshaller interface for type Dimension.
func (*Dimension) UnmarshalJSON ¶ added in v0.8.0
UnmarshalJSON implements the json.Unmarshaller interface for type Dimension.
type DimensionOperator ¶ added in v0.8.0
type DimensionOperator string
DimensionOperator - Operator for dimension values
const ( DimensionOperatorExclude DimensionOperator = "Exclude" DimensionOperatorInclude DimensionOperator = "Include" )
func PossibleDimensionOperatorValues ¶ added in v0.8.0
func PossibleDimensionOperatorValues() []DimensionOperator
PossibleDimensionOperatorValues returns the possible values for the DimensionOperator const type.
type DynamicMetricCriteria ¶
type DynamicMetricCriteria struct { // REQUIRED; The extent of deviation required to trigger an alert. This will affect how tight the threshold is to the metric // series pattern. AlertSensitivity *DynamicThresholdSensitivity // REQUIRED; Specifies the type of threshold criteria CriterionType *CriterionType // REQUIRED; The minimum number of violations required within the selected lookback time window required to raise an alert. FailingPeriods *DynamicThresholdFailingPeriods // REQUIRED; Name of the metric. MetricName *string // REQUIRED; Name of the criteria. Name *string // REQUIRED; The operator used to compare the metric value against the threshold. Operator *DynamicThresholdOperator // REQUIRED; the criteria time aggregation types. TimeAggregation *AggregationTypeEnum // OPTIONAL; Contains additional key/value pairs not defined in the schema. AdditionalProperties map[string]any // List of dimension conditions. Dimensions []*MetricDimension // Use this option to set the date from which to start learning the metric historical data and calculate the dynamic thresholds // (in ISO8601 format) IgnoreDataBefore *time.Time // Namespace of the metric. MetricNamespace *string // Allows creating an alert rule on a custom metric that isn't yet emitted, by causing the metric validation to be skipped. SkipMetricValidation *bool }
DynamicMetricCriteria - Criterion for dynamic threshold.
func (*DynamicMetricCriteria) GetMultiMetricCriteria ¶ added in v0.4.0
func (d *DynamicMetricCriteria) GetMultiMetricCriteria() *MultiMetricCriteria
GetMultiMetricCriteria implements the MultiMetricCriteriaClassification interface for type DynamicMetricCriteria.
func (DynamicMetricCriteria) MarshalJSON ¶
func (d DynamicMetricCriteria) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DynamicMetricCriteria.
func (*DynamicMetricCriteria) UnmarshalJSON ¶
func (d *DynamicMetricCriteria) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DynamicMetricCriteria.
type DynamicThresholdFailingPeriods ¶
type DynamicThresholdFailingPeriods struct { // REQUIRED; The number of violations to trigger an alert. Should be smaller or equal to numberOfEvaluationPeriods. MinFailingPeriodsToAlert *float32 // REQUIRED; The number of aggregated lookback points. The lookback time window is calculated based on the aggregation granularity // (windowSize) and the selected number of aggregated points. NumberOfEvaluationPeriods *float32 }
DynamicThresholdFailingPeriods - The minimum number of violations required within the selected lookback time window required to raise an alert.
func (DynamicThresholdFailingPeriods) MarshalJSON ¶ added in v0.8.0
func (d DynamicThresholdFailingPeriods) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DynamicThresholdFailingPeriods.
func (*DynamicThresholdFailingPeriods) UnmarshalJSON ¶ added in v0.8.0
func (d *DynamicThresholdFailingPeriods) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DynamicThresholdFailingPeriods.
type DynamicThresholdOperator ¶
type DynamicThresholdOperator string
DynamicThresholdOperator - The operator used to compare the metric value against the threshold.
const ( DynamicThresholdOperatorGreaterOrLessThan DynamicThresholdOperator = "GreaterOrLessThan" DynamicThresholdOperatorGreaterThan DynamicThresholdOperator = "GreaterThan" DynamicThresholdOperatorLessThan DynamicThresholdOperator = "LessThan" )
func PossibleDynamicThresholdOperatorValues ¶
func PossibleDynamicThresholdOperatorValues() []DynamicThresholdOperator
PossibleDynamicThresholdOperatorValues returns the possible values for the DynamicThresholdOperator const type.
type DynamicThresholdSensitivity ¶
type DynamicThresholdSensitivity string
DynamicThresholdSensitivity - The extent of deviation required to trigger an alert. This will affect how tight the threshold is to the metric series pattern.
const ( DynamicThresholdSensitivityHigh DynamicThresholdSensitivity = "High" DynamicThresholdSensitivityLow DynamicThresholdSensitivity = "Low" DynamicThresholdSensitivityMedium DynamicThresholdSensitivity = "Medium" )
func PossibleDynamicThresholdSensitivityValues ¶
func PossibleDynamicThresholdSensitivityValues() []DynamicThresholdSensitivity
PossibleDynamicThresholdSensitivityValues returns the possible values for the DynamicThresholdSensitivity const type.
type EmailNotification ¶
type EmailNotification struct { // the custom e-mails list. This value can be null or empty, in which case this attribute will be ignored. CustomEmails []*string // a value indicating whether to send email to subscription administrator. SendToSubscriptionAdministrator *bool // a value indicating whether to send email to subscription co-administrators. SendToSubscriptionCoAdministrators *bool }
EmailNotification - Email notification of an autoscale event.
func (EmailNotification) MarshalJSON ¶
func (e EmailNotification) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type EmailNotification.
func (*EmailNotification) UnmarshalJSON ¶ added in v0.8.0
func (e *EmailNotification) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type EmailNotification.
type EmailReceiver ¶
type EmailReceiver struct { // REQUIRED; The email address of this receiver. EmailAddress *string // REQUIRED; The name of the email receiver. Names must be unique across all receivers within an action group. Name *string // Indicates whether to use common alert schema. UseCommonAlertSchema *bool // READ-ONLY; The receiver status of the e-mail. Status *ReceiverStatus }
EmailReceiver - An email receiver.
func (EmailReceiver) MarshalJSON ¶ added in v0.8.0
func (e EmailReceiver) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type EmailReceiver.
func (*EmailReceiver) UnmarshalJSON ¶ added in v0.8.0
func (e *EmailReceiver) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type EmailReceiver.
type EmailReceiverAutoGenerated ¶ added in v0.9.0
type EmailReceiverAutoGenerated struct { // REQUIRED; The email address of this receiver. EmailAddress *string // REQUIRED; The name of the email receiver. Names must be unique across all receivers within a tenant action group. Name *string // Indicates whether to use common alert schema. UseCommonAlertSchema *bool // READ-ONLY; The receiver status of the e-mail. Status *ReceiverStatus }
EmailReceiverAutoGenerated - An email receiver.
func (EmailReceiverAutoGenerated) MarshalJSON ¶ added in v0.9.0
func (e EmailReceiverAutoGenerated) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type EmailReceiverAutoGenerated.
func (*EmailReceiverAutoGenerated) UnmarshalJSON ¶ added in v0.9.0
func (e *EmailReceiverAutoGenerated) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type EmailReceiverAutoGenerated.
type EnableRequest ¶
type EnableRequest struct { // REQUIRED; The name of the receiver to resubscribe. ReceiverName *string }
EnableRequest - Describes a receiver that should be resubscribed.
func (EnableRequest) MarshalJSON ¶ added in v0.8.0
func (e EnableRequest) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type EnableRequest.
func (*EnableRequest) UnmarshalJSON ¶ added in v0.8.0
func (e *EnableRequest) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type EnableRequest.
type Error ¶
type Error struct { // REQUIRED; Error code identifying the specific error. Code *string // Error message in the caller's locale. Message *string }
Error details.
func (Error) MarshalJSON ¶ added in v0.8.0
MarshalJSON implements the json.Marshaller interface for type Error.
func (*Error) UnmarshalJSON ¶ added in v0.8.0
UnmarshalJSON implements the json.Unmarshaller interface for type Error.
type ErrorAdditionalInfo ¶
type ErrorAdditionalInfo struct { // READ-ONLY; The additional info. Info any // READ-ONLY; The additional info type. Type *string }
ErrorAdditionalInfo - The resource management error additional info.
func (ErrorAdditionalInfo) MarshalJSON ¶ added in v0.8.0
func (e ErrorAdditionalInfo) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ErrorAdditionalInfo.
func (*ErrorAdditionalInfo) UnmarshalJSON ¶ added in v0.8.0
func (e *ErrorAdditionalInfo) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ErrorAdditionalInfo.
type ErrorContract ¶
type ErrorContract struct { // The error object. Error *ErrorResponse }
ErrorContract - Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.)
func (ErrorContract) MarshalJSON ¶ added in v0.8.0
func (e ErrorContract) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ErrorContract.
func (*ErrorContract) UnmarshalJSON ¶ added in v0.8.0
func (e *ErrorContract) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ErrorContract.
type ErrorContractAutoGenerated ¶ added in v0.9.0
type ErrorContractAutoGenerated struct { // The error details. Error *ErrorResponseDetails }
ErrorContractAutoGenerated - Describes the format of Error response.
func (ErrorContractAutoGenerated) MarshalJSON ¶ added in v0.9.0
func (e ErrorContractAutoGenerated) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ErrorContractAutoGenerated.
func (*ErrorContractAutoGenerated) UnmarshalJSON ¶ added in v0.9.0
func (e *ErrorContractAutoGenerated) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ErrorContractAutoGenerated.
type ErrorDetail ¶
type ErrorDetail struct { // READ-ONLY; The error additional info. AdditionalInfo []*ErrorAdditionalInfo // READ-ONLY; The error code. Code *string // READ-ONLY; The error details. Details []*ErrorDetail // READ-ONLY; The error message. Message *string // READ-ONLY; The error target. Target *string }
ErrorDetail - The error detail.
func (ErrorDetail) MarshalJSON ¶
func (e ErrorDetail) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ErrorDetail.
func (*ErrorDetail) UnmarshalJSON ¶ added in v0.8.0
func (e *ErrorDetail) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ErrorDetail.
type ErrorDetailAutoGenerated ¶ added in v0.9.0
type ErrorDetailAutoGenerated struct { // READ-ONLY; The error additional info. AdditionalInfo []*ErrorAdditionalInfo // READ-ONLY; The error code. Code *string // READ-ONLY; The error details. Details []*ErrorDetailAutoGenerated // READ-ONLY; The error message. Message *string // READ-ONLY; The error target. Target *string }
ErrorDetailAutoGenerated - The error detail.
func (ErrorDetailAutoGenerated) MarshalJSON ¶ added in v0.9.0
func (e ErrorDetailAutoGenerated) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ErrorDetailAutoGenerated.
func (*ErrorDetailAutoGenerated) UnmarshalJSON ¶ added in v0.9.0
func (e *ErrorDetailAutoGenerated) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ErrorDetailAutoGenerated.
type ErrorResponse ¶
type ErrorResponse struct { // Error code Code *string // Error message indicating why the operation failed. Message *string }
ErrorResponse - Describes the format of Error response.
func (ErrorResponse) MarshalJSON ¶ added in v0.8.0
func (e ErrorResponse) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ErrorResponse.
func (*ErrorResponse) UnmarshalJSON ¶ added in v0.8.0
func (e *ErrorResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ErrorResponse.
type ErrorResponseAdditionalInfo ¶ added in v0.8.0
type ErrorResponseAdditionalInfo struct { // READ-ONLY; The additional info. Info any // READ-ONLY; The additional info type. Type *string }
ErrorResponseAdditionalInfo - The resource management error additional info.
func (ErrorResponseAdditionalInfo) MarshalJSON ¶ added in v0.8.0
func (e ErrorResponseAdditionalInfo) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ErrorResponseAdditionalInfo.
func (*ErrorResponseAdditionalInfo) UnmarshalJSON ¶ added in v0.8.0
func (e *ErrorResponseAdditionalInfo) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ErrorResponseAdditionalInfo.
type ErrorResponseAutoGenerated ¶ added in v0.4.0
type ErrorResponseAutoGenerated struct { // READ-ONLY; The error code. Code *string // READ-ONLY; The error message indicating why the operation failed. Message *string }
ErrorResponseAutoGenerated - The error response.
func (ErrorResponseAutoGenerated) MarshalJSON ¶ added in v0.8.0
func (e ErrorResponseAutoGenerated) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ErrorResponseAutoGenerated.
func (*ErrorResponseAutoGenerated) UnmarshalJSON ¶ added in v0.8.0
func (e *ErrorResponseAutoGenerated) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ErrorResponseAutoGenerated.
type ErrorResponseAutoGenerated2 ¶ added in v0.9.0
type ErrorResponseAutoGenerated2 struct { // The error object. Error *ErrorDetailAutoGenerated }
ErrorResponseAutoGenerated2 - Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.).
func (ErrorResponseAutoGenerated2) MarshalJSON ¶ added in v0.9.0
func (e ErrorResponseAutoGenerated2) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ErrorResponseAutoGenerated2.
func (*ErrorResponseAutoGenerated2) UnmarshalJSON ¶ added in v0.9.0
func (e *ErrorResponseAutoGenerated2) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ErrorResponseAutoGenerated2.
type ErrorResponseCommonV2 ¶
type ErrorResponseCommonV2 struct { // The error object. Error *ErrorDetail }
ErrorResponseCommonV2 - Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.).
func (ErrorResponseCommonV2) MarshalJSON ¶ added in v0.8.0
func (e ErrorResponseCommonV2) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ErrorResponseCommonV2.
func (*ErrorResponseCommonV2) UnmarshalJSON ¶ added in v0.8.0
func (e *ErrorResponseCommonV2) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ErrorResponseCommonV2.
type ErrorResponseDetails ¶ added in v0.8.0
type ErrorResponseDetails struct { // READ-ONLY; The error additional info. AdditionalInfo []*ErrorResponseAdditionalInfo // READ-ONLY; The error code. Code *string // READ-ONLY; The error details. Details []*ErrorResponseDetails // READ-ONLY; The error message. Message *string // READ-ONLY; The error target. Target *string }
ErrorResponseDetails - Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.)
func (ErrorResponseDetails) MarshalJSON ¶ added in v0.8.0
func (e ErrorResponseDetails) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ErrorResponseDetails.
func (*ErrorResponseDetails) UnmarshalJSON ¶ added in v0.8.0
func (e *ErrorResponseDetails) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ErrorResponseDetails.
type EventCategoriesClient ¶
type EventCategoriesClient struct {
// contains filtered or unexported fields
}
EventCategoriesClient contains the methods for the EventCategories group. Don't use this type directly, use NewEventCategoriesClient() instead.
func NewEventCategoriesClient ¶
func NewEventCategoriesClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*EventCategoriesClient, error)
NewEventCategoriesClient creates a new instance of EventCategoriesClient with the specified values.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - pass nil to accept the default values.
func (*EventCategoriesClient) NewListPager ¶ added in v0.6.0
func (client *EventCategoriesClient) NewListPager(options *EventCategoriesClientListOptions) *runtime.Pager[EventCategoriesClientListResponse]
NewListPager - Get the list of available event categories supported in the Activity Logs Service. The current list includes the following: Administrative, Security, ServiceHealth, Alert, Recommendation, Policy.
Generated from API version 2015-04-01
- options - EventCategoriesClientListOptions contains the optional parameters for the EventCategoriesClient.NewListPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Insights/stable/2015-04-01/examples/GetEventCategories.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewEventCategoriesClient().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.EventCategoryCollection = armmonitor.EventCategoryCollection{ // Value: []*armmonitor.LocalizableString{ // { // LocalizedValue: to.Ptr("category1"), // Value: to.Ptr("category1"), // }, // { // LocalizedValue: to.Ptr("category2"), // Value: to.Ptr("category2"), // }}, // } } }
Output:
type EventCategoriesClientListOptions ¶ added in v0.4.0
type EventCategoriesClientListOptions struct { }
EventCategoriesClientListOptions contains the optional parameters for the EventCategoriesClient.NewListPager method.
type EventCategoriesClientListResponse ¶ added in v0.4.0
type EventCategoriesClientListResponse struct { // A collection of event categories. Currently possible values are: Administrative, Security, ServiceHealth, Alert, Recommendation, // Policy. EventCategoryCollection }
EventCategoriesClientListResponse contains the response from method EventCategoriesClient.NewListPager.
type EventCategoryCollection ¶
type EventCategoryCollection struct { // REQUIRED; the list that includes the Azure event categories. Value []*LocalizableString }
EventCategoryCollection - A collection of event categories. Currently possible values are: Administrative, Security, ServiceHealth, Alert, Recommendation, Policy.
func (EventCategoryCollection) MarshalJSON ¶
func (e EventCategoryCollection) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type EventCategoryCollection.
func (*EventCategoryCollection) UnmarshalJSON ¶ added in v0.8.0
func (e *EventCategoryCollection) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type EventCategoryCollection.
type EventData ¶
type EventData struct { // READ-ONLY; The sender authorization information. Authorization *SenderAuthorization // READ-ONLY; the email address of the user who has performed the operation, the UPN claim or SPN claim based on availability. Caller *string // READ-ONLY; the event category. Category *LocalizableString // READ-ONLY; key value pairs to identify ARM permissions. Claims map[string]*string // READ-ONLY; the correlation Id, usually a GUID in the string format. The correlation Id is shared among the events that // belong to the same uber operation. CorrelationID *string // READ-ONLY; the description of the event. Description *string // READ-ONLY; the event data Id. This is a unique identifier for an event. EventDataID *string // READ-ONLY; the event name. This value should not be confused with OperationName. For practical purposes, OperationName // might be more appealing to end users. EventName *LocalizableString // READ-ONLY; the timestamp of when the event was generated by the Azure service processing the request corresponding the // event. It in ISO 8601 format. EventTimestamp *time.Time // READ-ONLY; the HTTP request info. Usually includes the 'clientRequestId', 'clientIpAddress' (IP address of the user who // initiated the event) and 'method' (HTTP method e.g. PUT). HTTPRequest *HTTPRequestInfo // READ-ONLY; the Id of this event as required by ARM for RBAC. It contains the EventDataID and a timestamp information. ID *string // READ-ONLY; the event level Level *EventLevel // READ-ONLY; It is usually a GUID shared among the events corresponding to single operation. This value should not be confused // with EventName. OperationID *string // READ-ONLY; the operation name. OperationName *LocalizableString // READ-ONLY; the set of pairs (usually a Dictionary) that includes details about the event. Properties map[string]*string // READ-ONLY; the resource group name of the impacted resource. ResourceGroupName *string // READ-ONLY; the resource uri that uniquely identifies the resource that caused this event. ResourceID *string // READ-ONLY; the resource provider name of the impacted resource. ResourceProviderName *LocalizableString // READ-ONLY; the resource type ResourceType *LocalizableString // READ-ONLY; a string describing the status of the operation. Some typical values are: Started, In progress, Succeeded, Failed, // Resolved. Status *LocalizableString // READ-ONLY; the event sub status. Most of the time, when included, this captures the HTTP status code of the REST call. // Common values are: OK (HTTP Status Code: 200), Created (HTTP Status Code: 201), Accepted // (HTTP Status Code: 202), No Content (HTTP Status Code: 204), Bad Request(HTTP Status Code: 400), Not Found (HTTP Status // Code: 404), Conflict (HTTP Status Code: 409), Internal Server Error (HTTP Status // Code: 500), Service Unavailable (HTTP Status Code:503), Gateway Timeout (HTTP Status Code: 504) SubStatus *LocalizableString // READ-ONLY; the timestamp of when the event became available for querying via this API. It is in ISO 8601 format. This value // should not be confused eventTimestamp. As there might be a delay between the occurrence // time of the event, and the time that the event is submitted to the Azure logging infrastructure. SubmissionTimestamp *time.Time // READ-ONLY; the Azure subscription Id usually a GUID. SubscriptionID *string // READ-ONLY; the Azure tenant Id TenantID *string }
EventData - The Azure event log entries are of type EventData
func (EventData) MarshalJSON ¶
MarshalJSON implements the json.Marshaller interface for type EventData.
func (*EventData) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaller interface for type EventData.
type EventDataCollection ¶
type EventDataCollection struct { // REQUIRED; this list that includes the Azure audit logs. Value []*EventData // Provides the link to retrieve the next set of events. NextLink *string }
EventDataCollection - Represents collection of events.
func (EventDataCollection) MarshalJSON ¶
func (e EventDataCollection) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type EventDataCollection.
func (*EventDataCollection) UnmarshalJSON ¶ added in v0.8.0
func (e *EventDataCollection) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type EventDataCollection.
type EventHubDataSource ¶ added in v0.9.0
type EventHubDataSource struct { // Event Hub consumer group name ConsumerGroup *string // A friendly name for the data source. This name should be unique across all data sources (regardless of type) within the // data collection rule. Name *string // The stream to collect from EventHub Stream *string }
func (EventHubDataSource) MarshalJSON ¶ added in v0.9.0
func (e EventHubDataSource) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type EventHubDataSource.
func (*EventHubDataSource) UnmarshalJSON ¶ added in v0.9.0
func (e *EventHubDataSource) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type EventHubDataSource.
type EventHubDestination ¶ added in v0.9.0
type EventHubDestination struct { // The resource ID of the event hub. EventHubResourceID *string // A friendly name for the destination. This name should be unique across all destinations (regardless of type) within the // data collection rule. Name *string }
func (EventHubDestination) MarshalJSON ¶ added in v0.9.0
func (e EventHubDestination) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type EventHubDestination.
func (*EventHubDestination) UnmarshalJSON ¶ added in v0.9.0
func (e *EventHubDestination) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type EventHubDestination.
type EventHubDirectDestination ¶ added in v0.9.0
type EventHubDirectDestination struct { // The resource ID of the event hub. EventHubResourceID *string // A friendly name for the destination. This name should be unique across all destinations (regardless of type) within the // data collection rule. Name *string }
func (EventHubDirectDestination) MarshalJSON ¶ added in v0.9.0
func (e EventHubDirectDestination) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type EventHubDirectDestination.
func (*EventHubDirectDestination) UnmarshalJSON ¶ added in v0.9.0
func (e *EventHubDirectDestination) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type EventHubDirectDestination.
type EventHubReceiver ¶ added in v0.3.0
type EventHubReceiver struct { // REQUIRED; The name of the specific Event Hub queue EventHubName *string // REQUIRED; The Event Hub namespace EventHubNameSpace *string // REQUIRED; The name of the Event hub receiver. Names must be unique across all receivers within an action group. Name *string // REQUIRED; The Id for the subscription containing this event hub SubscriptionID *string // The tenant Id for the subscription containing this event hub TenantID *string // Indicates whether to use common alert schema. UseCommonAlertSchema *bool }
EventHubReceiver - An Event hub receiver.
func (EventHubReceiver) MarshalJSON ¶ added in v0.8.0
func (e EventHubReceiver) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type EventHubReceiver.
func (*EventHubReceiver) UnmarshalJSON ¶ added in v0.8.0
func (e *EventHubReceiver) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type EventHubReceiver.
type EventLevel ¶
type EventLevel string
EventLevel - the event level
const ( EventLevelCritical EventLevel = "Critical" EventLevelError EventLevel = "Error" EventLevelInformational EventLevel = "Informational" EventLevelVerbose EventLevel = "Verbose" EventLevelWarning EventLevel = "Warning" )
func PossibleEventLevelValues ¶
func PossibleEventLevelValues() []EventLevel
PossibleEventLevelValues returns the possible values for the EventLevel const type.
type ExtensionDataSource ¶
type ExtensionDataSource struct { // REQUIRED; The name of the VM extension. ExtensionName *string // The extension settings. The format is specific for particular extension. ExtensionSettings any // The list of data sources this extension needs data from. InputDataSources []*string // A friendly name for the data source. This name should be unique across all data sources (regardless of type) within the // data collection rule. Name *string // List of streams that this data source will be sent to. A stream indicates what schema will be used for this data and usually // what table in Log Analytics the data will be sent to. Streams []*KnownExtensionDataSourceStreams }
ExtensionDataSource - Definition of which data will be collected from a separate VM extension that integrates with the Azure Monitor Agent. Collected from either Windows and Linux machines, depending on which extension is defined.
func (ExtensionDataSource) MarshalJSON ¶
func (e ExtensionDataSource) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ExtensionDataSource.
func (*ExtensionDataSource) UnmarshalJSON ¶ added in v0.8.0
func (e *ExtensionDataSource) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ExtensionDataSource.
type FailoverConfigurationSpec ¶ added in v0.9.0
type FailoverConfigurationSpec struct { // Active location where data flow will occur. ActiveLocation *string // Locations that are configured for failover. Locations []*LocationSpec }
func (FailoverConfigurationSpec) MarshalJSON ¶ added in v0.9.0
func (f FailoverConfigurationSpec) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type FailoverConfigurationSpec.
func (*FailoverConfigurationSpec) UnmarshalJSON ¶ added in v0.9.0
func (f *FailoverConfigurationSpec) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type FailoverConfigurationSpec.
type HTTPRequestInfo ¶
type HTTPRequestInfo struct { // the client Ip Address ClientIPAddress *string // the client request id. ClientRequestID *string // the Http request method. Method *string // the Uri. URI *string }
HTTPRequestInfo - The Http request info.
func (HTTPRequestInfo) MarshalJSON ¶ added in v0.8.0
func (h HTTPRequestInfo) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type HTTPRequestInfo.
func (*HTTPRequestInfo) UnmarshalJSON ¶ added in v0.8.0
func (h *HTTPRequestInfo) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type HTTPRequestInfo.
type Identity ¶ added in v0.9.0
type Identity struct { // REQUIRED; Type of managed service identity. Type *IdentityType // The list of user identities associated with the resource. The user identity dictionary key references will be ARM resource // ids in the form: // '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. UserAssignedIdentities map[string]*UserIdentityProperties // READ-ONLY; The principal ID of resource identity. PrincipalID *string // READ-ONLY; The tenant ID of resource. TenantID *string }
Identity for the resource.
func (Identity) MarshalJSON ¶ added in v0.9.0
MarshalJSON implements the json.Marshaller interface for type Identity.
func (*Identity) UnmarshalJSON ¶ added in v0.9.0
UnmarshalJSON implements the json.Unmarshaller interface for type Identity.
type IdentityType ¶ added in v0.9.0
type IdentityType string
IdentityType - Type of managed service identity.
const ( IdentityTypeNone IdentityType = "None" IdentityTypeSystemAssigned IdentityType = "SystemAssigned" IdentityTypeUserAssigned IdentityType = "UserAssigned" )
func PossibleIdentityTypeValues ¶ added in v0.9.0
func PossibleIdentityTypeValues() []IdentityType
PossibleIdentityTypeValues returns the possible values for the IdentityType const type.
type IisLogsDataSource ¶ added in v0.5.0
type IisLogsDataSource struct { // REQUIRED; IIS streams Streams []*string // Absolute paths file location LogDirectories []*string // A friendly name for the data source. This name should be unique across all data sources (regardless of type) within the // data collection rule. Name *string }
IisLogsDataSource - Enables IIS logs to be collected by this data collection rule.
func (IisLogsDataSource) MarshalJSON ¶ added in v0.5.0
func (i IisLogsDataSource) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type IisLogsDataSource.
func (*IisLogsDataSource) UnmarshalJSON ¶ added in v0.8.0
func (i *IisLogsDataSource) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type IisLogsDataSource.
type Incident ¶
type Incident struct { // READ-ONLY; The time at which the incident was activated in ISO8601 format. ActivatedTime *time.Time // READ-ONLY; A boolean to indicate whether the incident is active or resolved. IsActive *bool // READ-ONLY; Incident name. Name *string // READ-ONLY; The time at which the incident was resolved in ISO8601 format. If null, it means the incident is still active. ResolvedTime *time.Time // READ-ONLY; Rule name that is associated with the incident. RuleName *string }
Incident - An alert incident indicates the activation status of an alert rule.
func (Incident) MarshalJSON ¶
MarshalJSON implements the json.Marshaller interface for type Incident.
func (*Incident) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaller interface for type Incident.
type IncidentListResult ¶
type IncidentListResult struct { // the incident collection. Value []*Incident }
IncidentListResult - The List incidents operation response.
func (IncidentListResult) MarshalJSON ¶
func (i IncidentListResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type IncidentListResult.
func (*IncidentListResult) UnmarshalJSON ¶ added in v0.8.0
func (i *IncidentListResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type IncidentListResult.
type IngestionSettings ¶ added in v0.9.0
type IngestionSettings struct { // READ-ONLY; The Azure resource Id of the default data collection endpoint for this workspace. DataCollectionEndpointResourceID *string // READ-ONLY; The Azure resource Id of the default data collection rule for this workspace. DataCollectionRuleResourceID *string }
IngestionSettings - Settings for data ingestion
func (IngestionSettings) MarshalJSON ¶ added in v0.9.0
func (i IngestionSettings) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type IngestionSettings.
func (*IngestionSettings) UnmarshalJSON ¶ added in v0.9.0
func (i *IngestionSettings) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type IngestionSettings.
type ItsmReceiver ¶
type ItsmReceiver struct { // REQUIRED; Unique identification of ITSM connection among multiple defined in above workspace. ConnectionID *string // REQUIRED; The name of the Itsm receiver. Names must be unique across all receivers within an action group. Name *string // REQUIRED; Region in which workspace resides. Supported values:'centralindia','japaneast','southeastasia','australiasoutheast','uksouth','westcentralus','canadacentral','eastus','westeurope' Region *string // REQUIRED; JSON blob for the configurations of the ITSM action. CreateMultipleWorkItems option will be part of this blob // as well. TicketConfiguration *string // REQUIRED; OMS LA instance identifier. WorkspaceID *string }
ItsmReceiver - An Itsm receiver.
func (ItsmReceiver) MarshalJSON ¶ added in v0.8.0
func (i ItsmReceiver) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ItsmReceiver.
func (*ItsmReceiver) UnmarshalJSON ¶ added in v0.8.0
func (i *ItsmReceiver) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ItsmReceiver.
type Kind ¶ added in v0.8.0
type Kind string
Kind - Indicates the type of scheduled query rule. The default is LogAlert.
func PossibleKindValues ¶ added in v0.8.0
func PossibleKindValues() []Kind
PossibleKindValues returns the possible values for the Kind const type.
type KnownColumnDefinitionType ¶ added in v0.5.0
type KnownColumnDefinitionType string
KnownColumnDefinitionType - The type of the column data.
const ( KnownColumnDefinitionTypeBoolean KnownColumnDefinitionType = "boolean" KnownColumnDefinitionTypeDatetime KnownColumnDefinitionType = "datetime" KnownColumnDefinitionTypeDynamic KnownColumnDefinitionType = "dynamic" KnownColumnDefinitionTypeInt KnownColumnDefinitionType = "int" KnownColumnDefinitionTypeLong KnownColumnDefinitionType = "long" KnownColumnDefinitionTypeReal KnownColumnDefinitionType = "real" KnownColumnDefinitionTypeString KnownColumnDefinitionType = "string" )
func PossibleKnownColumnDefinitionTypeValues ¶ added in v0.5.0
func PossibleKnownColumnDefinitionTypeValues() []KnownColumnDefinitionType
PossibleKnownColumnDefinitionTypeValues returns the possible values for the KnownColumnDefinitionType const type.
type KnownDataCollectionEndpointProvisioningState ¶
type KnownDataCollectionEndpointProvisioningState string
KnownDataCollectionEndpointProvisioningState - The resource provisioning state. This property is READ-ONLY.
const ( KnownDataCollectionEndpointProvisioningStateCanceled KnownDataCollectionEndpointProvisioningState = "Canceled" KnownDataCollectionEndpointProvisioningStateCreating KnownDataCollectionEndpointProvisioningState = "Creating" KnownDataCollectionEndpointProvisioningStateDeleting KnownDataCollectionEndpointProvisioningState = "Deleting" KnownDataCollectionEndpointProvisioningStateFailed KnownDataCollectionEndpointProvisioningState = "Failed" KnownDataCollectionEndpointProvisioningStateSucceeded KnownDataCollectionEndpointProvisioningState = "Succeeded" KnownDataCollectionEndpointProvisioningStateUpdating KnownDataCollectionEndpointProvisioningState = "Updating" )
func PossibleKnownDataCollectionEndpointProvisioningStateValues ¶
func PossibleKnownDataCollectionEndpointProvisioningStateValues() []KnownDataCollectionEndpointProvisioningState
PossibleKnownDataCollectionEndpointProvisioningStateValues returns the possible values for the KnownDataCollectionEndpointProvisioningState const type.
type KnownDataCollectionEndpointResourceKind ¶
type KnownDataCollectionEndpointResourceKind string
KnownDataCollectionEndpointResourceKind - The kind of the resource.
const ( KnownDataCollectionEndpointResourceKindLinux KnownDataCollectionEndpointResourceKind = "Linux" KnownDataCollectionEndpointResourceKindWindows KnownDataCollectionEndpointResourceKind = "Windows" )
func PossibleKnownDataCollectionEndpointResourceKindValues ¶
func PossibleKnownDataCollectionEndpointResourceKindValues() []KnownDataCollectionEndpointResourceKind
PossibleKnownDataCollectionEndpointResourceKindValues returns the possible values for the KnownDataCollectionEndpointResourceKind const type.
type KnownDataCollectionRuleAssociationProvisioningState ¶
type KnownDataCollectionRuleAssociationProvisioningState string
KnownDataCollectionRuleAssociationProvisioningState - The resource provisioning state.
const ( KnownDataCollectionRuleAssociationProvisioningStateCanceled KnownDataCollectionRuleAssociationProvisioningState = "Canceled" KnownDataCollectionRuleAssociationProvisioningStateCreating KnownDataCollectionRuleAssociationProvisioningState = "Creating" KnownDataCollectionRuleAssociationProvisioningStateDeleting KnownDataCollectionRuleAssociationProvisioningState = "Deleting" KnownDataCollectionRuleAssociationProvisioningStateFailed KnownDataCollectionRuleAssociationProvisioningState = "Failed" KnownDataCollectionRuleAssociationProvisioningStateSucceeded KnownDataCollectionRuleAssociationProvisioningState = "Succeeded" KnownDataCollectionRuleAssociationProvisioningStateUpdating KnownDataCollectionRuleAssociationProvisioningState = "Updating" )
func PossibleKnownDataCollectionRuleAssociationProvisioningStateValues ¶
func PossibleKnownDataCollectionRuleAssociationProvisioningStateValues() []KnownDataCollectionRuleAssociationProvisioningState
PossibleKnownDataCollectionRuleAssociationProvisioningStateValues returns the possible values for the KnownDataCollectionRuleAssociationProvisioningState const type.
type KnownDataCollectionRuleProvisioningState ¶
type KnownDataCollectionRuleProvisioningState string
KnownDataCollectionRuleProvisioningState - The resource provisioning state.
const ( KnownDataCollectionRuleProvisioningStateCanceled KnownDataCollectionRuleProvisioningState = "Canceled" KnownDataCollectionRuleProvisioningStateCreating KnownDataCollectionRuleProvisioningState = "Creating" KnownDataCollectionRuleProvisioningStateDeleting KnownDataCollectionRuleProvisioningState = "Deleting" KnownDataCollectionRuleProvisioningStateFailed KnownDataCollectionRuleProvisioningState = "Failed" KnownDataCollectionRuleProvisioningStateSucceeded KnownDataCollectionRuleProvisioningState = "Succeeded" KnownDataCollectionRuleProvisioningStateUpdating KnownDataCollectionRuleProvisioningState = "Updating" )
func PossibleKnownDataCollectionRuleProvisioningStateValues ¶
func PossibleKnownDataCollectionRuleProvisioningStateValues() []KnownDataCollectionRuleProvisioningState
PossibleKnownDataCollectionRuleProvisioningStateValues returns the possible values for the KnownDataCollectionRuleProvisioningState const type.
type KnownDataCollectionRuleResourceKind ¶
type KnownDataCollectionRuleResourceKind string
KnownDataCollectionRuleResourceKind - The kind of the resource.
const ( KnownDataCollectionRuleResourceKindLinux KnownDataCollectionRuleResourceKind = "Linux" KnownDataCollectionRuleResourceKindWindows KnownDataCollectionRuleResourceKind = "Windows" )
func PossibleKnownDataCollectionRuleResourceKindValues ¶
func PossibleKnownDataCollectionRuleResourceKindValues() []KnownDataCollectionRuleResourceKind
PossibleKnownDataCollectionRuleResourceKindValues returns the possible values for the KnownDataCollectionRuleResourceKind const type.
type KnownDataFlowStreams ¶
type KnownDataFlowStreams string
const ( KnownDataFlowStreamsMicrosoftEvent KnownDataFlowStreams = "Microsoft-Event" KnownDataFlowStreamsMicrosoftInsightsMetrics KnownDataFlowStreams = "Microsoft-InsightsMetrics" KnownDataFlowStreamsMicrosoftPerf KnownDataFlowStreams = "Microsoft-Perf" KnownDataFlowStreamsMicrosoftSyslog KnownDataFlowStreams = "Microsoft-Syslog" KnownDataFlowStreamsMicrosoftWindowsEvent KnownDataFlowStreams = "Microsoft-WindowsEvent" )
func PossibleKnownDataFlowStreamsValues ¶
func PossibleKnownDataFlowStreamsValues() []KnownDataFlowStreams
PossibleKnownDataFlowStreamsValues returns the possible values for the KnownDataFlowStreams const type.
type KnownExtensionDataSourceStreams ¶
type KnownExtensionDataSourceStreams string
const ( KnownExtensionDataSourceStreamsMicrosoftEvent KnownExtensionDataSourceStreams = "Microsoft-Event" KnownExtensionDataSourceStreamsMicrosoftInsightsMetrics KnownExtensionDataSourceStreams = "Microsoft-InsightsMetrics" KnownExtensionDataSourceStreamsMicrosoftPerf KnownExtensionDataSourceStreams = "Microsoft-Perf" KnownExtensionDataSourceStreamsMicrosoftSyslog KnownExtensionDataSourceStreams = "Microsoft-Syslog" KnownExtensionDataSourceStreamsMicrosoftWindowsEvent KnownExtensionDataSourceStreams = "Microsoft-WindowsEvent" )
func PossibleKnownExtensionDataSourceStreamsValues ¶
func PossibleKnownExtensionDataSourceStreamsValues() []KnownExtensionDataSourceStreams
PossibleKnownExtensionDataSourceStreamsValues returns the possible values for the KnownExtensionDataSourceStreams const type.
type KnownLocationSpecProvisioningStatus ¶ added in v0.9.0
type KnownLocationSpecProvisioningStatus string
KnownLocationSpecProvisioningStatus - The resource provisioning state in this location.
const ( KnownLocationSpecProvisioningStatusCanceled KnownLocationSpecProvisioningStatus = "Canceled" KnownLocationSpecProvisioningStatusCreating KnownLocationSpecProvisioningStatus = "Creating" KnownLocationSpecProvisioningStatusDeleting KnownLocationSpecProvisioningStatus = "Deleting" KnownLocationSpecProvisioningStatusFailed KnownLocationSpecProvisioningStatus = "Failed" KnownLocationSpecProvisioningStatusSucceeded KnownLocationSpecProvisioningStatus = "Succeeded" KnownLocationSpecProvisioningStatusUpdating KnownLocationSpecProvisioningStatus = "Updating" )
func PossibleKnownLocationSpecProvisioningStatusValues ¶ added in v0.9.0
func PossibleKnownLocationSpecProvisioningStatusValues() []KnownLocationSpecProvisioningStatus
PossibleKnownLocationSpecProvisioningStatusValues returns the possible values for the KnownLocationSpecProvisioningStatus const type.
type KnownLogFileTextSettingsRecordStartTimestampFormat ¶ added in v0.5.0
type KnownLogFileTextSettingsRecordStartTimestampFormat string
KnownLogFileTextSettingsRecordStartTimestampFormat - One of the supported timestamp formats
const ( KnownLogFileTextSettingsRecordStartTimestampFormatDdMMMYyyyHHMmSsZzz KnownLogFileTextSettingsRecordStartTimestampFormat = "dd/MMM/yyyy:HH:mm:ss zzz" KnownLogFileTextSettingsRecordStartTimestampFormatDdMMyyHHMmSs KnownLogFileTextSettingsRecordStartTimestampFormat = "ddMMyy HH:mm:ss" KnownLogFileTextSettingsRecordStartTimestampFormatISO8601 KnownLogFileTextSettingsRecordStartTimestampFormat = "ISO 8601" KnownLogFileTextSettingsRecordStartTimestampFormatMDYYYYHHMMSSAMPM KnownLogFileTextSettingsRecordStartTimestampFormat = "M/D/YYYY HH:MM:SS AM/PM" KnownLogFileTextSettingsRecordStartTimestampFormatMMMDHhMmSs KnownLogFileTextSettingsRecordStartTimestampFormat = "MMM d hh:mm:ss" KnownLogFileTextSettingsRecordStartTimestampFormatMonDDYYYYHHMMSS KnownLogFileTextSettingsRecordStartTimestampFormat = "Mon DD, YYYY HH:MM:SS" KnownLogFileTextSettingsRecordStartTimestampFormatYYYYMMDDHHMMSS KnownLogFileTextSettingsRecordStartTimestampFormat = "YYYY-MM-DD HH:MM:SS" KnownLogFileTextSettingsRecordStartTimestampFormatYyMMddHHMmSs KnownLogFileTextSettingsRecordStartTimestampFormat = "yyMMdd HH:mm:ss" KnownLogFileTextSettingsRecordStartTimestampFormatYyyyMMDdTHHMmSsK KnownLogFileTextSettingsRecordStartTimestampFormat = "yyyy-MM-ddTHH:mm:ssK" )
func PossibleKnownLogFileTextSettingsRecordStartTimestampFormatValues ¶ added in v0.5.0
func PossibleKnownLogFileTextSettingsRecordStartTimestampFormatValues() []KnownLogFileTextSettingsRecordStartTimestampFormat
PossibleKnownLogFileTextSettingsRecordStartTimestampFormatValues returns the possible values for the KnownLogFileTextSettingsRecordStartTimestampFormat const type.
type KnownLogFilesDataSourceFormat ¶ added in v0.5.0
type KnownLogFilesDataSourceFormat string
KnownLogFilesDataSourceFormat - The data format of the log files
const (
KnownLogFilesDataSourceFormatText KnownLogFilesDataSourceFormat = "text"
)
func PossibleKnownLogFilesDataSourceFormatValues ¶ added in v0.5.0
func PossibleKnownLogFilesDataSourceFormatValues() []KnownLogFilesDataSourceFormat
PossibleKnownLogFilesDataSourceFormatValues returns the possible values for the KnownLogFilesDataSourceFormat const type.
type KnownPerfCounterDataSourceStreams ¶
type KnownPerfCounterDataSourceStreams string
const ( KnownPerfCounterDataSourceStreamsMicrosoftInsightsMetrics KnownPerfCounterDataSourceStreams = "Microsoft-InsightsMetrics" KnownPerfCounterDataSourceStreamsMicrosoftPerf KnownPerfCounterDataSourceStreams = "Microsoft-Perf" )
func PossibleKnownPerfCounterDataSourceStreamsValues ¶
func PossibleKnownPerfCounterDataSourceStreamsValues() []KnownPerfCounterDataSourceStreams
PossibleKnownPerfCounterDataSourceStreamsValues returns the possible values for the KnownPerfCounterDataSourceStreams const type.
type KnownPrometheusForwarderDataSourceStreams ¶ added in v0.9.0
type KnownPrometheusForwarderDataSourceStreams string
const (
KnownPrometheusForwarderDataSourceStreamsMicrosoftPrometheusMetrics KnownPrometheusForwarderDataSourceStreams = "Microsoft-PrometheusMetrics"
)
func PossibleKnownPrometheusForwarderDataSourceStreamsValues ¶ added in v0.9.0
func PossibleKnownPrometheusForwarderDataSourceStreamsValues() []KnownPrometheusForwarderDataSourceStreams
PossibleKnownPrometheusForwarderDataSourceStreamsValues returns the possible values for the KnownPrometheusForwarderDataSourceStreams const type.
type KnownPublicNetworkAccessOptions ¶
type KnownPublicNetworkAccessOptions string
KnownPublicNetworkAccessOptions - The configuration to set whether network access from public internet to the endpoints are allowed.
const ( KnownPublicNetworkAccessOptionsDisabled KnownPublicNetworkAccessOptions = "Disabled" KnownPublicNetworkAccessOptionsEnabled KnownPublicNetworkAccessOptions = "Enabled" KnownPublicNetworkAccessOptionsSecuredByPerimeter KnownPublicNetworkAccessOptions = "SecuredByPerimeter" )
func PossibleKnownPublicNetworkAccessOptionsValues ¶
func PossibleKnownPublicNetworkAccessOptionsValues() []KnownPublicNetworkAccessOptions
PossibleKnownPublicNetworkAccessOptionsValues returns the possible values for the KnownPublicNetworkAccessOptions const type.
type KnownSyslogDataSourceFacilityNames ¶
type KnownSyslogDataSourceFacilityNames string
const ( KnownSyslogDataSourceFacilityNamesAsterisk KnownSyslogDataSourceFacilityNames = "*" KnownSyslogDataSourceFacilityNamesAuth KnownSyslogDataSourceFacilityNames = "auth" KnownSyslogDataSourceFacilityNamesAuthpriv KnownSyslogDataSourceFacilityNames = "authpriv" KnownSyslogDataSourceFacilityNamesCron KnownSyslogDataSourceFacilityNames = "cron" KnownSyslogDataSourceFacilityNamesDaemon KnownSyslogDataSourceFacilityNames = "daemon" KnownSyslogDataSourceFacilityNamesKern KnownSyslogDataSourceFacilityNames = "kern" KnownSyslogDataSourceFacilityNamesLocal0 KnownSyslogDataSourceFacilityNames = "local0" KnownSyslogDataSourceFacilityNamesLocal1 KnownSyslogDataSourceFacilityNames = "local1" KnownSyslogDataSourceFacilityNamesLocal2 KnownSyslogDataSourceFacilityNames = "local2" KnownSyslogDataSourceFacilityNamesLocal3 KnownSyslogDataSourceFacilityNames = "local3" KnownSyslogDataSourceFacilityNamesLocal4 KnownSyslogDataSourceFacilityNames = "local4" KnownSyslogDataSourceFacilityNamesLocal5 KnownSyslogDataSourceFacilityNames = "local5" KnownSyslogDataSourceFacilityNamesLocal6 KnownSyslogDataSourceFacilityNames = "local6" KnownSyslogDataSourceFacilityNamesLocal7 KnownSyslogDataSourceFacilityNames = "local7" KnownSyslogDataSourceFacilityNamesLpr KnownSyslogDataSourceFacilityNames = "lpr" KnownSyslogDataSourceFacilityNamesMail KnownSyslogDataSourceFacilityNames = "mail" KnownSyslogDataSourceFacilityNamesMark KnownSyslogDataSourceFacilityNames = "mark" KnownSyslogDataSourceFacilityNamesNews KnownSyslogDataSourceFacilityNames = "news" KnownSyslogDataSourceFacilityNamesSyslog KnownSyslogDataSourceFacilityNames = "syslog" KnownSyslogDataSourceFacilityNamesUser KnownSyslogDataSourceFacilityNames = "user" KnownSyslogDataSourceFacilityNamesUucp KnownSyslogDataSourceFacilityNames = "uucp" )
func PossibleKnownSyslogDataSourceFacilityNamesValues ¶
func PossibleKnownSyslogDataSourceFacilityNamesValues() []KnownSyslogDataSourceFacilityNames
PossibleKnownSyslogDataSourceFacilityNamesValues returns the possible values for the KnownSyslogDataSourceFacilityNames const type.
type KnownSyslogDataSourceLogLevels ¶
type KnownSyslogDataSourceLogLevels string
const ( KnownSyslogDataSourceLogLevelsAlert KnownSyslogDataSourceLogLevels = "Alert" KnownSyslogDataSourceLogLevelsAsterisk KnownSyslogDataSourceLogLevels = "*" KnownSyslogDataSourceLogLevelsCritical KnownSyslogDataSourceLogLevels = "Critical" KnownSyslogDataSourceLogLevelsDebug KnownSyslogDataSourceLogLevels = "Debug" KnownSyslogDataSourceLogLevelsEmergency KnownSyslogDataSourceLogLevels = "Emergency" KnownSyslogDataSourceLogLevelsError KnownSyslogDataSourceLogLevels = "Error" KnownSyslogDataSourceLogLevelsInfo KnownSyslogDataSourceLogLevels = "Info" KnownSyslogDataSourceLogLevelsNotice KnownSyslogDataSourceLogLevels = "Notice" KnownSyslogDataSourceLogLevelsWarning KnownSyslogDataSourceLogLevels = "Warning" )
func PossibleKnownSyslogDataSourceLogLevelsValues ¶
func PossibleKnownSyslogDataSourceLogLevelsValues() []KnownSyslogDataSourceLogLevels
PossibleKnownSyslogDataSourceLogLevelsValues returns the possible values for the KnownSyslogDataSourceLogLevels const type.
type KnownSyslogDataSourceStreams ¶
type KnownSyslogDataSourceStreams string
const (
KnownSyslogDataSourceStreamsMicrosoftSyslog KnownSyslogDataSourceStreams = "Microsoft-Syslog"
)
func PossibleKnownSyslogDataSourceStreamsValues ¶
func PossibleKnownSyslogDataSourceStreamsValues() []KnownSyslogDataSourceStreams
PossibleKnownSyslogDataSourceStreamsValues returns the possible values for the KnownSyslogDataSourceStreams const type.
type KnownWindowsEventLogDataSourceStreams ¶
type KnownWindowsEventLogDataSourceStreams string
const ( KnownWindowsEventLogDataSourceStreamsMicrosoftEvent KnownWindowsEventLogDataSourceStreams = "Microsoft-Event" KnownWindowsEventLogDataSourceStreamsMicrosoftWindowsEvent KnownWindowsEventLogDataSourceStreams = "Microsoft-WindowsEvent" )
func PossibleKnownWindowsEventLogDataSourceStreamsValues ¶
func PossibleKnownWindowsEventLogDataSourceStreamsValues() []KnownWindowsEventLogDataSourceStreams
PossibleKnownWindowsEventLogDataSourceStreamsValues returns the possible values for the KnownWindowsEventLogDataSourceStreams const type.
type LocalizableString ¶
type LocalizableString struct { // REQUIRED; the invariant value. Value *string // the locale specific value. LocalizedValue *string }
LocalizableString - The localizable string class.
func (LocalizableString) MarshalJSON ¶ added in v0.8.0
func (l LocalizableString) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type LocalizableString.
func (*LocalizableString) UnmarshalJSON ¶ added in v0.8.0
func (l *LocalizableString) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type LocalizableString.
type LocationSpec ¶ added in v0.9.0
type LocationSpec struct { // Name of location. Location *string // The resource provisioning state in this location. ProvisioningStatus *KnownLocationSpecProvisioningStatus }
func (LocationSpec) MarshalJSON ¶ added in v0.9.0
func (l LocationSpec) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type LocationSpec.
func (*LocationSpec) UnmarshalJSON ¶ added in v0.9.0
func (l *LocationSpec) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type LocationSpec.
type LocationThresholdRuleCondition ¶
type LocationThresholdRuleCondition struct { // REQUIRED; the number of locations that must fail to activate the alert. FailedLocationCount *int32 // REQUIRED; specifies the type of condition. This can be one of three types: ManagementEventRuleCondition (occurrences of // management events), LocationThresholdRuleCondition (based on the number of failures of a // web test), and ThresholdRuleCondition (based on the threshold of a metric). ODataType *string // the resource from which the rule collects its data. For this type dataSource will always be of type RuleMetricDataSource. DataSource RuleDataSourceClassification // the period of time (in ISO 8601 duration format) that is used to monitor alert activity based on the threshold. If specified // then it must be between 5 minutes and 1 day. WindowSize *string }
LocationThresholdRuleCondition - A rule condition based on a certain number of locations failing.
func (*LocationThresholdRuleCondition) GetRuleCondition ¶ added in v0.4.0
func (l *LocationThresholdRuleCondition) GetRuleCondition() *RuleCondition
GetRuleCondition implements the RuleConditionClassification interface for type LocationThresholdRuleCondition.
func (LocationThresholdRuleCondition) MarshalJSON ¶
func (l LocationThresholdRuleCondition) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type LocationThresholdRuleCondition.
func (*LocationThresholdRuleCondition) UnmarshalJSON ¶
func (l *LocationThresholdRuleCondition) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type LocationThresholdRuleCondition.
type LogAnalyticsDestination ¶
type LogAnalyticsDestination struct { // A friendly name for the destination. This name should be unique across all destinations (regardless of type) within the // data collection rule. Name *string // The resource ID of the Log Analytics workspace. WorkspaceResourceID *string // READ-ONLY; The Customer ID of the Log Analytics workspace. WorkspaceID *string }
LogAnalyticsDestination - Log Analytics destination.
func (LogAnalyticsDestination) MarshalJSON ¶ added in v0.8.0
func (l LogAnalyticsDestination) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type LogAnalyticsDestination.
func (*LogAnalyticsDestination) UnmarshalJSON ¶ added in v0.8.0
func (l *LogAnalyticsDestination) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type LogAnalyticsDestination.
type LogFileSettings ¶ added in v0.5.0
type LogFileSettings struct { // Text settings Text *LogFileSettingsText }
LogFileSettings - Settings for different log file formats
func (LogFileSettings) MarshalJSON ¶ added in v0.8.0
func (l LogFileSettings) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type LogFileSettings.
func (*LogFileSettings) UnmarshalJSON ¶ added in v0.8.0
func (l *LogFileSettings) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type LogFileSettings.
type LogFileSettingsText ¶ added in v0.5.0
type LogFileSettingsText struct { // REQUIRED; One of the supported timestamp formats RecordStartTimestampFormat *KnownLogFileTextSettingsRecordStartTimestampFormat }
LogFileSettingsText - Text settings
func (LogFileSettingsText) MarshalJSON ¶ added in v0.8.0
func (l LogFileSettingsText) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type LogFileSettingsText.
func (*LogFileSettingsText) UnmarshalJSON ¶ added in v0.8.0
func (l *LogFileSettingsText) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type LogFileSettingsText.
type LogFileTextSettings ¶ added in v0.5.0
type LogFileTextSettings struct { // REQUIRED; One of the supported timestamp formats RecordStartTimestampFormat *KnownLogFileTextSettingsRecordStartTimestampFormat }
LogFileTextSettings - Settings for text log files
func (LogFileTextSettings) MarshalJSON ¶ added in v0.8.0
func (l LogFileTextSettings) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type LogFileTextSettings.
func (*LogFileTextSettings) UnmarshalJSON ¶ added in v0.8.0
func (l *LogFileTextSettings) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type LogFileTextSettings.
type LogFilesDataSource ¶ added in v0.5.0
type LogFilesDataSource struct { // REQUIRED; File Patterns where the log files are located FilePatterns []*string // REQUIRED; The data format of the log files Format *KnownLogFilesDataSourceFormat // REQUIRED; List of streams that this data source will be sent to. A stream indicates what schema will be used for this data // source Streams []*string // A friendly name for the data source. This name should be unique across all data sources (regardless of type) within the // data collection rule. Name *string // The log files specific settings. Settings *LogFilesDataSourceSettings }
LogFilesDataSource - Definition of which custom log files will be collected by this data collection rule
func (LogFilesDataSource) MarshalJSON ¶ added in v0.5.0
func (l LogFilesDataSource) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type LogFilesDataSource.
func (*LogFilesDataSource) UnmarshalJSON ¶ added in v0.8.0
func (l *LogFilesDataSource) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type LogFilesDataSource.
type LogFilesDataSourceSettings ¶ added in v0.5.0
type LogFilesDataSourceSettings struct { // Text settings Text *LogFileSettingsText }
LogFilesDataSourceSettings - The log files specific settings.
func (LogFilesDataSourceSettings) MarshalJSON ¶ added in v0.8.0
func (l LogFilesDataSourceSettings) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type LogFilesDataSourceSettings.
func (*LogFilesDataSourceSettings) UnmarshalJSON ¶ added in v0.8.0
func (l *LogFilesDataSourceSettings) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type LogFilesDataSourceSettings.
type LogProfileCollection ¶
type LogProfileCollection struct { // REQUIRED; the values of the log profiles. Value []*LogProfileResource }
LogProfileCollection - Represents a collection of log profiles.
func (LogProfileCollection) MarshalJSON ¶
func (l LogProfileCollection) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type LogProfileCollection.
func (*LogProfileCollection) UnmarshalJSON ¶ added in v0.8.0
func (l *LogProfileCollection) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type LogProfileCollection.
type LogProfileProperties ¶
type LogProfileProperties struct { // REQUIRED; the categories of the logs. These categories are created as is convenient to the user. Some values are: 'Write', // 'Delete', and/or 'Action.' Categories []*string // REQUIRED; List of regions for which Activity Log events should be stored or streamed. It is a comma separated list of valid // ARM locations including the 'global' location. Locations []*string // REQUIRED; the retention policy for the events in the log. RetentionPolicy *RetentionPolicy // The service bus rule ID of the service bus namespace in which you would like to have Event Hubs created for streaming the // Activity Log. The rule ID is of the format: '{service bus resource // ID}/authorizationrules/{key name}'. ServiceBusRuleID *string // the resource id of the storage account to which you would like to send the Activity Log. StorageAccountID *string }
LogProfileProperties - The log profile properties.
func (LogProfileProperties) MarshalJSON ¶
func (l LogProfileProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type LogProfileProperties.
func (*LogProfileProperties) UnmarshalJSON ¶ added in v0.8.0
func (l *LogProfileProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type LogProfileProperties.
type LogProfileResource ¶
type LogProfileResource struct { // REQUIRED; Resource location Location *string // REQUIRED; The log profile properties of the resource. Properties *LogProfileProperties // Resource tags Tags map[string]*string // READ-ONLY; Azure resource Id ID *string // READ-ONLY; Azure resource name Name *string // READ-ONLY; Azure resource type Type *string }
LogProfileResource - The log profile resource.
func (LogProfileResource) MarshalJSON ¶
func (l LogProfileResource) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type LogProfileResource.
func (*LogProfileResource) UnmarshalJSON ¶ added in v0.8.0
func (l *LogProfileResource) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type LogProfileResource.
type LogProfileResourcePatch ¶
type LogProfileResourcePatch struct { // The log profile properties for an update operation. Properties *LogProfileProperties // Resource tags Tags map[string]*string }
LogProfileResourcePatch - The log profile resource for patch operations.
func (LogProfileResourcePatch) MarshalJSON ¶
func (l LogProfileResourcePatch) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type LogProfileResourcePatch.
func (*LogProfileResourcePatch) UnmarshalJSON ¶ added in v0.8.0
func (l *LogProfileResourcePatch) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type LogProfileResourcePatch.
type LogProfilesClient ¶
type LogProfilesClient struct {
// contains filtered or unexported fields
}
LogProfilesClient contains the methods for the LogProfiles group. Don't use this type directly, use NewLogProfilesClient() instead.
func NewLogProfilesClient ¶
func NewLogProfilesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*LogProfilesClient, error)
NewLogProfilesClient creates a new instance of LogProfilesClient with the specified values.
- subscriptionID - The ID of the target subscription.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - pass nil to accept the default values.
func (*LogProfilesClient) CreateOrUpdate ¶
func (client *LogProfilesClient) CreateOrUpdate(ctx context.Context, logProfileName string, parameters LogProfileResource, options *LogProfilesClientCreateOrUpdateOptions) (LogProfilesClientCreateOrUpdateResponse, error)
CreateOrUpdate - Create or update a log profile in Azure Monitoring REST API. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2016-03-01
- logProfileName - The name of the log profile.
- parameters - Parameters supplied to the operation.
- options - LogProfilesClientCreateOrUpdateOptions contains the optional parameters for the LogProfilesClient.CreateOrUpdate method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/createOrUpdateLogProfile.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewLogProfilesClient().CreateOrUpdate(ctx, "Rac46PostSwapRG", armmonitor.LogProfileResource{ Location: to.Ptr(""), Tags: map[string]*string{}, Properties: &armmonitor.LogProfileProperties{ Categories: []*string{ to.Ptr("Write"), to.Ptr("Delete"), to.Ptr("Action")}, Locations: []*string{ to.Ptr("global")}, RetentionPolicy: &armmonitor.RetentionPolicy{ Days: to.Ptr[int32](3), Enabled: to.Ptr(true), }, ServiceBusRuleID: to.Ptr(""), StorageAccountID: to.Ptr("/subscriptions/df602c9c-7aa0-407d-a6fb-eb20c8bd1192/resourceGroups/JohnKemTest/providers/Microsoft.Storage/storageAccounts/johnkemtest8162"), }, }, 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.LogProfileResource = armmonitor.LogProfileResource{ // Name: to.Ptr("default"), // Type: to.Ptr(""), // ID: to.Ptr("/subscriptions/df602c9c-7aa0-407d-a6fb-eb20c8bd1192/providers/microsoft.insights/logprofiles/default"), // Location: to.Ptr(""), // Properties: &armmonitor.LogProfileProperties{ // Categories: []*string{ // to.Ptr("Delete"), // to.Ptr("Write"), // to.Ptr("Action")}, // Locations: []*string{ // to.Ptr("global")}, // RetentionPolicy: &armmonitor.RetentionPolicy{ // Days: to.Ptr[int32](3), // Enabled: to.Ptr(true), // }, // ServiceBusRuleID: to.Ptr(""), // StorageAccountID: to.Ptr("/subscriptions/df602c9c-7aa0-407d-a6fb-eb20c8bd1192/resourceGroups/JohnKemTest/providers/Microsoft.Storage/storageAccounts/johnkemtest8162"), // }, // } }
Output:
func (*LogProfilesClient) Delete ¶
func (client *LogProfilesClient) Delete(ctx context.Context, logProfileName string, options *LogProfilesClientDeleteOptions) (LogProfilesClientDeleteResponse, error)
Delete - Deletes the log profile. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2016-03-01
- logProfileName - The name of the log profile.
- options - LogProfilesClientDeleteOptions contains the optional parameters for the LogProfilesClient.Delete method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/deleteLogProfile.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } _, err = clientFactory.NewLogProfilesClient().Delete(ctx, "Rac46PostSwapRG", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } }
Output:
func (*LogProfilesClient) Get ¶
func (client *LogProfilesClient) Get(ctx context.Context, logProfileName string, options *LogProfilesClientGetOptions) (LogProfilesClientGetResponse, error)
Get - Gets the log profile. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2016-03-01
- logProfileName - The name of the log profile.
- options - LogProfilesClientGetOptions contains the optional parameters for the LogProfilesClient.Get method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/getLogProfile.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewLogProfilesClient().Get(ctx, "default", 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.LogProfileResource = armmonitor.LogProfileResource{ // Name: to.Ptr("default"), // Type: to.Ptr(""), // ID: to.Ptr("/subscriptions/df602c9c-7aa0-407d-a6fb-eb20c8bd1192/providers/microsoft.insights/logprofiles/default"), // Location: to.Ptr(""), // Properties: &armmonitor.LogProfileProperties{ // Categories: []*string{ // to.Ptr("Delete"), // to.Ptr("Write"), // to.Ptr("Action")}, // Locations: []*string{ // to.Ptr("global")}, // RetentionPolicy: &armmonitor.RetentionPolicy{ // Days: to.Ptr[int32](3), // Enabled: to.Ptr(true), // }, // ServiceBusRuleID: to.Ptr(""), // StorageAccountID: to.Ptr("/subscriptions/df602c9c-7aa0-407d-a6fb-eb20c8bd1192/resourceGroups/JohnKemTest/providers/Microsoft.Storage/storageAccounts/johnkemtest8162"), // }, // } }
Output:
func (*LogProfilesClient) NewListPager ¶ added in v0.6.0
func (client *LogProfilesClient) NewListPager(options *LogProfilesClientListOptions) *runtime.Pager[LogProfilesClientListResponse]
NewListPager - List the log profiles.
Generated from API version 2016-03-01
- options - LogProfilesClientListOptions contains the optional parameters for the LogProfilesClient.NewListPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/listLogProfile.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewLogProfilesClient().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.LogProfileCollection = armmonitor.LogProfileCollection{ // Value: []*armmonitor.LogProfileResource{ // { // Name: to.Ptr("default"), // Type: to.Ptr(""), // ID: to.Ptr("/subscriptions/df602c9c-7aa0-407d-a6fb-eb20c8bd1192/providers/microsoft.insights/logprofiles/default"), // Location: to.Ptr(""), // Properties: &armmonitor.LogProfileProperties{ // Categories: []*string{ // to.Ptr("Delete"), // to.Ptr("Write"), // to.Ptr("Action")}, // Locations: []*string{ // to.Ptr("global")}, // RetentionPolicy: &armmonitor.RetentionPolicy{ // Days: to.Ptr[int32](3), // Enabled: to.Ptr(true), // }, // ServiceBusRuleID: to.Ptr(""), // StorageAccountID: to.Ptr("/subscriptions/df602c9c-7aa0-407d-a6fb-eb20c8bd1192/resourceGroups/JohnKemTest/providers/Microsoft.Storage/storageAccounts/johnkemtest8162"), // }, // }, // { // Name: to.Ptr("default2"), // Type: to.Ptr(""), // ID: to.Ptr("/subscriptions/df602c9c-7aa0-407d-a6fb-eb20c8bd1192/providers/microsoft.insights/logprofiles/default2"), // Location: to.Ptr(""), // Properties: &armmonitor.LogProfileProperties{ // Categories: []*string{ // to.Ptr("Delete"), // to.Ptr("Write"), // to.Ptr("Action")}, // Locations: []*string{ // to.Ptr("global")}, // RetentionPolicy: &armmonitor.RetentionPolicy{ // Days: to.Ptr[int32](15), // Enabled: to.Ptr(true), // }, // ServiceBusRuleID: to.Ptr(""), // StorageAccountID: to.Ptr("/subscriptions/df602c9c-7aa0-407d-a6fb-eb20c8bd1192/resourceGroups/JohnKemTest/providers/Microsoft.Storage/storageAccounts/johnkemtest8165"), // }, // }}, // } } }
Output:
func (*LogProfilesClient) Update ¶
func (client *LogProfilesClient) Update(ctx context.Context, logProfileName string, logProfilesResource LogProfileResourcePatch, options *LogProfilesClientUpdateOptions) (LogProfilesClientUpdateResponse, error)
Update - Updates an existing LogProfilesResource. To update other fields use the CreateOrUpdate method. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2016-03-01
- logProfileName - The name of the log profile.
- logProfilesResource - Parameters supplied to the operation.
- options - LogProfilesClientUpdateOptions contains the optional parameters for the LogProfilesClient.Update method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/patchLogProfile.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewLogProfilesClient().Update(ctx, "Rac46PostSwapRG", armmonitor.LogProfileResourcePatch{ Properties: &armmonitor.LogProfileProperties{ Categories: []*string{ to.Ptr("Write"), to.Ptr("Delete"), to.Ptr("Action")}, Locations: []*string{ to.Ptr("global")}, RetentionPolicy: &armmonitor.RetentionPolicy{ Days: to.Ptr[int32](3), Enabled: to.Ptr(true), }, ServiceBusRuleID: to.Ptr(""), StorageAccountID: to.Ptr("/subscriptions/df602c9c-7aa0-407d-a6fb-eb20c8bd1192/resourceGroups/JohnKemTest/providers/Microsoft.Storage/storageAccounts/johnkemtest8162"), }, Tags: map[string]*string{ "key1": to.Ptr("value1"), }, }, 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.LogProfileResource = armmonitor.LogProfileResource{ // Name: to.Ptr("default"), // Type: to.Ptr(""), // ID: to.Ptr("/subscriptions/df602c9c-7aa0-407d-a6fb-eb20c8bd1192/providers/microsoft.insights/logprofiles/default"), // Location: to.Ptr(""), // Tags: map[string]*string{ // "key1": to.Ptr("value1"), // }, // Properties: &armmonitor.LogProfileProperties{ // Categories: []*string{ // to.Ptr("Delete"), // to.Ptr("Write"), // to.Ptr("Action")}, // Locations: []*string{ // to.Ptr("global")}, // RetentionPolicy: &armmonitor.RetentionPolicy{ // Days: to.Ptr[int32](3), // Enabled: to.Ptr(true), // }, // ServiceBusRuleID: to.Ptr(""), // StorageAccountID: to.Ptr("/subscriptions/df602c9c-7aa0-407d-a6fb-eb20c8bd1192/resourceGroups/JohnKemTest/providers/Microsoft.Storage/storageAccounts/johnkemtest8162"), // }, // } }
Output:
type LogProfilesClientCreateOrUpdateOptions ¶ added in v0.4.0
type LogProfilesClientCreateOrUpdateOptions struct { }
LogProfilesClientCreateOrUpdateOptions contains the optional parameters for the LogProfilesClient.CreateOrUpdate method.
type LogProfilesClientCreateOrUpdateResponse ¶ added in v0.4.0
type LogProfilesClientCreateOrUpdateResponse struct { // The log profile resource. LogProfileResource }
LogProfilesClientCreateOrUpdateResponse contains the response from method LogProfilesClient.CreateOrUpdate.
type LogProfilesClientDeleteOptions ¶ added in v0.4.0
type LogProfilesClientDeleteOptions struct { }
LogProfilesClientDeleteOptions contains the optional parameters for the LogProfilesClient.Delete method.
type LogProfilesClientDeleteResponse ¶ added in v0.4.0
type LogProfilesClientDeleteResponse struct { }
LogProfilesClientDeleteResponse contains the response from method LogProfilesClient.Delete.
type LogProfilesClientGetOptions ¶ added in v0.4.0
type LogProfilesClientGetOptions struct { }
LogProfilesClientGetOptions contains the optional parameters for the LogProfilesClient.Get method.
type LogProfilesClientGetResponse ¶ added in v0.4.0
type LogProfilesClientGetResponse struct { // The log profile resource. LogProfileResource }
LogProfilesClientGetResponse contains the response from method LogProfilesClient.Get.
type LogProfilesClientListOptions ¶ added in v0.4.0
type LogProfilesClientListOptions struct { }
LogProfilesClientListOptions contains the optional parameters for the LogProfilesClient.NewListPager method.
type LogProfilesClientListResponse ¶ added in v0.4.0
type LogProfilesClientListResponse struct { // Represents a collection of log profiles. LogProfileCollection }
LogProfilesClientListResponse contains the response from method LogProfilesClient.NewListPager.
type LogProfilesClientUpdateOptions ¶ added in v0.4.0
type LogProfilesClientUpdateOptions struct { }
LogProfilesClientUpdateOptions contains the optional parameters for the LogProfilesClient.Update method.
type LogProfilesClientUpdateResponse ¶ added in v0.4.0
type LogProfilesClientUpdateResponse struct { // The log profile resource. LogProfileResource }
LogProfilesClientUpdateResponse contains the response from method LogProfilesClient.Update.
type LogSettings ¶
type LogSettings struct { // REQUIRED; a value indicating whether this log is enabled. Enabled *bool // Name of a Diagnostic Log category for a resource type this setting is applied to. To obtain the list of Diagnostic Log // categories for a resource, first perform a GET diagnostic settings operation. Category *string // Name of a Diagnostic Log category group for a resource type this setting is applied to. To obtain the list of Diagnostic // Log categories for a resource, first perform a GET diagnostic settings // operation. CategoryGroup *string // the retention policy for this log. RetentionPolicy *RetentionPolicy }
LogSettings - Part of MultiTenantDiagnosticSettings. Specifies the settings for a particular log.
func (LogSettings) MarshalJSON ¶ added in v0.8.0
func (l LogSettings) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type LogSettings.
func (*LogSettings) UnmarshalJSON ¶ added in v0.8.0
func (l *LogSettings) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type LogSettings.
type LogicAppReceiver ¶
type LogicAppReceiver struct { // REQUIRED; The callback url where http request sent to. CallbackURL *string // REQUIRED; The name of the logic app receiver. Names must be unique across all receivers within an action group. Name *string // REQUIRED; The azure resource id of the logic app receiver. ResourceID *string // Indicates whether to use common alert schema. UseCommonAlertSchema *bool }
LogicAppReceiver - A logic app receiver.
func (LogicAppReceiver) MarshalJSON ¶ added in v0.8.0
func (l LogicAppReceiver) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type LogicAppReceiver.
func (*LogicAppReceiver) UnmarshalJSON ¶ added in v0.8.0
func (l *LogicAppReceiver) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type LogicAppReceiver.
type LogsIngestionEndpointSpec ¶
type LogsIngestionEndpointSpec struct { // READ-ONLY; The endpoint. This property is READ-ONLY. Endpoint *string }
LogsIngestionEndpointSpec - Definition of the endpoint used for ingesting logs.
func (LogsIngestionEndpointSpec) MarshalJSON ¶ added in v0.8.0
func (l LogsIngestionEndpointSpec) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type LogsIngestionEndpointSpec.
func (*LogsIngestionEndpointSpec) UnmarshalJSON ¶ added in v0.8.0
func (l *LogsIngestionEndpointSpec) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type LogsIngestionEndpointSpec.
type ManagedServiceIdentity ¶ added in v0.9.0
type ManagedServiceIdentity struct { // REQUIRED; Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). Type *ManagedServiceIdentityType // The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM // resource ids in the form: // '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. // The dictionary values can be empty objects ({}) in // requests. UserAssignedIdentities map[string]*UserAssignedIdentity // READ-ONLY; The service principal ID of the system assigned identity. This property will only be provided for a system assigned // identity. PrincipalID *string // READ-ONLY; The tenant ID of the system assigned identity. This property will only be provided for a system assigned identity. TenantID *string }
ManagedServiceIdentity - Managed service identity (system assigned and/or user assigned identities)
func (ManagedServiceIdentity) MarshalJSON ¶ added in v0.9.0
func (m ManagedServiceIdentity) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ManagedServiceIdentity.
func (*ManagedServiceIdentity) UnmarshalJSON ¶ added in v0.9.0
func (m *ManagedServiceIdentity) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ManagedServiceIdentity.
type ManagedServiceIdentityType ¶ added in v0.9.0
type ManagedServiceIdentityType string
ManagedServiceIdentityType - Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed).
const ( ManagedServiceIdentityTypeNone ManagedServiceIdentityType = "None" ManagedServiceIdentityTypeSystemAssigned ManagedServiceIdentityType = "SystemAssigned" ManagedServiceIdentityTypeSystemAssignedUserAssigned ManagedServiceIdentityType = "SystemAssigned,UserAssigned" ManagedServiceIdentityTypeUserAssigned ManagedServiceIdentityType = "UserAssigned" )
func PossibleManagedServiceIdentityTypeValues ¶ added in v0.9.0
func PossibleManagedServiceIdentityTypeValues() []ManagedServiceIdentityType
PossibleManagedServiceIdentityTypeValues returns the possible values for the ManagedServiceIdentityType const type.
type ManagementEventAggregationCondition ¶
type ManagementEventAggregationCondition struct { // the condition operator. Operator *ConditionOperator // The threshold value that activates the alert. Threshold *float64 // the period of time (in ISO 8601 duration format) that is used to monitor alert activity based on the threshold. If specified // then it must be between 5 minutes and 1 day. WindowSize *string }
ManagementEventAggregationCondition - How the data that is collected should be combined over time.
func (ManagementEventAggregationCondition) MarshalJSON ¶ added in v0.8.0
func (m ManagementEventAggregationCondition) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ManagementEventAggregationCondition.
func (*ManagementEventAggregationCondition) UnmarshalJSON ¶ added in v0.8.0
func (m *ManagementEventAggregationCondition) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ManagementEventAggregationCondition.
type ManagementEventRuleCondition ¶
type ManagementEventRuleCondition struct { // REQUIRED; specifies the type of condition. This can be one of three types: ManagementEventRuleCondition (occurrences of // management events), LocationThresholdRuleCondition (based on the number of failures of a // web test), and ThresholdRuleCondition (based on the threshold of a metric). ODataType *string // How the data that is collected should be combined over time and when the alert is activated. Note that for management event // alerts aggregation is optional – if it is not provided then any event will // cause the alert to activate. Aggregation *ManagementEventAggregationCondition // the resource from which the rule collects its data. For this type dataSource will always be of type RuleMetricDataSource. DataSource RuleDataSourceClassification }
ManagementEventRuleCondition - A management event rule condition.
func (*ManagementEventRuleCondition) GetRuleCondition ¶ added in v0.4.0
func (m *ManagementEventRuleCondition) GetRuleCondition() *RuleCondition
GetRuleCondition implements the RuleConditionClassification interface for type ManagementEventRuleCondition.
func (ManagementEventRuleCondition) MarshalJSON ¶
func (m ManagementEventRuleCondition) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ManagementEventRuleCondition.
func (*ManagementEventRuleCondition) UnmarshalJSON ¶
func (m *ManagementEventRuleCondition) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ManagementEventRuleCondition.
type Metadata ¶ added in v0.5.0
type Metadata struct { // READ-ONLY; Azure offering managing this resource on-behalf-of customer. ProvisionedBy *string // READ-ONLY; Resource Id of azure offering managing this resource on-behalf-of customer. ProvisionedByResourceID *string }
Metadata about the resource
func (Metadata) MarshalJSON ¶ added in v0.8.0
MarshalJSON implements the json.Marshaller interface for type Metadata.
func (*Metadata) UnmarshalJSON ¶ added in v0.8.0
UnmarshalJSON implements the json.Unmarshaller interface for type Metadata.
type MetadataValue ¶
type MetadataValue struct { // the name of the metadata. Name *LocalizableString // the value of the metadata. Value *string }
MetadataValue - Represents a metric metadata value.
func (MetadataValue) MarshalJSON ¶ added in v0.8.0
func (m MetadataValue) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type MetadataValue.
func (*MetadataValue) UnmarshalJSON ¶ added in v0.8.0
func (m *MetadataValue) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type MetadataValue.
type Metric ¶
type Metric struct { // REQUIRED; the metric Id. ID *string // REQUIRED; the name and the display name of the metric, i.e. it is localizable string. Name *LocalizableString // REQUIRED; the time series returned when a data query is performed. Timeseries []*TimeSeriesElement // REQUIRED; the resource type of the metric resource. Type *string // REQUIRED; The unit of the metric. Unit *Unit // Detailed description of this metric. DisplayDescription *string // 'Success' or the error details on query failures for this metric. ErrorCode *string // Error message encountered querying this specific metric. ErrorMessage *string }
Metric - The result data of a query.
func (Metric) MarshalJSON ¶
MarshalJSON implements the json.Marshaller interface for type Metric.
func (*Metric) UnmarshalJSON ¶ added in v0.8.0
UnmarshalJSON implements the json.Unmarshaller interface for type Metric.
type MetricAggregationType ¶ added in v0.9.0
type MetricAggregationType string
MetricAggregationType - the aggregation type of the metric.
const ( MetricAggregationTypeAverage MetricAggregationType = "Average" MetricAggregationTypeCount MetricAggregationType = "Count" MetricAggregationTypeMaximum MetricAggregationType = "Maximum" MetricAggregationTypeMinimum MetricAggregationType = "Minimum" MetricAggregationTypeNone MetricAggregationType = "None" MetricAggregationTypeTotal MetricAggregationType = "Total" )
func PossibleMetricAggregationTypeValues ¶ added in v0.9.0
func PossibleMetricAggregationTypeValues() []MetricAggregationType
PossibleMetricAggregationTypeValues returns the possible values for the MetricAggregationType const type.
type MetricAlertAction ¶
type MetricAlertAction struct { // the id of the action group to use. ActionGroupID *string // This field allows specifying custom properties, which would be appended to the alert payload sent as input to the webhook. WebHookProperties map[string]*string }
MetricAlertAction - An alert action.
func (MetricAlertAction) MarshalJSON ¶
func (m MetricAlertAction) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type MetricAlertAction.
func (*MetricAlertAction) UnmarshalJSON ¶ added in v0.8.0
func (m *MetricAlertAction) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type MetricAlertAction.
type MetricAlertCriteria ¶
type MetricAlertCriteria struct { // REQUIRED; specifies the type of the alert criteria. ODataType *Odatatype // OPTIONAL; Contains additional key/value pairs not defined in the schema. AdditionalProperties map[string]any }
MetricAlertCriteria - The rule criteria that defines the conditions of the alert rule.
func (*MetricAlertCriteria) GetMetricAlertCriteria ¶
func (m *MetricAlertCriteria) GetMetricAlertCriteria() *MetricAlertCriteria
GetMetricAlertCriteria implements the MetricAlertCriteriaClassification interface for type MetricAlertCriteria.
func (MetricAlertCriteria) MarshalJSON ¶ added in v0.4.0
func (m MetricAlertCriteria) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type MetricAlertCriteria.
func (*MetricAlertCriteria) UnmarshalJSON ¶
func (m *MetricAlertCriteria) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type MetricAlertCriteria.
type MetricAlertCriteriaClassification ¶
type MetricAlertCriteriaClassification interface { // GetMetricAlertCriteria returns the MetricAlertCriteria content of the underlying type. GetMetricAlertCriteria() *MetricAlertCriteria }
MetricAlertCriteriaClassification provides polymorphic access to related types. Call the interface's GetMetricAlertCriteria() method to access the common type. Use a type switch to determine the concrete type. The possible types are: - *MetricAlertCriteria, *MetricAlertMultipleResourceMultipleMetricCriteria, *MetricAlertSingleResourceMultipleMetricCriteria, - *WebtestLocationAvailabilityCriteria
type MetricAlertMultipleResourceMultipleMetricCriteria ¶
type MetricAlertMultipleResourceMultipleMetricCriteria struct { // REQUIRED; specifies the type of the alert criteria. ODataType *Odatatype // OPTIONAL; Contains additional key/value pairs not defined in the schema. AdditionalProperties map[string]any // the list of multiple metric criteria for this 'all of' operation. AllOf []MultiMetricCriteriaClassification }
MetricAlertMultipleResourceMultipleMetricCriteria - Specifies the metric alert criteria for multiple resource that has multiple metric criteria.
func (*MetricAlertMultipleResourceMultipleMetricCriteria) GetMetricAlertCriteria ¶ added in v0.4.0
func (m *MetricAlertMultipleResourceMultipleMetricCriteria) GetMetricAlertCriteria() *MetricAlertCriteria
GetMetricAlertCriteria implements the MetricAlertCriteriaClassification interface for type MetricAlertMultipleResourceMultipleMetricCriteria.
func (MetricAlertMultipleResourceMultipleMetricCriteria) MarshalJSON ¶
func (m MetricAlertMultipleResourceMultipleMetricCriteria) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type MetricAlertMultipleResourceMultipleMetricCriteria.
func (*MetricAlertMultipleResourceMultipleMetricCriteria) UnmarshalJSON ¶
func (m *MetricAlertMultipleResourceMultipleMetricCriteria) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type MetricAlertMultipleResourceMultipleMetricCriteria.
type MetricAlertProperties ¶
type MetricAlertProperties struct { // REQUIRED; defines the specific alert criteria information. Criteria MetricAlertCriteriaClassification // REQUIRED; the flag that indicates whether the metric alert is enabled. Enabled *bool // REQUIRED; how often the metric alert is evaluated represented in ISO 8601 duration format. EvaluationFrequency *string // REQUIRED; the list of resource id's that this metric alert is scoped to. Scopes []*string // REQUIRED; Alert severity {0, 1, 2, 3, 4} Severity *int32 // REQUIRED; the period of time (in ISO 8601 duration format) that is used to monitor alert activity based on the threshold. WindowSize *string // the array of actions that are performed when the alert rule becomes active, and when an alert condition is resolved. Actions []*MetricAlertAction // the flag that indicates whether the alert should be auto resolved or not. The default is true. AutoMitigate *bool // the description of the metric alert that will be included in the alert email. Description *string // the region of the target resource(s) on which the alert is created/updated. Mandatory if the scope contains a subscription, // resource group, or more than one resource. TargetResourceRegion *string // the resource type of the target resource(s) on which the alert is created/updated. Mandatory if the scope contains a subscription, // resource group, or more than one resource. TargetResourceType *string // READ-ONLY; the value indicating whether this alert rule is migrated. IsMigrated *bool // READ-ONLY; Last time the rule was updated in ISO8601 format. LastUpdatedTime *time.Time }
MetricAlertProperties - An alert rule.
func (MetricAlertProperties) MarshalJSON ¶
func (m MetricAlertProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type MetricAlertProperties.
func (*MetricAlertProperties) UnmarshalJSON ¶
func (m *MetricAlertProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type MetricAlertProperties.
type MetricAlertPropertiesPatch ¶
type MetricAlertPropertiesPatch struct { // the array of actions that are performed when the alert rule becomes active, and when an alert condition is resolved. Actions []*MetricAlertAction // the flag that indicates whether the alert should be auto resolved or not. The default is true. AutoMitigate *bool // defines the specific alert criteria information. Criteria MetricAlertCriteriaClassification // the description of the metric alert that will be included in the alert email. Description *string // the flag that indicates whether the metric alert is enabled. Enabled *bool // how often the metric alert is evaluated represented in ISO 8601 duration format. EvaluationFrequency *string // the list of resource id's that this metric alert is scoped to. Scopes []*string // Alert severity {0, 1, 2, 3, 4} Severity *int32 // the region of the target resource(s) on which the alert is created/updated. Mandatory for MultipleResourceMultipleMetricCriteria. TargetResourceRegion *string // the resource type of the target resource(s) on which the alert is created/updated. Mandatory for MultipleResourceMultipleMetricCriteria. TargetResourceType *string // the period of time (in ISO 8601 duration format) that is used to monitor alert activity based on the threshold. WindowSize *string // READ-ONLY; the value indicating whether this alert rule is migrated. IsMigrated *bool // READ-ONLY; Last time the rule was updated in ISO8601 format. LastUpdatedTime *time.Time }
MetricAlertPropertiesPatch - An alert rule properties for patch.
func (MetricAlertPropertiesPatch) MarshalJSON ¶
func (m MetricAlertPropertiesPatch) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type MetricAlertPropertiesPatch.
func (*MetricAlertPropertiesPatch) UnmarshalJSON ¶
func (m *MetricAlertPropertiesPatch) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type MetricAlertPropertiesPatch.
type MetricAlertResource ¶
type MetricAlertResource struct { // REQUIRED; Resource location Location *string // REQUIRED; The alert rule properties of the resource. Properties *MetricAlertProperties // Resource tags Tags map[string]*string // READ-ONLY; Azure resource Id ID *string // READ-ONLY; Azure resource name Name *string // READ-ONLY; Azure resource type Type *string }
MetricAlertResource - The metric alert resource.
func (MetricAlertResource) MarshalJSON ¶
func (m MetricAlertResource) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type MetricAlertResource.
func (*MetricAlertResource) UnmarshalJSON ¶ added in v0.8.0
func (m *MetricAlertResource) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type MetricAlertResource.
type MetricAlertResourceCollection ¶
type MetricAlertResourceCollection struct { // the values for the alert rule resources. Value []*MetricAlertResource }
MetricAlertResourceCollection - Represents a collection of alert rule resources.
func (MetricAlertResourceCollection) MarshalJSON ¶
func (m MetricAlertResourceCollection) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type MetricAlertResourceCollection.
func (*MetricAlertResourceCollection) UnmarshalJSON ¶ added in v0.8.0
func (m *MetricAlertResourceCollection) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type MetricAlertResourceCollection.
type MetricAlertResourcePatch ¶
type MetricAlertResourcePatch struct { // The alert rule properties of the resource. Properties *MetricAlertPropertiesPatch // Resource tags Tags map[string]*string }
MetricAlertResourcePatch - The metric alert resource for patch operations.
func (MetricAlertResourcePatch) MarshalJSON ¶
func (m MetricAlertResourcePatch) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type MetricAlertResourcePatch.
func (*MetricAlertResourcePatch) UnmarshalJSON ¶ added in v0.8.0
func (m *MetricAlertResourcePatch) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type MetricAlertResourcePatch.
type MetricAlertSingleResourceMultipleMetricCriteria ¶
type MetricAlertSingleResourceMultipleMetricCriteria struct { // REQUIRED; specifies the type of the alert criteria. ODataType *Odatatype // OPTIONAL; Contains additional key/value pairs not defined in the schema. AdditionalProperties map[string]any // The list of metric criteria for this 'all of' operation. AllOf []*MetricCriteria }
MetricAlertSingleResourceMultipleMetricCriteria - Specifies the metric alert criteria for a single resource that has multiple metric criteria.
func (*MetricAlertSingleResourceMultipleMetricCriteria) GetMetricAlertCriteria ¶ added in v0.4.0
func (m *MetricAlertSingleResourceMultipleMetricCriteria) GetMetricAlertCriteria() *MetricAlertCriteria
GetMetricAlertCriteria implements the MetricAlertCriteriaClassification interface for type MetricAlertSingleResourceMultipleMetricCriteria.
func (MetricAlertSingleResourceMultipleMetricCriteria) MarshalJSON ¶
func (m MetricAlertSingleResourceMultipleMetricCriteria) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type MetricAlertSingleResourceMultipleMetricCriteria.
func (*MetricAlertSingleResourceMultipleMetricCriteria) UnmarshalJSON ¶
func (m *MetricAlertSingleResourceMultipleMetricCriteria) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type MetricAlertSingleResourceMultipleMetricCriteria.
type MetricAlertStatus ¶
type MetricAlertStatus struct { // The alert rule arm id. ID *string // The status name. Name *string // The alert status properties of the metric alert status. Properties *MetricAlertStatusProperties // The extended resource type name. Type *string }
MetricAlertStatus - An alert status.
func (MetricAlertStatus) MarshalJSON ¶ added in v0.8.0
func (m MetricAlertStatus) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type MetricAlertStatus.
func (*MetricAlertStatus) UnmarshalJSON ¶ added in v0.8.0
func (m *MetricAlertStatus) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type MetricAlertStatus.
type MetricAlertStatusCollection ¶
type MetricAlertStatusCollection struct { // the values for the alert rule resources. Value []*MetricAlertStatus }
MetricAlertStatusCollection - Represents a collection of alert rule resources.
func (MetricAlertStatusCollection) MarshalJSON ¶
func (m MetricAlertStatusCollection) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type MetricAlertStatusCollection.
func (*MetricAlertStatusCollection) UnmarshalJSON ¶ added in v0.8.0
func (m *MetricAlertStatusCollection) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type MetricAlertStatusCollection.
type MetricAlertStatusProperties ¶
type MetricAlertStatusProperties struct { // An object describing the type of the dimensions. Dimensions map[string]*string // status value Status *string // UTC time when the status was checked. Timestamp *time.Time }
MetricAlertStatusProperties - An alert status properties.
func (MetricAlertStatusProperties) MarshalJSON ¶
func (m MetricAlertStatusProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type MetricAlertStatusProperties.
func (*MetricAlertStatusProperties) UnmarshalJSON ¶
func (m *MetricAlertStatusProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type MetricAlertStatusProperties.
type MetricAlertsClient ¶
type MetricAlertsClient struct {
// contains filtered or unexported fields
}
MetricAlertsClient contains the methods for the MetricAlerts group. Don't use this type directly, use NewMetricAlertsClient() instead.
func NewMetricAlertsClient ¶
func NewMetricAlertsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*MetricAlertsClient, error)
NewMetricAlertsClient creates a new instance of MetricAlertsClient with the specified values.
- subscriptionID - The ID of the target subscription.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - pass nil to accept the default values.
func (*MetricAlertsClient) CreateOrUpdate ¶
func (client *MetricAlertsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, ruleName string, parameters MetricAlertResource, options *MetricAlertsClientCreateOrUpdateOptions) (MetricAlertsClientCreateOrUpdateResponse, error)
CreateOrUpdate - Create or update an metric alert definition. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2018-03-01
- resourceGroupName - The name of the resource group. The name is case insensitive.
- ruleName - The name of the rule.
- parameters - The parameters of the rule to create or update.
- options - MetricAlertsClientCreateOrUpdateOptions contains the optional parameters for the MetricAlertsClient.CreateOrUpdate method.
Example (CreateOrUpdateADynamicAlertRuleForMultipleResources) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/createOrUpdateDynamicMetricAlertMultipleResource.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewMetricAlertsClient().CreateOrUpdate(ctx, "gigtest", "MetricAlertOnMultipleResources", armmonitor.MetricAlertResource{ Location: to.Ptr("global"), Tags: map[string]*string{}, Properties: &armmonitor.MetricAlertProperties{ Description: to.Ptr("This is the description of the rule1"), Actions: []*armmonitor.MetricAlertAction{ { ActionGroupID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2"), WebHookProperties: map[string]*string{ "key11": to.Ptr("value11"), "key12": to.Ptr("value12"), }, }}, AutoMitigate: to.Ptr(true), Criteria: &armmonitor.MetricAlertMultipleResourceMultipleMetricCriteria{ ODataType: to.Ptr(armmonitor.OdatatypeMicrosoftAzureMonitorMultipleResourceMultipleMetricCriteria), AllOf: []armmonitor.MultiMetricCriteriaClassification{ &armmonitor.DynamicMetricCriteria{ Name: to.Ptr("High_CPU_80"), CriterionType: to.Ptr(armmonitor.CriterionTypeDynamicThresholdCriterion), Dimensions: []*armmonitor.MetricDimension{}, MetricName: to.Ptr("Percentage CPU"), MetricNamespace: to.Ptr("microsoft.compute/virtualmachines"), TimeAggregation: to.Ptr(armmonitor.AggregationTypeEnumAverage), AlertSensitivity: to.Ptr(armmonitor.DynamicThresholdSensitivityMedium), FailingPeriods: &armmonitor.DynamicThresholdFailingPeriods{ MinFailingPeriodsToAlert: to.Ptr[float32](4), NumberOfEvaluationPeriods: to.Ptr[float32](4), }, Operator: to.Ptr(armmonitor.DynamicThresholdOperatorGreaterOrLessThan), }}, }, Enabled: to.Ptr(true), EvaluationFrequency: to.Ptr("PT1M"), Scopes: []*string{ to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme1"), to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme2")}, Severity: to.Ptr[int32](3), TargetResourceRegion: to.Ptr("southcentralus"), TargetResourceType: to.Ptr("Microsoft.Compute/virtualMachines"), WindowSize: to.Ptr("PT15M"), }, }, 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.MetricAlertResource = armmonitor.MetricAlertResource{ // Type: to.Ptr("Microsoft.Insights/metricAlerts"), // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/gigtest/providers/providers/microsoft.insights/metricalerts/MetricAlertOnMultipleResources"), // Location: to.Ptr("global"), // Tags: map[string]*string{ // "hidden-link:/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/leoalerttest": to.Ptr("Resource"), // }, // Properties: &armmonitor.MetricAlertProperties{ // Description: to.Ptr("This is the description of the rule1"), // Actions: []*armmonitor.MetricAlertAction{ // { // ActionGroupID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2"), // WebHookProperties: map[string]*string{ // "key11": to.Ptr("value11"), // "key12": to.Ptr("value12"), // }, // }}, // AutoMitigate: to.Ptr(true), // Criteria: &armmonitor.MetricAlertMultipleResourceMultipleMetricCriteria{ // ODataType: to.Ptr(armmonitor.OdatatypeMicrosoftAzureMonitorMultipleResourceMultipleMetricCriteria), // AllOf: []armmonitor.MultiMetricCriteriaClassification{ // &armmonitor.DynamicMetricCriteria{ // Name: to.Ptr("High_CPU_80"), // CriterionType: to.Ptr(armmonitor.CriterionTypeDynamicThresholdCriterion), // Dimensions: []*armmonitor.MetricDimension{ // }, // MetricName: to.Ptr("Percentage CPU"), // MetricNamespace: to.Ptr("microsoft.compute/virtualmachines"), // TimeAggregation: to.Ptr(armmonitor.AggregationTypeEnumAverage), // AlertSensitivity: to.Ptr(armmonitor.DynamicThresholdSensitivityMedium), // FailingPeriods: &armmonitor.DynamicThresholdFailingPeriods{ // MinFailingPeriodsToAlert: to.Ptr[float32](4), // NumberOfEvaluationPeriods: to.Ptr[float32](4), // }, // Operator: to.Ptr(armmonitor.DynamicThresholdOperatorGreaterOrLessThan), // }}, // }, // Enabled: to.Ptr(true), // EvaluationFrequency: to.Ptr("PT1M"), // Scopes: []*string{ // to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme1"), // to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme2")}, // Severity: to.Ptr[int32](3), // TargetResourceRegion: to.Ptr("southcentralus"), // TargetResourceType: to.Ptr("Microsoft.Compute/virtualMachines"), // WindowSize: to.Ptr("PT15M"), // }, // } }
Output:
Example (CreateOrUpdateADynamicAlertRuleForSingleResource) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/createOrUpdateDynamicMetricAlertSingleResource.json
package main import ( "context" "log" "time" "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/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewMetricAlertsClient().CreateOrUpdate(ctx, "gigtest", "chiricutin", armmonitor.MetricAlertResource{ Location: to.Ptr("global"), Tags: map[string]*string{}, Properties: &armmonitor.MetricAlertProperties{ Description: to.Ptr("This is the description of the rule1"), Actions: []*armmonitor.MetricAlertAction{ { ActionGroupID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2"), WebHookProperties: map[string]*string{ "key11": to.Ptr("value11"), "key12": to.Ptr("value12"), }, }}, AutoMitigate: to.Ptr(true), Criteria: &armmonitor.MetricAlertMultipleResourceMultipleMetricCriteria{ ODataType: to.Ptr(armmonitor.OdatatypeMicrosoftAzureMonitorMultipleResourceMultipleMetricCriteria), AllOf: []armmonitor.MultiMetricCriteriaClassification{ &armmonitor.DynamicMetricCriteria{ Name: to.Ptr("High_CPU_80"), CriterionType: to.Ptr(armmonitor.CriterionTypeDynamicThresholdCriterion), Dimensions: []*armmonitor.MetricDimension{}, MetricName: to.Ptr("Percentage CPU"), MetricNamespace: to.Ptr("microsoft.compute/virtualmachines"), TimeAggregation: to.Ptr(armmonitor.AggregationTypeEnumAverage), AlertSensitivity: to.Ptr(armmonitor.DynamicThresholdSensitivityMedium), FailingPeriods: &armmonitor.DynamicThresholdFailingPeriods{ MinFailingPeriodsToAlert: to.Ptr[float32](4), NumberOfEvaluationPeriods: to.Ptr[float32](4), }, IgnoreDataBefore: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-04-04T21:00:00.000Z"); return t }()), Operator: to.Ptr(armmonitor.DynamicThresholdOperatorGreaterOrLessThan), }}, }, Enabled: to.Ptr(true), EvaluationFrequency: to.Ptr("PT1M"), Scopes: []*string{ to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme")}, Severity: to.Ptr[int32](3), WindowSize: to.Ptr("PT15M"), }, }, 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.MetricAlertResource = armmonitor.MetricAlertResource{ // Type: to.Ptr("Microsoft.Insights/metricAlerts"), // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/gigtest/providers/providers/microsoft.insights/metricalerts/chiricutin"), // Location: to.Ptr("global"), // Tags: map[string]*string{ // "hidden-link:/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/leoalerttest": to.Ptr("Resource"), // }, // Properties: &armmonitor.MetricAlertProperties{ // Description: to.Ptr("This is the description of the rule1"), // Actions: []*armmonitor.MetricAlertAction{ // { // ActionGroupID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2"), // WebHookProperties: map[string]*string{ // "key11": to.Ptr("value11"), // "key12": to.Ptr("value12"), // }, // }}, // AutoMitigate: to.Ptr(true), // Criteria: &armmonitor.MetricAlertMultipleResourceMultipleMetricCriteria{ // ODataType: to.Ptr(armmonitor.OdatatypeMicrosoftAzureMonitorMultipleResourceMultipleMetricCriteria), // AllOf: []armmonitor.MultiMetricCriteriaClassification{ // &armmonitor.DynamicMetricCriteria{ // Name: to.Ptr("High_CPU_80"), // CriterionType: to.Ptr(armmonitor.CriterionTypeDynamicThresholdCriterion), // Dimensions: []*armmonitor.MetricDimension{ // }, // MetricName: to.Ptr("Percentage CPU"), // MetricNamespace: to.Ptr("microsoft.compute/virtualmachines"), // TimeAggregation: to.Ptr(armmonitor.AggregationTypeEnumAverage), // AlertSensitivity: to.Ptr(armmonitor.DynamicThresholdSensitivityMedium), // FailingPeriods: &armmonitor.DynamicThresholdFailingPeriods{ // MinFailingPeriodsToAlert: to.Ptr[float32](4), // NumberOfEvaluationPeriods: to.Ptr[float32](4), // }, // IgnoreDataBefore: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-04-04T21:00:00.000Z"); return t}()), // Operator: to.Ptr(armmonitor.DynamicThresholdOperatorGreaterOrLessThan), // }}, // }, // Enabled: to.Ptr(true), // EvaluationFrequency: to.Ptr("PT1M"), // Scopes: []*string{ // to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme")}, // Severity: to.Ptr[int32](3), // TargetResourceRegion: to.Ptr("southcentralus"), // TargetResourceType: to.Ptr("Microsoft.Compute/virtualMachines"), // WindowSize: to.Ptr("PT15M"), // }, // } }
Output:
Example (CreateOrUpdateAWebTestAlertRule) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/createOrUpdateWebTestMetricAlert.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewMetricAlertsClient().CreateOrUpdate(ctx, "rg-example", "webtest-name-example", armmonitor.MetricAlertResource{ Location: to.Ptr("global"), Tags: map[string]*string{ "hidden-link:/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/components/webtest-name-example": to.Ptr("Resource"), "hidden-link:/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/webtests/component-example": to.Ptr("Resource"), }, Properties: &armmonitor.MetricAlertProperties{ Description: to.Ptr("Automatically created alert rule for availability test \"component-example\" a"), Actions: []*armmonitor.MetricAlertAction{}, Criteria: &armmonitor.WebtestLocationAvailabilityCriteria{ ODataType: to.Ptr(armmonitor.OdatatypeMicrosoftAzureMonitorWebtestLocationAvailabilityCriteria), ComponentID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/components/webtest-name-example"), FailedLocationCount: to.Ptr[float32](2), WebTestID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/webtests/component-example"), }, Enabled: to.Ptr(true), EvaluationFrequency: to.Ptr("PT1M"), Scopes: []*string{ to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/webtests/component-example"), to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/components/webtest-name-example")}, Severity: to.Ptr[int32](4), WindowSize: to.Ptr("PT15M"), }, }, 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.MetricAlertResource = armmonitor.MetricAlertResource{ // Name: to.Ptr("webtest-name-example"), // Type: to.Ptr("Microsoft.Insights/metricAlerts"), // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/metricalerts/webtest-name-example"), // Location: to.Ptr("global"), // Tags: map[string]*string{ // "hidden-link:/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/components/component-example": to.Ptr("Resource"), // "hidden-link:/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/webtests/webtest-name-example": to.Ptr("Resource"), // }, // Properties: &armmonitor.MetricAlertProperties{ // Description: to.Ptr("Automatically created alert rule for availability test \"webtest-name-example\" a"), // Actions: []*armmonitor.MetricAlertAction{ // }, // Criteria: &armmonitor.WebtestLocationAvailabilityCriteria{ // ODataType: to.Ptr(armmonitor.OdatatypeMicrosoftAzureMonitorWebtestLocationAvailabilityCriteria), // ComponentID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/components/component-example"), // FailedLocationCount: to.Ptr[float32](2), // WebTestID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/webtests/webtest-name-example"), // }, // Enabled: to.Ptr(true), // EvaluationFrequency: to.Ptr("PT1M"), // Scopes: []*string{ // to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/webtests/webtest-name-example"), // to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/components/component-example")}, // Severity: to.Ptr[int32](4), // WindowSize: to.Ptr("PT15M"), // }, // } }
Output:
Example (CreateOrUpdateAnAlertRuleForMultipleResource) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/createOrUpdateMetricAlertMultipleResource.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewMetricAlertsClient().CreateOrUpdate(ctx, "gigtest", "MetricAlertOnMultipleResources", armmonitor.MetricAlertResource{ Location: to.Ptr("global"), Tags: map[string]*string{}, Properties: &armmonitor.MetricAlertProperties{ Description: to.Ptr("This is the description of the rule1"), Actions: []*armmonitor.MetricAlertAction{ { ActionGroupID: to.Ptr("/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2"), WebHookProperties: map[string]*string{ "key11": to.Ptr("value11"), "key12": to.Ptr("value12"), }, }}, AutoMitigate: to.Ptr(true), Criteria: &armmonitor.MetricAlertMultipleResourceMultipleMetricCriteria{ ODataType: to.Ptr(armmonitor.OdatatypeMicrosoftAzureMonitorMultipleResourceMultipleMetricCriteria), AllOf: []armmonitor.MultiMetricCriteriaClassification{ &armmonitor.MetricCriteria{ Name: to.Ptr("High_CPU_80"), CriterionType: to.Ptr(armmonitor.CriterionTypeStaticThresholdCriterion), Dimensions: []*armmonitor.MetricDimension{}, MetricName: to.Ptr("Percentage CPU"), MetricNamespace: to.Ptr("microsoft.compute/virtualmachines"), TimeAggregation: to.Ptr(armmonitor.AggregationTypeEnumAverage), Operator: to.Ptr(armmonitor.OperatorGreaterThan), Threshold: to.Ptr[float64](80.5), }}, }, Enabled: to.Ptr(true), EvaluationFrequency: to.Ptr("PT1M"), Scopes: []*string{ to.Ptr("/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme1"), to.Ptr("/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme2")}, Severity: to.Ptr[int32](3), TargetResourceRegion: to.Ptr("southcentralus"), TargetResourceType: to.Ptr("Microsoft.Compute/virtualMachines"), WindowSize: to.Ptr("PT15M"), }, }, 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.MetricAlertResource = armmonitor.MetricAlertResource{ // Type: to.Ptr("Microsoft.Insights/metricAlerts"), // ID: to.Ptr("/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/providers/microsoft.insights/metricalerts/MetricAlertOnMultipleResources"), // Location: to.Ptr("global"), // Tags: map[string]*string{ // "hidden-link:/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/leoalerttest": to.Ptr("Resource"), // }, // Properties: &armmonitor.MetricAlertProperties{ // Description: to.Ptr("This is the description of the rule1"), // Actions: []*armmonitor.MetricAlertAction{ // { // ActionGroupID: to.Ptr("/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2"), // WebHookProperties: map[string]*string{ // "key11": to.Ptr("value11"), // "key12": to.Ptr("value12"), // }, // }}, // AutoMitigate: to.Ptr(true), // Criteria: &armmonitor.MetricAlertMultipleResourceMultipleMetricCriteria{ // ODataType: to.Ptr(armmonitor.OdatatypeMicrosoftAzureMonitorMultipleResourceMultipleMetricCriteria), // AllOf: []armmonitor.MultiMetricCriteriaClassification{ // &armmonitor.MetricCriteria{ // Name: to.Ptr("High_CPU_80"), // CriterionType: to.Ptr(armmonitor.CriterionTypeStaticThresholdCriterion), // Dimensions: []*armmonitor.MetricDimension{ // }, // MetricName: to.Ptr("Percentage CPU"), // MetricNamespace: to.Ptr("microsoft.compute/virtualmachines"), // TimeAggregation: to.Ptr(armmonitor.AggregationTypeEnumAverage), // Operator: to.Ptr(armmonitor.OperatorGreaterThan), // Threshold: to.Ptr[float64](80.5), // }}, // }, // Enabled: to.Ptr(true), // EvaluationFrequency: to.Ptr("PT1M"), // Scopes: []*string{ // to.Ptr("/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme1"), // to.Ptr("/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme2")}, // Severity: to.Ptr[int32](3), // TargetResourceRegion: to.Ptr("southcentralus"), // TargetResourceType: to.Ptr("Microsoft.Compute/virtualMachines"), // WindowSize: to.Ptr("PT15M"), // }, // } }
Output:
Example (CreateOrUpdateAnAlertRuleForSingleResource) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/createOrUpdateMetricAlertSingleResource.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewMetricAlertsClient().CreateOrUpdate(ctx, "gigtest", "chiricutin", armmonitor.MetricAlertResource{ Location: to.Ptr("global"), Tags: map[string]*string{}, Properties: &armmonitor.MetricAlertProperties{ Description: to.Ptr("This is the description of the rule1"), Actions: []*armmonitor.MetricAlertAction{ { ActionGroupID: to.Ptr("/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2"), WebHookProperties: map[string]*string{ "key11": to.Ptr("value11"), "key12": to.Ptr("value12"), }, }}, AutoMitigate: to.Ptr(true), Criteria: &armmonitor.MetricAlertSingleResourceMultipleMetricCriteria{ ODataType: to.Ptr(armmonitor.OdatatypeMicrosoftAzureMonitorSingleResourceMultipleMetricCriteria), AllOf: []*armmonitor.MetricCriteria{ { Name: to.Ptr("High_CPU_80"), CriterionType: to.Ptr(armmonitor.CriterionTypeStaticThresholdCriterion), Dimensions: []*armmonitor.MetricDimension{}, MetricName: to.Ptr("\\Processor(_Total)\\% Processor Time"), TimeAggregation: to.Ptr(armmonitor.AggregationTypeEnumAverage), Operator: to.Ptr(armmonitor.OperatorGreaterThan), Threshold: to.Ptr[float64](80.5), }}, }, Enabled: to.Ptr(true), EvaluationFrequency: to.Ptr("Pt1m"), Scopes: []*string{ to.Ptr("/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme")}, Severity: to.Ptr[int32](3), WindowSize: to.Ptr("Pt15m"), }, }, 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.MetricAlertResource = armmonitor.MetricAlertResource{ // Type: to.Ptr("Microsoft.Insights/metricAlerts"), // ID: to.Ptr("/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/providers/microsoft.insights/metricalerts/chiricutin"), // Location: to.Ptr("global"), // Tags: map[string]*string{ // "hidden-link:/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/leoalerttest": to.Ptr("Resource"), // }, // Properties: &armmonitor.MetricAlertProperties{ // Description: to.Ptr("This is the description of the rule1"), // Actions: []*armmonitor.MetricAlertAction{ // { // ActionGroupID: to.Ptr("/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2"), // WebHookProperties: map[string]*string{ // "key11": to.Ptr("value11"), // "key12": to.Ptr("value12"), // }, // }}, // AutoMitigate: to.Ptr(true), // Criteria: &armmonitor.MetricAlertSingleResourceMultipleMetricCriteria{ // ODataType: to.Ptr(armmonitor.OdatatypeMicrosoftAzureMonitorSingleResourceMultipleMetricCriteria), // AllOf: []*armmonitor.MetricCriteria{ // { // Name: to.Ptr("High_CPU_80"), // CriterionType: to.Ptr(armmonitor.CriterionTypeStaticThresholdCriterion), // Dimensions: []*armmonitor.MetricDimension{ // }, // MetricName: to.Ptr("\\Processor(_Total)\\% Processor Time"), // TimeAggregation: to.Ptr(armmonitor.AggregationTypeEnumAverage), // Operator: to.Ptr(armmonitor.OperatorGreaterThan), // Threshold: to.Ptr[float64](80.5), // }}, // }, // Enabled: to.Ptr(true), // EvaluationFrequency: to.Ptr("Pt1m"), // Scopes: []*string{ // to.Ptr("/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme")}, // Severity: to.Ptr[int32](3), // WindowSize: to.Ptr("Pt15m"), // }, // } }
Output:
Example (CreateOrUpdateAnAlertRuleOnResourceGroupS) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/createOrUpdateMetricAlertResourceGroup.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewMetricAlertsClient().CreateOrUpdate(ctx, "gigtest1", "MetricAlertAtResourceGroupLevel", armmonitor.MetricAlertResource{ Location: to.Ptr("global"), Tags: map[string]*string{}, Properties: &armmonitor.MetricAlertProperties{ Description: to.Ptr("This is the description of the rule1"), Actions: []*armmonitor.MetricAlertAction{ { ActionGroupID: to.Ptr("/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2"), WebHookProperties: map[string]*string{ "key11": to.Ptr("value11"), "key12": to.Ptr("value12"), }, }}, AutoMitigate: to.Ptr(true), Criteria: &armmonitor.MetricAlertMultipleResourceMultipleMetricCriteria{ ODataType: to.Ptr(armmonitor.OdatatypeMicrosoftAzureMonitorMultipleResourceMultipleMetricCriteria), AllOf: []armmonitor.MultiMetricCriteriaClassification{ &armmonitor.MetricCriteria{ Name: to.Ptr("High_CPU_80"), CriterionType: to.Ptr(armmonitor.CriterionTypeStaticThresholdCriterion), Dimensions: []*armmonitor.MetricDimension{}, MetricName: to.Ptr("Percentage CPU"), MetricNamespace: to.Ptr("microsoft.compute/virtualmachines"), TimeAggregation: to.Ptr(armmonitor.AggregationTypeEnumAverage), Operator: to.Ptr(armmonitor.OperatorGreaterThan), Threshold: to.Ptr[float64](80.5), }}, }, Enabled: to.Ptr(true), EvaluationFrequency: to.Ptr("PT1M"), Scopes: []*string{ to.Ptr("/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest1"), to.Ptr("/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest2")}, Severity: to.Ptr[int32](3), TargetResourceRegion: to.Ptr("southcentralus"), TargetResourceType: to.Ptr("Microsoft.Compute/virtualMachines"), WindowSize: to.Ptr("PT15M"), }, }, 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.MetricAlertResource = armmonitor.MetricAlertResource{ // Type: to.Ptr("Microsoft.Insights/metricAlerts"), // ID: to.Ptr("/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest1/providers/providers/microsoft.insights/metricalerts/MetricAlertAtResourceGroupLevel"), // Location: to.Ptr("global"), // Tags: map[string]*string{ // "hidden-link:/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/leoalerttest": to.Ptr("Resource"), // }, // Properties: &armmonitor.MetricAlertProperties{ // Description: to.Ptr("This is the description of the rule1"), // Actions: []*armmonitor.MetricAlertAction{ // { // ActionGroupID: to.Ptr("/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2"), // WebHookProperties: map[string]*string{ // "key11": to.Ptr("value11"), // "key12": to.Ptr("value12"), // }, // }}, // AutoMitigate: to.Ptr(true), // Criteria: &armmonitor.MetricAlertMultipleResourceMultipleMetricCriteria{ // ODataType: to.Ptr(armmonitor.OdatatypeMicrosoftAzureMonitorMultipleResourceMultipleMetricCriteria), // AllOf: []armmonitor.MultiMetricCriteriaClassification{ // &armmonitor.MetricCriteria{ // Name: to.Ptr("High_CPU_80"), // CriterionType: to.Ptr(armmonitor.CriterionTypeStaticThresholdCriterion), // Dimensions: []*armmonitor.MetricDimension{ // }, // MetricName: to.Ptr("Percentage CPU"), // MetricNamespace: to.Ptr("microsoft.compute/virtualmachines"), // TimeAggregation: to.Ptr(armmonitor.AggregationTypeEnumAverage), // Operator: to.Ptr(armmonitor.OperatorGreaterThan), // Threshold: to.Ptr[float64](80.5), // }}, // }, // Enabled: to.Ptr(true), // EvaluationFrequency: to.Ptr("PT1M"), // Scopes: []*string{ // to.Ptr("/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest1"), // to.Ptr("/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest2")}, // Severity: to.Ptr[int32](3), // TargetResourceRegion: to.Ptr("southcentralus"), // TargetResourceType: to.Ptr("Microsoft.Compute/virtualMachines"), // WindowSize: to.Ptr("PT15M"), // }, // } }
Output:
Example (CreateOrUpdateAnAlertRuleOnSubscription) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/createOrUpdateMetricAlertSubscription.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewMetricAlertsClient().CreateOrUpdate(ctx, "gigtest", "MetricAlertAtSubscriptionLevel", armmonitor.MetricAlertResource{ Location: to.Ptr("global"), Tags: map[string]*string{}, Properties: &armmonitor.MetricAlertProperties{ Description: to.Ptr("This is the description of the rule1"), Actions: []*armmonitor.MetricAlertAction{ { ActionGroupID: to.Ptr("/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2"), WebHookProperties: map[string]*string{ "key11": to.Ptr("value11"), "key12": to.Ptr("value12"), }, }}, AutoMitigate: to.Ptr(true), Criteria: &armmonitor.MetricAlertMultipleResourceMultipleMetricCriteria{ ODataType: to.Ptr(armmonitor.OdatatypeMicrosoftAzureMonitorMultipleResourceMultipleMetricCriteria), AllOf: []armmonitor.MultiMetricCriteriaClassification{ &armmonitor.MetricCriteria{ Name: to.Ptr("High_CPU_80"), CriterionType: to.Ptr(armmonitor.CriterionTypeStaticThresholdCriterion), Dimensions: []*armmonitor.MetricDimension{}, MetricName: to.Ptr("Percentage CPU"), MetricNamespace: to.Ptr("microsoft.compute/virtualmachines"), TimeAggregation: to.Ptr(armmonitor.AggregationTypeEnumAverage), Operator: to.Ptr(armmonitor.OperatorGreaterThan), Threshold: to.Ptr[float64](80.5), }}, }, Enabled: to.Ptr(true), EvaluationFrequency: to.Ptr("PT1M"), Scopes: []*string{ to.Ptr("/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7")}, Severity: to.Ptr[int32](3), TargetResourceRegion: to.Ptr("southcentralus"), TargetResourceType: to.Ptr("Microsoft.Compute/virtualMachines"), WindowSize: to.Ptr("PT15M"), }, }, 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.MetricAlertResource = armmonitor.MetricAlertResource{ // Type: to.Ptr("Microsoft.Insights/metricAlerts"), // ID: to.Ptr("/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/providers/microsoft.insights/metricalerts/MetricAlertAtSubscriptionLevel"), // Location: to.Ptr("global"), // Tags: map[string]*string{ // "hidden-link:/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/leoalerttest": to.Ptr("Resource"), // }, // Properties: &armmonitor.MetricAlertProperties{ // Description: to.Ptr("This is the description of the rule1"), // Actions: []*armmonitor.MetricAlertAction{ // { // ActionGroupID: to.Ptr("/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2"), // WebHookProperties: map[string]*string{ // "key11": to.Ptr("value11"), // "key12": to.Ptr("value12"), // }, // }}, // AutoMitigate: to.Ptr(true), // Criteria: &armmonitor.MetricAlertMultipleResourceMultipleMetricCriteria{ // ODataType: to.Ptr(armmonitor.OdatatypeMicrosoftAzureMonitorMultipleResourceMultipleMetricCriteria), // AllOf: []armmonitor.MultiMetricCriteriaClassification{ // &armmonitor.MetricCriteria{ // Name: to.Ptr("High_CPU_80"), // CriterionType: to.Ptr(armmonitor.CriterionTypeStaticThresholdCriterion), // Dimensions: []*armmonitor.MetricDimension{ // }, // MetricName: to.Ptr("Percentage CPU"), // MetricNamespace: to.Ptr("microsoft.compute/virtualmachines"), // TimeAggregation: to.Ptr(armmonitor.AggregationTypeEnumAverage), // Operator: to.Ptr(armmonitor.OperatorGreaterThan), // Threshold: to.Ptr[float64](80.5), // }}, // }, // Enabled: to.Ptr(true), // EvaluationFrequency: to.Ptr("PT1M"), // Scopes: []*string{ // to.Ptr("/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7")}, // Severity: to.Ptr[int32](3), // TargetResourceRegion: to.Ptr("southcentralus"), // TargetResourceType: to.Ptr("Microsoft.Compute/virtualMachines"), // WindowSize: to.Ptr("PT15M"), // }, // } }
Output:
Example (CreateOrUpdateAnAlertRulesWithDimensions) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/createOrUpdateMetricAlertWithDimensions.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewMetricAlertsClient().CreateOrUpdate(ctx, "gigtest", "MetricAlertOnMultipleDimensions", armmonitor.MetricAlertResource{ Location: to.Ptr("global"), Tags: map[string]*string{}, Properties: &armmonitor.MetricAlertProperties{ Description: to.Ptr("This is the description of the rule1"), Actions: []*armmonitor.MetricAlertAction{ { ActionGroupID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2"), WebHookProperties: map[string]*string{ "key11": to.Ptr("value11"), "key12": to.Ptr("value12"), }, }}, AutoMitigate: to.Ptr(true), Criteria: &armmonitor.MetricAlertMultipleResourceMultipleMetricCriteria{ ODataType: to.Ptr(armmonitor.OdatatypeMicrosoftAzureMonitorMultipleResourceMultipleMetricCriteria), AllOf: []armmonitor.MultiMetricCriteriaClassification{ &armmonitor.MetricCriteria{ Name: to.Ptr("Metric1"), CriterionType: to.Ptr(armmonitor.CriterionTypeStaticThresholdCriterion), Dimensions: []*armmonitor.MetricDimension{ { Name: to.Ptr("ActivityName"), Operator: to.Ptr("Include"), Values: []*string{ to.Ptr("*")}, }, { Name: to.Ptr("StatusCode"), Operator: to.Ptr("Include"), Values: []*string{ to.Ptr("200")}, }}, MetricName: to.Ptr("Availability"), MetricNamespace: to.Ptr("Microsoft.KeyVault/vaults"), TimeAggregation: to.Ptr(armmonitor.AggregationTypeEnumAverage), Operator: to.Ptr(armmonitor.OperatorGreaterThan), Threshold: to.Ptr[float64](55), }}, }, Enabled: to.Ptr(true), EvaluationFrequency: to.Ptr("PT1H"), Scopes: []*string{ to.Ptr("/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/Microsoft.KeyVault/vaults/keyVaultResource")}, Severity: to.Ptr[int32](3), WindowSize: to.Ptr("P1D"), }, }, 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.MetricAlertResource = armmonitor.MetricAlertResource{ // Type: to.Ptr("Microsoft.Insights/metricAlerts"), // ID: to.Ptr("/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/providers/microsoft.insights/metricalerts/MetricAlertWithDimensions"), // Location: to.Ptr("global"), // Tags: map[string]*string{ // "hidden-link:/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/leoalerttest": to.Ptr("Resource"), // }, // Properties: &armmonitor.MetricAlertProperties{ // Description: to.Ptr("This is the description of the rule1"), // Actions: []*armmonitor.MetricAlertAction{ // { // ActionGroupID: to.Ptr("/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2"), // WebHookProperties: map[string]*string{ // "key11": to.Ptr("value11"), // "key12": to.Ptr("value12"), // }, // }}, // AutoMitigate: to.Ptr(true), // Criteria: &armmonitor.MetricAlertMultipleResourceMultipleMetricCriteria{ // ODataType: to.Ptr(armmonitor.OdatatypeMicrosoftAzureMonitorMultipleResourceMultipleMetricCriteria), // AllOf: []armmonitor.MultiMetricCriteriaClassification{ // &armmonitor.MetricCriteria{ // Name: to.Ptr("Metric1"), // CriterionType: to.Ptr(armmonitor.CriterionTypeStaticThresholdCriterion), // Dimensions: []*armmonitor.MetricDimension{ // { // Name: to.Ptr("ActivityName"), // Operator: to.Ptr("Include"), // Values: []*string{ // to.Ptr("*")}, // }, // { // Name: to.Ptr("StatusCode"), // Operator: to.Ptr("Include"), // Values: []*string{ // to.Ptr("200")}, // }}, // MetricName: to.Ptr("Availability"), // MetricNamespace: to.Ptr("Microsoft.KeyVault/vaults"), // TimeAggregation: to.Ptr(armmonitor.AggregationTypeEnumAverage), // Operator: to.Ptr(armmonitor.OperatorGreaterThan), // Threshold: to.Ptr[float64](55), // }}, // }, // Enabled: to.Ptr(true), // EvaluationFrequency: to.Ptr("PT1H"), // Scopes: []*string{ // to.Ptr("/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/Microsoft.KeyVault/vaults/keyVaultResource")}, // Severity: to.Ptr[int32](3), // TargetResourceRegion: to.Ptr("southcentralus"), // TargetResourceType: to.Ptr("Microsoft.KeyVault/vaults"), // WindowSize: to.Ptr("P1D"), // }, // } }
Output:
func (*MetricAlertsClient) Delete ¶
func (client *MetricAlertsClient) Delete(ctx context.Context, resourceGroupName string, ruleName string, options *MetricAlertsClientDeleteOptions) (MetricAlertsClientDeleteResponse, error)
Delete - Delete an alert rule definition. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2018-03-01
- resourceGroupName - The name of the resource group. The name is case insensitive.
- ruleName - The name of the rule.
- options - MetricAlertsClientDeleteOptions contains the optional parameters for the MetricAlertsClient.Delete method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/deleteMetricAlert.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } _, err = clientFactory.NewMetricAlertsClient().Delete(ctx, "gigtest", "chiricutin", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } }
Output:
func (*MetricAlertsClient) Get ¶
func (client *MetricAlertsClient) Get(ctx context.Context, resourceGroupName string, ruleName string, options *MetricAlertsClientGetOptions) (MetricAlertsClientGetResponse, error)
Get - Retrieve an alert rule definition. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2018-03-01
- resourceGroupName - The name of the resource group. The name is case insensitive.
- ruleName - The name of the rule.
- options - MetricAlertsClientGetOptions contains the optional parameters for the MetricAlertsClient.Get method.
Example (GetADynamicAlertRuleForMultipleResources) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/getDynamicMetricAlertMultipleResource.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewMetricAlertsClient().Get(ctx, "gigtest", "MetricAlertOnMultipleResources", 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.MetricAlertResource = armmonitor.MetricAlertResource{ // Type: to.Ptr("Microsoft.Insights/metricAlerts"), // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/gigtest/providers/providers/microsoft.insights/metricalerts/MetricAlertOnMultipleResources"), // Location: to.Ptr("global"), // Tags: map[string]*string{ // "hidden-link:/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/leoalerttest": to.Ptr("Resource"), // }, // Properties: &armmonitor.MetricAlertProperties{ // Description: to.Ptr("This is the description of the rule1"), // Actions: []*armmonitor.MetricAlertAction{ // { // ActionGroupID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2"), // WebHookProperties: map[string]*string{ // "key11": to.Ptr("value11"), // "key12": to.Ptr("value12"), // }, // }}, // AutoMitigate: to.Ptr(false), // Criteria: &armmonitor.MetricAlertMultipleResourceMultipleMetricCriteria{ // ODataType: to.Ptr(armmonitor.OdatatypeMicrosoftAzureMonitorMultipleResourceMultipleMetricCriteria), // AllOf: []armmonitor.MultiMetricCriteriaClassification{ // &armmonitor.DynamicMetricCriteria{ // Name: to.Ptr("High_CPU_80"), // CriterionType: to.Ptr(armmonitor.CriterionTypeDynamicThresholdCriterion), // Dimensions: []*armmonitor.MetricDimension{ // }, // MetricName: to.Ptr("Percentage CPU"), // MetricNamespace: to.Ptr("microsoft.compute/virtualmachines"), // TimeAggregation: to.Ptr(armmonitor.AggregationTypeEnumAverage), // AlertSensitivity: to.Ptr(armmonitor.DynamicThresholdSensitivityMedium), // FailingPeriods: &armmonitor.DynamicThresholdFailingPeriods{ // MinFailingPeriodsToAlert: to.Ptr[float32](4), // NumberOfEvaluationPeriods: to.Ptr[float32](4), // }, // Operator: to.Ptr(armmonitor.DynamicThresholdOperatorGreaterOrLessThan), // }}, // }, // Enabled: to.Ptr(true), // EvaluationFrequency: to.Ptr("PT1M"), // Scopes: []*string{ // to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme1"), // to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme2")}, // Severity: to.Ptr[int32](3), // TargetResourceRegion: to.Ptr("southcentralus"), // TargetResourceType: to.Ptr("Microsoft.Compute/virtualMachines"), // WindowSize: to.Ptr("PT15M"), // }, // } }
Output:
Example (GetADynamicAlertRuleForSingleResource) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/getDynamicMetricAlertSingleResource.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewMetricAlertsClient().Get(ctx, "gigtest", "chiricutin", 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.MetricAlertResource = armmonitor.MetricAlertResource{ // Type: to.Ptr("Microsoft.Insights/metricAlerts"), // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/gigtest/providers/providers/microsoft.insights/metricalerts/chiricutin"), // Location: to.Ptr("global"), // Tags: map[string]*string{ // "hidden-link:/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/leoalerttest": to.Ptr("Resource"), // }, // Properties: &armmonitor.MetricAlertProperties{ // Description: to.Ptr("This is the description of the rule1"), // Actions: []*armmonitor.MetricAlertAction{ // { // ActionGroupID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2"), // WebHookProperties: map[string]*string{ // "key11": to.Ptr("value11"), // "key12": to.Ptr("value12"), // }, // }}, // AutoMitigate: to.Ptr(false), // Criteria: &armmonitor.MetricAlertMultipleResourceMultipleMetricCriteria{ // ODataType: to.Ptr(armmonitor.OdatatypeMicrosoftAzureMonitorMultipleResourceMultipleMetricCriteria), // AllOf: []armmonitor.MultiMetricCriteriaClassification{ // &armmonitor.DynamicMetricCriteria{ // Name: to.Ptr("High_CPU_80"), // CriterionType: to.Ptr(armmonitor.CriterionTypeDynamicThresholdCriterion), // Dimensions: []*armmonitor.MetricDimension{ // }, // MetricName: to.Ptr("Percentage CPU"), // MetricNamespace: to.Ptr("microsoft.compute/virtualmachines"), // TimeAggregation: to.Ptr(armmonitor.AggregationTypeEnumAverage), // AlertSensitivity: to.Ptr(armmonitor.DynamicThresholdSensitivityMedium), // FailingPeriods: &armmonitor.DynamicThresholdFailingPeriods{ // MinFailingPeriodsToAlert: to.Ptr[float32](4), // NumberOfEvaluationPeriods: to.Ptr[float32](4), // }, // Operator: to.Ptr(armmonitor.DynamicThresholdOperatorGreaterOrLessThan), // }}, // }, // Enabled: to.Ptr(true), // EvaluationFrequency: to.Ptr("Pt1m"), // Scopes: []*string{ // to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme")}, // Severity: to.Ptr[int32](3), // WindowSize: to.Ptr("Pt15m"), // }, // } }
Output:
Example (GetAWebTestAlertRule) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/getWebTestMetricAlert.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewMetricAlertsClient().Get(ctx, "rg-example", "webtest-name-example", 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.MetricAlertResource = armmonitor.MetricAlertResource{ // Name: to.Ptr("webtest-name-example"), // Type: to.Ptr("Microsoft.Insights/metricAlerts"), // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/metricalerts/webtest-name-example"), // Location: to.Ptr("global"), // Tags: map[string]*string{ // "hidden-link:/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/components/component-example": to.Ptr("Resource"), // "hidden-link:/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/webtests/webtest-name-example": to.Ptr("Resource"), // }, // Properties: &armmonitor.MetricAlertProperties{ // Description: to.Ptr("Automatically created alert rule for availability test \"webtest-name-example\""), // Actions: []*armmonitor.MetricAlertAction{ // }, // Criteria: &armmonitor.WebtestLocationAvailabilityCriteria{ // ODataType: to.Ptr(armmonitor.OdatatypeMicrosoftAzureMonitorWebtestLocationAvailabilityCriteria), // ComponentID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/components/component-example"), // FailedLocationCount: to.Ptr[float32](2), // WebTestID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/webtests/webtest-name-example"), // }, // Enabled: to.Ptr(true), // EvaluationFrequency: to.Ptr("PT1M"), // Scopes: []*string{ // to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/webtests/webtest-name-example"), // to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/components/component-example")}, // Severity: to.Ptr[int32](4), // WindowSize: to.Ptr("PT15M"), // }, // } }
Output:
Example (GetAnAlertRuleForMultipleResources) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/getMetricAlertMultipleResource.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewMetricAlertsClient().Get(ctx, "gigtest", "MetricAlertOnMultipleResources", 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.MetricAlertResource = armmonitor.MetricAlertResource{ // Type: to.Ptr("Microsoft.Insights/metricAlerts"), // ID: to.Ptr("/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/providers/microsoft.insights/metricalerts/MetricAlertOnMultipleResources"), // Location: to.Ptr("global"), // Tags: map[string]*string{ // "hidden-link:/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/leoalerttest": to.Ptr("Resource"), // }, // Properties: &armmonitor.MetricAlertProperties{ // Description: to.Ptr("This is the description of the rule1"), // Actions: []*armmonitor.MetricAlertAction{ // { // ActionGroupID: to.Ptr("/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2"), // WebHookProperties: map[string]*string{ // "key11": to.Ptr("value11"), // "key12": to.Ptr("value12"), // }, // }}, // AutoMitigate: to.Ptr(false), // Criteria: &armmonitor.MetricAlertMultipleResourceMultipleMetricCriteria{ // ODataType: to.Ptr(armmonitor.OdatatypeMicrosoftAzureMonitorMultipleResourceMultipleMetricCriteria), // AllOf: []armmonitor.MultiMetricCriteriaClassification{ // &armmonitor.MetricCriteria{ // Name: to.Ptr("High_CPU_80"), // CriterionType: to.Ptr(armmonitor.CriterionTypeStaticThresholdCriterion), // Dimensions: []*armmonitor.MetricDimension{ // }, // MetricName: to.Ptr("Percentage CPU"), // MetricNamespace: to.Ptr("microsoft.compute/virtualmachines"), // TimeAggregation: to.Ptr(armmonitor.AggregationTypeEnumAverage), // Operator: to.Ptr(armmonitor.OperatorGreaterThan), // Threshold: to.Ptr[float64](80.5), // }}, // }, // Enabled: to.Ptr(true), // EvaluationFrequency: to.Ptr("PT1M"), // Scopes: []*string{ // to.Ptr("/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme1"), // to.Ptr("/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme2")}, // Severity: to.Ptr[int32](3), // TargetResourceRegion: to.Ptr("southcentralus"), // TargetResourceType: to.Ptr("Microsoft.Compute/virtualMachines"), // WindowSize: to.Ptr("PT15M"), // }, // } }
Output:
Example (GetAnAlertRuleForSingleResource) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/getMetricAlertSingleResource.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewMetricAlertsClient().Get(ctx, "gigtest", "chiricutin", 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.MetricAlertResource = armmonitor.MetricAlertResource{ // Type: to.Ptr("Microsoft.Insights/metricAlerts"), // ID: to.Ptr("/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/providers/microsoft.insights/metricalerts/chiricutin"), // Location: to.Ptr("global"), // Tags: map[string]*string{ // "hidden-link:/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/leoalerttest": to.Ptr("Resource"), // }, // Properties: &armmonitor.MetricAlertProperties{ // Description: to.Ptr("This is the description of the rule1"), // Actions: []*armmonitor.MetricAlertAction{ // { // ActionGroupID: to.Ptr("/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2"), // WebHookProperties: map[string]*string{ // "key11": to.Ptr("value11"), // "key12": to.Ptr("value12"), // }, // }}, // AutoMitigate: to.Ptr(false), // Criteria: &armmonitor.MetricAlertSingleResourceMultipleMetricCriteria{ // ODataType: to.Ptr(armmonitor.OdatatypeMicrosoftAzureMonitorSingleResourceMultipleMetricCriteria), // AllOf: []*armmonitor.MetricCriteria{ // { // Name: to.Ptr("High_CPU_80"), // CriterionType: to.Ptr(armmonitor.CriterionTypeStaticThresholdCriterion), // Dimensions: []*armmonitor.MetricDimension{ // }, // MetricName: to.Ptr("\\Processor(_Total)\\% Processor Time"), // TimeAggregation: to.Ptr(armmonitor.AggregationTypeEnumAverage), // Operator: to.Ptr(armmonitor.OperatorGreaterThan), // Threshold: to.Ptr[float64](80.5), // }}, // }, // Enabled: to.Ptr(true), // EvaluationFrequency: to.Ptr("Pt1m"), // Scopes: []*string{ // to.Ptr("/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme")}, // Severity: to.Ptr[int32](3), // WindowSize: to.Ptr("Pt15m"), // }, // } }
Output:
Example (GetAnAlertRuleOnResourceGroupS) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/getMetricAlertResourceGroup.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewMetricAlertsClient().Get(ctx, "gigtest1", "MetricAlertAtResourceGroupLevel", 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.MetricAlertResource = armmonitor.MetricAlertResource{ // Type: to.Ptr("Microsoft.Insights/metricAlerts"), // ID: to.Ptr("/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest1/providers/providers/microsoft.insights/metricalerts/MetricAlertAtResourceGroupLevel"), // Location: to.Ptr("global"), // Tags: map[string]*string{ // "hidden-link:/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/leoalerttest": to.Ptr("Resource"), // }, // Properties: &armmonitor.MetricAlertProperties{ // Description: to.Ptr("This is the description of the rule1"), // Actions: []*armmonitor.MetricAlertAction{ // { // ActionGroupID: to.Ptr("/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2"), // WebHookProperties: map[string]*string{ // "key11": to.Ptr("value11"), // "key12": to.Ptr("value12"), // }, // }}, // AutoMitigate: to.Ptr(false), // Criteria: &armmonitor.MetricAlertMultipleResourceMultipleMetricCriteria{ // ODataType: to.Ptr(armmonitor.OdatatypeMicrosoftAzureMonitorMultipleResourceMultipleMetricCriteria), // AllOf: []armmonitor.MultiMetricCriteriaClassification{ // &armmonitor.MetricCriteria{ // Name: to.Ptr("High_CPU_80"), // CriterionType: to.Ptr(armmonitor.CriterionTypeStaticThresholdCriterion), // Dimensions: []*armmonitor.MetricDimension{ // }, // MetricName: to.Ptr("Percentage CPU"), // MetricNamespace: to.Ptr("microsoft.compute/virtualmachines"), // TimeAggregation: to.Ptr(armmonitor.AggregationTypeEnumAverage), // Operator: to.Ptr(armmonitor.OperatorGreaterThan), // Threshold: to.Ptr[float64](80.5), // }}, // }, // Enabled: to.Ptr(true), // EvaluationFrequency: to.Ptr("PT1M"), // Scopes: []*string{ // to.Ptr("/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest1"), // to.Ptr("/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest2")}, // Severity: to.Ptr[int32](3), // TargetResourceRegion: to.Ptr("southcentralus"), // TargetResourceType: to.Ptr("Microsoft.Compute/virtualMachines"), // WindowSize: to.Ptr("PT15M"), // }, // } }
Output:
Example (GetAnAlertRuleOnSubscription) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/getMetricAlertSubscription.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewMetricAlertsClient().Get(ctx, "gigtest", "MetricAlertAtSubscriptionLevel", 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.MetricAlertResource = armmonitor.MetricAlertResource{ // Type: to.Ptr("Microsoft.Insights/metricAlerts"), // ID: to.Ptr("/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/providers/microsoft.insights/metricalerts/MetricAlertAtSubscriptionLevel"), // Location: to.Ptr("global"), // Tags: map[string]*string{ // "hidden-link:/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/leoalerttest": to.Ptr("Resource"), // }, // Properties: &armmonitor.MetricAlertProperties{ // Description: to.Ptr("This is the description of the rule1"), // Actions: []*armmonitor.MetricAlertAction{ // { // ActionGroupID: to.Ptr("/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2"), // WebHookProperties: map[string]*string{ // "key11": to.Ptr("value11"), // "key12": to.Ptr("value12"), // }, // }}, // AutoMitigate: to.Ptr(false), // Criteria: &armmonitor.MetricAlertMultipleResourceMultipleMetricCriteria{ // ODataType: to.Ptr(armmonitor.OdatatypeMicrosoftAzureMonitorMultipleResourceMultipleMetricCriteria), // AllOf: []armmonitor.MultiMetricCriteriaClassification{ // &armmonitor.MetricCriteria{ // Name: to.Ptr("High_CPU_80"), // CriterionType: to.Ptr(armmonitor.CriterionTypeStaticThresholdCriterion), // Dimensions: []*armmonitor.MetricDimension{ // }, // MetricName: to.Ptr("Percentage CPU"), // MetricNamespace: to.Ptr("microsoft.compute/virtualmachines"), // TimeAggregation: to.Ptr(armmonitor.AggregationTypeEnumAverage), // Operator: to.Ptr(armmonitor.OperatorGreaterThan), // Threshold: to.Ptr[float64](80.5), // }}, // }, // Enabled: to.Ptr(true), // EvaluationFrequency: to.Ptr("PT1M"), // Scopes: []*string{ // to.Ptr("/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7")}, // Severity: to.Ptr[int32](3), // TargetResourceRegion: to.Ptr("southcentralus"), // TargetResourceType: to.Ptr("Microsoft.Compute/virtualMachines"), // WindowSize: to.Ptr("PT15M"), // }, // } }
Output:
func (*MetricAlertsClient) NewListByResourceGroupPager ¶ added in v0.6.0
func (client *MetricAlertsClient) NewListByResourceGroupPager(resourceGroupName string, options *MetricAlertsClientListByResourceGroupOptions) *runtime.Pager[MetricAlertsClientListByResourceGroupResponse]
NewListByResourceGroupPager - Retrieve alert rule definitions in a resource group.
Generated from API version 2018-03-01
- resourceGroupName - The name of the resource group. The name is case insensitive.
- options - MetricAlertsClientListByResourceGroupOptions contains the optional parameters for the MetricAlertsClient.NewListByResourceGroupPager method.
func (*MetricAlertsClient) NewListBySubscriptionPager ¶ added in v0.6.0
func (client *MetricAlertsClient) NewListBySubscriptionPager(options *MetricAlertsClientListBySubscriptionOptions) *runtime.Pager[MetricAlertsClientListBySubscriptionResponse]
NewListBySubscriptionPager - Retrieve alert rule definitions in a subscription.
Generated from API version 2018-03-01
- options - MetricAlertsClientListBySubscriptionOptions contains the optional parameters for the MetricAlertsClient.NewListBySubscriptionPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/listMetricAlert.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewMetricAlertsClient().NewListBySubscriptionPager(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.MetricAlertResourceCollection = armmonitor.MetricAlertResourceCollection{ // Value: []*armmonitor.MetricAlertResource{ // { // Type: to.Ptr("Microsoft.Insights/metricAlerts"), // ID: to.Ptr("/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/providers/microsoft.insights/metricalerts/highcpu"), // Location: to.Ptr("global"), // Tags: map[string]*string{ // "hidden-link:/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/leoalerttest": to.Ptr("Resource"), // }, // Properties: &armmonitor.MetricAlertProperties{ // Description: to.Ptr("This is the description of the rule1"), // Actions: []*armmonitor.MetricAlertAction{ // { // ActionGroupID: to.Ptr("/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2"), // WebHookProperties: map[string]*string{ // "key11": to.Ptr("value11"), // "key12": to.Ptr("value12"), // }, // }}, // Criteria: &armmonitor.MetricAlertSingleResourceMultipleMetricCriteria{ // ODataType: to.Ptr(armmonitor.OdatatypeMicrosoftAzureMonitorSingleResourceMultipleMetricCriteria), // AllOf: []*armmonitor.MetricCriteria{ // { // Name: to.Ptr("High_CPU_80"), // CriterionType: to.Ptr(armmonitor.CriterionTypeStaticThresholdCriterion), // Dimensions: []*armmonitor.MetricDimension{ // }, // MetricName: to.Ptr("CustomMetric_\\Processor(_Total)\\% Processor Time"), // TimeAggregation: to.Ptr(armmonitor.AggregationTypeEnumAverage), // Operator: to.Ptr(armmonitor.OperatorGreaterThan), // Threshold: to.Ptr[float64](80.5), // }}, // }, // Enabled: to.Ptr(true), // EvaluationFrequency: to.Ptr("Pt1m"), // Scopes: []*string{ // to.Ptr("/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme")}, // Severity: to.Ptr[int32](3), // WindowSize: to.Ptr("Pt15m"), // }, // }, // { // Type: to.Ptr("Microsoft.Insights/metricAlerts"), // ID: to.Ptr("/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/providers/microsoft.insights/metricalerts/mediumcpu"), // Location: to.Ptr("global"), // Tags: map[string]*string{ // "hidden-link:/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/leoalerttest": to.Ptr("Resource"), // }, // Properties: &armmonitor.MetricAlertProperties{ // Description: to.Ptr("Med cpu alert"), // Actions: []*armmonitor.MetricAlertAction{ // { // ActionGroupID: to.Ptr("/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2"), // WebHookProperties: map[string]*string{ // "key11": to.Ptr("value11"), // "key12": to.Ptr("value12"), // }, // }}, // Criteria: &armmonitor.MetricAlertSingleResourceMultipleMetricCriteria{ // ODataType: to.Ptr(armmonitor.OdatatypeMicrosoftAzureMonitorSingleResourceMultipleMetricCriteria), // AllOf: []*armmonitor.MetricCriteria{ // { // Name: to.Ptr("Medium_CPU_50"), // CriterionType: to.Ptr(armmonitor.CriterionTypeStaticThresholdCriterion), // Dimensions: []*armmonitor.MetricDimension{ // }, // MetricName: to.Ptr("CustomMetric_\\Processor(_Total)\\% Processor Time"), // TimeAggregation: to.Ptr(armmonitor.AggregationTypeEnumAverage), // Operator: to.Ptr(armmonitor.OperatorGreaterThan), // Threshold: to.Ptr[float64](50.5), // }}, // }, // Enabled: to.Ptr(true), // EvaluationFrequency: to.Ptr("Pt1m"), // Scopes: []*string{ // to.Ptr("/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme")}, // Severity: to.Ptr[int32](4), // WindowSize: to.Ptr("Pt15m"), // }, // }}, // } } }
Output:
func (*MetricAlertsClient) Update ¶
func (client *MetricAlertsClient) Update(ctx context.Context, resourceGroupName string, ruleName string, parameters MetricAlertResourcePatch, options *MetricAlertsClientUpdateOptions) (MetricAlertsClientUpdateResponse, error)
Update - Update an metric alert definition. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2018-03-01
- resourceGroupName - The name of the resource group. The name is case insensitive.
- ruleName - The name of the rule.
- parameters - The parameters of the rule to update.
- options - MetricAlertsClientUpdateOptions contains the optional parameters for the MetricAlertsClient.Update method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/UpdateMetricAlert.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewMetricAlertsClient().Update(ctx, "gigtest", "chiricutin", armmonitor.MetricAlertResourcePatch{ Properties: &armmonitor.MetricAlertPropertiesPatch{ Description: to.Ptr("This is the description of the rule1"), Actions: []*armmonitor.MetricAlertAction{ { ActionGroupID: to.Ptr("/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2"), WebHookProperties: map[string]*string{ "key11": to.Ptr("value11"), "key12": to.Ptr("value12"), }, }}, AutoMitigate: to.Ptr(true), Criteria: &armmonitor.MetricAlertSingleResourceMultipleMetricCriteria{ ODataType: to.Ptr(armmonitor.OdatatypeMicrosoftAzureMonitorSingleResourceMultipleMetricCriteria), AllOf: []*armmonitor.MetricCriteria{ { Name: to.Ptr("High_CPU_80"), CriterionType: to.Ptr(armmonitor.CriterionTypeStaticThresholdCriterion), Dimensions: []*armmonitor.MetricDimension{}, MetricName: to.Ptr("\\Processor(_Total)\\% Processor Time"), TimeAggregation: to.Ptr(armmonitor.AggregationTypeEnumAverage), Operator: to.Ptr(armmonitor.OperatorGreaterThan), Threshold: to.Ptr[float64](80.5), }}, }, Enabled: to.Ptr(true), EvaluationFrequency: to.Ptr("Pt1m"), Scopes: []*string{ to.Ptr("/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme")}, Severity: to.Ptr[int32](3), WindowSize: to.Ptr("Pt15m"), }, Tags: map[string]*string{}, }, 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.MetricAlertResource = armmonitor.MetricAlertResource{ // Type: to.Ptr("Microsoft.Insights/metricAlerts"), // ID: to.Ptr("/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/providers/microsoft.insights/metricalerts/chiricutin"), // Location: to.Ptr("global"), // Tags: map[string]*string{ // "hidden-link:/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/leoalerttest": to.Ptr("Resource"), // }, // Properties: &armmonitor.MetricAlertProperties{ // Description: to.Ptr("This is the description of the rule1"), // Actions: []*armmonitor.MetricAlertAction{ // { // ActionGroupID: to.Ptr("/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2"), // WebHookProperties: map[string]*string{ // "key11": to.Ptr("value11"), // "key12": to.Ptr("value12"), // }, // }}, // AutoMitigate: to.Ptr(true), // Criteria: &armmonitor.MetricAlertSingleResourceMultipleMetricCriteria{ // ODataType: to.Ptr(armmonitor.OdatatypeMicrosoftAzureMonitorSingleResourceMultipleMetricCriteria), // AllOf: []*armmonitor.MetricCriteria{ // { // Name: to.Ptr("High_CPU_80"), // CriterionType: to.Ptr(armmonitor.CriterionTypeStaticThresholdCriterion), // Dimensions: []*armmonitor.MetricDimension{ // }, // MetricName: to.Ptr("\\Processor(_Total)\\% Processor Time"), // TimeAggregation: to.Ptr(armmonitor.AggregationTypeEnumAverage), // Operator: to.Ptr(armmonitor.OperatorGreaterThan), // Threshold: to.Ptr[float64](80.5), // }}, // }, // Enabled: to.Ptr(true), // EvaluationFrequency: to.Ptr("Pt1m"), // Scopes: []*string{ // to.Ptr("/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme")}, // Severity: to.Ptr[int32](3), // WindowSize: to.Ptr("Pt15m"), // }, // } }
Output:
type MetricAlertsClientCreateOrUpdateOptions ¶ added in v0.4.0
type MetricAlertsClientCreateOrUpdateOptions struct { }
MetricAlertsClientCreateOrUpdateOptions contains the optional parameters for the MetricAlertsClient.CreateOrUpdate method.
type MetricAlertsClientCreateOrUpdateResponse ¶ added in v0.4.0
type MetricAlertsClientCreateOrUpdateResponse struct { // The metric alert resource. MetricAlertResource }
MetricAlertsClientCreateOrUpdateResponse contains the response from method MetricAlertsClient.CreateOrUpdate.
type MetricAlertsClientDeleteOptions ¶ added in v0.4.0
type MetricAlertsClientDeleteOptions struct { }
MetricAlertsClientDeleteOptions contains the optional parameters for the MetricAlertsClient.Delete method.
type MetricAlertsClientDeleteResponse ¶ added in v0.4.0
type MetricAlertsClientDeleteResponse struct { }
MetricAlertsClientDeleteResponse contains the response from method MetricAlertsClient.Delete.
type MetricAlertsClientGetOptions ¶ added in v0.4.0
type MetricAlertsClientGetOptions struct { }
MetricAlertsClientGetOptions contains the optional parameters for the MetricAlertsClient.Get method.
type MetricAlertsClientGetResponse ¶ added in v0.4.0
type MetricAlertsClientGetResponse struct { // The metric alert resource. MetricAlertResource }
MetricAlertsClientGetResponse contains the response from method MetricAlertsClient.Get.
type MetricAlertsClientListByResourceGroupOptions ¶ added in v0.4.0
type MetricAlertsClientListByResourceGroupOptions struct { }
MetricAlertsClientListByResourceGroupOptions contains the optional parameters for the MetricAlertsClient.NewListByResourceGroupPager method.
type MetricAlertsClientListByResourceGroupResponse ¶ added in v0.4.0
type MetricAlertsClientListByResourceGroupResponse struct { // Represents a collection of alert rule resources. MetricAlertResourceCollection }
MetricAlertsClientListByResourceGroupResponse contains the response from method MetricAlertsClient.NewListByResourceGroupPager.
type MetricAlertsClientListBySubscriptionOptions ¶ added in v0.4.0
type MetricAlertsClientListBySubscriptionOptions struct { }
MetricAlertsClientListBySubscriptionOptions contains the optional parameters for the MetricAlertsClient.NewListBySubscriptionPager method.
type MetricAlertsClientListBySubscriptionResponse ¶ added in v0.4.0
type MetricAlertsClientListBySubscriptionResponse struct { // Represents a collection of alert rule resources. MetricAlertResourceCollection }
MetricAlertsClientListBySubscriptionResponse contains the response from method MetricAlertsClient.NewListBySubscriptionPager.
type MetricAlertsClientUpdateOptions ¶ added in v0.4.0
type MetricAlertsClientUpdateOptions struct { }
MetricAlertsClientUpdateOptions contains the optional parameters for the MetricAlertsClient.Update method.
type MetricAlertsClientUpdateResponse ¶ added in v0.4.0
type MetricAlertsClientUpdateResponse struct { // The metric alert resource. MetricAlertResource }
MetricAlertsClientUpdateResponse contains the response from method MetricAlertsClient.Update.
type MetricAlertsStatusClient ¶
type MetricAlertsStatusClient struct {
// contains filtered or unexported fields
}
MetricAlertsStatusClient contains the methods for the MetricAlertsStatus group. Don't use this type directly, use NewMetricAlertsStatusClient() instead.
func NewMetricAlertsStatusClient ¶
func NewMetricAlertsStatusClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*MetricAlertsStatusClient, error)
NewMetricAlertsStatusClient creates a new instance of MetricAlertsStatusClient with the specified values.
- subscriptionID - The ID of the target subscription.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - pass nil to accept the default values.
func (*MetricAlertsStatusClient) List ¶
func (client *MetricAlertsStatusClient) List(ctx context.Context, resourceGroupName string, ruleName string, options *MetricAlertsStatusClientListOptions) (MetricAlertsStatusClientListResponse, error)
List - Retrieve an alert rule status. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2018-03-01
- resourceGroupName - The name of the resource group. The name is case insensitive.
- ruleName - The name of the rule.
- options - MetricAlertsStatusClientListOptions contains the optional parameters for the MetricAlertsStatusClient.List method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/getMetricAlertStatus.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewMetricAlertsStatusClient().List(ctx, "gigtest", "chiricutin", 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.MetricAlertStatusCollection = armmonitor.MetricAlertStatusCollection{ // Value: []*armmonitor.MetricAlertStatus{ // { // Name: to.Ptr("cmVzb3VyY2VJZD0vc3Vic2NyaXB0aW9ucy8xNGRkZjBjNS03N2M1LTRiNTMtODRmNi1lMWZhNDNhZDY4ZjcvcmVzb3VyY2VHcm91cHMvZ2lndGVzdC9wcm92aWRlcnMvTWljcm9zb2Z0LkNvbXB1dGUvdmlydHVhbE1hY2hpbmVzL2dpZ3dhZG1l"), // Type: to.Ptr("Microsoft.Insights/metricAlerts/status"), // ID: to.Ptr("/subscriptions/009f6022-67ec-423e-9aa7-691182870588/resourceGroups/EastUs/providers/microsoft.insights/metricAlerts/LeoAlert_custom1"), // Properties: &armmonitor.MetricAlertStatusProperties{ // Dimensions: map[string]*string{ // "resourceId": to.Ptr("/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme"), // }, // Status: to.Ptr("Healthy"), // Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-17T20:17:25.629Z"); return t}()), // }, // }}, // } }
Output:
func (*MetricAlertsStatusClient) ListByName ¶
func (client *MetricAlertsStatusClient) ListByName(ctx context.Context, resourceGroupName string, ruleName string, statusName string, options *MetricAlertsStatusClientListByNameOptions) (MetricAlertsStatusClientListByNameResponse, error)
ListByName - Retrieve an alert rule status. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2018-03-01
- resourceGroupName - The name of the resource group. The name is case insensitive.
- ruleName - The name of the rule.
- statusName - The name of the status.
- options - MetricAlertsStatusClientListByNameOptions contains the optional parameters for the MetricAlertsStatusClient.ListByName method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Insights/stable/2018-03-01/examples/getMetricAlertStatusByName.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewMetricAlertsStatusClient().ListByName(ctx, "EastUs", "custom1", "cmVzb3VyY2VJZD0vc3Vic2NyaXB0aW9ucy8xNGRkZjBjNS03N2M1LTRiNTMtODRmNi1lMWZhNDNhZDY4ZjcvcmVzb3VyY2VHcm91cHMvZ2lndGVzdC9wcm92aWRlcnMvTWljcm9zb2Z0LkNvbXB1dGUvdmlydHVhbE1hY2hpbmVzL2dpZ3dhZG1l", 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.MetricAlertStatusCollection = armmonitor.MetricAlertStatusCollection{ // Value: []*armmonitor.MetricAlertStatus{ // { // Name: to.Ptr("cmVzb3VyY2VJZD0vc3Vic2NyaXB0aW9ucy8xNGRkZjBjNS03N2M1LTRiNTMtODRmNi1lMWZhNDNhZDY4ZjcvcmVzb3VyY2VHcm91cHMvZ2lndGVzdC9wcm92aWRlcnMvTWljcm9zb2Z0LkNvbXB1dGUvdmlydHVhbE1hY2hpbmVzL2dpZ3dhZG1l"), // Type: to.Ptr("Microsoft.Insights/metricAlerts/status"), // ID: to.Ptr("/subscriptions/009f6022-67ec-423e-9aa7-691182870588/resourceGroups/EastUs/providers/microsoft.insights/metricAlerts/custom1"), // Properties: &armmonitor.MetricAlertStatusProperties{ // Dimensions: map[string]*string{ // "resourceId": to.Ptr("/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme"), // }, // Status: to.Ptr("Healthy"), // Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-17T20:17:25.629Z"); return t}()), // }, // }}, // } }
Output:
type MetricAlertsStatusClientListByNameOptions ¶ added in v0.4.0
type MetricAlertsStatusClientListByNameOptions struct { }
MetricAlertsStatusClientListByNameOptions contains the optional parameters for the MetricAlertsStatusClient.ListByName method.
type MetricAlertsStatusClientListByNameResponse ¶ added in v0.4.0
type MetricAlertsStatusClientListByNameResponse struct { // Represents a collection of alert rule resources. MetricAlertStatusCollection }
MetricAlertsStatusClientListByNameResponse contains the response from method MetricAlertsStatusClient.ListByName.
type MetricAlertsStatusClientListOptions ¶ added in v0.4.0
type MetricAlertsStatusClientListOptions struct { }
MetricAlertsStatusClientListOptions contains the optional parameters for the MetricAlertsStatusClient.List method.
type MetricAlertsStatusClientListResponse ¶ added in v0.4.0
type MetricAlertsStatusClientListResponse struct { // Represents a collection of alert rule resources. MetricAlertStatusCollection }
MetricAlertsStatusClientListResponse contains the response from method MetricAlertsStatusClient.List.
type MetricAvailability ¶
type MetricAvailability struct { // the retention period for the metric at the specified timegrain. Expressed as a duration 'PT1M', 'P1D', etc. Retention *string // the time grain specifies the aggregation interval for the metric. Expressed as a duration 'PT1M', 'P1D', etc. TimeGrain *string }
MetricAvailability - Metric availability specifies the time grain (aggregation interval or frequency) and the retention period for that time grain.
func (MetricAvailability) MarshalJSON ¶ added in v0.8.0
func (m MetricAvailability) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type MetricAvailability.
func (*MetricAvailability) UnmarshalJSON ¶ added in v0.8.0
func (m *MetricAvailability) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type MetricAvailability.
type MetricBaselinesProperties ¶
type MetricBaselinesProperties struct { // REQUIRED; The baseline for each time series that was queried. Baselines []*TimeSeriesBaseline // REQUIRED; The interval (window size) for which the metric data was returned in. This may be adjusted in the future and // returned back from what was originally requested. This is not present if a metadata request // was made. Interval *string // REQUIRED; The timespan for which the data was retrieved. Its value consists of two datetimes concatenated, separated by // '/'. This may be adjusted in the future and returned back from what was originally // requested. Timespan *string // The namespace of the metrics been queried. Namespace *string }
MetricBaselinesProperties - The response to a metric baselines query.
func (MetricBaselinesProperties) MarshalJSON ¶
func (m MetricBaselinesProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type MetricBaselinesProperties.
func (*MetricBaselinesProperties) UnmarshalJSON ¶ added in v0.8.0
func (m *MetricBaselinesProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type MetricBaselinesProperties.
type MetricBaselinesResponse ¶
type MetricBaselinesResponse struct { // The list of metric baselines. Value []*SingleMetricBaseline }
MetricBaselinesResponse - A list of metric baselines.
func (MetricBaselinesResponse) MarshalJSON ¶
func (m MetricBaselinesResponse) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type MetricBaselinesResponse.
func (*MetricBaselinesResponse) UnmarshalJSON ¶ added in v0.8.0
func (m *MetricBaselinesResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type MetricBaselinesResponse.
type MetricClass ¶
type MetricClass string
MetricClass - The class of the metric.
const ( MetricClassAvailability MetricClass = "Availability" MetricClassErrors MetricClass = "Errors" MetricClassLatency MetricClass = "Latency" MetricClassSaturation MetricClass = "Saturation" MetricClassTransactions MetricClass = "Transactions" )
func PossibleMetricClassValues ¶
func PossibleMetricClassValues() []MetricClass
PossibleMetricClassValues returns the possible values for the MetricClass const type.
type MetricCriteria ¶
type MetricCriteria struct { // REQUIRED; Specifies the type of threshold criteria CriterionType *CriterionType // REQUIRED; Name of the metric. MetricName *string // REQUIRED; Name of the criteria. Name *string // REQUIRED; the criteria operator. Operator *Operator // REQUIRED; the criteria threshold value that activates the alert. Threshold *float64 // REQUIRED; the criteria time aggregation types. TimeAggregation *AggregationTypeEnum // OPTIONAL; Contains additional key/value pairs not defined in the schema. AdditionalProperties map[string]any // List of dimension conditions. Dimensions []*MetricDimension // Namespace of the metric. MetricNamespace *string // Allows creating an alert rule on a custom metric that isn't yet emitted, by causing the metric validation to be skipped. SkipMetricValidation *bool }
MetricCriteria - Criterion to filter metrics.
func (*MetricCriteria) GetMultiMetricCriteria ¶ added in v0.4.0
func (m *MetricCriteria) GetMultiMetricCriteria() *MultiMetricCriteria
GetMultiMetricCriteria implements the MultiMetricCriteriaClassification interface for type MetricCriteria.
func (MetricCriteria) MarshalJSON ¶
func (m MetricCriteria) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type MetricCriteria.
func (*MetricCriteria) UnmarshalJSON ¶
func (m *MetricCriteria) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type MetricCriteria.
type MetricDefinition ¶
type MetricDefinition struct { // Custom category name for this metric. Category *string // the name and the display name of the dimension, i.e. it is a localizable string. Dimensions []*LocalizableString // Detailed description of this metric. DisplayDescription *string // the resource identifier of the metric definition. ID *string // Flag to indicate whether the dimension is required. IsDimensionRequired *bool // the collection of what aggregation intervals are available to be queried. MetricAvailabilities []*MetricAvailability // The class of the metric. MetricClass *MetricClass // the name and the display name of the metric, i.e. it is a localizable string. Name *LocalizableString // the namespace the metric belongs to. Namespace *string // the primary aggregation type value defining how to use the values for display. PrimaryAggregationType *AggregationType // the resource identifier of the resource that emitted the metric. ResourceID *string // the collection of what aggregation types are supported. SupportedAggregationTypes []*AggregationType // the unit of the metric. Unit *MetricUnit }
MetricDefinition - Metric definition class specifies the metadata for a metric.
func (MetricDefinition) MarshalJSON ¶
func (m MetricDefinition) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type MetricDefinition.
func (*MetricDefinition) UnmarshalJSON ¶ added in v0.8.0
func (m *MetricDefinition) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type MetricDefinition.
type MetricDefinitionCollection ¶
type MetricDefinitionCollection struct { // REQUIRED; the values for the metric definitions. Value []*MetricDefinition }
MetricDefinitionCollection - Represents collection of metric definitions.
func (MetricDefinitionCollection) MarshalJSON ¶
func (m MetricDefinitionCollection) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type MetricDefinitionCollection.
func (*MetricDefinitionCollection) UnmarshalJSON ¶ added in v0.8.0
func (m *MetricDefinitionCollection) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type MetricDefinitionCollection.
type MetricDefinitionsClient ¶
type MetricDefinitionsClient struct {
// contains filtered or unexported fields
}
MetricDefinitionsClient contains the methods for the MetricDefinitions group. Don't use this type directly, use NewMetricDefinitionsClient() instead.
func NewMetricDefinitionsClient ¶
func NewMetricDefinitionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*MetricDefinitionsClient, error)
NewMetricDefinitionsClient creates a new instance of MetricDefinitionsClient with the specified values.
- subscriptionID - The ID of the target subscription.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - pass nil to accept the default values.
func (*MetricDefinitionsClient) NewListAtSubscriptionScopePager ¶ added in v0.9.0
func (client *MetricDefinitionsClient) NewListAtSubscriptionScopePager(region string, options *MetricDefinitionsClientListAtSubscriptionScopeOptions) *runtime.Pager[MetricDefinitionsClientListAtSubscriptionScopeResponse]
NewListAtSubscriptionScopePager - Lists the metric definitions for the subscription.
Generated from API version 2021-05-01
- region - The region where the metrics you want reside.
- options - MetricDefinitionsClientListAtSubscriptionScopeOptions contains the optional parameters for the MetricDefinitionsClient.NewListAtSubscriptionScopePager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Insights/stable/2021-05-01/examples/GetMultiResourceMetricDefinitions.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewMetricDefinitionsClient().NewListAtSubscriptionScopePager("westus2", &armmonitor.MetricDefinitionsClientListAtSubscriptionScopeOptions{Metricnamespace: to.Ptr("microsoft.compute/virtualmachines")}) 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.SubscriptionScopeMetricDefinitionCollection = armmonitor.SubscriptionScopeMetricDefinitionCollection{ // Value: []*armmonitor.SubscriptionScopeMetricDefinition{ // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("Percentage CPU"), // Value: to.Ptr("Percentage CPU"), // }, // Dimensions: []*armmonitor.LocalizableString{ // { // LocalizedValue: to.Ptr("Microsoft.ResourceId"), // Value: to.Ptr("Microsoft.ResourceId"), // }, // { // LocalizedValue: to.Ptr("Microsoft.ResourceGroupName"), // Value: to.Ptr("Microsoft.ResourceGroupName"), // }}, // DisplayDescription: to.Ptr("The percentage of allocated compute units that are currently in use by the Virtual Machine(s)"), // ID: to.Ptr("subscriptions/92d2a2d8-b514-432d-8cc9-a5f9272630d5/providers/microsoft.insights/metricdefinitions/Percentage CPU"), // IsDimensionRequired: to.Ptr(false), // MetricAvailabilities: []*armmonitor.MetricAvailability{ // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT5M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT15M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT30M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT6H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT12H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("P1D"), // }}, // Namespace: to.Ptr("microsoft.compute/virtualmachines"), // PrimaryAggregationType: to.Ptr(armmonitor.MetricAggregationTypeAverage), // ResourceID: to.Ptr("subscriptions/92d2a2d8-b514-432d-8cc9-a5f9272630d5"), // SupportedAggregationTypes: []*armmonitor.MetricAggregationType{ // to.Ptr(armmonitor.MetricAggregationTypeNone), // to.Ptr(armmonitor.MetricAggregationTypeAverage), // to.Ptr(armmonitor.MetricAggregationTypeMinimum), // to.Ptr(armmonitor.MetricAggregationTypeMaximum), // to.Ptr(armmonitor.MetricAggregationTypeTotal), // to.Ptr(armmonitor.MetricAggregationTypeCount)}, // Unit: to.Ptr(armmonitor.MetricUnitPercent), // }, // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("Network In Billable (Deprecated)"), // Value: to.Ptr("Network In"), // }, // Dimensions: []*armmonitor.LocalizableString{ // { // LocalizedValue: to.Ptr("Microsoft.ResourceId"), // Value: to.Ptr("Microsoft.ResourceId"), // }, // { // LocalizedValue: to.Ptr("Microsoft.ResourceGroupName"), // Value: to.Ptr("Microsoft.ResourceGroupName"), // }}, // DisplayDescription: to.Ptr("The number of billable bytes received on all network interfaces by the Virtual Machine(s) (Incoming Traffic) (Deprecated)"), // ID: to.Ptr("subscriptions/92d2a2d8-b514-432d-8cc9-a5f9272630d5/providers/microsoft.insights/metricdefinitions/Network In"), // IsDimensionRequired: to.Ptr(false), // MetricAvailabilities: []*armmonitor.MetricAvailability{ // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT5M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT15M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT30M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT6H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT12H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("P1D"), // }}, // Namespace: to.Ptr("microsoft.compute/virtualmachines"), // PrimaryAggregationType: to.Ptr(armmonitor.MetricAggregationTypeTotal), // ResourceID: to.Ptr("subscriptions/92d2a2d8-b514-432d-8cc9-a5f9272630d5"), // SupportedAggregationTypes: []*armmonitor.MetricAggregationType{ // to.Ptr(armmonitor.MetricAggregationTypeNone), // to.Ptr(armmonitor.MetricAggregationTypeAverage), // to.Ptr(armmonitor.MetricAggregationTypeMinimum), // to.Ptr(armmonitor.MetricAggregationTypeMaximum), // to.Ptr(armmonitor.MetricAggregationTypeTotal), // to.Ptr(armmonitor.MetricAggregationTypeCount)}, // Unit: to.Ptr(armmonitor.MetricUnitBytes), // }, // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("Network Out Billable (Deprecated)"), // Value: to.Ptr("Network Out"), // }, // Dimensions: []*armmonitor.LocalizableString{ // { // LocalizedValue: to.Ptr("Microsoft.ResourceId"), // Value: to.Ptr("Microsoft.ResourceId"), // }, // { // LocalizedValue: to.Ptr("Microsoft.ResourceGroupName"), // Value: to.Ptr("Microsoft.ResourceGroupName"), // }}, // DisplayDescription: to.Ptr("The number of billable bytes out on all network interfaces by the Virtual Machine(s) (Outgoing Traffic) (Deprecated)"), // ID: to.Ptr("subscriptions/92d2a2d8-b514-432d-8cc9-a5f9272630d5/providers/microsoft.insights/metricdefinitions/Network Out"), // IsDimensionRequired: to.Ptr(false), // MetricAvailabilities: []*armmonitor.MetricAvailability{ // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT5M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT15M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT30M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT6H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT12H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("P1D"), // }}, // Namespace: to.Ptr("microsoft.compute/virtualmachines"), // PrimaryAggregationType: to.Ptr(armmonitor.MetricAggregationTypeTotal), // ResourceID: to.Ptr("subscriptions/92d2a2d8-b514-432d-8cc9-a5f9272630d5"), // SupportedAggregationTypes: []*armmonitor.MetricAggregationType{ // to.Ptr(armmonitor.MetricAggregationTypeNone), // to.Ptr(armmonitor.MetricAggregationTypeAverage), // to.Ptr(armmonitor.MetricAggregationTypeMinimum), // to.Ptr(armmonitor.MetricAggregationTypeMaximum), // to.Ptr(armmonitor.MetricAggregationTypeTotal), // to.Ptr(armmonitor.MetricAggregationTypeCount)}, // Unit: to.Ptr(armmonitor.MetricUnitBytes), // }, // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("Disk Read Bytes"), // Value: to.Ptr("Disk Read Bytes"), // }, // Dimensions: []*armmonitor.LocalizableString{ // { // LocalizedValue: to.Ptr("Microsoft.ResourceId"), // Value: to.Ptr("Microsoft.ResourceId"), // }, // { // LocalizedValue: to.Ptr("Microsoft.ResourceGroupName"), // Value: to.Ptr("Microsoft.ResourceGroupName"), // }}, // DisplayDescription: to.Ptr("Bytes read from disk during monitoring period"), // ID: to.Ptr("subscriptions/92d2a2d8-b514-432d-8cc9-a5f9272630d5/providers/microsoft.insights/metricdefinitions/Disk Read Bytes"), // IsDimensionRequired: to.Ptr(false), // MetricAvailabilities: []*armmonitor.MetricAvailability{ // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT5M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT15M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT30M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT6H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT12H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("P1D"), // }}, // Namespace: to.Ptr("microsoft.compute/virtualmachines"), // PrimaryAggregationType: to.Ptr(armmonitor.MetricAggregationTypeTotal), // ResourceID: to.Ptr("subscriptions/92d2a2d8-b514-432d-8cc9-a5f9272630d5"), // SupportedAggregationTypes: []*armmonitor.MetricAggregationType{ // to.Ptr(armmonitor.MetricAggregationTypeNone), // to.Ptr(armmonitor.MetricAggregationTypeAverage), // to.Ptr(armmonitor.MetricAggregationTypeMinimum), // to.Ptr(armmonitor.MetricAggregationTypeMaximum), // to.Ptr(armmonitor.MetricAggregationTypeTotal), // to.Ptr(armmonitor.MetricAggregationTypeCount)}, // Unit: to.Ptr(armmonitor.MetricUnitBytes), // }, // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("Disk Write Bytes"), // Value: to.Ptr("Disk Write Bytes"), // }, // Dimensions: []*armmonitor.LocalizableString{ // { // LocalizedValue: to.Ptr("Microsoft.ResourceId"), // Value: to.Ptr("Microsoft.ResourceId"), // }, // { // LocalizedValue: to.Ptr("Microsoft.ResourceGroupName"), // Value: to.Ptr("Microsoft.ResourceGroupName"), // }}, // DisplayDescription: to.Ptr("Bytes written to disk during monitoring period"), // ID: to.Ptr("subscriptions/92d2a2d8-b514-432d-8cc9-a5f9272630d5/providers/microsoft.insights/metricdefinitions/Disk Write Bytes"), // IsDimensionRequired: to.Ptr(false), // MetricAvailabilities: []*armmonitor.MetricAvailability{ // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT5M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT15M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT30M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT6H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT12H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("P1D"), // }}, // Namespace: to.Ptr("microsoft.compute/virtualmachines"), // PrimaryAggregationType: to.Ptr(armmonitor.MetricAggregationTypeTotal), // ResourceID: to.Ptr("subscriptions/92d2a2d8-b514-432d-8cc9-a5f9272630d5"), // SupportedAggregationTypes: []*armmonitor.MetricAggregationType{ // to.Ptr(armmonitor.MetricAggregationTypeNone), // to.Ptr(armmonitor.MetricAggregationTypeAverage), // to.Ptr(armmonitor.MetricAggregationTypeMinimum), // to.Ptr(armmonitor.MetricAggregationTypeMaximum), // to.Ptr(armmonitor.MetricAggregationTypeTotal), // to.Ptr(armmonitor.MetricAggregationTypeCount)}, // Unit: to.Ptr(armmonitor.MetricUnitBytes), // }, // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("Disk Read Operations/Sec"), // Value: to.Ptr("Disk Read Operations/Sec"), // }, // Dimensions: []*armmonitor.LocalizableString{ // { // LocalizedValue: to.Ptr("Microsoft.ResourceId"), // Value: to.Ptr("Microsoft.ResourceId"), // }, // { // LocalizedValue: to.Ptr("Microsoft.ResourceGroupName"), // Value: to.Ptr("Microsoft.ResourceGroupName"), // }}, // DisplayDescription: to.Ptr("Disk Read IOPS"), // ID: to.Ptr("subscriptions/92d2a2d8-b514-432d-8cc9-a5f9272630d5/providers/microsoft.insights/metricdefinitions/Disk Read Operations/Sec"), // IsDimensionRequired: to.Ptr(false), // MetricAvailabilities: []*armmonitor.MetricAvailability{ // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT5M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT15M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT30M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT6H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT12H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("P1D"), // }}, // Namespace: to.Ptr("microsoft.compute/virtualmachines"), // PrimaryAggregationType: to.Ptr(armmonitor.MetricAggregationTypeAverage), // ResourceID: to.Ptr("subscriptions/92d2a2d8-b514-432d-8cc9-a5f9272630d5"), // SupportedAggregationTypes: []*armmonitor.MetricAggregationType{ // to.Ptr(armmonitor.MetricAggregationTypeNone), // to.Ptr(armmonitor.MetricAggregationTypeAverage), // to.Ptr(armmonitor.MetricAggregationTypeMinimum), // to.Ptr(armmonitor.MetricAggregationTypeMaximum), // to.Ptr(armmonitor.MetricAggregationTypeTotal), // to.Ptr(armmonitor.MetricAggregationTypeCount)}, // Unit: to.Ptr(armmonitor.MetricUnitCountPerSecond), // }, // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("Disk Write Operations/Sec"), // Value: to.Ptr("Disk Write Operations/Sec"), // }, // Dimensions: []*armmonitor.LocalizableString{ // { // LocalizedValue: to.Ptr("Microsoft.ResourceId"), // Value: to.Ptr("Microsoft.ResourceId"), // }, // { // LocalizedValue: to.Ptr("Microsoft.ResourceGroupName"), // Value: to.Ptr("Microsoft.ResourceGroupName"), // }}, // DisplayDescription: to.Ptr("Disk Write IOPS"), // ID: to.Ptr("subscriptions/92d2a2d8-b514-432d-8cc9-a5f9272630d5/providers/microsoft.insights/metricdefinitions/Disk Write Operations/Sec"), // IsDimensionRequired: to.Ptr(false), // MetricAvailabilities: []*armmonitor.MetricAvailability{ // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT5M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT15M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT30M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT6H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT12H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("P1D"), // }}, // Namespace: to.Ptr("microsoft.compute/virtualmachines"), // PrimaryAggregationType: to.Ptr(armmonitor.MetricAggregationTypeAverage), // ResourceID: to.Ptr("subscriptions/92d2a2d8-b514-432d-8cc9-a5f9272630d5"), // SupportedAggregationTypes: []*armmonitor.MetricAggregationType{ // to.Ptr(armmonitor.MetricAggregationTypeNone), // to.Ptr(armmonitor.MetricAggregationTypeAverage), // to.Ptr(armmonitor.MetricAggregationTypeMinimum), // to.Ptr(armmonitor.MetricAggregationTypeMaximum), // to.Ptr(armmonitor.MetricAggregationTypeTotal), // to.Ptr(armmonitor.MetricAggregationTypeCount)}, // Unit: to.Ptr(armmonitor.MetricUnitCountPerSecond), // }, // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("CPU Credits Remaining"), // Value: to.Ptr("CPU Credits Remaining"), // }, // Dimensions: []*armmonitor.LocalizableString{ // { // LocalizedValue: to.Ptr("Microsoft.ResourceId"), // Value: to.Ptr("Microsoft.ResourceId"), // }, // { // LocalizedValue: to.Ptr("Microsoft.ResourceGroupName"), // Value: to.Ptr("Microsoft.ResourceGroupName"), // }}, // DisplayDescription: to.Ptr("Total number of credits available to burst. Only available on B-series burstable VMs"), // ID: to.Ptr("subscriptions/92d2a2d8-b514-432d-8cc9-a5f9272630d5/providers/microsoft.insights/metricdefinitions/CPU Credits Remaining"), // IsDimensionRequired: to.Ptr(false), // MetricAvailabilities: []*armmonitor.MetricAvailability{ // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT5M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT15M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT30M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT6H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT12H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("P1D"), // }}, // Namespace: to.Ptr("microsoft.compute/virtualmachines"), // PrimaryAggregationType: to.Ptr(armmonitor.MetricAggregationTypeAverage), // ResourceID: to.Ptr("subscriptions/92d2a2d8-b514-432d-8cc9-a5f9272630d5"), // SupportedAggregationTypes: []*armmonitor.MetricAggregationType{ // to.Ptr(armmonitor.MetricAggregationTypeNone), // to.Ptr(armmonitor.MetricAggregationTypeAverage), // to.Ptr(armmonitor.MetricAggregationTypeMinimum), // to.Ptr(armmonitor.MetricAggregationTypeMaximum), // to.Ptr(armmonitor.MetricAggregationTypeTotal), // to.Ptr(armmonitor.MetricAggregationTypeCount)}, // Unit: to.Ptr(armmonitor.MetricUnitCount), // }, // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("CPU Credits Consumed"), // Value: to.Ptr("CPU Credits Consumed"), // }, // Dimensions: []*armmonitor.LocalizableString{ // { // LocalizedValue: to.Ptr("Microsoft.ResourceId"), // Value: to.Ptr("Microsoft.ResourceId"), // }, // { // LocalizedValue: to.Ptr("Microsoft.ResourceGroupName"), // Value: to.Ptr("Microsoft.ResourceGroupName"), // }}, // DisplayDescription: to.Ptr("Total number of credits consumed by the Virtual Machine. Only available on B-series burstable VMs"), // ID: to.Ptr("subscriptions/92d2a2d8-b514-432d-8cc9-a5f9272630d5/providers/microsoft.insights/metricdefinitions/CPU Credits Consumed"), // IsDimensionRequired: to.Ptr(false), // MetricAvailabilities: []*armmonitor.MetricAvailability{ // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT5M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT15M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT30M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT6H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT12H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("P1D"), // }}, // Namespace: to.Ptr("microsoft.compute/virtualmachines"), // PrimaryAggregationType: to.Ptr(armmonitor.MetricAggregationTypeAverage), // ResourceID: to.Ptr("subscriptions/92d2a2d8-b514-432d-8cc9-a5f9272630d5"), // SupportedAggregationTypes: []*armmonitor.MetricAggregationType{ // to.Ptr(armmonitor.MetricAggregationTypeNone), // to.Ptr(armmonitor.MetricAggregationTypeAverage), // to.Ptr(armmonitor.MetricAggregationTypeMinimum), // to.Ptr(armmonitor.MetricAggregationTypeMaximum), // to.Ptr(armmonitor.MetricAggregationTypeTotal), // to.Ptr(armmonitor.MetricAggregationTypeCount)}, // Unit: to.Ptr(armmonitor.MetricUnitCount), // }, // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("Data Disk Read Bytes/Sec"), // Value: to.Ptr("Data Disk Read Bytes/sec"), // }, // Dimensions: []*armmonitor.LocalizableString{ // { // LocalizedValue: to.Ptr("LUN"), // Value: to.Ptr("LUN"), // }, // { // LocalizedValue: to.Ptr("Microsoft.ResourceId"), // Value: to.Ptr("Microsoft.ResourceId"), // }, // { // LocalizedValue: to.Ptr("Microsoft.ResourceGroupName"), // Value: to.Ptr("Microsoft.ResourceGroupName"), // }}, // DisplayDescription: to.Ptr("Bytes/Sec read from a single disk during monitoring period"), // ID: to.Ptr("subscriptions/92d2a2d8-b514-432d-8cc9-a5f9272630d5/providers/microsoft.insights/metricdefinitions/Data Disk Read Bytes/sec"), // IsDimensionRequired: to.Ptr(false), // MetricAvailabilities: []*armmonitor.MetricAvailability{ // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT5M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT15M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT30M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT6H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT12H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("P1D"), // }}, // Namespace: to.Ptr("microsoft.compute/virtualmachines"), // PrimaryAggregationType: to.Ptr(armmonitor.MetricAggregationTypeAverage), // ResourceID: to.Ptr("subscriptions/92d2a2d8-b514-432d-8cc9-a5f9272630d5"), // SupportedAggregationTypes: []*armmonitor.MetricAggregationType{ // to.Ptr(armmonitor.MetricAggregationTypeNone), // to.Ptr(armmonitor.MetricAggregationTypeAverage), // to.Ptr(armmonitor.MetricAggregationTypeMinimum), // to.Ptr(armmonitor.MetricAggregationTypeMaximum), // to.Ptr(armmonitor.MetricAggregationTypeTotal), // to.Ptr(armmonitor.MetricAggregationTypeCount)}, // Unit: to.Ptr(armmonitor.MetricUnitBytesPerSecond), // }, // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("Data Disk Write Bytes/Sec"), // Value: to.Ptr("Data Disk Write Bytes/sec"), // }, // Dimensions: []*armmonitor.LocalizableString{ // { // LocalizedValue: to.Ptr("LUN"), // Value: to.Ptr("LUN"), // }, // { // LocalizedValue: to.Ptr("Microsoft.ResourceId"), // Value: to.Ptr("Microsoft.ResourceId"), // }, // { // LocalizedValue: to.Ptr("Microsoft.ResourceGroupName"), // Value: to.Ptr("Microsoft.ResourceGroupName"), // }}, // DisplayDescription: to.Ptr("Bytes/Sec written to a single disk during monitoring period"), // ID: to.Ptr("subscriptions/92d2a2d8-b514-432d-8cc9-a5f9272630d5/providers/microsoft.insights/metricdefinitions/Data Disk Write Bytes/sec"), // IsDimensionRequired: to.Ptr(false), // MetricAvailabilities: []*armmonitor.MetricAvailability{ // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT5M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT15M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT30M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT6H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT12H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("P1D"), // }}, // Namespace: to.Ptr("microsoft.compute/virtualmachines"), // PrimaryAggregationType: to.Ptr(armmonitor.MetricAggregationTypeAverage), // ResourceID: to.Ptr("subscriptions/92d2a2d8-b514-432d-8cc9-a5f9272630d5"), // SupportedAggregationTypes: []*armmonitor.MetricAggregationType{ // to.Ptr(armmonitor.MetricAggregationTypeNone), // to.Ptr(armmonitor.MetricAggregationTypeAverage), // to.Ptr(armmonitor.MetricAggregationTypeMinimum), // to.Ptr(armmonitor.MetricAggregationTypeMaximum), // to.Ptr(armmonitor.MetricAggregationTypeTotal), // to.Ptr(armmonitor.MetricAggregationTypeCount)}, // Unit: to.Ptr(armmonitor.MetricUnitBytesPerSecond), // }, // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("Data Disk Read Operations/Sec"), // Value: to.Ptr("Data Disk Read Operations/Sec"), // }, // Dimensions: []*armmonitor.LocalizableString{ // { // LocalizedValue: to.Ptr("LUN"), // Value: to.Ptr("LUN"), // }, // { // LocalizedValue: to.Ptr("Microsoft.ResourceId"), // Value: to.Ptr("Microsoft.ResourceId"), // }, // { // LocalizedValue: to.Ptr("Microsoft.ResourceGroupName"), // Value: to.Ptr("Microsoft.ResourceGroupName"), // }}, // DisplayDescription: to.Ptr("Read IOPS from a single disk during monitoring period"), // ID: to.Ptr("subscriptions/92d2a2d8-b514-432d-8cc9-a5f9272630d5/providers/microsoft.insights/metricdefinitions/Data Disk Read Operations/Sec"), // IsDimensionRequired: to.Ptr(false), // MetricAvailabilities: []*armmonitor.MetricAvailability{ // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT5M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT15M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT30M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT6H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT12H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("P1D"), // }}, // Namespace: to.Ptr("microsoft.compute/virtualmachines"), // PrimaryAggregationType: to.Ptr(armmonitor.MetricAggregationTypeAverage), // ResourceID: to.Ptr("subscriptions/92d2a2d8-b514-432d-8cc9-a5f9272630d5"), // SupportedAggregationTypes: []*armmonitor.MetricAggregationType{ // to.Ptr(armmonitor.MetricAggregationTypeNone), // to.Ptr(armmonitor.MetricAggregationTypeAverage), // to.Ptr(armmonitor.MetricAggregationTypeMinimum), // to.Ptr(armmonitor.MetricAggregationTypeMaximum), // to.Ptr(armmonitor.MetricAggregationTypeTotal), // to.Ptr(armmonitor.MetricAggregationTypeCount)}, // Unit: to.Ptr(armmonitor.MetricUnitCountPerSecond), // }, // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("Data Disk Write Operations/Sec"), // Value: to.Ptr("Data Disk Write Operations/Sec"), // }, // Dimensions: []*armmonitor.LocalizableString{ // { // LocalizedValue: to.Ptr("LUN"), // Value: to.Ptr("LUN"), // }, // { // LocalizedValue: to.Ptr("Microsoft.ResourceId"), // Value: to.Ptr("Microsoft.ResourceId"), // }, // { // LocalizedValue: to.Ptr("Microsoft.ResourceGroupName"), // Value: to.Ptr("Microsoft.ResourceGroupName"), // }}, // DisplayDescription: to.Ptr("Write IOPS from a single disk during monitoring period"), // ID: to.Ptr("subscriptions/92d2a2d8-b514-432d-8cc9-a5f9272630d5/providers/microsoft.insights/metricdefinitions/Data Disk Write Operations/Sec"), // IsDimensionRequired: to.Ptr(false), // MetricAvailabilities: []*armmonitor.MetricAvailability{ // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT5M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT15M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT30M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT6H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT12H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("P1D"), // }}, // Namespace: to.Ptr("microsoft.compute/virtualmachines"), // PrimaryAggregationType: to.Ptr(armmonitor.MetricAggregationTypeAverage), // ResourceID: to.Ptr("subscriptions/92d2a2d8-b514-432d-8cc9-a5f9272630d5"), // SupportedAggregationTypes: []*armmonitor.MetricAggregationType{ // to.Ptr(armmonitor.MetricAggregationTypeNone), // to.Ptr(armmonitor.MetricAggregationTypeAverage), // to.Ptr(armmonitor.MetricAggregationTypeMinimum), // to.Ptr(armmonitor.MetricAggregationTypeMaximum), // to.Ptr(armmonitor.MetricAggregationTypeTotal), // to.Ptr(armmonitor.MetricAggregationTypeCount)}, // Unit: to.Ptr(armmonitor.MetricUnitCountPerSecond), // }, // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("Data Disk Queue Depth"), // Value: to.Ptr("Data Disk Queue Depth"), // }, // Dimensions: []*armmonitor.LocalizableString{ // { // LocalizedValue: to.Ptr("LUN"), // Value: to.Ptr("LUN"), // }, // { // LocalizedValue: to.Ptr("Microsoft.ResourceId"), // Value: to.Ptr("Microsoft.ResourceId"), // }, // { // LocalizedValue: to.Ptr("Microsoft.ResourceGroupName"), // Value: to.Ptr("Microsoft.ResourceGroupName"), // }}, // DisplayDescription: to.Ptr("Data Disk Queue Depth(or Queue Length)"), // ID: to.Ptr("subscriptions/92d2a2d8-b514-432d-8cc9-a5f9272630d5/providers/microsoft.insights/metricdefinitions/Data Disk Queue Depth"), // IsDimensionRequired: to.Ptr(false), // MetricAvailabilities: []*armmonitor.MetricAvailability{ // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT5M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT15M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT30M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT6H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT12H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("P1D"), // }}, // Namespace: to.Ptr("microsoft.compute/virtualmachines"), // PrimaryAggregationType: to.Ptr(armmonitor.MetricAggregationTypeAverage), // ResourceID: to.Ptr("subscriptions/92d2a2d8-b514-432d-8cc9-a5f9272630d5"), // SupportedAggregationTypes: []*armmonitor.MetricAggregationType{ // to.Ptr(armmonitor.MetricAggregationTypeNone), // to.Ptr(armmonitor.MetricAggregationTypeAverage), // to.Ptr(armmonitor.MetricAggregationTypeMinimum), // to.Ptr(armmonitor.MetricAggregationTypeMaximum), // to.Ptr(armmonitor.MetricAggregationTypeTotal), // to.Ptr(armmonitor.MetricAggregationTypeCount)}, // Unit: to.Ptr(armmonitor.MetricUnitCount), // }, // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("Data Disk Bandwidth Consumed Percentage"), // Value: to.Ptr("Data Disk Bandwidth Consumed Percentage"), // }, // Dimensions: []*armmonitor.LocalizableString{ // { // LocalizedValue: to.Ptr("LUN"), // Value: to.Ptr("LUN"), // }, // { // LocalizedValue: to.Ptr("Microsoft.ResourceId"), // Value: to.Ptr("Microsoft.ResourceId"), // }, // { // LocalizedValue: to.Ptr("Microsoft.ResourceGroupName"), // Value: to.Ptr("Microsoft.ResourceGroupName"), // }}, // DisplayDescription: to.Ptr("Percentage of data disk bandwidth consumed per minute"), // ID: to.Ptr("subscriptions/92d2a2d8-b514-432d-8cc9-a5f9272630d5/providers/microsoft.insights/metricdefinitions/Data Disk Bandwidth Consumed Percentage"), // IsDimensionRequired: to.Ptr(false), // MetricAvailabilities: []*armmonitor.MetricAvailability{ // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT5M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT15M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT30M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT6H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT12H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("P1D"), // }}, // Namespace: to.Ptr("microsoft.compute/virtualmachines"), // PrimaryAggregationType: to.Ptr(armmonitor.MetricAggregationTypeAverage), // ResourceID: to.Ptr("subscriptions/92d2a2d8-b514-432d-8cc9-a5f9272630d5"), // SupportedAggregationTypes: []*armmonitor.MetricAggregationType{ // to.Ptr(armmonitor.MetricAggregationTypeNone), // to.Ptr(armmonitor.MetricAggregationTypeAverage), // to.Ptr(armmonitor.MetricAggregationTypeMinimum), // to.Ptr(armmonitor.MetricAggregationTypeMaximum), // to.Ptr(armmonitor.MetricAggregationTypeTotal), // to.Ptr(armmonitor.MetricAggregationTypeCount)}, // Unit: to.Ptr(armmonitor.MetricUnitPercent), // }, // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("Data Disk IOPS Consumed Percentage"), // Value: to.Ptr("Data Disk IOPS Consumed Percentage"), // }, // Dimensions: []*armmonitor.LocalizableString{ // { // LocalizedValue: to.Ptr("LUN"), // Value: to.Ptr("LUN"), // }, // { // LocalizedValue: to.Ptr("Microsoft.ResourceId"), // Value: to.Ptr("Microsoft.ResourceId"), // }, // { // LocalizedValue: to.Ptr("Microsoft.ResourceGroupName"), // Value: to.Ptr("Microsoft.ResourceGroupName"), // }}, // DisplayDescription: to.Ptr("Percentage of data disk I/Os consumed per minute"), // ID: to.Ptr("subscriptions/92d2a2d8-b514-432d-8cc9-a5f9272630d5/providers/microsoft.insights/metricdefinitions/Data Disk IOPS Consumed Percentage"), // IsDimensionRequired: to.Ptr(false), // MetricAvailabilities: []*armmonitor.MetricAvailability{ // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT5M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT15M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT30M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT6H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT12H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("P1D"), // }}, // Namespace: to.Ptr("microsoft.compute/virtualmachines"), // PrimaryAggregationType: to.Ptr(armmonitor.MetricAggregationTypeAverage), // ResourceID: to.Ptr("subscriptions/92d2a2d8-b514-432d-8cc9-a5f9272630d5"), // SupportedAggregationTypes: []*armmonitor.MetricAggregationType{ // to.Ptr(armmonitor.MetricAggregationTypeNone), // to.Ptr(armmonitor.MetricAggregationTypeAverage), // to.Ptr(armmonitor.MetricAggregationTypeMinimum), // to.Ptr(armmonitor.MetricAggregationTypeMaximum), // to.Ptr(armmonitor.MetricAggregationTypeTotal), // to.Ptr(armmonitor.MetricAggregationTypeCount)}, // Unit: to.Ptr(armmonitor.MetricUnitPercent), // }, // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("Data Disk Target Bandwidth"), // Value: to.Ptr("Data Disk Target Bandwidth"), // }, // Dimensions: []*armmonitor.LocalizableString{ // { // LocalizedValue: to.Ptr("LUN"), // Value: to.Ptr("LUN"), // }, // { // LocalizedValue: to.Ptr("Microsoft.ResourceId"), // Value: to.Ptr("Microsoft.ResourceId"), // }, // { // LocalizedValue: to.Ptr("Microsoft.ResourceGroupName"), // Value: to.Ptr("Microsoft.ResourceGroupName"), // }}, // DisplayDescription: to.Ptr("Baseline bytes per second throughput Data Disk can achieve without bursting"), // ID: to.Ptr("subscriptions/92d2a2d8-b514-432d-8cc9-a5f9272630d5/providers/microsoft.insights/metricdefinitions/Data Disk Target Bandwidth"), // IsDimensionRequired: to.Ptr(false), // MetricAvailabilities: []*armmonitor.MetricAvailability{ // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT5M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT15M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT30M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT6H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT12H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("P1D"), // }}, // Namespace: to.Ptr("microsoft.compute/virtualmachines"), // PrimaryAggregationType: to.Ptr(armmonitor.MetricAggregationTypeAverage), // ResourceID: to.Ptr("subscriptions/92d2a2d8-b514-432d-8cc9-a5f9272630d5"), // SupportedAggregationTypes: []*armmonitor.MetricAggregationType{ // to.Ptr(armmonitor.MetricAggregationTypeNone), // to.Ptr(armmonitor.MetricAggregationTypeAverage), // to.Ptr(armmonitor.MetricAggregationTypeMinimum), // to.Ptr(armmonitor.MetricAggregationTypeMaximum), // to.Ptr(armmonitor.MetricAggregationTypeTotal), // to.Ptr(armmonitor.MetricAggregationTypeCount)}, // Unit: to.Ptr(armmonitor.MetricUnitCount), // }, // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("Data Disk Target IOPS"), // Value: to.Ptr("Data Disk Target IOPS"), // }, // Dimensions: []*armmonitor.LocalizableString{ // { // LocalizedValue: to.Ptr("LUN"), // Value: to.Ptr("LUN"), // }, // { // LocalizedValue: to.Ptr("Microsoft.ResourceId"), // Value: to.Ptr("Microsoft.ResourceId"), // }, // { // LocalizedValue: to.Ptr("Microsoft.ResourceGroupName"), // Value: to.Ptr("Microsoft.ResourceGroupName"), // }}, // DisplayDescription: to.Ptr("Baseline IOPS Data Disk can achieve without bursting"), // ID: to.Ptr("subscriptions/92d2a2d8-b514-432d-8cc9-a5f9272630d5/providers/microsoft.insights/metricdefinitions/Data Disk Target IOPS"), // IsDimensionRequired: to.Ptr(false), // MetricAvailabilities: []*armmonitor.MetricAvailability{ // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT5M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT15M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT30M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT6H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT12H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("P1D"), // }}, // Namespace: to.Ptr("microsoft.compute/virtualmachines"), // PrimaryAggregationType: to.Ptr(armmonitor.MetricAggregationTypeAverage), // ResourceID: to.Ptr("subscriptions/92d2a2d8-b514-432d-8cc9-a5f9272630d5"), // SupportedAggregationTypes: []*armmonitor.MetricAggregationType{ // to.Ptr(armmonitor.MetricAggregationTypeNone), // to.Ptr(armmonitor.MetricAggregationTypeAverage), // to.Ptr(armmonitor.MetricAggregationTypeMinimum), // to.Ptr(armmonitor.MetricAggregationTypeMaximum), // to.Ptr(armmonitor.MetricAggregationTypeTotal), // to.Ptr(armmonitor.MetricAggregationTypeCount)}, // Unit: to.Ptr(armmonitor.MetricUnitCount), // }, // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("Data Disk Max Burst Bandwidth"), // Value: to.Ptr("Data Disk Max Burst Bandwidth"), // }, // Dimensions: []*armmonitor.LocalizableString{ // { // LocalizedValue: to.Ptr("LUN"), // Value: to.Ptr("LUN"), // }, // { // LocalizedValue: to.Ptr("Microsoft.ResourceId"), // Value: to.Ptr("Microsoft.ResourceId"), // }, // { // LocalizedValue: to.Ptr("Microsoft.ResourceGroupName"), // Value: to.Ptr("Microsoft.ResourceGroupName"), // }}, // DisplayDescription: to.Ptr("Maximum bytes per second throughput Data Disk can achieve with bursting"), // ID: to.Ptr("subscriptions/92d2a2d8-b514-432d-8cc9-a5f9272630d5/providers/microsoft.insights/metricdefinitions/Data Disk Max Burst Bandwidth"), // IsDimensionRequired: to.Ptr(false), // MetricAvailabilities: []*armmonitor.MetricAvailability{ // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT5M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT15M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT30M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT6H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT12H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("P1D"), // }}, // Namespace: to.Ptr("microsoft.compute/virtualmachines"), // PrimaryAggregationType: to.Ptr(armmonitor.MetricAggregationTypeAverage), // ResourceID: to.Ptr("subscriptions/92d2a2d8-b514-432d-8cc9-a5f9272630d5"), // SupportedAggregationTypes: []*armmonitor.MetricAggregationType{ // to.Ptr(armmonitor.MetricAggregationTypeNone), // to.Ptr(armmonitor.MetricAggregationTypeAverage), // to.Ptr(armmonitor.MetricAggregationTypeMinimum), // to.Ptr(armmonitor.MetricAggregationTypeMaximum), // to.Ptr(armmonitor.MetricAggregationTypeTotal), // to.Ptr(armmonitor.MetricAggregationTypeCount)}, // Unit: to.Ptr(armmonitor.MetricUnitCount), // }, // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("Data Disk Max Burst IOPS"), // Value: to.Ptr("Data Disk Max Burst IOPS"), // }, // Dimensions: []*armmonitor.LocalizableString{ // { // LocalizedValue: to.Ptr("LUN"), // Value: to.Ptr("LUN"), // }, // { // LocalizedValue: to.Ptr("Microsoft.ResourceId"), // Value: to.Ptr("Microsoft.ResourceId"), // }, // { // LocalizedValue: to.Ptr("Microsoft.ResourceGroupName"), // Value: to.Ptr("Microsoft.ResourceGroupName"), // }}, // DisplayDescription: to.Ptr("Maximum IOPS Data Disk can achieve with bursting"), // ID: to.Ptr("subscriptions/92d2a2d8-b514-432d-8cc9-a5f9272630d5/providers/microsoft.insights/metricdefinitions/Data Disk Max Burst IOPS"), // IsDimensionRequired: to.Ptr(false), // MetricAvailabilities: []*armmonitor.MetricAvailability{ // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT5M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT15M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT30M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT6H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT12H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("P1D"), // }}, // Namespace: to.Ptr("microsoft.compute/virtualmachines"), // PrimaryAggregationType: to.Ptr(armmonitor.MetricAggregationTypeAverage), // ResourceID: to.Ptr("subscriptions/92d2a2d8-b514-432d-8cc9-a5f9272630d5"), // SupportedAggregationTypes: []*armmonitor.MetricAggregationType{ // to.Ptr(armmonitor.MetricAggregationTypeNone), // to.Ptr(armmonitor.MetricAggregationTypeAverage), // to.Ptr(armmonitor.MetricAggregationTypeMinimum), // to.Ptr(armmonitor.MetricAggregationTypeMaximum), // to.Ptr(armmonitor.MetricAggregationTypeTotal), // to.Ptr(armmonitor.MetricAggregationTypeCount)}, // Unit: to.Ptr(armmonitor.MetricUnitCount), // }, // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("Data Disk Used Burst BPS Credits Percentage"), // Value: to.Ptr("Data Disk Used Burst BPS Credits Percentage"), // }, // Dimensions: []*armmonitor.LocalizableString{ // { // LocalizedValue: to.Ptr("LUN"), // Value: to.Ptr("LUN"), // }, // { // LocalizedValue: to.Ptr("Microsoft.ResourceId"), // Value: to.Ptr("Microsoft.ResourceId"), // }, // { // LocalizedValue: to.Ptr("Microsoft.ResourceGroupName"), // Value: to.Ptr("Microsoft.ResourceGroupName"), // }}, // DisplayDescription: to.Ptr("Percentage of Data Disk burst bandwidth credits used so far"), // ID: to.Ptr("subscriptions/92d2a2d8-b514-432d-8cc9-a5f9272630d5/providers/microsoft.insights/metricdefinitions/Data Disk Used Burst BPS Credits Percentage"), // IsDimensionRequired: to.Ptr(false), // MetricAvailabilities: []*armmonitor.MetricAvailability{ // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT5M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT15M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT30M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT6H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT12H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("P1D"), // }}, // Namespace: to.Ptr("microsoft.compute/virtualmachines"), // PrimaryAggregationType: to.Ptr(armmonitor.MetricAggregationTypeAverage), // ResourceID: to.Ptr("subscriptions/92d2a2d8-b514-432d-8cc9-a5f9272630d5"), // SupportedAggregationTypes: []*armmonitor.MetricAggregationType{ // to.Ptr(armmonitor.MetricAggregationTypeNone), // to.Ptr(armmonitor.MetricAggregationTypeAverage), // to.Ptr(armmonitor.MetricAggregationTypeMinimum), // to.Ptr(armmonitor.MetricAggregationTypeMaximum), // to.Ptr(armmonitor.MetricAggregationTypeTotal), // to.Ptr(armmonitor.MetricAggregationTypeCount)}, // Unit: to.Ptr(armmonitor.MetricUnitPercent), // }, // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("Data Disk Used Burst IO Credits Percentage"), // Value: to.Ptr("Data Disk Used Burst IO Credits Percentage"), // }, // Dimensions: []*armmonitor.LocalizableString{ // { // LocalizedValue: to.Ptr("LUN"), // Value: to.Ptr("LUN"), // }, // { // LocalizedValue: to.Ptr("Microsoft.ResourceId"), // Value: to.Ptr("Microsoft.ResourceId"), // }, // { // LocalizedValue: to.Ptr("Microsoft.ResourceGroupName"), // Value: to.Ptr("Microsoft.ResourceGroupName"), // }}, // DisplayDescription: to.Ptr("Percentage of Data Disk burst I/O credits used so far"), // ID: to.Ptr("subscriptions/92d2a2d8-b514-432d-8cc9-a5f9272630d5/providers/microsoft.insights/metricdefinitions/Data Disk Used Burst IO Credits Percentage"), // IsDimensionRequired: to.Ptr(false), // MetricAvailabilities: []*armmonitor.MetricAvailability{ // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT5M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT15M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT30M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT6H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT12H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("P1D"), // }}, // Namespace: to.Ptr("microsoft.compute/virtualmachines"), // PrimaryAggregationType: to.Ptr(armmonitor.MetricAggregationTypeAverage), // ResourceID: to.Ptr("subscriptions/92d2a2d8-b514-432d-8cc9-a5f9272630d5"), // SupportedAggregationTypes: []*armmonitor.MetricAggregationType{ // to.Ptr(armmonitor.MetricAggregationTypeNone), // to.Ptr(armmonitor.MetricAggregationTypeAverage), // to.Ptr(armmonitor.MetricAggregationTypeMinimum), // to.Ptr(armmonitor.MetricAggregationTypeMaximum), // to.Ptr(armmonitor.MetricAggregationTypeTotal), // to.Ptr(armmonitor.MetricAggregationTypeCount)}, // Unit: to.Ptr(armmonitor.MetricUnitPercent), // }, // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("OS Disk Read Bytes/Sec"), // Value: to.Ptr("OS Disk Read Bytes/sec"), // }, // Dimensions: []*armmonitor.LocalizableString{ // { // LocalizedValue: to.Ptr("Microsoft.ResourceId"), // Value: to.Ptr("Microsoft.ResourceId"), // }, // { // LocalizedValue: to.Ptr("Microsoft.ResourceGroupName"), // Value: to.Ptr("Microsoft.ResourceGroupName"), // }}, // DisplayDescription: to.Ptr("Bytes/Sec read from a single disk during monitoring period for OS disk"), // ID: to.Ptr("subscriptions/92d2a2d8-b514-432d-8cc9-a5f9272630d5/providers/microsoft.insights/metricdefinitions/OS Disk Read Bytes/sec"), // IsDimensionRequired: to.Ptr(false), // MetricAvailabilities: []*armmonitor.MetricAvailability{ // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT5M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT15M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT30M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT6H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT12H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("P1D"), // }}, // Namespace: to.Ptr("microsoft.compute/virtualmachines"), // PrimaryAggregationType: to.Ptr(armmonitor.MetricAggregationTypeAverage), // ResourceID: to.Ptr("subscriptions/92d2a2d8-b514-432d-8cc9-a5f9272630d5"), // SupportedAggregationTypes: []*armmonitor.MetricAggregationType{ // to.Ptr(armmonitor.MetricAggregationTypeNone), // to.Ptr(armmonitor.MetricAggregationTypeAverage), // to.Ptr(armmonitor.MetricAggregationTypeMinimum), // to.Ptr(armmonitor.MetricAggregationTypeMaximum), // to.Ptr(armmonitor.MetricAggregationTypeTotal), // to.Ptr(armmonitor.MetricAggregationTypeCount)}, // Unit: to.Ptr(armmonitor.MetricUnitBytesPerSecond), // }, // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("OS Disk Write Bytes/Sec"), // Value: to.Ptr("OS Disk Write Bytes/sec"), // }, // Dimensions: []*armmonitor.LocalizableString{ // { // LocalizedValue: to.Ptr("Microsoft.ResourceId"), // Value: to.Ptr("Microsoft.ResourceId"), // }, // { // LocalizedValue: to.Ptr("Microsoft.ResourceGroupName"), // Value: to.Ptr("Microsoft.ResourceGroupName"), // }}, // DisplayDescription: to.Ptr("Bytes/Sec written to a single disk during monitoring period for OS disk"), // ID: to.Ptr("subscriptions/92d2a2d8-b514-432d-8cc9-a5f9272630d5/providers/microsoft.insights/metricdefinitions/OS Disk Write Bytes/sec"), // IsDimensionRequired: to.Ptr(false), // MetricAvailabilities: []*armmonitor.MetricAvailability{ // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT5M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT15M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT30M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT6H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT12H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("P1D"), // }}, // Namespace: to.Ptr("microsoft.compute/virtualmachines"), // PrimaryAggregationType: to.Ptr(armmonitor.MetricAggregationTypeAverage), // ResourceID: to.Ptr("subscriptions/92d2a2d8-b514-432d-8cc9-a5f9272630d5"), // SupportedAggregationTypes: []*armmonitor.MetricAggregationType{ // to.Ptr(armmonitor.MetricAggregationTypeNone), // to.Ptr(armmonitor.MetricAggregationTypeAverage), // to.Ptr(armmonitor.MetricAggregationTypeMinimum), // to.Ptr(armmonitor.MetricAggregationTypeMaximum), // to.Ptr(armmonitor.MetricAggregationTypeTotal), // to.Ptr(armmonitor.MetricAggregationTypeCount)}, // Unit: to.Ptr(armmonitor.MetricUnitBytesPerSecond), // }, // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("OS Disk Read Operations/Sec"), // Value: to.Ptr("OS Disk Read Operations/Sec"), // }, // Dimensions: []*armmonitor.LocalizableString{ // { // LocalizedValue: to.Ptr("Microsoft.ResourceId"), // Value: to.Ptr("Microsoft.ResourceId"), // }, // { // LocalizedValue: to.Ptr("Microsoft.ResourceGroupName"), // Value: to.Ptr("Microsoft.ResourceGroupName"), // }}, // DisplayDescription: to.Ptr("Read IOPS from a single disk during monitoring period for OS disk"), // ID: to.Ptr("subscriptions/92d2a2d8-b514-432d-8cc9-a5f9272630d5/providers/microsoft.insights/metricdefinitions/OS Disk Read Operations/Sec"), // IsDimensionRequired: to.Ptr(false), // MetricAvailabilities: []*armmonitor.MetricAvailability{ // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT5M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT15M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT30M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT6H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT12H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("P1D"), // }}, // Namespace: to.Ptr("microsoft.compute/virtualmachines"), // PrimaryAggregationType: to.Ptr(armmonitor.MetricAggregationTypeAverage), // ResourceID: to.Ptr("subscriptions/92d2a2d8-b514-432d-8cc9-a5f9272630d5"), // SupportedAggregationTypes: []*armmonitor.MetricAggregationType{ // to.Ptr(armmonitor.MetricAggregationTypeNone), // to.Ptr(armmonitor.MetricAggregationTypeAverage), // to.Ptr(armmonitor.MetricAggregationTypeMinimum), // to.Ptr(armmonitor.MetricAggregationTypeMaximum), // to.Ptr(armmonitor.MetricAggregationTypeTotal), // to.Ptr(armmonitor.MetricAggregationTypeCount)}, // Unit: to.Ptr(armmonitor.MetricUnitCountPerSecond), // }, // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("OS Disk Write Operations/Sec"), // Value: to.Ptr("OS Disk Write Operations/Sec"), // }, // Dimensions: []*armmonitor.LocalizableString{ // { // LocalizedValue: to.Ptr("Microsoft.ResourceId"), // Value: to.Ptr("Microsoft.ResourceId"), // }, // { // LocalizedValue: to.Ptr("Microsoft.ResourceGroupName"), // Value: to.Ptr("Microsoft.ResourceGroupName"), // }}, // DisplayDescription: to.Ptr("Write IOPS from a single disk during monitoring period for OS disk"), // ID: to.Ptr("subscriptions/92d2a2d8-b514-432d-8cc9-a5f9272630d5/providers/microsoft.insights/metricdefinitions/OS Disk Write Operations/Sec"), // IsDimensionRequired: to.Ptr(false), // MetricAvailabilities: []*armmonitor.MetricAvailability{ // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT5M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT15M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT30M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT6H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT12H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("P1D"), // }}, // Namespace: to.Ptr("microsoft.compute/virtualmachines"), // PrimaryAggregationType: to.Ptr(armmonitor.MetricAggregationTypeAverage), // ResourceID: to.Ptr("subscriptions/92d2a2d8-b514-432d-8cc9-a5f9272630d5"), // SupportedAggregationTypes: []*armmonitor.MetricAggregationType{ // to.Ptr(armmonitor.MetricAggregationTypeNone), // to.Ptr(armmonitor.MetricAggregationTypeAverage), // to.Ptr(armmonitor.MetricAggregationTypeMinimum), // to.Ptr(armmonitor.MetricAggregationTypeMaximum), // to.Ptr(armmonitor.MetricAggregationTypeTotal), // to.Ptr(armmonitor.MetricAggregationTypeCount)}, // Unit: to.Ptr(armmonitor.MetricUnitCountPerSecond), // }, // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("OS Disk Queue Depth"), // Value: to.Ptr("OS Disk Queue Depth"), // }, // Dimensions: []*armmonitor.LocalizableString{ // { // LocalizedValue: to.Ptr("Microsoft.ResourceId"), // Value: to.Ptr("Microsoft.ResourceId"), // }, // { // LocalizedValue: to.Ptr("Microsoft.ResourceGroupName"), // Value: to.Ptr("Microsoft.ResourceGroupName"), // }}, // DisplayDescription: to.Ptr("OS Disk Queue Depth(or Queue Length)"), // ID: to.Ptr("subscriptions/92d2a2d8-b514-432d-8cc9-a5f9272630d5/providers/microsoft.insights/metricdefinitions/OS Disk Queue Depth"), // IsDimensionRequired: to.Ptr(false), // MetricAvailabilities: []*armmonitor.MetricAvailability{ // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT5M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT15M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT30M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT6H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT12H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("P1D"), // }}, // Namespace: to.Ptr("microsoft.compute/virtualmachines"), // PrimaryAggregationType: to.Ptr(armmonitor.MetricAggregationTypeAverage), // ResourceID: to.Ptr("subscriptions/92d2a2d8-b514-432d-8cc9-a5f9272630d5"), // SupportedAggregationTypes: []*armmonitor.MetricAggregationType{ // to.Ptr(armmonitor.MetricAggregationTypeNone), // to.Ptr(armmonitor.MetricAggregationTypeAverage), // to.Ptr(armmonitor.MetricAggregationTypeMinimum), // to.Ptr(armmonitor.MetricAggregationTypeMaximum), // to.Ptr(armmonitor.MetricAggregationTypeTotal), // to.Ptr(armmonitor.MetricAggregationTypeCount)}, // Unit: to.Ptr(armmonitor.MetricUnitCount), // }, // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("OS Disk Bandwidth Consumed Percentage"), // Value: to.Ptr("OS Disk Bandwidth Consumed Percentage"), // }, // Dimensions: []*armmonitor.LocalizableString{ // { // LocalizedValue: to.Ptr("LUN"), // Value: to.Ptr("LUN"), // }, // { // LocalizedValue: to.Ptr("Microsoft.ResourceId"), // Value: to.Ptr("Microsoft.ResourceId"), // }, // { // LocalizedValue: to.Ptr("Microsoft.ResourceGroupName"), // Value: to.Ptr("Microsoft.ResourceGroupName"), // }}, // DisplayDescription: to.Ptr("Percentage of operating system disk bandwidth consumed per minute"), // ID: to.Ptr("subscriptions/92d2a2d8-b514-432d-8cc9-a5f9272630d5/providers/microsoft.insights/metricdefinitions/OS Disk Bandwidth Consumed Percentage"), // IsDimensionRequired: to.Ptr(false), // MetricAvailabilities: []*armmonitor.MetricAvailability{ // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT5M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT15M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT30M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT6H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT12H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("P1D"), // }}, // Namespace: to.Ptr("microsoft.compute/virtualmachines"), // PrimaryAggregationType: to.Ptr(armmonitor.MetricAggregationTypeAverage), // ResourceID: to.Ptr("subscriptions/92d2a2d8-b514-432d-8cc9-a5f9272630d5"), // SupportedAggregationTypes: []*armmonitor.MetricAggregationType{ // to.Ptr(armmonitor.MetricAggregationTypeNone), // to.Ptr(armmonitor.MetricAggregationTypeAverage), // to.Ptr(armmonitor.MetricAggregationTypeMinimum), // to.Ptr(armmonitor.MetricAggregationTypeMaximum), // to.Ptr(armmonitor.MetricAggregationTypeTotal), // to.Ptr(armmonitor.MetricAggregationTypeCount)}, // Unit: to.Ptr(armmonitor.MetricUnitPercent), // }, // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("OS Disk IOPS Consumed Percentage"), // Value: to.Ptr("OS Disk IOPS Consumed Percentage"), // }, // Dimensions: []*armmonitor.LocalizableString{ // { // LocalizedValue: to.Ptr("LUN"), // Value: to.Ptr("LUN"), // }, // { // LocalizedValue: to.Ptr("Microsoft.ResourceId"), // Value: to.Ptr("Microsoft.ResourceId"), // }, // { // LocalizedValue: to.Ptr("Microsoft.ResourceGroupName"), // Value: to.Ptr("Microsoft.ResourceGroupName"), // }}, // DisplayDescription: to.Ptr("Percentage of operating system disk I/Os consumed per minute"), // ID: to.Ptr("subscriptions/92d2a2d8-b514-432d-8cc9-a5f9272630d5/providers/microsoft.insights/metricdefinitions/OS Disk IOPS Consumed Percentage"), // IsDimensionRequired: to.Ptr(false), // MetricAvailabilities: []*armmonitor.MetricAvailability{ // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT5M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT15M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT30M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT6H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT12H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("P1D"), // }}, // Namespace: to.Ptr("microsoft.compute/virtualmachines"), // PrimaryAggregationType: to.Ptr(armmonitor.MetricAggregationTypeAverage), // ResourceID: to.Ptr("subscriptions/92d2a2d8-b514-432d-8cc9-a5f9272630d5"), // SupportedAggregationTypes: []*armmonitor.MetricAggregationType{ // to.Ptr(armmonitor.MetricAggregationTypeNone), // to.Ptr(armmonitor.MetricAggregationTypeAverage), // to.Ptr(armmonitor.MetricAggregationTypeMinimum), // to.Ptr(armmonitor.MetricAggregationTypeMaximum), // to.Ptr(armmonitor.MetricAggregationTypeTotal), // to.Ptr(armmonitor.MetricAggregationTypeCount)}, // Unit: to.Ptr(armmonitor.MetricUnitPercent), // }, // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("OS Disk Target Bandwidth"), // Value: to.Ptr("OS Disk Target Bandwidth"), // }, // Dimensions: []*armmonitor.LocalizableString{ // { // LocalizedValue: to.Ptr("LUN"), // Value: to.Ptr("LUN"), // }, // { // LocalizedValue: to.Ptr("Microsoft.ResourceId"), // Value: to.Ptr("Microsoft.ResourceId"), // }, // { // LocalizedValue: to.Ptr("Microsoft.ResourceGroupName"), // Value: to.Ptr("Microsoft.ResourceGroupName"), // }}, // DisplayDescription: to.Ptr("Baseline bytes per second throughput OS Disk can achieve without bursting"), // ID: to.Ptr("subscriptions/92d2a2d8-b514-432d-8cc9-a5f9272630d5/providers/microsoft.insights/metricdefinitions/OS Disk Target Bandwidth"), // IsDimensionRequired: to.Ptr(false), // MetricAvailabilities: []*armmonitor.MetricAvailability{ // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT5M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT15M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT30M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT6H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT12H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("P1D"), // }}, // Namespace: to.Ptr("microsoft.compute/virtualmachines"), // PrimaryAggregationType: to.Ptr(armmonitor.MetricAggregationTypeAverage), // ResourceID: to.Ptr("subscriptions/92d2a2d8-b514-432d-8cc9-a5f9272630d5"), // SupportedAggregationTypes: []*armmonitor.MetricAggregationType{ // to.Ptr(armmonitor.MetricAggregationTypeNone), // to.Ptr(armmonitor.MetricAggregationTypeAverage), // to.Ptr(armmonitor.MetricAggregationTypeMinimum), // to.Ptr(armmonitor.MetricAggregationTypeMaximum), // to.Ptr(armmonitor.MetricAggregationTypeTotal), // to.Ptr(armmonitor.MetricAggregationTypeCount)}, // Unit: to.Ptr(armmonitor.MetricUnitCount), // }, // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("OS Disk Target IOPS"), // Value: to.Ptr("OS Disk Target IOPS"), // }, // Dimensions: []*armmonitor.LocalizableString{ // { // LocalizedValue: to.Ptr("LUN"), // Value: to.Ptr("LUN"), // }, // { // LocalizedValue: to.Ptr("Microsoft.ResourceId"), // Value: to.Ptr("Microsoft.ResourceId"), // }, // { // LocalizedValue: to.Ptr("Microsoft.ResourceGroupName"), // Value: to.Ptr("Microsoft.ResourceGroupName"), // }}, // DisplayDescription: to.Ptr("Baseline IOPS OS Disk can achieve without bursting"), // ID: to.Ptr("subscriptions/92d2a2d8-b514-432d-8cc9-a5f9272630d5/providers/microsoft.insights/metricdefinitions/OS Disk Target IOPS"), // IsDimensionRequired: to.Ptr(false), // MetricAvailabilities: []*armmonitor.MetricAvailability{ // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT5M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT15M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT30M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT6H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT12H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("P1D"), // }}, // Namespace: to.Ptr("microsoft.compute/virtualmachines"), // PrimaryAggregationType: to.Ptr(armmonitor.MetricAggregationTypeAverage), // ResourceID: to.Ptr("subscriptions/92d2a2d8-b514-432d-8cc9-a5f9272630d5"), // SupportedAggregationTypes: []*armmonitor.MetricAggregationType{ // to.Ptr(armmonitor.MetricAggregationTypeNone), // to.Ptr(armmonitor.MetricAggregationTypeAverage), // to.Ptr(armmonitor.MetricAggregationTypeMinimum), // to.Ptr(armmonitor.MetricAggregationTypeMaximum), // to.Ptr(armmonitor.MetricAggregationTypeTotal), // to.Ptr(armmonitor.MetricAggregationTypeCount)}, // Unit: to.Ptr(armmonitor.MetricUnitCount), // }, // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("OS Disk Max Burst Bandwidth"), // Value: to.Ptr("OS Disk Max Burst Bandwidth"), // }, // Dimensions: []*armmonitor.LocalizableString{ // { // LocalizedValue: to.Ptr("LUN"), // Value: to.Ptr("LUN"), // }, // { // LocalizedValue: to.Ptr("Microsoft.ResourceId"), // Value: to.Ptr("Microsoft.ResourceId"), // }, // { // LocalizedValue: to.Ptr("Microsoft.ResourceGroupName"), // Value: to.Ptr("Microsoft.ResourceGroupName"), // }}, // DisplayDescription: to.Ptr("Maximum bytes per second throughput OS Disk can achieve with bursting"), // ID: to.Ptr("subscriptions/92d2a2d8-b514-432d-8cc9-a5f9272630d5/providers/microsoft.insights/metricdefinitions/OS Disk Max Burst Bandwidth"), // IsDimensionRequired: to.Ptr(false), // MetricAvailabilities: []*armmonitor.MetricAvailability{ // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT5M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT15M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT30M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT6H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT12H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("P1D"), // }}, // Namespace: to.Ptr("microsoft.compute/virtualmachines"), // PrimaryAggregationType: to.Ptr(armmonitor.MetricAggregationTypeAverage), // ResourceID: to.Ptr("subscriptions/92d2a2d8-b514-432d-8cc9-a5f9272630d5"), // SupportedAggregationTypes: []*armmonitor.MetricAggregationType{ // to.Ptr(armmonitor.MetricAggregationTypeNone), // to.Ptr(armmonitor.MetricAggregationTypeAverage), // to.Ptr(armmonitor.MetricAggregationTypeMinimum), // to.Ptr(armmonitor.MetricAggregationTypeMaximum), // to.Ptr(armmonitor.MetricAggregationTypeTotal), // to.Ptr(armmonitor.MetricAggregationTypeCount)}, // Unit: to.Ptr(armmonitor.MetricUnitCount), // }, // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("OS Disk Max Burst IOPS"), // Value: to.Ptr("OS Disk Max Burst IOPS"), // }, // Dimensions: []*armmonitor.LocalizableString{ // { // LocalizedValue: to.Ptr("LUN"), // Value: to.Ptr("LUN"), // }, // { // LocalizedValue: to.Ptr("Microsoft.ResourceId"), // Value: to.Ptr("Microsoft.ResourceId"), // }, // { // LocalizedValue: to.Ptr("Microsoft.ResourceGroupName"), // Value: to.Ptr("Microsoft.ResourceGroupName"), // }}, // DisplayDescription: to.Ptr("Maximum IOPS OS Disk can achieve with bursting"), // ID: to.Ptr("subscriptions/92d2a2d8-b514-432d-8cc9-a5f9272630d5/providers/microsoft.insights/metricdefinitions/OS Disk Max Burst IOPS"), // IsDimensionRequired: to.Ptr(false), // MetricAvailabilities: []*armmonitor.MetricAvailability{ // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT5M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT15M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT30M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT6H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT12H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("P1D"), // }}, // Namespace: to.Ptr("microsoft.compute/virtualmachines"), // PrimaryAggregationType: to.Ptr(armmonitor.MetricAggregationTypeAverage), // ResourceID: to.Ptr("subscriptions/92d2a2d8-b514-432d-8cc9-a5f9272630d5"), // SupportedAggregationTypes: []*armmonitor.MetricAggregationType{ // to.Ptr(armmonitor.MetricAggregationTypeNone), // to.Ptr(armmonitor.MetricAggregationTypeAverage), // to.Ptr(armmonitor.MetricAggregationTypeMinimum), // to.Ptr(armmonitor.MetricAggregationTypeMaximum), // to.Ptr(armmonitor.MetricAggregationTypeTotal), // to.Ptr(armmonitor.MetricAggregationTypeCount)}, // Unit: to.Ptr(armmonitor.MetricUnitCount), // }, // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("OS Disk Used Burst BPS Credits Percentage"), // Value: to.Ptr("OS Disk Used Burst BPS Credits Percentage"), // }, // Dimensions: []*armmonitor.LocalizableString{ // { // LocalizedValue: to.Ptr("LUN"), // Value: to.Ptr("LUN"), // }, // { // LocalizedValue: to.Ptr("Microsoft.ResourceId"), // Value: to.Ptr("Microsoft.ResourceId"), // }, // { // LocalizedValue: to.Ptr("Microsoft.ResourceGroupName"), // Value: to.Ptr("Microsoft.ResourceGroupName"), // }}, // DisplayDescription: to.Ptr("Percentage of OS Disk burst bandwidth credits used so far"), // ID: to.Ptr("subscriptions/92d2a2d8-b514-432d-8cc9-a5f9272630d5/providers/microsoft.insights/metricdefinitions/OS Disk Used Burst BPS Credits Percentage"), // IsDimensionRequired: to.Ptr(false), // MetricAvailabilities: []*armmonitor.MetricAvailability{ // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT5M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT15M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT30M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT6H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT12H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("P1D"), // }}, // Namespace: to.Ptr("microsoft.compute/virtualmachines"), // PrimaryAggregationType: to.Ptr(armmonitor.MetricAggregationTypeAverage), // ResourceID: to.Ptr("subscriptions/92d2a2d8-b514-432d-8cc9-a5f9272630d5"), // SupportedAggregationTypes: []*armmonitor.MetricAggregationType{ // to.Ptr(armmonitor.MetricAggregationTypeNone), // to.Ptr(armmonitor.MetricAggregationTypeAverage), // to.Ptr(armmonitor.MetricAggregationTypeMinimum), // to.Ptr(armmonitor.MetricAggregationTypeMaximum), // to.Ptr(armmonitor.MetricAggregationTypeTotal), // to.Ptr(armmonitor.MetricAggregationTypeCount)}, // Unit: to.Ptr(armmonitor.MetricUnitPercent), // }, // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("OS Disk Used Burst IO Credits Percentage"), // Value: to.Ptr("OS Disk Used Burst IO Credits Percentage"), // }, // Dimensions: []*armmonitor.LocalizableString{ // { // LocalizedValue: to.Ptr("LUN"), // Value: to.Ptr("LUN"), // }, // { // LocalizedValue: to.Ptr("Microsoft.ResourceId"), // Value: to.Ptr("Microsoft.ResourceId"), // }, // { // LocalizedValue: to.Ptr("Microsoft.ResourceGroupName"), // Value: to.Ptr("Microsoft.ResourceGroupName"), // }}, // DisplayDescription: to.Ptr("Percentage of OS Disk burst I/O credits used so far"), // ID: to.Ptr("subscriptions/92d2a2d8-b514-432d-8cc9-a5f9272630d5/providers/microsoft.insights/metricdefinitions/OS Disk Used Burst IO Credits Percentage"), // IsDimensionRequired: to.Ptr(false), // MetricAvailabilities: []*armmonitor.MetricAvailability{ // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT5M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT15M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT30M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT6H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT12H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("P1D"), // }}, // Namespace: to.Ptr("microsoft.compute/virtualmachines"), // PrimaryAggregationType: to.Ptr(armmonitor.MetricAggregationTypeAverage), // ResourceID: to.Ptr("subscriptions/92d2a2d8-b514-432d-8cc9-a5f9272630d5"), // SupportedAggregationTypes: []*armmonitor.MetricAggregationType{ // to.Ptr(armmonitor.MetricAggregationTypeNone), // to.Ptr(armmonitor.MetricAggregationTypeAverage), // to.Ptr(armmonitor.MetricAggregationTypeMinimum), // to.Ptr(armmonitor.MetricAggregationTypeMaximum), // to.Ptr(armmonitor.MetricAggregationTypeTotal), // to.Ptr(armmonitor.MetricAggregationTypeCount)}, // Unit: to.Ptr(armmonitor.MetricUnitPercent), // }, // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("Inbound Flows"), // Value: to.Ptr("Inbound Flows"), // }, // Dimensions: []*armmonitor.LocalizableString{ // { // LocalizedValue: to.Ptr("Microsoft.ResourceId"), // Value: to.Ptr("Microsoft.ResourceId"), // }, // { // LocalizedValue: to.Ptr("Microsoft.ResourceGroupName"), // Value: to.Ptr("Microsoft.ResourceGroupName"), // }}, // DisplayDescription: to.Ptr("Inbound Flows are number of current flows in the inbound direction (traffic going into the VM)"), // ID: to.Ptr("subscriptions/92d2a2d8-b514-432d-8cc9-a5f9272630d5/providers/microsoft.insights/metricdefinitions/Inbound Flows"), // IsDimensionRequired: to.Ptr(false), // MetricAvailabilities: []*armmonitor.MetricAvailability{ // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT5M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT15M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT30M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT6H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT12H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("P1D"), // }}, // Namespace: to.Ptr("microsoft.compute/virtualmachines"), // PrimaryAggregationType: to.Ptr(armmonitor.MetricAggregationTypeAverage), // ResourceID: to.Ptr("subscriptions/92d2a2d8-b514-432d-8cc9-a5f9272630d5"), // SupportedAggregationTypes: []*armmonitor.MetricAggregationType{ // to.Ptr(armmonitor.MetricAggregationTypeNone), // to.Ptr(armmonitor.MetricAggregationTypeAverage), // to.Ptr(armmonitor.MetricAggregationTypeMinimum), // to.Ptr(armmonitor.MetricAggregationTypeMaximum), // to.Ptr(armmonitor.MetricAggregationTypeTotal), // to.Ptr(armmonitor.MetricAggregationTypeCount)}, // Unit: to.Ptr(armmonitor.MetricUnitCount), // }, // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("Outbound Flows"), // Value: to.Ptr("Outbound Flows"), // }, // Dimensions: []*armmonitor.LocalizableString{ // { // LocalizedValue: to.Ptr("Microsoft.ResourceId"), // Value: to.Ptr("Microsoft.ResourceId"), // }, // { // LocalizedValue: to.Ptr("Microsoft.ResourceGroupName"), // Value: to.Ptr("Microsoft.ResourceGroupName"), // }}, // DisplayDescription: to.Ptr("Outbound Flows are number of current flows in the outbound direction (traffic going out of the VM)"), // ID: to.Ptr("subscriptions/92d2a2d8-b514-432d-8cc9-a5f9272630d5/providers/microsoft.insights/metricdefinitions/Outbound Flows"), // IsDimensionRequired: to.Ptr(false), // MetricAvailabilities: []*armmonitor.MetricAvailability{ // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT5M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT15M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT30M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT6H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT12H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("P1D"), // }}, // Namespace: to.Ptr("microsoft.compute/virtualmachines"), // PrimaryAggregationType: to.Ptr(armmonitor.MetricAggregationTypeAverage), // ResourceID: to.Ptr("subscriptions/92d2a2d8-b514-432d-8cc9-a5f9272630d5"), // SupportedAggregationTypes: []*armmonitor.MetricAggregationType{ // to.Ptr(armmonitor.MetricAggregationTypeNone), // to.Ptr(armmonitor.MetricAggregationTypeAverage), // to.Ptr(armmonitor.MetricAggregationTypeMinimum), // to.Ptr(armmonitor.MetricAggregationTypeMaximum), // to.Ptr(armmonitor.MetricAggregationTypeTotal), // to.Ptr(armmonitor.MetricAggregationTypeCount)}, // Unit: to.Ptr(armmonitor.MetricUnitCount), // }, // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("Inbound Flows Maximum Creation Rate"), // Value: to.Ptr("Inbound Flows Maximum Creation Rate"), // }, // Dimensions: []*armmonitor.LocalizableString{ // { // LocalizedValue: to.Ptr("Microsoft.ResourceId"), // Value: to.Ptr("Microsoft.ResourceId"), // }, // { // LocalizedValue: to.Ptr("Microsoft.ResourceGroupName"), // Value: to.Ptr("Microsoft.ResourceGroupName"), // }}, // DisplayDescription: to.Ptr("The maximum creation rate of inbound flows (traffic going into the VM)"), // ID: to.Ptr("subscriptions/92d2a2d8-b514-432d-8cc9-a5f9272630d5/providers/microsoft.insights/metricdefinitions/Inbound Flows Maximum Creation Rate"), // IsDimensionRequired: to.Ptr(false), // MetricAvailabilities: []*armmonitor.MetricAvailability{ // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT5M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT15M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT30M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT6H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT12H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("P1D"), // }}, // Namespace: to.Ptr("microsoft.compute/virtualmachines"), // PrimaryAggregationType: to.Ptr(armmonitor.MetricAggregationTypeAverage), // ResourceID: to.Ptr("subscriptions/92d2a2d8-b514-432d-8cc9-a5f9272630d5"), // SupportedAggregationTypes: []*armmonitor.MetricAggregationType{ // to.Ptr(armmonitor.MetricAggregationTypeNone), // to.Ptr(armmonitor.MetricAggregationTypeAverage), // to.Ptr(armmonitor.MetricAggregationTypeMinimum), // to.Ptr(armmonitor.MetricAggregationTypeMaximum), // to.Ptr(armmonitor.MetricAggregationTypeTotal), // to.Ptr(armmonitor.MetricAggregationTypeCount)}, // Unit: to.Ptr(armmonitor.MetricUnitCountPerSecond), // }, // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("Outbound Flows Maximum Creation Rate"), // Value: to.Ptr("Outbound Flows Maximum Creation Rate"), // }, // Dimensions: []*armmonitor.LocalizableString{ // { // LocalizedValue: to.Ptr("Microsoft.ResourceId"), // Value: to.Ptr("Microsoft.ResourceId"), // }, // { // LocalizedValue: to.Ptr("Microsoft.ResourceGroupName"), // Value: to.Ptr("Microsoft.ResourceGroupName"), // }}, // DisplayDescription: to.Ptr("The maximum creation rate of outbound flows (traffic going out of the VM)"), // ID: to.Ptr("subscriptions/92d2a2d8-b514-432d-8cc9-a5f9272630d5/providers/microsoft.insights/metricdefinitions/Outbound Flows Maximum Creation Rate"), // IsDimensionRequired: to.Ptr(false), // MetricAvailabilities: []*armmonitor.MetricAvailability{ // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT5M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT15M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT30M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT6H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT12H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("P1D"), // }}, // Namespace: to.Ptr("microsoft.compute/virtualmachines"), // PrimaryAggregationType: to.Ptr(armmonitor.MetricAggregationTypeAverage), // ResourceID: to.Ptr("subscriptions/92d2a2d8-b514-432d-8cc9-a5f9272630d5"), // SupportedAggregationTypes: []*armmonitor.MetricAggregationType{ // to.Ptr(armmonitor.MetricAggregationTypeNone), // to.Ptr(armmonitor.MetricAggregationTypeAverage), // to.Ptr(armmonitor.MetricAggregationTypeMinimum), // to.Ptr(armmonitor.MetricAggregationTypeMaximum), // to.Ptr(armmonitor.MetricAggregationTypeTotal), // to.Ptr(armmonitor.MetricAggregationTypeCount)}, // Unit: to.Ptr(armmonitor.MetricUnitCountPerSecond), // }, // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("Premium Data Disk Cache Read Hit"), // Value: to.Ptr("Premium Data Disk Cache Read Hit"), // }, // Dimensions: []*armmonitor.LocalizableString{ // { // LocalizedValue: to.Ptr("LUN"), // Value: to.Ptr("LUN"), // }, // { // LocalizedValue: to.Ptr("Microsoft.ResourceId"), // Value: to.Ptr("Microsoft.ResourceId"), // }, // { // LocalizedValue: to.Ptr("Microsoft.ResourceGroupName"), // Value: to.Ptr("Microsoft.ResourceGroupName"), // }}, // DisplayDescription: to.Ptr("Premium Data Disk Cache Read Hit"), // ID: to.Ptr("subscriptions/92d2a2d8-b514-432d-8cc9-a5f9272630d5/providers/microsoft.insights/metricdefinitions/Premium Data Disk Cache Read Hit"), // IsDimensionRequired: to.Ptr(false), // MetricAvailabilities: []*armmonitor.MetricAvailability{ // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT5M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT15M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT30M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT6H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT12H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("P1D"), // }}, // Namespace: to.Ptr("microsoft.compute/virtualmachines"), // PrimaryAggregationType: to.Ptr(armmonitor.MetricAggregationTypeAverage), // ResourceID: to.Ptr("subscriptions/92d2a2d8-b514-432d-8cc9-a5f9272630d5"), // SupportedAggregationTypes: []*armmonitor.MetricAggregationType{ // to.Ptr(armmonitor.MetricAggregationTypeNone), // to.Ptr(armmonitor.MetricAggregationTypeAverage), // to.Ptr(armmonitor.MetricAggregationTypeMinimum), // to.Ptr(armmonitor.MetricAggregationTypeMaximum), // to.Ptr(armmonitor.MetricAggregationTypeTotal), // to.Ptr(armmonitor.MetricAggregationTypeCount)}, // Unit: to.Ptr(armmonitor.MetricUnitPercent), // }, // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("Premium Data Disk Cache Read Miss"), // Value: to.Ptr("Premium Data Disk Cache Read Miss"), // }, // Dimensions: []*armmonitor.LocalizableString{ // { // LocalizedValue: to.Ptr("LUN"), // Value: to.Ptr("LUN"), // }, // { // LocalizedValue: to.Ptr("Microsoft.ResourceId"), // Value: to.Ptr("Microsoft.ResourceId"), // }, // { // LocalizedValue: to.Ptr("Microsoft.ResourceGroupName"), // Value: to.Ptr("Microsoft.ResourceGroupName"), // }}, // DisplayDescription: to.Ptr("Premium Data Disk Cache Read Miss"), // ID: to.Ptr("subscriptions/92d2a2d8-b514-432d-8cc9-a5f9272630d5/providers/microsoft.insights/metricdefinitions/Premium Data Disk Cache Read Miss"), // IsDimensionRequired: to.Ptr(false), // MetricAvailabilities: []*armmonitor.MetricAvailability{ // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT5M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT15M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT30M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT6H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT12H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("P1D"), // }}, // Namespace: to.Ptr("microsoft.compute/virtualmachines"), // PrimaryAggregationType: to.Ptr(armmonitor.MetricAggregationTypeAverage), // ResourceID: to.Ptr("subscriptions/92d2a2d8-b514-432d-8cc9-a5f9272630d5"), // SupportedAggregationTypes: []*armmonitor.MetricAggregationType{ // to.Ptr(armmonitor.MetricAggregationTypeNone), // to.Ptr(armmonitor.MetricAggregationTypeAverage), // to.Ptr(armmonitor.MetricAggregationTypeMinimum), // to.Ptr(armmonitor.MetricAggregationTypeMaximum), // to.Ptr(armmonitor.MetricAggregationTypeTotal), // to.Ptr(armmonitor.MetricAggregationTypeCount)}, // Unit: to.Ptr(armmonitor.MetricUnitPercent), // }, // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("Premium OS Disk Cache Read Hit"), // Value: to.Ptr("Premium OS Disk Cache Read Hit"), // }, // Dimensions: []*armmonitor.LocalizableString{ // { // LocalizedValue: to.Ptr("Microsoft.ResourceId"), // Value: to.Ptr("Microsoft.ResourceId"), // }, // { // LocalizedValue: to.Ptr("Microsoft.ResourceGroupName"), // Value: to.Ptr("Microsoft.ResourceGroupName"), // }}, // DisplayDescription: to.Ptr("Premium OS Disk Cache Read Hit"), // ID: to.Ptr("subscriptions/92d2a2d8-b514-432d-8cc9-a5f9272630d5/providers/microsoft.insights/metricdefinitions/Premium OS Disk Cache Read Hit"), // IsDimensionRequired: to.Ptr(false), // MetricAvailabilities: []*armmonitor.MetricAvailability{ // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT5M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT15M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT30M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT6H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT12H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("P1D"), // }}, // Namespace: to.Ptr("microsoft.compute/virtualmachines"), // PrimaryAggregationType: to.Ptr(armmonitor.MetricAggregationTypeAverage), // ResourceID: to.Ptr("subscriptions/92d2a2d8-b514-432d-8cc9-a5f9272630d5"), // SupportedAggregationTypes: []*armmonitor.MetricAggregationType{ // to.Ptr(armmonitor.MetricAggregationTypeNone), // to.Ptr(armmonitor.MetricAggregationTypeAverage), // to.Ptr(armmonitor.MetricAggregationTypeMinimum), // to.Ptr(armmonitor.MetricAggregationTypeMaximum), // to.Ptr(armmonitor.MetricAggregationTypeTotal), // to.Ptr(armmonitor.MetricAggregationTypeCount)}, // Unit: to.Ptr(armmonitor.MetricUnitPercent), // }, // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("Premium OS Disk Cache Read Miss"), // Value: to.Ptr("Premium OS Disk Cache Read Miss"), // }, // Dimensions: []*armmonitor.LocalizableString{ // { // LocalizedValue: to.Ptr("Microsoft.ResourceId"), // Value: to.Ptr("Microsoft.ResourceId"), // }, // { // LocalizedValue: to.Ptr("Microsoft.ResourceGroupName"), // Value: to.Ptr("Microsoft.ResourceGroupName"), // }}, // DisplayDescription: to.Ptr("Premium OS Disk Cache Read Miss"), // ID: to.Ptr("subscriptions/92d2a2d8-b514-432d-8cc9-a5f9272630d5/providers/microsoft.insights/metricdefinitions/Premium OS Disk Cache Read Miss"), // IsDimensionRequired: to.Ptr(false), // MetricAvailabilities: []*armmonitor.MetricAvailability{ // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT5M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT15M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT30M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT6H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT12H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("P1D"), // }}, // Namespace: to.Ptr("microsoft.compute/virtualmachines"), // PrimaryAggregationType: to.Ptr(armmonitor.MetricAggregationTypeAverage), // ResourceID: to.Ptr("subscriptions/92d2a2d8-b514-432d-8cc9-a5f9272630d5"), // SupportedAggregationTypes: []*armmonitor.MetricAggregationType{ // to.Ptr(armmonitor.MetricAggregationTypeNone), // to.Ptr(armmonitor.MetricAggregationTypeAverage), // to.Ptr(armmonitor.MetricAggregationTypeMinimum), // to.Ptr(armmonitor.MetricAggregationTypeMaximum), // to.Ptr(armmonitor.MetricAggregationTypeTotal), // to.Ptr(armmonitor.MetricAggregationTypeCount)}, // Unit: to.Ptr(armmonitor.MetricUnitPercent), // }, // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("VM Cached Bandwidth Consumed Percentage"), // Value: to.Ptr("VM Cached Bandwidth Consumed Percentage"), // }, // Dimensions: []*armmonitor.LocalizableString{ // { // LocalizedValue: to.Ptr("Microsoft.ResourceId"), // Value: to.Ptr("Microsoft.ResourceId"), // }, // { // LocalizedValue: to.Ptr("Microsoft.ResourceGroupName"), // Value: to.Ptr("Microsoft.ResourceGroupName"), // }}, // DisplayDescription: to.Ptr("Percentage of cached disk bandwidth consumed by the VM"), // ID: to.Ptr("subscriptions/92d2a2d8-b514-432d-8cc9-a5f9272630d5/providers/microsoft.insights/metricdefinitions/VM Cached Bandwidth Consumed Percentage"), // IsDimensionRequired: to.Ptr(false), // MetricAvailabilities: []*armmonitor.MetricAvailability{ // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT5M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT15M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT30M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT6H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT12H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("P1D"), // }}, // Namespace: to.Ptr("microsoft.compute/virtualmachines"), // PrimaryAggregationType: to.Ptr(armmonitor.MetricAggregationTypeAverage), // ResourceID: to.Ptr("subscriptions/92d2a2d8-b514-432d-8cc9-a5f9272630d5"), // SupportedAggregationTypes: []*armmonitor.MetricAggregationType{ // to.Ptr(armmonitor.MetricAggregationTypeNone), // to.Ptr(armmonitor.MetricAggregationTypeAverage), // to.Ptr(armmonitor.MetricAggregationTypeMinimum), // to.Ptr(armmonitor.MetricAggregationTypeMaximum), // to.Ptr(armmonitor.MetricAggregationTypeTotal), // to.Ptr(armmonitor.MetricAggregationTypeCount)}, // Unit: to.Ptr(armmonitor.MetricUnitPercent), // }, // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("VM Cached IOPS Consumed Percentage"), // Value: to.Ptr("VM Cached IOPS Consumed Percentage"), // }, // Dimensions: []*armmonitor.LocalizableString{ // { // LocalizedValue: to.Ptr("Microsoft.ResourceId"), // Value: to.Ptr("Microsoft.ResourceId"), // }, // { // LocalizedValue: to.Ptr("Microsoft.ResourceGroupName"), // Value: to.Ptr("Microsoft.ResourceGroupName"), // }}, // DisplayDescription: to.Ptr("Percentage of cached disk IOPS consumed by the VM"), // ID: to.Ptr("subscriptions/92d2a2d8-b514-432d-8cc9-a5f9272630d5/providers/microsoft.insights/metricdefinitions/VM Cached IOPS Consumed Percentage"), // IsDimensionRequired: to.Ptr(false), // MetricAvailabilities: []*armmonitor.MetricAvailability{ // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT5M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT15M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT30M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT6H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT12H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("P1D"), // }}, // Namespace: to.Ptr("microsoft.compute/virtualmachines"), // PrimaryAggregationType: to.Ptr(armmonitor.MetricAggregationTypeAverage), // ResourceID: to.Ptr("subscriptions/92d2a2d8-b514-432d-8cc9-a5f9272630d5"), // SupportedAggregationTypes: []*armmonitor.MetricAggregationType{ // to.Ptr(armmonitor.MetricAggregationTypeNone), // to.Ptr(armmonitor.MetricAggregationTypeAverage), // to.Ptr(armmonitor.MetricAggregationTypeMinimum), // to.Ptr(armmonitor.MetricAggregationTypeMaximum), // to.Ptr(armmonitor.MetricAggregationTypeTotal), // to.Ptr(armmonitor.MetricAggregationTypeCount)}, // Unit: to.Ptr(armmonitor.MetricUnitPercent), // }, // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("VM Uncached Bandwidth Consumed Percentage"), // Value: to.Ptr("VM Uncached Bandwidth Consumed Percentage"), // }, // Dimensions: []*armmonitor.LocalizableString{ // { // LocalizedValue: to.Ptr("Microsoft.ResourceId"), // Value: to.Ptr("Microsoft.ResourceId"), // }, // { // LocalizedValue: to.Ptr("Microsoft.ResourceGroupName"), // Value: to.Ptr("Microsoft.ResourceGroupName"), // }}, // DisplayDescription: to.Ptr("Percentage of uncached disk bandwidth consumed by the VM"), // ID: to.Ptr("subscriptions/92d2a2d8-b514-432d-8cc9-a5f9272630d5/providers/microsoft.insights/metricdefinitions/VM Uncached Bandwidth Consumed Percentage"), // IsDimensionRequired: to.Ptr(false), // MetricAvailabilities: []*armmonitor.MetricAvailability{ // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT5M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT15M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT30M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT6H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT12H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("P1D"), // }}, // Namespace: to.Ptr("microsoft.compute/virtualmachines"), // PrimaryAggregationType: to.Ptr(armmonitor.MetricAggregationTypeAverage), // ResourceID: to.Ptr("subscriptions/92d2a2d8-b514-432d-8cc9-a5f9272630d5"), // SupportedAggregationTypes: []*armmonitor.MetricAggregationType{ // to.Ptr(armmonitor.MetricAggregationTypeNone), // to.Ptr(armmonitor.MetricAggregationTypeAverage), // to.Ptr(armmonitor.MetricAggregationTypeMinimum), // to.Ptr(armmonitor.MetricAggregationTypeMaximum), // to.Ptr(armmonitor.MetricAggregationTypeTotal), // to.Ptr(armmonitor.MetricAggregationTypeCount)}, // Unit: to.Ptr(armmonitor.MetricUnitPercent), // }, // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("VM Uncached IOPS Consumed Percentage"), // Value: to.Ptr("VM Uncached IOPS Consumed Percentage"), // }, // Dimensions: []*armmonitor.LocalizableString{ // { // LocalizedValue: to.Ptr("Microsoft.ResourceId"), // Value: to.Ptr("Microsoft.ResourceId"), // }, // { // LocalizedValue: to.Ptr("Microsoft.ResourceGroupName"), // Value: to.Ptr("Microsoft.ResourceGroupName"), // }}, // DisplayDescription: to.Ptr("Percentage of uncached disk IOPS consumed by the VM"), // ID: to.Ptr("subscriptions/92d2a2d8-b514-432d-8cc9-a5f9272630d5/providers/microsoft.insights/metricdefinitions/VM Uncached IOPS Consumed Percentage"), // IsDimensionRequired: to.Ptr(false), // MetricAvailabilities: []*armmonitor.MetricAvailability{ // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT5M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT15M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT30M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT6H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT12H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("P1D"), // }}, // Namespace: to.Ptr("microsoft.compute/virtualmachines"), // PrimaryAggregationType: to.Ptr(armmonitor.MetricAggregationTypeAverage), // ResourceID: to.Ptr("subscriptions/92d2a2d8-b514-432d-8cc9-a5f9272630d5"), // SupportedAggregationTypes: []*armmonitor.MetricAggregationType{ // to.Ptr(armmonitor.MetricAggregationTypeNone), // to.Ptr(armmonitor.MetricAggregationTypeAverage), // to.Ptr(armmonitor.MetricAggregationTypeMinimum), // to.Ptr(armmonitor.MetricAggregationTypeMaximum), // to.Ptr(armmonitor.MetricAggregationTypeTotal), // to.Ptr(armmonitor.MetricAggregationTypeCount)}, // Unit: to.Ptr(armmonitor.MetricUnitPercent), // }, // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("Network In Total"), // Value: to.Ptr("Network In Total"), // }, // Dimensions: []*armmonitor.LocalizableString{ // { // LocalizedValue: to.Ptr("Microsoft.ResourceId"), // Value: to.Ptr("Microsoft.ResourceId"), // }, // { // LocalizedValue: to.Ptr("Microsoft.ResourceGroupName"), // Value: to.Ptr("Microsoft.ResourceGroupName"), // }}, // DisplayDescription: to.Ptr("The number of bytes received on all network interfaces by the Virtual Machine(s) (Incoming Traffic)"), // ID: to.Ptr("subscriptions/92d2a2d8-b514-432d-8cc9-a5f9272630d5/providers/microsoft.insights/metricdefinitions/Network In Total"), // IsDimensionRequired: to.Ptr(false), // MetricAvailabilities: []*armmonitor.MetricAvailability{ // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT5M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT15M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT30M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT6H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT12H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("P1D"), // }}, // Namespace: to.Ptr("microsoft.compute/virtualmachines"), // PrimaryAggregationType: to.Ptr(armmonitor.MetricAggregationTypeTotal), // ResourceID: to.Ptr("subscriptions/92d2a2d8-b514-432d-8cc9-a5f9272630d5"), // SupportedAggregationTypes: []*armmonitor.MetricAggregationType{ // to.Ptr(armmonitor.MetricAggregationTypeNone), // to.Ptr(armmonitor.MetricAggregationTypeAverage), // to.Ptr(armmonitor.MetricAggregationTypeMinimum), // to.Ptr(armmonitor.MetricAggregationTypeMaximum), // to.Ptr(armmonitor.MetricAggregationTypeTotal), // to.Ptr(armmonitor.MetricAggregationTypeCount)}, // Unit: to.Ptr(armmonitor.MetricUnitBytes), // }, // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("Network Out Total"), // Value: to.Ptr("Network Out Total"), // }, // Dimensions: []*armmonitor.LocalizableString{ // { // LocalizedValue: to.Ptr("Microsoft.ResourceId"), // Value: to.Ptr("Microsoft.ResourceId"), // }, // { // LocalizedValue: to.Ptr("Microsoft.ResourceGroupName"), // Value: to.Ptr("Microsoft.ResourceGroupName"), // }}, // DisplayDescription: to.Ptr("The number of bytes out on all network interfaces by the Virtual Machine(s) (Outgoing Traffic)"), // ID: to.Ptr("subscriptions/92d2a2d8-b514-432d-8cc9-a5f9272630d5/providers/microsoft.insights/metricdefinitions/Network Out Total"), // IsDimensionRequired: to.Ptr(false), // MetricAvailabilities: []*armmonitor.MetricAvailability{ // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT5M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT15M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT30M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT6H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT12H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("P1D"), // }}, // Namespace: to.Ptr("microsoft.compute/virtualmachines"), // PrimaryAggregationType: to.Ptr(armmonitor.MetricAggregationTypeTotal), // ResourceID: to.Ptr("subscriptions/92d2a2d8-b514-432d-8cc9-a5f9272630d5"), // SupportedAggregationTypes: []*armmonitor.MetricAggregationType{ // to.Ptr(armmonitor.MetricAggregationTypeNone), // to.Ptr(armmonitor.MetricAggregationTypeAverage), // to.Ptr(armmonitor.MetricAggregationTypeMinimum), // to.Ptr(armmonitor.MetricAggregationTypeMaximum), // to.Ptr(armmonitor.MetricAggregationTypeTotal), // to.Ptr(armmonitor.MetricAggregationTypeCount)}, // Unit: to.Ptr(armmonitor.MetricUnitBytes), // }}, // } } }
Output:
func (*MetricDefinitionsClient) NewListPager ¶ added in v0.6.0
func (client *MetricDefinitionsClient) NewListPager(resourceURI string, options *MetricDefinitionsClientListOptions) *runtime.Pager[MetricDefinitionsClientListResponse]
NewListPager - Lists the metric definitions for the resource.
Generated from API version 2021-05-01
- resourceURI - The identifier of the resource.
- options - MetricDefinitionsClientListOptions contains the optional parameters for the MetricDefinitionsClient.NewListPager method.
Example (GetApplicationInsightsMetricDefinitionsWithoutFilter) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Insights/stable/2021-05-01/examples/GetMetricDefinitionsApplicationInsights.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewMetricDefinitionsClient().NewListPager("subscriptions/182c901a-129a-4f5d-86e4-cc6b294590a2/resourceGroups/hyr-log/providers/microsoft.insights/components/f1-bill/providers/microsoft.insights/metricdefinitions", &armmonitor.MetricDefinitionsClientListOptions{Metricnamespace: to.Ptr("microsoft.insights/components")}) 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.MetricDefinitionCollection = armmonitor.MetricDefinitionCollection{ // Value: []*armmonitor.MetricDefinition{ // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("Availability"), // Value: to.Ptr("availabilityResults/availabilityPercentage"), // }, // Category: to.Ptr("Availability"), // Dimensions: []*armmonitor.LocalizableString{ // { // LocalizedValue: to.Ptr("Test name"), // Value: to.Ptr("availabilityResult/name"), // }, // { // LocalizedValue: to.Ptr("Run location"), // Value: to.Ptr("availabilityResult/location"), // }}, // DisplayDescription: to.Ptr("Percentage of successfully completed availability tests"), // ID: to.Ptr("/subscriptions/182c901a-129a-4f5d-86e4-cc6b294590a2/resourceGroups/hyr-log/providers/microsoft.insights/components/f1-bill/providers/microsoft.insights/metricdefinitions/availabilityResults/availabilityPercentage"), // IsDimensionRequired: to.Ptr(false), // MetricAvailabilities: []*armmonitor.MetricAvailability{ // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT5M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT15M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT30M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT6H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT12H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("P1D"), // }}, // Namespace: to.Ptr("microsoft.insights/components"), // PrimaryAggregationType: to.Ptr(armmonitor.AggregationTypeAverage), // ResourceID: to.Ptr("/subscriptions/182c901a-129a-4f5d-86e4-cc6b294590a2/resourceGroups/hyr-log/providers/microsoft.insights/components/f1-bill"), // SupportedAggregationTypes: []*armmonitor.AggregationType{ // to.Ptr(armmonitor.AggregationTypeAverage)}, // Unit: to.Ptr(armmonitor.MetricUnitPercent), // }, // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("Availability tests"), // Value: to.Ptr("availabilityResults/count"), // }, // Category: to.Ptr("Availability"), // Dimensions: []*armmonitor.LocalizableString{ // { // LocalizedValue: to.Ptr("Test name"), // Value: to.Ptr("availabilityResult/name"), // }, // { // LocalizedValue: to.Ptr("Run location"), // Value: to.Ptr("availabilityResult/location"), // }, // { // LocalizedValue: to.Ptr("Test result"), // Value: to.Ptr("availabilityResult/success"), // }}, // DisplayDescription: to.Ptr("Count of availability tests"), // ID: to.Ptr("/subscriptions/182c901a-129a-4f5d-86e4-cc6b294590a2/resourceGroups/hyr-log/providers/microsoft.insights/components/f1-bill/providers/microsoft.insights/metricdefinitions/availabilityResults/count"), // IsDimensionRequired: to.Ptr(false), // MetricAvailabilities: []*armmonitor.MetricAvailability{ // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT5M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT15M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT30M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT6H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT12H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("P1D"), // }}, // Namespace: to.Ptr("microsoft.insights/components"), // PrimaryAggregationType: to.Ptr(armmonitor.AggregationTypeCount), // ResourceID: to.Ptr("/subscriptions/182c901a-129a-4f5d-86e4-cc6b294590a2/resourceGroups/hyr-log/providers/microsoft.insights/components/f1-bill"), // SupportedAggregationTypes: []*armmonitor.AggregationType{ // to.Ptr(armmonitor.AggregationTypeCount)}, // Unit: to.Ptr(armmonitor.MetricUnitCount), // }, // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("Availability test duration"), // Value: to.Ptr("availabilityResults/duration"), // }, // Category: to.Ptr("Availability"), // Dimensions: []*armmonitor.LocalizableString{ // { // LocalizedValue: to.Ptr("Test name"), // Value: to.Ptr("availabilityResult/name"), // }, // { // LocalizedValue: to.Ptr("Run location"), // Value: to.Ptr("availabilityResult/location"), // }, // { // LocalizedValue: to.Ptr("Test result"), // Value: to.Ptr("availabilityResult/success"), // }}, // DisplayDescription: to.Ptr("Availability test duration"), // ID: to.Ptr("/subscriptions/182c901a-129a-4f5d-86e4-cc6b294590a2/resourceGroups/hyr-log/providers/microsoft.insights/components/f1-bill/providers/microsoft.insights/metricdefinitions/availabilityResults/duration"), // IsDimensionRequired: to.Ptr(false), // MetricAvailabilities: []*armmonitor.MetricAvailability{ // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT5M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT15M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT30M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT6H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT12H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("P1D"), // }}, // Namespace: to.Ptr("microsoft.insights/components"), // PrimaryAggregationType: to.Ptr(armmonitor.AggregationTypeAverage), // ResourceID: to.Ptr("/subscriptions/182c901a-129a-4f5d-86e4-cc6b294590a2/resourceGroups/hyr-log/providers/microsoft.insights/components/f1-bill"), // SupportedAggregationTypes: []*armmonitor.AggregationType{ // to.Ptr(armmonitor.AggregationTypeAverage), // to.Ptr(armmonitor.AggregationTypeMaximum), // to.Ptr(armmonitor.AggregationTypeMinimum)}, // Unit: to.Ptr(armmonitor.MetricUnitMilliSeconds), // }, // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("Page load network connect time"), // Value: to.Ptr("browserTimings/networkDuration"), // }, // Category: to.Ptr("Browser"), // DisplayDescription: to.Ptr("Time between user request and network connection. Includes DNS lookup and transport connection."), // ID: to.Ptr("/subscriptions/182c901a-129a-4f5d-86e4-cc6b294590a2/resourceGroups/hyr-log/providers/microsoft.insights/components/f1-bill/providers/microsoft.insights/metricdefinitions/browserTimings/networkDuration"), // IsDimensionRequired: to.Ptr(false), // MetricAvailabilities: []*armmonitor.MetricAvailability{ // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT5M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT15M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT30M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT6H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT12H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("P1D"), // }}, // Namespace: to.Ptr("microsoft.insights/components"), // PrimaryAggregationType: to.Ptr(armmonitor.AggregationTypeAverage), // ResourceID: to.Ptr("/subscriptions/182c901a-129a-4f5d-86e4-cc6b294590a2/resourceGroups/hyr-log/providers/microsoft.insights/components/f1-bill"), // SupportedAggregationTypes: []*armmonitor.AggregationType{ // to.Ptr(armmonitor.AggregationTypeAverage), // to.Ptr(armmonitor.AggregationTypeMaximum), // to.Ptr(armmonitor.AggregationTypeMinimum)}, // Unit: to.Ptr(armmonitor.MetricUnitMilliSeconds), // }, // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("Client processing time"), // Value: to.Ptr("browserTimings/processingDuration"), // }, // Category: to.Ptr("Browser"), // DisplayDescription: to.Ptr("Time between receiving the last byte of a document until the DOM is loaded. Async requests may still be processing."), // ID: to.Ptr("/subscriptions/182c901a-129a-4f5d-86e4-cc6b294590a2/resourceGroups/hyr-log/providers/microsoft.insights/components/f1-bill/providers/microsoft.insights/metricdefinitions/browserTimings/processingDuration"), // IsDimensionRequired: to.Ptr(false), // MetricAvailabilities: []*armmonitor.MetricAvailability{ // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT5M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT15M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT30M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT6H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT12H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("P1D"), // }}, // Namespace: to.Ptr("microsoft.insights/components"), // PrimaryAggregationType: to.Ptr(armmonitor.AggregationTypeAverage), // ResourceID: to.Ptr("/subscriptions/182c901a-129a-4f5d-86e4-cc6b294590a2/resourceGroups/hyr-log/providers/microsoft.insights/components/f1-bill"), // SupportedAggregationTypes: []*armmonitor.AggregationType{ // to.Ptr(armmonitor.AggregationTypeAverage), // to.Ptr(armmonitor.AggregationTypeMaximum), // to.Ptr(armmonitor.AggregationTypeMinimum)}, // Unit: to.Ptr(armmonitor.MetricUnitMilliSeconds), // }, // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("Receiving response time"), // Value: to.Ptr("browserTimings/receiveDuration"), // }, // Category: to.Ptr("Browser"), // DisplayDescription: to.Ptr("Time between the first and last bytes, or until disconnection."), // ID: to.Ptr("/subscriptions/182c901a-129a-4f5d-86e4-cc6b294590a2/resourceGroups/hyr-log/providers/microsoft.insights/components/f1-bill/providers/microsoft.insights/metricdefinitions/browserTimings/receiveDuration"), // IsDimensionRequired: to.Ptr(false), // MetricAvailabilities: []*armmonitor.MetricAvailability{ // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT5M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT15M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT30M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT6H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT12H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("P1D"), // }}, // Namespace: to.Ptr("microsoft.insights/components"), // PrimaryAggregationType: to.Ptr(armmonitor.AggregationTypeAverage), // ResourceID: to.Ptr("/subscriptions/182c901a-129a-4f5d-86e4-cc6b294590a2/resourceGroups/hyr-log/providers/microsoft.insights/components/f1-bill"), // SupportedAggregationTypes: []*armmonitor.AggregationType{ // to.Ptr(armmonitor.AggregationTypeAverage), // to.Ptr(armmonitor.AggregationTypeMaximum), // to.Ptr(armmonitor.AggregationTypeMinimum)}, // Unit: to.Ptr(armmonitor.MetricUnitMilliSeconds), // }, // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("Send request time"), // Value: to.Ptr("browserTimings/sendDuration"), // }, // Category: to.Ptr("Browser"), // DisplayDescription: to.Ptr("Time between network connection and receiving the first byte."), // ID: to.Ptr("/subscriptions/182c901a-129a-4f5d-86e4-cc6b294590a2/resourceGroups/hyr-log/providers/microsoft.insights/components/f1-bill/providers/microsoft.insights/metricdefinitions/browserTimings/sendDuration"), // IsDimensionRequired: to.Ptr(false), // MetricAvailabilities: []*armmonitor.MetricAvailability{ // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT5M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT15M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT30M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT6H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT12H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("P1D"), // }}, // Namespace: to.Ptr("microsoft.insights/components"), // PrimaryAggregationType: to.Ptr(armmonitor.AggregationTypeAverage), // ResourceID: to.Ptr("/subscriptions/182c901a-129a-4f5d-86e4-cc6b294590a2/resourceGroups/hyr-log/providers/microsoft.insights/components/f1-bill"), // SupportedAggregationTypes: []*armmonitor.AggregationType{ // to.Ptr(armmonitor.AggregationTypeAverage), // to.Ptr(armmonitor.AggregationTypeMaximum), // to.Ptr(armmonitor.AggregationTypeMinimum)}, // Unit: to.Ptr(armmonitor.MetricUnitMilliSeconds), // }, // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("Browser page load time"), // Value: to.Ptr("browserTimings/totalDuration"), // }, // Category: to.Ptr("Browser"), // DisplayDescription: to.Ptr("Time from user request until DOM, stylesheets, scripts and images are loaded."), // ID: to.Ptr("/subscriptions/182c901a-129a-4f5d-86e4-cc6b294590a2/resourceGroups/hyr-log/providers/microsoft.insights/components/f1-bill/providers/microsoft.insights/metricdefinitions/browserTimings/totalDuration"), // IsDimensionRequired: to.Ptr(false), // MetricAvailabilities: []*armmonitor.MetricAvailability{ // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT5M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT15M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT30M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT6H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT12H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("P1D"), // }}, // Namespace: to.Ptr("microsoft.insights/components"), // PrimaryAggregationType: to.Ptr(armmonitor.AggregationTypeAverage), // ResourceID: to.Ptr("/subscriptions/182c901a-129a-4f5d-86e4-cc6b294590a2/resourceGroups/hyr-log/providers/microsoft.insights/components/f1-bill"), // SupportedAggregationTypes: []*armmonitor.AggregationType{ // to.Ptr(armmonitor.AggregationTypeAverage), // to.Ptr(armmonitor.AggregationTypeMaximum), // to.Ptr(armmonitor.AggregationTypeMinimum)}, // Unit: to.Ptr(armmonitor.MetricUnitMilliSeconds), // }, // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("Dependency calls"), // Value: to.Ptr("dependencies/count"), // }, // Category: to.Ptr("Server"), // Dimensions: []*armmonitor.LocalizableString{ // { // LocalizedValue: to.Ptr("Dependency type"), // Value: to.Ptr("dependency/type"), // }, // { // LocalizedValue: to.Ptr("Dependency performance"), // Value: to.Ptr("dependency/performanceBucket"), // }, // { // LocalizedValue: to.Ptr("Successful call"), // Value: to.Ptr("dependency/success"), // }, // { // LocalizedValue: to.Ptr("Target of a dependency call"), // Value: to.Ptr("dependency/target"), // }, // { // LocalizedValue: to.Ptr("Result code"), // Value: to.Ptr("dependency/resultCode"), // }, // { // LocalizedValue: to.Ptr("Is traffic synthetic"), // Value: to.Ptr("operation/synthetic"), // }, // { // LocalizedValue: to.Ptr("Cloud role instance"), // Value: to.Ptr("cloud/roleInstance"), // }, // { // LocalizedValue: to.Ptr("Cloud role name"), // Value: to.Ptr("cloud/roleName"), // }}, // DisplayDescription: to.Ptr("Count of calls made by the application to external resources."), // ID: to.Ptr("/subscriptions/182c901a-129a-4f5d-86e4-cc6b294590a2/resourceGroups/hyr-log/providers/microsoft.insights/components/f1-bill/providers/microsoft.insights/metricdefinitions/dependencies/count"), // IsDimensionRequired: to.Ptr(false), // MetricAvailabilities: []*armmonitor.MetricAvailability{ // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT5M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT15M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT30M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT6H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT12H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("P1D"), // }}, // Namespace: to.Ptr("microsoft.insights/components"), // PrimaryAggregationType: to.Ptr(armmonitor.AggregationTypeCount), // ResourceID: to.Ptr("/subscriptions/182c901a-129a-4f5d-86e4-cc6b294590a2/resourceGroups/hyr-log/providers/microsoft.insights/components/f1-bill"), // SupportedAggregationTypes: []*armmonitor.AggregationType{ // to.Ptr(armmonitor.AggregationTypeCount)}, // Unit: to.Ptr(armmonitor.MetricUnitCount), // }, // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("Dependency duration"), // Value: to.Ptr("dependencies/duration"), // }, // Category: to.Ptr("Server"), // Dimensions: []*armmonitor.LocalizableString{ // { // LocalizedValue: to.Ptr("Dependency type"), // Value: to.Ptr("dependency/type"), // }, // { // LocalizedValue: to.Ptr("Dependency performance"), // Value: to.Ptr("dependency/performanceBucket"), // }, // { // LocalizedValue: to.Ptr("Successful call"), // Value: to.Ptr("dependency/success"), // }, // { // LocalizedValue: to.Ptr("Target of a dependency call"), // Value: to.Ptr("dependency/target"), // }, // { // LocalizedValue: to.Ptr("Result code"), // Value: to.Ptr("dependency/resultCode"), // }, // { // LocalizedValue: to.Ptr("Is traffic synthetic"), // Value: to.Ptr("operation/synthetic"), // }, // { // LocalizedValue: to.Ptr("Cloud role instance"), // Value: to.Ptr("cloud/roleInstance"), // }, // { // LocalizedValue: to.Ptr("Cloud role name"), // Value: to.Ptr("cloud/roleName"), // }}, // DisplayDescription: to.Ptr("Duration of calls made by the application to external resources."), // ID: to.Ptr("/subscriptions/182c901a-129a-4f5d-86e4-cc6b294590a2/resourceGroups/hyr-log/providers/microsoft.insights/components/f1-bill/providers/microsoft.insights/metricdefinitions/dependencies/duration"), // IsDimensionRequired: to.Ptr(false), // MetricAvailabilities: []*armmonitor.MetricAvailability{ // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT5M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT15M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT30M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT6H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT12H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("P1D"), // }}, // Namespace: to.Ptr("microsoft.insights/components"), // PrimaryAggregationType: to.Ptr(armmonitor.AggregationTypeAverage), // ResourceID: to.Ptr("/subscriptions/182c901a-129a-4f5d-86e4-cc6b294590a2/resourceGroups/hyr-log/providers/microsoft.insights/components/f1-bill"), // SupportedAggregationTypes: []*armmonitor.AggregationType{ // to.Ptr(armmonitor.AggregationTypeAverage), // to.Ptr(armmonitor.AggregationTypeMaximum), // to.Ptr(armmonitor.AggregationTypeMinimum)}, // Unit: to.Ptr(armmonitor.MetricUnitMilliSeconds), // }, // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("Dependency call failures"), // Value: to.Ptr("dependencies/failed"), // }, // Category: to.Ptr("Failures"), // Dimensions: []*armmonitor.LocalizableString{ // { // LocalizedValue: to.Ptr("Dependency type"), // Value: to.Ptr("dependency/type"), // }, // { // LocalizedValue: to.Ptr("Dependency performance"), // Value: to.Ptr("dependency/performanceBucket"), // }, // { // LocalizedValue: to.Ptr("Target of a dependency call"), // Value: to.Ptr("dependency/target"), // }, // { // LocalizedValue: to.Ptr("Result code"), // Value: to.Ptr("dependency/resultCode"), // }, // { // LocalizedValue: to.Ptr("Is traffic synthetic"), // Value: to.Ptr("operation/synthetic"), // }, // { // LocalizedValue: to.Ptr("Cloud role instance"), // Value: to.Ptr("cloud/roleInstance"), // }, // { // LocalizedValue: to.Ptr("Cloud role name"), // Value: to.Ptr("cloud/roleName"), // }}, // DisplayDescription: to.Ptr("Count of failed dependency calls made by the application to external resources."), // ID: to.Ptr("/subscriptions/182c901a-129a-4f5d-86e4-cc6b294590a2/resourceGroups/hyr-log/providers/microsoft.insights/components/f1-bill/providers/microsoft.insights/metricdefinitions/dependencies/failed"), // IsDimensionRequired: to.Ptr(false), // MetricAvailabilities: []*armmonitor.MetricAvailability{ // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT5M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT15M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT30M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT6H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT12H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("P1D"), // }}, // Namespace: to.Ptr("microsoft.insights/components"), // PrimaryAggregationType: to.Ptr(armmonitor.AggregationTypeCount), // ResourceID: to.Ptr("/subscriptions/182c901a-129a-4f5d-86e4-cc6b294590a2/resourceGroups/hyr-log/providers/microsoft.insights/components/f1-bill"), // SupportedAggregationTypes: []*armmonitor.AggregationType{ // to.Ptr(armmonitor.AggregationTypeCount)}, // Unit: to.Ptr(armmonitor.MetricUnitCount), // }, // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("Page views"), // Value: to.Ptr("pageViews/count"), // }, // Category: to.Ptr("Usage"), // Dimensions: []*armmonitor.LocalizableString{ // { // LocalizedValue: to.Ptr("Is traffic synthetic"), // Value: to.Ptr("operation/synthetic"), // }, // { // LocalizedValue: to.Ptr("Cloud role name"), // Value: to.Ptr("cloud/roleName"), // }}, // DisplayDescription: to.Ptr("Count of page views."), // ID: to.Ptr("/subscriptions/182c901a-129a-4f5d-86e4-cc6b294590a2/resourceGroups/hyr-log/providers/microsoft.insights/components/f1-bill/providers/microsoft.insights/metricdefinitions/pageViews/count"), // IsDimensionRequired: to.Ptr(false), // MetricAvailabilities: []*armmonitor.MetricAvailability{ // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT5M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT15M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT30M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT6H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT12H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("P1D"), // }}, // Namespace: to.Ptr("microsoft.insights/components"), // PrimaryAggregationType: to.Ptr(armmonitor.AggregationTypeCount), // ResourceID: to.Ptr("/subscriptions/182c901a-129a-4f5d-86e4-cc6b294590a2/resourceGroups/hyr-log/providers/microsoft.insights/components/f1-bill"), // SupportedAggregationTypes: []*armmonitor.AggregationType{ // to.Ptr(armmonitor.AggregationTypeCount)}, // Unit: to.Ptr(armmonitor.MetricUnitCount), // }, // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("Page view load time"), // Value: to.Ptr("pageViews/duration"), // }, // Category: to.Ptr("Usage"), // Dimensions: []*armmonitor.LocalizableString{ // { // LocalizedValue: to.Ptr("Is traffic synthetic"), // Value: to.Ptr("operation/synthetic"), // }, // { // LocalizedValue: to.Ptr("Cloud role name"), // Value: to.Ptr("cloud/roleName"), // }}, // DisplayDescription: to.Ptr("Page view load time"), // ID: to.Ptr("/subscriptions/182c901a-129a-4f5d-86e4-cc6b294590a2/resourceGroups/hyr-log/providers/microsoft.insights/components/f1-bill/providers/microsoft.insights/metricdefinitions/pageViews/duration"), // IsDimensionRequired: to.Ptr(false), // MetricAvailabilities: []*armmonitor.MetricAvailability{ // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT5M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT15M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT30M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT6H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT12H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("P1D"), // }}, // Namespace: to.Ptr("microsoft.insights/components"), // PrimaryAggregationType: to.Ptr(armmonitor.AggregationTypeAverage), // ResourceID: to.Ptr("/subscriptions/182c901a-129a-4f5d-86e4-cc6b294590a2/resourceGroups/hyr-log/providers/microsoft.insights/components/f1-bill"), // SupportedAggregationTypes: []*armmonitor.AggregationType{ // to.Ptr(armmonitor.AggregationTypeAverage), // to.Ptr(armmonitor.AggregationTypeMaximum), // to.Ptr(armmonitor.AggregationTypeMinimum)}, // Unit: to.Ptr(armmonitor.MetricUnitMilliSeconds), // }, // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("HTTP request execution time"), // Value: to.Ptr("performanceCounters/requestExecutionTime"), // }, // Category: to.Ptr("Performance counters"), // Dimensions: []*armmonitor.LocalizableString{ // { // LocalizedValue: to.Ptr("Cloud role instance"), // Value: to.Ptr("cloud/roleInstance"), // }}, // DisplayDescription: to.Ptr("Execution time of the most recent request."), // ID: to.Ptr("/subscriptions/182c901a-129a-4f5d-86e4-cc6b294590a2/resourceGroups/hyr-log/providers/microsoft.insights/components/f1-bill/providers/microsoft.insights/metricdefinitions/performanceCounters/requestExecutionTime"), // IsDimensionRequired: to.Ptr(false), // MetricAvailabilities: []*armmonitor.MetricAvailability{ // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT5M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT15M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT30M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT6H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT12H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("P1D"), // }}, // Namespace: to.Ptr("microsoft.insights/components"), // PrimaryAggregationType: to.Ptr(armmonitor.AggregationTypeAverage), // ResourceID: to.Ptr("/subscriptions/182c901a-129a-4f5d-86e4-cc6b294590a2/resourceGroups/hyr-log/providers/microsoft.insights/components/f1-bill"), // SupportedAggregationTypes: []*armmonitor.AggregationType{ // to.Ptr(armmonitor.AggregationTypeAverage), // to.Ptr(armmonitor.AggregationTypeMaximum), // to.Ptr(armmonitor.AggregationTypeMinimum)}, // Unit: to.Ptr(armmonitor.MetricUnitMilliSeconds), // }, // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("HTTP requests in application queue"), // Value: to.Ptr("performanceCounters/requestsInQueue"), // }, // Category: to.Ptr("Performance counters"), // Dimensions: []*armmonitor.LocalizableString{ // { // LocalizedValue: to.Ptr("Cloud role instance"), // Value: to.Ptr("cloud/roleInstance"), // }}, // DisplayDescription: to.Ptr("Length of the application request queue."), // ID: to.Ptr("/subscriptions/182c901a-129a-4f5d-86e4-cc6b294590a2/resourceGroups/hyr-log/providers/microsoft.insights/components/f1-bill/providers/microsoft.insights/metricdefinitions/performanceCounters/requestsInQueue"), // IsDimensionRequired: to.Ptr(false), // MetricAvailabilities: []*armmonitor.MetricAvailability{ // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT5M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT15M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT30M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT6H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT12H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("P1D"), // }}, // Namespace: to.Ptr("microsoft.insights/components"), // PrimaryAggregationType: to.Ptr(armmonitor.AggregationTypeAverage), // ResourceID: to.Ptr("/subscriptions/182c901a-129a-4f5d-86e4-cc6b294590a2/resourceGroups/hyr-log/providers/microsoft.insights/components/f1-bill"), // SupportedAggregationTypes: []*armmonitor.AggregationType{ // to.Ptr(armmonitor.AggregationTypeAverage), // to.Ptr(armmonitor.AggregationTypeMaximum), // to.Ptr(armmonitor.AggregationTypeMinimum)}, // Unit: to.Ptr(armmonitor.MetricUnitCount), // }, // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("HTTP request rate"), // Value: to.Ptr("performanceCounters/requestsPerSecond"), // }, // Category: to.Ptr("Performance counters"), // Dimensions: []*armmonitor.LocalizableString{ // { // LocalizedValue: to.Ptr("Cloud role instance"), // Value: to.Ptr("cloud/roleInstance"), // }}, // DisplayDescription: to.Ptr("Rate of all requests to the application per second from ASP.NET."), // ID: to.Ptr("/subscriptions/182c901a-129a-4f5d-86e4-cc6b294590a2/resourceGroups/hyr-log/providers/microsoft.insights/components/f1-bill/providers/microsoft.insights/metricdefinitions/performanceCounters/requestsPerSecond"), // IsDimensionRequired: to.Ptr(false), // MetricAvailabilities: []*armmonitor.MetricAvailability{ // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT5M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT15M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT30M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT6H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT12H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("P1D"), // }}, // Namespace: to.Ptr("microsoft.insights/components"), // PrimaryAggregationType: to.Ptr(armmonitor.AggregationTypeAverage), // ResourceID: to.Ptr("/subscriptions/182c901a-129a-4f5d-86e4-cc6b294590a2/resourceGroups/hyr-log/providers/microsoft.insights/components/f1-bill"), // SupportedAggregationTypes: []*armmonitor.AggregationType{ // to.Ptr(armmonitor.AggregationTypeAverage), // to.Ptr(armmonitor.AggregationTypeMaximum), // to.Ptr(armmonitor.AggregationTypeMinimum)}, // Unit: to.Ptr(armmonitor.MetricUnitCountPerSecond), // }, // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("Exception rate"), // Value: to.Ptr("performanceCounters/exceptionsPerSecond"), // }, // Category: to.Ptr("Performance counters"), // Dimensions: []*armmonitor.LocalizableString{ // { // LocalizedValue: to.Ptr("Cloud role instance"), // Value: to.Ptr("cloud/roleInstance"), // }}, // DisplayDescription: to.Ptr("Count of handled and unhandled exceptions reported to windows, including .NET exceptions and unmanaged exceptions that are converted into .NET exceptions."), // ID: to.Ptr("/subscriptions/182c901a-129a-4f5d-86e4-cc6b294590a2/resourceGroups/hyr-log/providers/microsoft.insights/components/f1-bill/providers/microsoft.insights/metricdefinitions/performanceCounters/exceptionsPerSecond"), // IsDimensionRequired: to.Ptr(false), // MetricAvailabilities: []*armmonitor.MetricAvailability{ // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT5M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT15M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT30M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT6H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT12H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("P1D"), // }}, // Namespace: to.Ptr("microsoft.insights/components"), // PrimaryAggregationType: to.Ptr(armmonitor.AggregationTypeAverage), // ResourceID: to.Ptr("/subscriptions/182c901a-129a-4f5d-86e4-cc6b294590a2/resourceGroups/hyr-log/providers/microsoft.insights/components/f1-bill"), // SupportedAggregationTypes: []*armmonitor.AggregationType{ // to.Ptr(armmonitor.AggregationTypeAverage), // to.Ptr(armmonitor.AggregationTypeMaximum), // to.Ptr(armmonitor.AggregationTypeMinimum)}, // Unit: to.Ptr(armmonitor.MetricUnitCountPerSecond), // }, // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("Process IO rate"), // Value: to.Ptr("performanceCounters/processIOBytesPerSecond"), // }, // Category: to.Ptr("Performance counters"), // Dimensions: []*armmonitor.LocalizableString{ // { // LocalizedValue: to.Ptr("Cloud role instance"), // Value: to.Ptr("cloud/roleInstance"), // }}, // DisplayDescription: to.Ptr("Total bytes per second read and written to files, network and devices."), // ID: to.Ptr("/subscriptions/182c901a-129a-4f5d-86e4-cc6b294590a2/resourceGroups/hyr-log/providers/microsoft.insights/components/f1-bill/providers/microsoft.insights/metricdefinitions/performanceCounters/processIOBytesPerSecond"), // IsDimensionRequired: to.Ptr(false), // MetricAvailabilities: []*armmonitor.MetricAvailability{ // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT5M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT15M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT30M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT6H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT12H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("P1D"), // }}, // Namespace: to.Ptr("microsoft.insights/components"), // PrimaryAggregationType: to.Ptr(armmonitor.AggregationTypeAverage), // ResourceID: to.Ptr("/subscriptions/182c901a-129a-4f5d-86e4-cc6b294590a2/resourceGroups/hyr-log/providers/microsoft.insights/components/f1-bill"), // SupportedAggregationTypes: []*armmonitor.AggregationType{ // to.Ptr(armmonitor.AggregationTypeAverage), // to.Ptr(armmonitor.AggregationTypeMaximum), // to.Ptr(armmonitor.AggregationTypeMinimum)}, // Unit: to.Ptr(armmonitor.MetricUnitBytesPerSecond), // }, // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("Process CPU"), // Value: to.Ptr("performanceCounters/processCpuPercentage"), // }, // Category: to.Ptr("Performance counters"), // Dimensions: []*armmonitor.LocalizableString{ // { // LocalizedValue: to.Ptr("Cloud role instance"), // Value: to.Ptr("cloud/roleInstance"), // }}, // DisplayDescription: to.Ptr("The percentage of elapsed time that all process threads used the processor to execute instructions. This can vary between 0 to 100. This metric indicates the performance of w3wp process alone."), // ID: to.Ptr("/subscriptions/182c901a-129a-4f5d-86e4-cc6b294590a2/resourceGroups/hyr-log/providers/microsoft.insights/components/f1-bill/providers/microsoft.insights/metricdefinitions/performanceCounters/processCpuPercentage"), // IsDimensionRequired: to.Ptr(false), // MetricAvailabilities: []*armmonitor.MetricAvailability{ // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT5M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT15M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT30M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT6H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT12H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("P1D"), // }}, // Namespace: to.Ptr("microsoft.insights/components"), // PrimaryAggregationType: to.Ptr(armmonitor.AggregationTypeAverage), // ResourceID: to.Ptr("/subscriptions/182c901a-129a-4f5d-86e4-cc6b294590a2/resourceGroups/hyr-log/providers/microsoft.insights/components/f1-bill"), // SupportedAggregationTypes: []*armmonitor.AggregationType{ // to.Ptr(armmonitor.AggregationTypeAverage), // to.Ptr(armmonitor.AggregationTypeMaximum), // to.Ptr(armmonitor.AggregationTypeMinimum)}, // Unit: to.Ptr(armmonitor.MetricUnitPercent), // }, // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("Processor time"), // Value: to.Ptr("performanceCounters/processorCpuPercentage"), // }, // Category: to.Ptr("Performance counters"), // Dimensions: []*armmonitor.LocalizableString{ // { // LocalizedValue: to.Ptr("Cloud role instance"), // Value: to.Ptr("cloud/roleInstance"), // }}, // DisplayDescription: to.Ptr("The percentage of time that the processor spends in non-idle threads."), // ID: to.Ptr("/subscriptions/182c901a-129a-4f5d-86e4-cc6b294590a2/resourceGroups/hyr-log/providers/microsoft.insights/components/f1-bill/providers/microsoft.insights/metricdefinitions/performanceCounters/processorCpuPercentage"), // IsDimensionRequired: to.Ptr(false), // MetricAvailabilities: []*armmonitor.MetricAvailability{ // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT5M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT15M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT30M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT6H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT12H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("P1D"), // }}, // Namespace: to.Ptr("microsoft.insights/components"), // PrimaryAggregationType: to.Ptr(armmonitor.AggregationTypeAverage), // ResourceID: to.Ptr("/subscriptions/182c901a-129a-4f5d-86e4-cc6b294590a2/resourceGroups/hyr-log/providers/microsoft.insights/components/f1-bill"), // SupportedAggregationTypes: []*armmonitor.AggregationType{ // to.Ptr(armmonitor.AggregationTypeAverage), // to.Ptr(armmonitor.AggregationTypeMaximum), // to.Ptr(armmonitor.AggregationTypeMinimum)}, // Unit: to.Ptr(armmonitor.MetricUnitPercent), // }, // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("Available memory"), // Value: to.Ptr("performanceCounters/memoryAvailableBytes"), // }, // Category: to.Ptr("Performance counters"), // Dimensions: []*armmonitor.LocalizableString{ // { // LocalizedValue: to.Ptr("Cloud role instance"), // Value: to.Ptr("cloud/roleInstance"), // }}, // DisplayDescription: to.Ptr("Physical memory immediately available for allocation to a process or for system use."), // ID: to.Ptr("/subscriptions/182c901a-129a-4f5d-86e4-cc6b294590a2/resourceGroups/hyr-log/providers/microsoft.insights/components/f1-bill/providers/microsoft.insights/metricdefinitions/performanceCounters/memoryAvailableBytes"), // IsDimensionRequired: to.Ptr(false), // MetricAvailabilities: []*armmonitor.MetricAvailability{ // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT5M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT15M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT30M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT6H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT12H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("P1D"), // }}, // Namespace: to.Ptr("microsoft.insights/components"), // PrimaryAggregationType: to.Ptr(armmonitor.AggregationTypeAverage), // ResourceID: to.Ptr("/subscriptions/182c901a-129a-4f5d-86e4-cc6b294590a2/resourceGroups/hyr-log/providers/microsoft.insights/components/f1-bill"), // SupportedAggregationTypes: []*armmonitor.AggregationType{ // to.Ptr(armmonitor.AggregationTypeAverage), // to.Ptr(armmonitor.AggregationTypeMaximum), // to.Ptr(armmonitor.AggregationTypeMinimum)}, // Unit: to.Ptr(armmonitor.MetricUnitBytes), // }, // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("Process private bytes"), // Value: to.Ptr("performanceCounters/processPrivateBytes"), // }, // Category: to.Ptr("Performance counters"), // Dimensions: []*armmonitor.LocalizableString{ // { // LocalizedValue: to.Ptr("Cloud role instance"), // Value: to.Ptr("cloud/roleInstance"), // }}, // DisplayDescription: to.Ptr("Memory exclusively assigned to the monitored application's processes."), // ID: to.Ptr("/subscriptions/182c901a-129a-4f5d-86e4-cc6b294590a2/resourceGroups/hyr-log/providers/microsoft.insights/components/f1-bill/providers/microsoft.insights/metricdefinitions/performanceCounters/processPrivateBytes"), // IsDimensionRequired: to.Ptr(false), // MetricAvailabilities: []*armmonitor.MetricAvailability{ // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT5M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT15M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT30M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT6H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT12H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("P1D"), // }}, // Namespace: to.Ptr("microsoft.insights/components"), // PrimaryAggregationType: to.Ptr(armmonitor.AggregationTypeAverage), // ResourceID: to.Ptr("/subscriptions/182c901a-129a-4f5d-86e4-cc6b294590a2/resourceGroups/hyr-log/providers/microsoft.insights/components/f1-bill"), // SupportedAggregationTypes: []*armmonitor.AggregationType{ // to.Ptr(armmonitor.AggregationTypeAverage), // to.Ptr(armmonitor.AggregationTypeMaximum), // to.Ptr(armmonitor.AggregationTypeMinimum)}, // Unit: to.Ptr(armmonitor.MetricUnitBytes), // }, // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("Server response time"), // Value: to.Ptr("requests/duration"), // }, // Category: to.Ptr("Server"), // Dimensions: []*armmonitor.LocalizableString{ // { // LocalizedValue: to.Ptr("Request performance"), // Value: to.Ptr("request/performanceBucket"), // }, // { // LocalizedValue: to.Ptr("Result code"), // Value: to.Ptr("request/resultCode"), // }, // { // LocalizedValue: to.Ptr("Is traffic synthetic"), // Value: to.Ptr("operation/synthetic"), // }, // { // LocalizedValue: to.Ptr("Cloud role instance"), // Value: to.Ptr("cloud/roleInstance"), // }, // { // LocalizedValue: to.Ptr("Successful request"), // Value: to.Ptr("request/success"), // }, // { // LocalizedValue: to.Ptr("Cloud role name"), // Value: to.Ptr("cloud/roleName"), // }}, // DisplayDescription: to.Ptr("Time between receiving an HTTP request and finishing sending the response."), // ID: to.Ptr("/subscriptions/182c901a-129a-4f5d-86e4-cc6b294590a2/resourceGroups/hyr-log/providers/microsoft.insights/components/f1-bill/providers/microsoft.insights/metricdefinitions/requests/duration"), // IsDimensionRequired: to.Ptr(false), // MetricAvailabilities: []*armmonitor.MetricAvailability{ // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT5M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT15M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT30M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT6H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT12H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("P1D"), // }}, // Namespace: to.Ptr("microsoft.insights/components"), // PrimaryAggregationType: to.Ptr(armmonitor.AggregationTypeAverage), // ResourceID: to.Ptr("/subscriptions/182c901a-129a-4f5d-86e4-cc6b294590a2/resourceGroups/hyr-log/providers/microsoft.insights/components/f1-bill"), // SupportedAggregationTypes: []*armmonitor.AggregationType{ // to.Ptr(armmonitor.AggregationTypeAverage), // to.Ptr(armmonitor.AggregationTypeMaximum), // to.Ptr(armmonitor.AggregationTypeMinimum)}, // Unit: to.Ptr(armmonitor.MetricUnitMilliSeconds), // }, // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("Server requests"), // Value: to.Ptr("requests/count"), // }, // Category: to.Ptr("Server"), // Dimensions: []*armmonitor.LocalizableString{ // { // LocalizedValue: to.Ptr("Request performance"), // Value: to.Ptr("request/performanceBucket"), // }, // { // LocalizedValue: to.Ptr("Result code"), // Value: to.Ptr("request/resultCode"), // }, // { // LocalizedValue: to.Ptr("Is traffic synthetic"), // Value: to.Ptr("operation/synthetic"), // }, // { // LocalizedValue: to.Ptr("Cloud role instance"), // Value: to.Ptr("cloud/roleInstance"), // }, // { // LocalizedValue: to.Ptr("Successful request"), // Value: to.Ptr("request/success"), // }, // { // LocalizedValue: to.Ptr("Cloud role name"), // Value: to.Ptr("cloud/roleName"), // }}, // DisplayDescription: to.Ptr("Count of HTTP requests completed."), // ID: to.Ptr("/subscriptions/182c901a-129a-4f5d-86e4-cc6b294590a2/resourceGroups/hyr-log/providers/microsoft.insights/components/f1-bill/providers/microsoft.insights/metricdefinitions/requests/count"), // IsDimensionRequired: to.Ptr(false), // MetricAvailabilities: []*armmonitor.MetricAvailability{ // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT5M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT15M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT30M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT6H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT12H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("P1D"), // }}, // Namespace: to.Ptr("microsoft.insights/components"), // PrimaryAggregationType: to.Ptr(armmonitor.AggregationTypeCount), // ResourceID: to.Ptr("/subscriptions/182c901a-129a-4f5d-86e4-cc6b294590a2/resourceGroups/hyr-log/providers/microsoft.insights/components/f1-bill"), // SupportedAggregationTypes: []*armmonitor.AggregationType{ // to.Ptr(armmonitor.AggregationTypeCount)}, // Unit: to.Ptr(armmonitor.MetricUnitCount), // }, // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("Failed requests"), // Value: to.Ptr("requests/failed"), // }, // Category: to.Ptr("Failures"), // Dimensions: []*armmonitor.LocalizableString{ // { // LocalizedValue: to.Ptr("Request performance"), // Value: to.Ptr("request/performanceBucket"), // }, // { // LocalizedValue: to.Ptr("Result code"), // Value: to.Ptr("request/resultCode"), // }, // { // LocalizedValue: to.Ptr("Is traffic synthetic"), // Value: to.Ptr("operation/synthetic"), // }, // { // LocalizedValue: to.Ptr("Cloud role instance"), // Value: to.Ptr("cloud/roleInstance"), // }, // { // LocalizedValue: to.Ptr("Cloud role name"), // Value: to.Ptr("cloud/roleName"), // }}, // DisplayDescription: to.Ptr("Count of HTTP requests marked as failed. In most cases these are requests with a response code >= 400 and not equal to 401."), // ID: to.Ptr("/subscriptions/182c901a-129a-4f5d-86e4-cc6b294590a2/resourceGroups/hyr-log/providers/microsoft.insights/components/f1-bill/providers/microsoft.insights/metricdefinitions/requests/failed"), // IsDimensionRequired: to.Ptr(false), // MetricAvailabilities: []*armmonitor.MetricAvailability{ // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT5M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT15M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT30M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT6H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT12H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("P1D"), // }}, // Namespace: to.Ptr("microsoft.insights/components"), // PrimaryAggregationType: to.Ptr(armmonitor.AggregationTypeCount), // ResourceID: to.Ptr("/subscriptions/182c901a-129a-4f5d-86e4-cc6b294590a2/resourceGroups/hyr-log/providers/microsoft.insights/components/f1-bill"), // SupportedAggregationTypes: []*armmonitor.AggregationType{ // to.Ptr(armmonitor.AggregationTypeCount)}, // Unit: to.Ptr(armmonitor.MetricUnitCount), // }, // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("Server request rate"), // Value: to.Ptr("requests/rate"), // }, // Category: to.Ptr("Server"), // Dimensions: []*armmonitor.LocalizableString{ // { // LocalizedValue: to.Ptr("Request performance"), // Value: to.Ptr("request/performanceBucket"), // }, // { // LocalizedValue: to.Ptr("Result code"), // Value: to.Ptr("request/resultCode"), // }, // { // LocalizedValue: to.Ptr("Is traffic synthetic"), // Value: to.Ptr("operation/synthetic"), // }, // { // LocalizedValue: to.Ptr("Cloud role instance"), // Value: to.Ptr("cloud/roleInstance"), // }, // { // LocalizedValue: to.Ptr("Successful request"), // Value: to.Ptr("request/success"), // }, // { // LocalizedValue: to.Ptr("Cloud role name"), // Value: to.Ptr("cloud/roleName"), // }}, // DisplayDescription: to.Ptr("Rate of server requests per second"), // ID: to.Ptr("/subscriptions/182c901a-129a-4f5d-86e4-cc6b294590a2/resourceGroups/hyr-log/providers/microsoft.insights/components/f1-bill/providers/microsoft.insights/metricdefinitions/requests/rate"), // IsDimensionRequired: to.Ptr(false), // MetricAvailabilities: []*armmonitor.MetricAvailability{ // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT5M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT15M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT30M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT6H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT12H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("P1D"), // }}, // Namespace: to.Ptr("microsoft.insights/components"), // PrimaryAggregationType: to.Ptr(armmonitor.AggregationTypeAverage), // ResourceID: to.Ptr("/subscriptions/182c901a-129a-4f5d-86e4-cc6b294590a2/resourceGroups/hyr-log/providers/microsoft.insights/components/f1-bill"), // SupportedAggregationTypes: []*armmonitor.AggregationType{ // to.Ptr(armmonitor.AggregationTypeAverage)}, // Unit: to.Ptr(armmonitor.MetricUnitCountPerSecond), // }, // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("Exceptions"), // Value: to.Ptr("exceptions/count"), // }, // Category: to.Ptr("Failures"), // Dimensions: []*armmonitor.LocalizableString{ // { // LocalizedValue: to.Ptr("Cloud role name"), // Value: to.Ptr("cloud/roleName"), // }, // { // LocalizedValue: to.Ptr("Cloud role instance"), // Value: to.Ptr("cloud/roleInstance"), // }, // { // LocalizedValue: to.Ptr("Device type"), // Value: to.Ptr("client/type"), // }}, // DisplayDescription: to.Ptr("Combined count of all uncaught exceptions."), // ID: to.Ptr("/subscriptions/182c901a-129a-4f5d-86e4-cc6b294590a2/resourceGroups/hyr-log/providers/microsoft.insights/components/f1-bill/providers/microsoft.insights/metricdefinitions/exceptions/count"), // IsDimensionRequired: to.Ptr(false), // MetricAvailabilities: []*armmonitor.MetricAvailability{ // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT5M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT15M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT30M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT6H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT12H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("P1D"), // }}, // Namespace: to.Ptr("microsoft.insights/components"), // PrimaryAggregationType: to.Ptr(armmonitor.AggregationTypeCount), // ResourceID: to.Ptr("/subscriptions/182c901a-129a-4f5d-86e4-cc6b294590a2/resourceGroups/hyr-log/providers/microsoft.insights/components/f1-bill"), // SupportedAggregationTypes: []*armmonitor.AggregationType{ // to.Ptr(armmonitor.AggregationTypeCount)}, // Unit: to.Ptr(armmonitor.MetricUnitCount), // }, // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("Browser exceptions"), // Value: to.Ptr("exceptions/browser"), // }, // Category: to.Ptr("Failures"), // Dimensions: []*armmonitor.LocalizableString{ // { // LocalizedValue: to.Ptr("Cloud role name"), // Value: to.Ptr("cloud/roleName"), // }}, // DisplayDescription: to.Ptr("Count of uncaught exceptions thrown in the browser."), // ID: to.Ptr("/subscriptions/182c901a-129a-4f5d-86e4-cc6b294590a2/resourceGroups/hyr-log/providers/microsoft.insights/components/f1-bill/providers/microsoft.insights/metricdefinitions/exceptions/browser"), // IsDimensionRequired: to.Ptr(false), // MetricAvailabilities: []*armmonitor.MetricAvailability{ // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT5M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT15M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT30M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT6H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT12H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("P1D"), // }}, // Namespace: to.Ptr("microsoft.insights/components"), // PrimaryAggregationType: to.Ptr(armmonitor.AggregationTypeCount), // ResourceID: to.Ptr("/subscriptions/182c901a-129a-4f5d-86e4-cc6b294590a2/resourceGroups/hyr-log/providers/microsoft.insights/components/f1-bill"), // SupportedAggregationTypes: []*armmonitor.AggregationType{ // to.Ptr(armmonitor.AggregationTypeCount)}, // Unit: to.Ptr(armmonitor.MetricUnitCount), // }, // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("Server exceptions"), // Value: to.Ptr("exceptions/server"), // }, // Category: to.Ptr("Failures"), // Dimensions: []*armmonitor.LocalizableString{ // { // LocalizedValue: to.Ptr("Cloud role name"), // Value: to.Ptr("cloud/roleName"), // }, // { // LocalizedValue: to.Ptr("Cloud role instance"), // Value: to.Ptr("cloud/roleInstance"), // }}, // DisplayDescription: to.Ptr("Count of uncaught exceptions thrown in the server application."), // ID: to.Ptr("/subscriptions/182c901a-129a-4f5d-86e4-cc6b294590a2/resourceGroups/hyr-log/providers/microsoft.insights/components/f1-bill/providers/microsoft.insights/metricdefinitions/exceptions/server"), // IsDimensionRequired: to.Ptr(false), // MetricAvailabilities: []*armmonitor.MetricAvailability{ // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT5M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT15M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT30M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT6H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT12H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("P1D"), // }}, // Namespace: to.Ptr("microsoft.insights/components"), // PrimaryAggregationType: to.Ptr(armmonitor.AggregationTypeCount), // ResourceID: to.Ptr("/subscriptions/182c901a-129a-4f5d-86e4-cc6b294590a2/resourceGroups/hyr-log/providers/microsoft.insights/components/f1-bill"), // SupportedAggregationTypes: []*armmonitor.AggregationType{ // to.Ptr(armmonitor.AggregationTypeCount)}, // Unit: to.Ptr(armmonitor.MetricUnitCount), // }, // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("Traces"), // Value: to.Ptr("traces/count"), // }, // Category: to.Ptr("Usage"), // Dimensions: []*armmonitor.LocalizableString{ // { // LocalizedValue: to.Ptr("Severity level"), // Value: to.Ptr("trace/severityLevel"), // }, // { // LocalizedValue: to.Ptr("Is traffic synthetic"), // Value: to.Ptr("operation/synthetic"), // }, // { // LocalizedValue: to.Ptr("Cloud role name"), // Value: to.Ptr("cloud/roleName"), // }, // { // LocalizedValue: to.Ptr("Cloud role instance"), // Value: to.Ptr("cloud/roleInstance"), // }}, // DisplayDescription: to.Ptr("Trace document count"), // ID: to.Ptr("/subscriptions/182c901a-129a-4f5d-86e4-cc6b294590a2/resourceGroups/hyr-log/providers/microsoft.insights/components/f1-bill/providers/microsoft.insights/metricdefinitions/traces/count"), // IsDimensionRequired: to.Ptr(false), // MetricAvailabilities: []*armmonitor.MetricAvailability{ // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT5M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT15M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT30M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT6H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT12H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("P1D"), // }}, // Namespace: to.Ptr("microsoft.insights/components"), // PrimaryAggregationType: to.Ptr(armmonitor.AggregationTypeCount), // ResourceID: to.Ptr("/subscriptions/182c901a-129a-4f5d-86e4-cc6b294590a2/resourceGroups/hyr-log/providers/microsoft.insights/components/f1-bill"), // SupportedAggregationTypes: []*armmonitor.AggregationType{ // to.Ptr(armmonitor.AggregationTypeCount)}, // Unit: to.Ptr(armmonitor.MetricUnitCount), // }}, // } } }
Output:
Example (GetMetricDefinitionsWithoutFilter) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Insights/stable/2021-05-01/examples/GetMetricDefinitions.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewMetricDefinitionsClient().NewListPager("subscriptions/07c0b09d-9f69-4e6e-8d05-f59f67299cb2/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/alertruleTest/providers/microsoft.insights/metricDefinitions", &armmonitor.MetricDefinitionsClientListOptions{Metricnamespace: to.Ptr("Microsoft.Web/sites")}) 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.MetricDefinitionCollection = armmonitor.MetricDefinitionCollection{ // Value: []*armmonitor.MetricDefinition{ // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("CPU Time"), // Value: to.Ptr("CpuTime"), // }, // Dimensions: []*armmonitor.LocalizableString{ // { // LocalizedValue: to.Ptr("Instance"), // Value: to.Ptr("Instance"), // }}, // ID: to.Ptr("/subscriptions/07c0b09d-9f69-4e6e-8d05-f59f67299cb2/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/alertruleTest/providers/microsoft.insights/metricdefinitions/CpuTime"), // IsDimensionRequired: to.Ptr(false), // MetricAvailabilities: []*armmonitor.MetricAvailability{ // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT5M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT15M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT30M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT6H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT12H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("P1D"), // }}, // Namespace: to.Ptr("Microsoft.Web/sites"), // PrimaryAggregationType: to.Ptr(armmonitor.AggregationTypeTotal), // ResourceID: to.Ptr("/subscriptions/07c0b09d-9f69-4e6e-8d05-f59f67299cb2/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/alertruleTest"), // SupportedAggregationTypes: []*armmonitor.AggregationType{ // to.Ptr(armmonitor.AggregationTypeNone), // to.Ptr(armmonitor.AggregationTypeAverage), // to.Ptr(armmonitor.AggregationTypeMinimum), // to.Ptr(armmonitor.AggregationTypeMaximum), // to.Ptr(armmonitor.AggregationTypeTotal), // to.Ptr(armmonitor.AggregationTypeCount)}, // Unit: to.Ptr(armmonitor.MetricUnitSeconds), // }, // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("Requests"), // Value: to.Ptr("Requests"), // }, // Dimensions: []*armmonitor.LocalizableString{ // { // LocalizedValue: to.Ptr("Instance"), // Value: to.Ptr("Instance"), // }}, // ID: to.Ptr("/subscriptions/07c0b09d-9f69-4e6e-8d05-f59f67299cb2/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/alertruleTest/providers/microsoft.insights/metricdefinitions/Requests"), // IsDimensionRequired: to.Ptr(false), // MetricAvailabilities: []*armmonitor.MetricAvailability{ // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT5M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT15M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT30M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT6H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT12H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("P1D"), // }}, // Namespace: to.Ptr("Microsoft.Web/sites"), // PrimaryAggregationType: to.Ptr(armmonitor.AggregationTypeTotal), // ResourceID: to.Ptr("/subscriptions/07c0b09d-9f69-4e6e-8d05-f59f67299cb2/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/alertruleTest"), // SupportedAggregationTypes: []*armmonitor.AggregationType{ // to.Ptr(armmonitor.AggregationTypeNone), // to.Ptr(armmonitor.AggregationTypeAverage), // to.Ptr(armmonitor.AggregationTypeMinimum), // to.Ptr(armmonitor.AggregationTypeMaximum), // to.Ptr(armmonitor.AggregationTypeTotal), // to.Ptr(armmonitor.AggregationTypeCount)}, // Unit: to.Ptr(armmonitor.MetricUnitCount), // }, // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("Data In"), // Value: to.Ptr("BytesReceived"), // }, // Dimensions: []*armmonitor.LocalizableString{ // { // LocalizedValue: to.Ptr("Instance"), // Value: to.Ptr("Instance"), // }}, // ID: to.Ptr("/subscriptions/07c0b09d-9f69-4e6e-8d05-f59f67299cb2/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/alertruleTest/providers/microsoft.insights/metricdefinitions/BytesReceived"), // IsDimensionRequired: to.Ptr(false), // MetricAvailabilities: []*armmonitor.MetricAvailability{ // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT5M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT15M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT30M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT6H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT12H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("P1D"), // }}, // Namespace: to.Ptr("Microsoft.Web/sites"), // PrimaryAggregationType: to.Ptr(armmonitor.AggregationTypeTotal), // ResourceID: to.Ptr("/subscriptions/07c0b09d-9f69-4e6e-8d05-f59f67299cb2/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/alertruleTest"), // SupportedAggregationTypes: []*armmonitor.AggregationType{ // to.Ptr(armmonitor.AggregationTypeNone), // to.Ptr(armmonitor.AggregationTypeAverage), // to.Ptr(armmonitor.AggregationTypeMinimum), // to.Ptr(armmonitor.AggregationTypeMaximum), // to.Ptr(armmonitor.AggregationTypeTotal), // to.Ptr(armmonitor.AggregationTypeCount)}, // Unit: to.Ptr(armmonitor.MetricUnitBytes), // }, // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("Data Out"), // Value: to.Ptr("BytesSent"), // }, // Dimensions: []*armmonitor.LocalizableString{ // { // LocalizedValue: to.Ptr("Instance"), // Value: to.Ptr("Instance"), // }}, // ID: to.Ptr("/subscriptions/07c0b09d-9f69-4e6e-8d05-f59f67299cb2/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/alertruleTest/providers/microsoft.insights/metricdefinitions/BytesSent"), // IsDimensionRequired: to.Ptr(false), // MetricAvailabilities: []*armmonitor.MetricAvailability{ // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT5M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT15M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT30M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT6H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT12H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("P1D"), // }}, // Namespace: to.Ptr("Microsoft.Web/sites"), // PrimaryAggregationType: to.Ptr(armmonitor.AggregationTypeTotal), // ResourceID: to.Ptr("/subscriptions/07c0b09d-9f69-4e6e-8d05-f59f67299cb2/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/alertruleTest"), // SupportedAggregationTypes: []*armmonitor.AggregationType{ // to.Ptr(armmonitor.AggregationTypeNone), // to.Ptr(armmonitor.AggregationTypeAverage), // to.Ptr(armmonitor.AggregationTypeMinimum), // to.Ptr(armmonitor.AggregationTypeMaximum), // to.Ptr(armmonitor.AggregationTypeTotal), // to.Ptr(armmonitor.AggregationTypeCount)}, // Unit: to.Ptr(armmonitor.MetricUnitBytes), // }, // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("Http 101"), // Value: to.Ptr("Http101"), // }, // Dimensions: []*armmonitor.LocalizableString{ // { // LocalizedValue: to.Ptr("Instance"), // Value: to.Ptr("Instance"), // }}, // ID: to.Ptr("/subscriptions/07c0b09d-9f69-4e6e-8d05-f59f67299cb2/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/alertruleTest/providers/microsoft.insights/metricdefinitions/Http101"), // IsDimensionRequired: to.Ptr(false), // MetricAvailabilities: []*armmonitor.MetricAvailability{ // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT5M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT15M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT30M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT6H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT12H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("P1D"), // }}, // Namespace: to.Ptr("Microsoft.Web/sites"), // PrimaryAggregationType: to.Ptr(armmonitor.AggregationTypeTotal), // ResourceID: to.Ptr("/subscriptions/07c0b09d-9f69-4e6e-8d05-f59f67299cb2/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/alertruleTest"), // SupportedAggregationTypes: []*armmonitor.AggregationType{ // to.Ptr(armmonitor.AggregationTypeNone), // to.Ptr(armmonitor.AggregationTypeAverage), // to.Ptr(armmonitor.AggregationTypeMinimum), // to.Ptr(armmonitor.AggregationTypeMaximum), // to.Ptr(armmonitor.AggregationTypeTotal), // to.Ptr(armmonitor.AggregationTypeCount)}, // Unit: to.Ptr(armmonitor.MetricUnitCount), // }, // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("Http 2xx"), // Value: to.Ptr("Http2xx"), // }, // Dimensions: []*armmonitor.LocalizableString{ // { // LocalizedValue: to.Ptr("Instance"), // Value: to.Ptr("Instance"), // }}, // ID: to.Ptr("/subscriptions/07c0b09d-9f69-4e6e-8d05-f59f67299cb2/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/alertruleTest/providers/microsoft.insights/metricdefinitions/Http2xx"), // IsDimensionRequired: to.Ptr(false), // MetricAvailabilities: []*armmonitor.MetricAvailability{ // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT5M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT15M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT30M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT6H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT12H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("P1D"), // }}, // Namespace: to.Ptr("Microsoft.Web/sites"), // PrimaryAggregationType: to.Ptr(armmonitor.AggregationTypeTotal), // ResourceID: to.Ptr("/subscriptions/07c0b09d-9f69-4e6e-8d05-f59f67299cb2/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/alertruleTest"), // SupportedAggregationTypes: []*armmonitor.AggregationType{ // to.Ptr(armmonitor.AggregationTypeNone), // to.Ptr(armmonitor.AggregationTypeAverage), // to.Ptr(armmonitor.AggregationTypeMinimum), // to.Ptr(armmonitor.AggregationTypeMaximum), // to.Ptr(armmonitor.AggregationTypeTotal), // to.Ptr(armmonitor.AggregationTypeCount)}, // Unit: to.Ptr(armmonitor.MetricUnitCount), // }, // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("Http 3xx"), // Value: to.Ptr("Http3xx"), // }, // Dimensions: []*armmonitor.LocalizableString{ // { // LocalizedValue: to.Ptr("Instance"), // Value: to.Ptr("Instance"), // }}, // ID: to.Ptr("/subscriptions/07c0b09d-9f69-4e6e-8d05-f59f67299cb2/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/alertruleTest/providers/microsoft.insights/metricdefinitions/Http3xx"), // IsDimensionRequired: to.Ptr(false), // MetricAvailabilities: []*armmonitor.MetricAvailability{ // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT5M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT15M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT30M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT6H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT12H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("P1D"), // }}, // Namespace: to.Ptr("Microsoft.Web/sites"), // PrimaryAggregationType: to.Ptr(armmonitor.AggregationTypeTotal), // ResourceID: to.Ptr("/subscriptions/07c0b09d-9f69-4e6e-8d05-f59f67299cb2/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/alertruleTest"), // SupportedAggregationTypes: []*armmonitor.AggregationType{ // to.Ptr(armmonitor.AggregationTypeNone), // to.Ptr(armmonitor.AggregationTypeAverage), // to.Ptr(armmonitor.AggregationTypeMinimum), // to.Ptr(armmonitor.AggregationTypeMaximum), // to.Ptr(armmonitor.AggregationTypeTotal), // to.Ptr(armmonitor.AggregationTypeCount)}, // Unit: to.Ptr(armmonitor.MetricUnitCount), // }, // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("Http 401"), // Value: to.Ptr("Http401"), // }, // Dimensions: []*armmonitor.LocalizableString{ // { // LocalizedValue: to.Ptr("Instance"), // Value: to.Ptr("Instance"), // }}, // ID: to.Ptr("/subscriptions/07c0b09d-9f69-4e6e-8d05-f59f67299cb2/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/alertruleTest/providers/microsoft.insights/metricdefinitions/Http401"), // IsDimensionRequired: to.Ptr(false), // MetricAvailabilities: []*armmonitor.MetricAvailability{ // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT5M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT15M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT30M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT6H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT12H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("P1D"), // }}, // Namespace: to.Ptr("Microsoft.Web/sites"), // PrimaryAggregationType: to.Ptr(armmonitor.AggregationTypeTotal), // ResourceID: to.Ptr("/subscriptions/07c0b09d-9f69-4e6e-8d05-f59f67299cb2/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/alertruleTest"), // SupportedAggregationTypes: []*armmonitor.AggregationType{ // to.Ptr(armmonitor.AggregationTypeNone), // to.Ptr(armmonitor.AggregationTypeAverage), // to.Ptr(armmonitor.AggregationTypeMinimum), // to.Ptr(armmonitor.AggregationTypeMaximum), // to.Ptr(armmonitor.AggregationTypeTotal), // to.Ptr(armmonitor.AggregationTypeCount)}, // Unit: to.Ptr(armmonitor.MetricUnitCount), // }, // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("Http 403"), // Value: to.Ptr("Http403"), // }, // Dimensions: []*armmonitor.LocalizableString{ // { // LocalizedValue: to.Ptr("Instance"), // Value: to.Ptr("Instance"), // }}, // ID: to.Ptr("/subscriptions/07c0b09d-9f69-4e6e-8d05-f59f67299cb2/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/alertruleTest/providers/microsoft.insights/metricdefinitions/Http403"), // IsDimensionRequired: to.Ptr(false), // MetricAvailabilities: []*armmonitor.MetricAvailability{ // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT5M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT15M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT30M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT6H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT12H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("P1D"), // }}, // Namespace: to.Ptr("Microsoft.Web/sites"), // PrimaryAggregationType: to.Ptr(armmonitor.AggregationTypeTotal), // ResourceID: to.Ptr("/subscriptions/07c0b09d-9f69-4e6e-8d05-f59f67299cb2/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/alertruleTest"), // SupportedAggregationTypes: []*armmonitor.AggregationType{ // to.Ptr(armmonitor.AggregationTypeNone), // to.Ptr(armmonitor.AggregationTypeAverage), // to.Ptr(armmonitor.AggregationTypeMinimum), // to.Ptr(armmonitor.AggregationTypeMaximum), // to.Ptr(armmonitor.AggregationTypeTotal), // to.Ptr(armmonitor.AggregationTypeCount)}, // Unit: to.Ptr(armmonitor.MetricUnitCount), // }, // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("Http 404"), // Value: to.Ptr("Http404"), // }, // Dimensions: []*armmonitor.LocalizableString{ // { // LocalizedValue: to.Ptr("Instance"), // Value: to.Ptr("Instance"), // }}, // ID: to.Ptr("/subscriptions/07c0b09d-9f69-4e6e-8d05-f59f67299cb2/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/alertruleTest/providers/microsoft.insights/metricdefinitions/Http404"), // IsDimensionRequired: to.Ptr(false), // MetricAvailabilities: []*armmonitor.MetricAvailability{ // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT5M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT15M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT30M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT6H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT12H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("P1D"), // }}, // Namespace: to.Ptr("Microsoft.Web/sites"), // PrimaryAggregationType: to.Ptr(armmonitor.AggregationTypeTotal), // ResourceID: to.Ptr("/subscriptions/07c0b09d-9f69-4e6e-8d05-f59f67299cb2/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/alertruleTest"), // SupportedAggregationTypes: []*armmonitor.AggregationType{ // to.Ptr(armmonitor.AggregationTypeNone), // to.Ptr(armmonitor.AggregationTypeAverage), // to.Ptr(armmonitor.AggregationTypeMinimum), // to.Ptr(armmonitor.AggregationTypeMaximum), // to.Ptr(armmonitor.AggregationTypeTotal), // to.Ptr(armmonitor.AggregationTypeCount)}, // Unit: to.Ptr(armmonitor.MetricUnitCount), // }, // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("Http 406"), // Value: to.Ptr("Http406"), // }, // Dimensions: []*armmonitor.LocalizableString{ // { // LocalizedValue: to.Ptr("Instance"), // Value: to.Ptr("Instance"), // }}, // ID: to.Ptr("/subscriptions/07c0b09d-9f69-4e6e-8d05-f59f67299cb2/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/alertruleTest/providers/microsoft.insights/metricdefinitions/Http406"), // IsDimensionRequired: to.Ptr(false), // MetricAvailabilities: []*armmonitor.MetricAvailability{ // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT5M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT15M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT30M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT6H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT12H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("P1D"), // }}, // Namespace: to.Ptr("Microsoft.Web/sites"), // PrimaryAggregationType: to.Ptr(armmonitor.AggregationTypeTotal), // ResourceID: to.Ptr("/subscriptions/07c0b09d-9f69-4e6e-8d05-f59f67299cb2/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/alertruleTest"), // SupportedAggregationTypes: []*armmonitor.AggregationType{ // to.Ptr(armmonitor.AggregationTypeNone), // to.Ptr(armmonitor.AggregationTypeAverage), // to.Ptr(armmonitor.AggregationTypeMinimum), // to.Ptr(armmonitor.AggregationTypeMaximum), // to.Ptr(armmonitor.AggregationTypeTotal), // to.Ptr(armmonitor.AggregationTypeCount)}, // Unit: to.Ptr(armmonitor.MetricUnitCount), // }, // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("Http 4xx"), // Value: to.Ptr("Http4xx"), // }, // Dimensions: []*armmonitor.LocalizableString{ // { // LocalizedValue: to.Ptr("Instance"), // Value: to.Ptr("Instance"), // }}, // ID: to.Ptr("/subscriptions/07c0b09d-9f69-4e6e-8d05-f59f67299cb2/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/alertruleTest/providers/microsoft.insights/metricdefinitions/Http4xx"), // IsDimensionRequired: to.Ptr(false), // MetricAvailabilities: []*armmonitor.MetricAvailability{ // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT5M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT15M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT30M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT6H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT12H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("P1D"), // }}, // Namespace: to.Ptr("Microsoft.Web/sites"), // PrimaryAggregationType: to.Ptr(armmonitor.AggregationTypeTotal), // ResourceID: to.Ptr("/subscriptions/07c0b09d-9f69-4e6e-8d05-f59f67299cb2/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/alertruleTest"), // SupportedAggregationTypes: []*armmonitor.AggregationType{ // to.Ptr(armmonitor.AggregationTypeNone), // to.Ptr(armmonitor.AggregationTypeAverage), // to.Ptr(armmonitor.AggregationTypeMinimum), // to.Ptr(armmonitor.AggregationTypeMaximum), // to.Ptr(armmonitor.AggregationTypeTotal), // to.Ptr(armmonitor.AggregationTypeCount)}, // Unit: to.Ptr(armmonitor.MetricUnitCount), // }, // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("Http Server Errors"), // Value: to.Ptr("Http5xx"), // }, // Dimensions: []*armmonitor.LocalizableString{ // { // LocalizedValue: to.Ptr("Instance"), // Value: to.Ptr("Instance"), // }}, // ID: to.Ptr("/subscriptions/07c0b09d-9f69-4e6e-8d05-f59f67299cb2/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/alertruleTest/providers/microsoft.insights/metricdefinitions/Http5xx"), // IsDimensionRequired: to.Ptr(false), // MetricAvailabilities: []*armmonitor.MetricAvailability{ // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT5M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT15M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT30M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT6H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT12H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("P1D"), // }}, // Namespace: to.Ptr("Microsoft.Web/sites"), // PrimaryAggregationType: to.Ptr(armmonitor.AggregationTypeTotal), // ResourceID: to.Ptr("/subscriptions/07c0b09d-9f69-4e6e-8d05-f59f67299cb2/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/alertruleTest"), // SupportedAggregationTypes: []*armmonitor.AggregationType{ // to.Ptr(armmonitor.AggregationTypeNone), // to.Ptr(armmonitor.AggregationTypeAverage), // to.Ptr(armmonitor.AggregationTypeMinimum), // to.Ptr(armmonitor.AggregationTypeMaximum), // to.Ptr(armmonitor.AggregationTypeTotal), // to.Ptr(armmonitor.AggregationTypeCount)}, // Unit: to.Ptr(armmonitor.MetricUnitCount), // }, // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("Memory working set"), // Value: to.Ptr("MemoryWorkingSet"), // }, // Dimensions: []*armmonitor.LocalizableString{ // { // LocalizedValue: to.Ptr("Instance"), // Value: to.Ptr("Instance"), // }}, // ID: to.Ptr("/subscriptions/07c0b09d-9f69-4e6e-8d05-f59f67299cb2/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/alertruleTest/providers/microsoft.insights/metricdefinitions/MemoryWorkingSet"), // IsDimensionRequired: to.Ptr(false), // MetricAvailabilities: []*armmonitor.MetricAvailability{ // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT5M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT15M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT30M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT6H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT12H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("P1D"), // }}, // Namespace: to.Ptr("Microsoft.Web/sites"), // PrimaryAggregationType: to.Ptr(armmonitor.AggregationTypeAverage), // ResourceID: to.Ptr("/subscriptions/07c0b09d-9f69-4e6e-8d05-f59f67299cb2/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/alertruleTest"), // SupportedAggregationTypes: []*armmonitor.AggregationType{ // to.Ptr(armmonitor.AggregationTypeNone), // to.Ptr(armmonitor.AggregationTypeAverage), // to.Ptr(armmonitor.AggregationTypeMinimum), // to.Ptr(armmonitor.AggregationTypeMaximum), // to.Ptr(armmonitor.AggregationTypeTotal), // to.Ptr(armmonitor.AggregationTypeCount)}, // Unit: to.Ptr(armmonitor.MetricUnitBytes), // }, // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("Average memory working set"), // Value: to.Ptr("AverageMemoryWorkingSet"), // }, // Dimensions: []*armmonitor.LocalizableString{ // { // LocalizedValue: to.Ptr("Instance"), // Value: to.Ptr("Instance"), // }}, // ID: to.Ptr("/subscriptions/07c0b09d-9f69-4e6e-8d05-f59f67299cb2/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/alertruleTest/providers/microsoft.insights/metricdefinitions/AverageMemoryWorkingSet"), // IsDimensionRequired: to.Ptr(false), // MetricAvailabilities: []*armmonitor.MetricAvailability{ // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT5M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT15M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT30M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT6H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT12H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("P1D"), // }}, // Namespace: to.Ptr("Microsoft.Web/sites"), // PrimaryAggregationType: to.Ptr(armmonitor.AggregationTypeAverage), // ResourceID: to.Ptr("/subscriptions/07c0b09d-9f69-4e6e-8d05-f59f67299cb2/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/alertruleTest"), // SupportedAggregationTypes: []*armmonitor.AggregationType{ // to.Ptr(armmonitor.AggregationTypeNone), // to.Ptr(armmonitor.AggregationTypeAverage), // to.Ptr(armmonitor.AggregationTypeMinimum), // to.Ptr(armmonitor.AggregationTypeMaximum), // to.Ptr(armmonitor.AggregationTypeTotal), // to.Ptr(armmonitor.AggregationTypeCount)}, // Unit: to.Ptr(armmonitor.MetricUnitBytes), // }, // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("Average Response Time"), // Value: to.Ptr("AverageResponseTime"), // }, // Dimensions: []*armmonitor.LocalizableString{ // { // LocalizedValue: to.Ptr("Instance"), // Value: to.Ptr("Instance"), // }}, // ID: to.Ptr("/subscriptions/07c0b09d-9f69-4e6e-8d05-f59f67299cb2/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/alertruleTest/providers/microsoft.insights/metricdefinitions/AverageResponseTime"), // IsDimensionRequired: to.Ptr(false), // MetricAvailabilities: []*armmonitor.MetricAvailability{ // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT5M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT15M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT30M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT6H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT12H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("P1D"), // }}, // Namespace: to.Ptr("Microsoft.Web/sites"), // PrimaryAggregationType: to.Ptr(armmonitor.AggregationTypeAverage), // ResourceID: to.Ptr("/subscriptions/07c0b09d-9f69-4e6e-8d05-f59f67299cb2/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/alertruleTest"), // SupportedAggregationTypes: []*armmonitor.AggregationType{ // to.Ptr(armmonitor.AggregationTypeNone), // to.Ptr(armmonitor.AggregationTypeAverage), // to.Ptr(armmonitor.AggregationTypeMinimum), // to.Ptr(armmonitor.AggregationTypeMaximum), // to.Ptr(armmonitor.AggregationTypeTotal), // to.Ptr(armmonitor.AggregationTypeCount)}, // Unit: to.Ptr(armmonitor.MetricUnitSeconds), // }}, // } } }
Output:
Example (GetStorageCacheMetricDefinitionsWithMetricClass) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Insights/stable/2021-05-01/examples/GetMetricDefinitionsMetricClass.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewMetricDefinitionsClient().NewListPager("subscriptions/46841c0e-69c8-4b17-af46-6626ecb15fc2/resourceGroups/adgarntptestrg/providers/Microsoft.StorageCache/caches/adgarntptestcache", &armmonitor.MetricDefinitionsClientListOptions{Metricnamespace: to.Ptr("microsoft.storagecache/caches")}) 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.MetricDefinitionCollection = armmonitor.MetricDefinitionCollection{ // Value: []*armmonitor.MetricDefinition{ // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("Total Client IOPS"), // Value: to.Ptr("ClientIOPS"), // }, // DisplayDescription: to.Ptr("The rate of client file operations processed by the Cache."), // ID: to.Ptr("/subscriptions/46841c0e-69c8-4b17-af46-6626ecb15fc2/resourceGroups/adgarntptestrg/providers/Microsoft.StorageCache/caches/adgarntptestcache/providers/microsoft.insights/metricdefinitions/ClientIOPS"), // IsDimensionRequired: to.Ptr(false), // MetricAvailabilities: []*armmonitor.MetricAvailability{ // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT5M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT15M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT30M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT6H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT12H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("P1D"), // }}, // MetricClass: to.Ptr(armmonitor.MetricClassTransactions), // Namespace: to.Ptr("microsoft.storagecache/caches"), // PrimaryAggregationType: to.Ptr(armmonitor.AggregationTypeAverage), // ResourceID: to.Ptr("/subscriptions/46841c0e-69c8-4b17-af46-6626ecb15fc2/resourceGroups/adgarntptestrg/providers/Microsoft.StorageCache/caches/adgarntptestcache"), // SupportedAggregationTypes: []*armmonitor.AggregationType{ // to.Ptr(armmonitor.AggregationTypeMinimum), // to.Ptr(armmonitor.AggregationTypeMaximum), // to.Ptr(armmonitor.AggregationTypeAverage)}, // Unit: to.Ptr(armmonitor.MetricUnitCount), // }, // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("Average Client Latency"), // Value: to.Ptr("ClientLatency"), // }, // DisplayDescription: to.Ptr("Average latency of client file operations to the Cache."), // ID: to.Ptr("/subscriptions/46841c0e-69c8-4b17-af46-6626ecb15fc2/resourceGroups/adgarntptestrg/providers/Microsoft.StorageCache/caches/adgarntptestcache/providers/microsoft.insights/metricdefinitions/ClientLatency"), // IsDimensionRequired: to.Ptr(false), // MetricAvailabilities: []*armmonitor.MetricAvailability{ // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT5M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT15M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT30M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT6H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT12H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("P1D"), // }}, // MetricClass: to.Ptr(armmonitor.MetricClassLatency), // Namespace: to.Ptr("microsoft.storagecache/caches"), // PrimaryAggregationType: to.Ptr(armmonitor.AggregationTypeAverage), // ResourceID: to.Ptr("/subscriptions/46841c0e-69c8-4b17-af46-6626ecb15fc2/resourceGroups/adgarntptestrg/providers/Microsoft.StorageCache/caches/adgarntptestcache"), // SupportedAggregationTypes: []*armmonitor.AggregationType{ // to.Ptr(armmonitor.AggregationTypeMinimum), // to.Ptr(armmonitor.AggregationTypeMaximum), // to.Ptr(armmonitor.AggregationTypeAverage)}, // Unit: to.Ptr(armmonitor.MetricUnitMilliSeconds), // }, // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("Client Read IOPS"), // Value: to.Ptr("ClientReadIOPS"), // }, // DisplayDescription: to.Ptr("Client read operations per second."), // ID: to.Ptr("/subscriptions/46841c0e-69c8-4b17-af46-6626ecb15fc2/resourceGroups/adgarntptestrg/providers/Microsoft.StorageCache/caches/adgarntptestcache/providers/microsoft.insights/metricdefinitions/ClientReadIOPS"), // IsDimensionRequired: to.Ptr(false), // MetricAvailabilities: []*armmonitor.MetricAvailability{ // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT5M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT15M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT30M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT6H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT12H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("P1D"), // }}, // MetricClass: to.Ptr(armmonitor.MetricClassTransactions), // Namespace: to.Ptr("microsoft.storagecache/caches"), // PrimaryAggregationType: to.Ptr(armmonitor.AggregationTypeAverage), // ResourceID: to.Ptr("/subscriptions/46841c0e-69c8-4b17-af46-6626ecb15fc2/resourceGroups/adgarntptestrg/providers/Microsoft.StorageCache/caches/adgarntptestcache"), // SupportedAggregationTypes: []*armmonitor.AggregationType{ // to.Ptr(armmonitor.AggregationTypeMinimum), // to.Ptr(armmonitor.AggregationTypeMaximum), // to.Ptr(armmonitor.AggregationTypeAverage)}, // Unit: to.Ptr(armmonitor.MetricUnitCountPerSecond), // }, // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("Average Cache Read Throughput"), // Value: to.Ptr("ClientReadThroughput"), // }, // DisplayDescription: to.Ptr("Client read data transfer rate."), // ID: to.Ptr("/subscriptions/46841c0e-69c8-4b17-af46-6626ecb15fc2/resourceGroups/adgarntptestrg/providers/Microsoft.StorageCache/caches/adgarntptestcache/providers/microsoft.insights/metricdefinitions/ClientReadThroughput"), // IsDimensionRequired: to.Ptr(false), // MetricAvailabilities: []*armmonitor.MetricAvailability{ // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT5M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT15M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT30M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT6H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT12H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("P1D"), // }}, // MetricClass: to.Ptr(armmonitor.MetricClassTransactions), // Namespace: to.Ptr("microsoft.storagecache/caches"), // PrimaryAggregationType: to.Ptr(armmonitor.AggregationTypeAverage), // ResourceID: to.Ptr("/subscriptions/46841c0e-69c8-4b17-af46-6626ecb15fc2/resourceGroups/adgarntptestrg/providers/Microsoft.StorageCache/caches/adgarntptestcache"), // SupportedAggregationTypes: []*armmonitor.AggregationType{ // to.Ptr(armmonitor.AggregationTypeMinimum), // to.Ptr(armmonitor.AggregationTypeMaximum), // to.Ptr(armmonitor.AggregationTypeAverage)}, // Unit: to.Ptr(armmonitor.MetricUnitBytesPerSecond), // }, // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("Client Write IOPS"), // Value: to.Ptr("ClientWriteIOPS"), // }, // DisplayDescription: to.Ptr("Client write operations per second."), // ID: to.Ptr("/subscriptions/46841c0e-69c8-4b17-af46-6626ecb15fc2/resourceGroups/adgarntptestrg/providers/Microsoft.StorageCache/caches/adgarntptestcache/providers/microsoft.insights/metricdefinitions/ClientWriteIOPS"), // IsDimensionRequired: to.Ptr(false), // MetricAvailabilities: []*armmonitor.MetricAvailability{ // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT5M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT15M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT30M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT6H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT12H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("P1D"), // }}, // MetricClass: to.Ptr(armmonitor.MetricClassTransactions), // Namespace: to.Ptr("microsoft.storagecache/caches"), // PrimaryAggregationType: to.Ptr(armmonitor.AggregationTypeAverage), // ResourceID: to.Ptr("/subscriptions/46841c0e-69c8-4b17-af46-6626ecb15fc2/resourceGroups/adgarntptestrg/providers/Microsoft.StorageCache/caches/adgarntptestcache"), // SupportedAggregationTypes: []*armmonitor.AggregationType{ // to.Ptr(armmonitor.AggregationTypeMinimum), // to.Ptr(armmonitor.AggregationTypeMaximum), // to.Ptr(armmonitor.AggregationTypeAverage)}, // Unit: to.Ptr(armmonitor.MetricUnitCountPerSecond), // }, // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("Average Cache Write Throughput"), // Value: to.Ptr("ClientWriteThroughput"), // }, // DisplayDescription: to.Ptr("Client write data transfer rate."), // ID: to.Ptr("/subscriptions/46841c0e-69c8-4b17-af46-6626ecb15fc2/resourceGroups/adgarntptestrg/providers/Microsoft.StorageCache/caches/adgarntptestcache/providers/microsoft.insights/metricdefinitions/ClientWriteThroughput"), // IsDimensionRequired: to.Ptr(false), // MetricAvailabilities: []*armmonitor.MetricAvailability{ // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT5M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT15M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT30M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT6H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT12H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("P1D"), // }}, // MetricClass: to.Ptr(armmonitor.MetricClassTransactions), // Namespace: to.Ptr("microsoft.storagecache/caches"), // PrimaryAggregationType: to.Ptr(armmonitor.AggregationTypeAverage), // ResourceID: to.Ptr("/subscriptions/46841c0e-69c8-4b17-af46-6626ecb15fc2/resourceGroups/adgarntptestrg/providers/Microsoft.StorageCache/caches/adgarntptestcache"), // SupportedAggregationTypes: []*armmonitor.AggregationType{ // to.Ptr(armmonitor.AggregationTypeMinimum), // to.Ptr(armmonitor.AggregationTypeMaximum), // to.Ptr(armmonitor.AggregationTypeAverage)}, // Unit: to.Ptr(armmonitor.MetricUnitBytesPerSecond), // }, // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("Client Metadata Read IOPS"), // Value: to.Ptr("ClientMetadataReadIOPS"), // }, // DisplayDescription: to.Ptr("The rate of client file operations sent to the Cache, excluding data reads, that do not modify persistent state."), // ID: to.Ptr("/subscriptions/46841c0e-69c8-4b17-af46-6626ecb15fc2/resourceGroups/adgarntptestrg/providers/Microsoft.StorageCache/caches/adgarntptestcache/providers/microsoft.insights/metricdefinitions/ClientMetadataReadIOPS"), // IsDimensionRequired: to.Ptr(false), // MetricAvailabilities: []*armmonitor.MetricAvailability{ // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT5M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT15M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT30M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT6H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT12H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("P1D"), // }}, // MetricClass: to.Ptr(armmonitor.MetricClassTransactions), // Namespace: to.Ptr("microsoft.storagecache/caches"), // PrimaryAggregationType: to.Ptr(armmonitor.AggregationTypeAverage), // ResourceID: to.Ptr("/subscriptions/46841c0e-69c8-4b17-af46-6626ecb15fc2/resourceGroups/adgarntptestrg/providers/Microsoft.StorageCache/caches/adgarntptestcache"), // SupportedAggregationTypes: []*armmonitor.AggregationType{ // to.Ptr(armmonitor.AggregationTypeMinimum), // to.Ptr(armmonitor.AggregationTypeMaximum), // to.Ptr(armmonitor.AggregationTypeAverage)}, // Unit: to.Ptr(armmonitor.MetricUnitCountPerSecond), // }, // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("Client Metadata Write IOPS"), // Value: to.Ptr("ClientMetadataWriteIOPS"), // }, // DisplayDescription: to.Ptr("The rate of client file operations sent to the Cache, excluding data writes, that modify persistent state."), // ID: to.Ptr("/subscriptions/46841c0e-69c8-4b17-af46-6626ecb15fc2/resourceGroups/adgarntptestrg/providers/Microsoft.StorageCache/caches/adgarntptestcache/providers/microsoft.insights/metricdefinitions/ClientMetadataWriteIOPS"), // IsDimensionRequired: to.Ptr(false), // MetricAvailabilities: []*armmonitor.MetricAvailability{ // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT5M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT15M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT30M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT6H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT12H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("P1D"), // }}, // MetricClass: to.Ptr(armmonitor.MetricClassTransactions), // Namespace: to.Ptr("microsoft.storagecache/caches"), // PrimaryAggregationType: to.Ptr(armmonitor.AggregationTypeAverage), // ResourceID: to.Ptr("/subscriptions/46841c0e-69c8-4b17-af46-6626ecb15fc2/resourceGroups/adgarntptestrg/providers/Microsoft.StorageCache/caches/adgarntptestcache"), // SupportedAggregationTypes: []*armmonitor.AggregationType{ // to.Ptr(armmonitor.AggregationTypeMinimum), // to.Ptr(armmonitor.AggregationTypeMaximum), // to.Ptr(armmonitor.AggregationTypeAverage)}, // Unit: to.Ptr(armmonitor.MetricUnitCountPerSecond), // }, // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("Client Lock IOPS"), // Value: to.Ptr("ClientLockIOPS"), // }, // DisplayDescription: to.Ptr("Client file locking operations per second."), // ID: to.Ptr("/subscriptions/46841c0e-69c8-4b17-af46-6626ecb15fc2/resourceGroups/adgarntptestrg/providers/Microsoft.StorageCache/caches/adgarntptestcache/providers/microsoft.insights/metricdefinitions/ClientLockIOPS"), // IsDimensionRequired: to.Ptr(false), // MetricAvailabilities: []*armmonitor.MetricAvailability{ // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT5M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT15M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT30M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT6H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT12H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("P1D"), // }}, // MetricClass: to.Ptr(armmonitor.MetricClassTransactions), // Namespace: to.Ptr("microsoft.storagecache/caches"), // PrimaryAggregationType: to.Ptr(armmonitor.AggregationTypeAverage), // ResourceID: to.Ptr("/subscriptions/46841c0e-69c8-4b17-af46-6626ecb15fc2/resourceGroups/adgarntptestrg/providers/Microsoft.StorageCache/caches/adgarntptestcache"), // SupportedAggregationTypes: []*armmonitor.AggregationType{ // to.Ptr(armmonitor.AggregationTypeMinimum), // to.Ptr(armmonitor.AggregationTypeMaximum), // to.Ptr(armmonitor.AggregationTypeAverage)}, // Unit: to.Ptr(armmonitor.MetricUnitCountPerSecond), // }, // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("Storage Target Health"), // Value: to.Ptr("StorageTargetHealth"), // }, // DisplayDescription: to.Ptr("Boolean results of connectivity test between the Cache and Storage Targets."), // ID: to.Ptr("/subscriptions/46841c0e-69c8-4b17-af46-6626ecb15fc2/resourceGroups/adgarntptestrg/providers/Microsoft.StorageCache/caches/adgarntptestcache/providers/microsoft.insights/metricdefinitions/StorageTargetHealth"), // IsDimensionRequired: to.Ptr(false), // MetricAvailabilities: []*armmonitor.MetricAvailability{ // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT5M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT15M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT30M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT6H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT12H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("P1D"), // }}, // MetricClass: to.Ptr(armmonitor.MetricClassErrors), // Namespace: to.Ptr("microsoft.storagecache/caches"), // PrimaryAggregationType: to.Ptr(armmonitor.AggregationTypeAverage), // ResourceID: to.Ptr("/subscriptions/46841c0e-69c8-4b17-af46-6626ecb15fc2/resourceGroups/adgarntptestrg/providers/Microsoft.StorageCache/caches/adgarntptestcache"), // SupportedAggregationTypes: []*armmonitor.AggregationType{ // to.Ptr(armmonitor.AggregationTypeMinimum), // to.Ptr(armmonitor.AggregationTypeMaximum), // to.Ptr(armmonitor.AggregationTypeAverage)}, // Unit: to.Ptr(armmonitor.MetricUnitCount), // }, // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("Uptime"), // Value: to.Ptr("Uptime"), // }, // DisplayDescription: to.Ptr("Boolean results of connectivity test between the Cache and monitoring system."), // ID: to.Ptr("/subscriptions/46841c0e-69c8-4b17-af46-6626ecb15fc2/resourceGroups/adgarntptestrg/providers/Microsoft.StorageCache/caches/adgarntptestcache/providers/microsoft.insights/metricdefinitions/Uptime"), // IsDimensionRequired: to.Ptr(false), // MetricAvailabilities: []*armmonitor.MetricAvailability{ // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT5M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT15M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT30M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT6H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT12H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("P1D"), // }}, // MetricClass: to.Ptr(armmonitor.MetricClassAvailability), // Namespace: to.Ptr("microsoft.storagecache/caches"), // PrimaryAggregationType: to.Ptr(armmonitor.AggregationTypeAverage), // ResourceID: to.Ptr("/subscriptions/46841c0e-69c8-4b17-af46-6626ecb15fc2/resourceGroups/adgarntptestrg/providers/Microsoft.StorageCache/caches/adgarntptestcache"), // SupportedAggregationTypes: []*armmonitor.AggregationType{ // to.Ptr(armmonitor.AggregationTypeMinimum), // to.Ptr(armmonitor.AggregationTypeMaximum), // to.Ptr(armmonitor.AggregationTypeAverage)}, // Unit: to.Ptr(armmonitor.MetricUnitCount), // }, // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("Total StorageTarget IOPS"), // Value: to.Ptr("StorageTargetIOPS"), // }, // Dimensions: []*armmonitor.LocalizableString{ // { // LocalizedValue: to.Ptr("StorageTarget"), // Value: to.Ptr("StorageTarget"), // }}, // DisplayDescription: to.Ptr("The rate of all file operations the Cache sends to a particular StorageTarget."), // ID: to.Ptr("/subscriptions/46841c0e-69c8-4b17-af46-6626ecb15fc2/resourceGroups/adgarntptestrg/providers/Microsoft.StorageCache/caches/adgarntptestcache/providers/microsoft.insights/metricdefinitions/StorageTargetIOPS"), // IsDimensionRequired: to.Ptr(false), // MetricAvailabilities: []*armmonitor.MetricAvailability{ // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT5M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT15M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT30M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT6H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT12H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("P1D"), // }}, // MetricClass: to.Ptr(armmonitor.MetricClassTransactions), // Namespace: to.Ptr("microsoft.storagecache/caches"), // PrimaryAggregationType: to.Ptr(armmonitor.AggregationTypeAverage), // ResourceID: to.Ptr("/subscriptions/46841c0e-69c8-4b17-af46-6626ecb15fc2/resourceGroups/adgarntptestrg/providers/Microsoft.StorageCache/caches/adgarntptestcache"), // SupportedAggregationTypes: []*armmonitor.AggregationType{ // to.Ptr(armmonitor.AggregationTypeMinimum), // to.Ptr(armmonitor.AggregationTypeMaximum), // to.Ptr(armmonitor.AggregationTypeAverage)}, // Unit: to.Ptr(armmonitor.MetricUnitCount), // }, // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("StorageTarget Write IOPS"), // Value: to.Ptr("StorageTargetWriteIOPS"), // }, // Dimensions: []*armmonitor.LocalizableString{ // { // LocalizedValue: to.Ptr("StorageTarget"), // Value: to.Ptr("StorageTarget"), // }}, // DisplayDescription: to.Ptr("The rate of the file write operations the Cache sends to a particular StorageTarget."), // ID: to.Ptr("/subscriptions/46841c0e-69c8-4b17-af46-6626ecb15fc2/resourceGroups/adgarntptestrg/providers/Microsoft.StorageCache/caches/adgarntptestcache/providers/microsoft.insights/metricdefinitions/StorageTargetWriteIOPS"), // IsDimensionRequired: to.Ptr(false), // MetricAvailabilities: []*armmonitor.MetricAvailability{ // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT5M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT15M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT30M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT6H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT12H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("P1D"), // }}, // MetricClass: to.Ptr(armmonitor.MetricClassTransactions), // Namespace: to.Ptr("microsoft.storagecache/caches"), // PrimaryAggregationType: to.Ptr(armmonitor.AggregationTypeAverage), // ResourceID: to.Ptr("/subscriptions/46841c0e-69c8-4b17-af46-6626ecb15fc2/resourceGroups/adgarntptestrg/providers/Microsoft.StorageCache/caches/adgarntptestcache"), // SupportedAggregationTypes: []*armmonitor.AggregationType{ // to.Ptr(armmonitor.AggregationTypeMinimum), // to.Ptr(armmonitor.AggregationTypeMaximum), // to.Ptr(armmonitor.AggregationTypeAverage)}, // Unit: to.Ptr(armmonitor.MetricUnitCount), // }, // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("StorageTarget Asynchronous Write Throughput"), // Value: to.Ptr("StorageTargetAsyncWriteThroughput"), // }, // Dimensions: []*armmonitor.LocalizableString{ // { // LocalizedValue: to.Ptr("StorageTarget"), // Value: to.Ptr("StorageTarget"), // }}, // DisplayDescription: to.Ptr("The rate the Cache asynchronously writes data to a particular StorageTarget. These are opportunistic writes that do not cause clients to block."), // ID: to.Ptr("/subscriptions/46841c0e-69c8-4b17-af46-6626ecb15fc2/resourceGroups/adgarntptestrg/providers/Microsoft.StorageCache/caches/adgarntptestcache/providers/microsoft.insights/metricdefinitions/StorageTargetAsyncWriteThroughput"), // IsDimensionRequired: to.Ptr(false), // MetricAvailabilities: []*armmonitor.MetricAvailability{ // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT5M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT15M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT30M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT6H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT12H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("P1D"), // }}, // MetricClass: to.Ptr(armmonitor.MetricClassTransactions), // Namespace: to.Ptr("microsoft.storagecache/caches"), // PrimaryAggregationType: to.Ptr(armmonitor.AggregationTypeAverage), // ResourceID: to.Ptr("/subscriptions/46841c0e-69c8-4b17-af46-6626ecb15fc2/resourceGroups/adgarntptestrg/providers/Microsoft.StorageCache/caches/adgarntptestcache"), // SupportedAggregationTypes: []*armmonitor.AggregationType{ // to.Ptr(armmonitor.AggregationTypeMinimum), // to.Ptr(armmonitor.AggregationTypeMaximum), // to.Ptr(armmonitor.AggregationTypeAverage)}, // Unit: to.Ptr(armmonitor.MetricUnitBytesPerSecond), // }, // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("StorageTarget Synchronous Write Throughput"), // Value: to.Ptr("StorageTargetSyncWriteThroughput"), // }, // Dimensions: []*armmonitor.LocalizableString{ // { // LocalizedValue: to.Ptr("StorageTarget"), // Value: to.Ptr("StorageTarget"), // }}, // DisplayDescription: to.Ptr("The rate the Cache synchronously writes data to a particular StorageTarget. These are writes that do cause clients to block."), // ID: to.Ptr("/subscriptions/46841c0e-69c8-4b17-af46-6626ecb15fc2/resourceGroups/adgarntptestrg/providers/Microsoft.StorageCache/caches/adgarntptestcache/providers/microsoft.insights/metricdefinitions/StorageTargetSyncWriteThroughput"), // IsDimensionRequired: to.Ptr(false), // MetricAvailabilities: []*armmonitor.MetricAvailability{ // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT5M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT15M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT30M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT6H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT12H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("P1D"), // }}, // MetricClass: to.Ptr(armmonitor.MetricClassTransactions), // Namespace: to.Ptr("microsoft.storagecache/caches"), // PrimaryAggregationType: to.Ptr(armmonitor.AggregationTypeAverage), // ResourceID: to.Ptr("/subscriptions/46841c0e-69c8-4b17-af46-6626ecb15fc2/resourceGroups/adgarntptestrg/providers/Microsoft.StorageCache/caches/adgarntptestcache"), // SupportedAggregationTypes: []*armmonitor.AggregationType{ // to.Ptr(armmonitor.AggregationTypeMinimum), // to.Ptr(armmonitor.AggregationTypeMaximum), // to.Ptr(armmonitor.AggregationTypeAverage)}, // Unit: to.Ptr(armmonitor.MetricUnitBytesPerSecond), // }, // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("StorageTarget Total Write Throughput"), // Value: to.Ptr("StorageTargetTotalWriteThroughput"), // }, // Dimensions: []*armmonitor.LocalizableString{ // { // LocalizedValue: to.Ptr("StorageTarget"), // Value: to.Ptr("StorageTarget"), // }}, // DisplayDescription: to.Ptr("The total rate that the Cache writes data to a particular StorageTarget."), // ID: to.Ptr("/subscriptions/46841c0e-69c8-4b17-af46-6626ecb15fc2/resourceGroups/adgarntptestrg/providers/Microsoft.StorageCache/caches/adgarntptestcache/providers/microsoft.insights/metricdefinitions/StorageTargetTotalWriteThroughput"), // IsDimensionRequired: to.Ptr(false), // MetricAvailabilities: []*armmonitor.MetricAvailability{ // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT5M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT15M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT30M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT6H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT12H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("P1D"), // }}, // MetricClass: to.Ptr(armmonitor.MetricClassTransactions), // Namespace: to.Ptr("microsoft.storagecache/caches"), // PrimaryAggregationType: to.Ptr(armmonitor.AggregationTypeAverage), // ResourceID: to.Ptr("/subscriptions/46841c0e-69c8-4b17-af46-6626ecb15fc2/resourceGroups/adgarntptestrg/providers/Microsoft.StorageCache/caches/adgarntptestcache"), // SupportedAggregationTypes: []*armmonitor.AggregationType{ // to.Ptr(armmonitor.AggregationTypeMinimum), // to.Ptr(armmonitor.AggregationTypeMaximum), // to.Ptr(armmonitor.AggregationTypeAverage)}, // Unit: to.Ptr(armmonitor.MetricUnitBytesPerSecond), // }, // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("StorageTarget Latency"), // Value: to.Ptr("StorageTargetLatency"), // }, // Dimensions: []*armmonitor.LocalizableString{ // { // LocalizedValue: to.Ptr("StorageTarget"), // Value: to.Ptr("StorageTarget"), // }}, // DisplayDescription: to.Ptr("The average round trip latency of all the file operations the Cache sends to a partricular StorageTarget."), // ID: to.Ptr("/subscriptions/46841c0e-69c8-4b17-af46-6626ecb15fc2/resourceGroups/adgarntptestrg/providers/Microsoft.StorageCache/caches/adgarntptestcache/providers/microsoft.insights/metricdefinitions/StorageTargetLatency"), // IsDimensionRequired: to.Ptr(false), // MetricAvailabilities: []*armmonitor.MetricAvailability{ // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT5M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT15M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT30M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT6H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT12H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("P1D"), // }}, // MetricClass: to.Ptr(armmonitor.MetricClassTransactions), // Namespace: to.Ptr("microsoft.storagecache/caches"), // PrimaryAggregationType: to.Ptr(armmonitor.AggregationTypeAverage), // ResourceID: to.Ptr("/subscriptions/46841c0e-69c8-4b17-af46-6626ecb15fc2/resourceGroups/adgarntptestrg/providers/Microsoft.StorageCache/caches/adgarntptestcache"), // SupportedAggregationTypes: []*armmonitor.AggregationType{ // to.Ptr(armmonitor.AggregationTypeMinimum), // to.Ptr(armmonitor.AggregationTypeMaximum), // to.Ptr(armmonitor.AggregationTypeAverage)}, // Unit: to.Ptr(armmonitor.MetricUnitMilliSeconds), // }, // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("StorageTarget Metadata Read IOPS"), // Value: to.Ptr("StorageTargetMetadataReadIOPS"), // }, // Dimensions: []*armmonitor.LocalizableString{ // { // LocalizedValue: to.Ptr("StorageTarget"), // Value: to.Ptr("StorageTarget"), // }}, // DisplayDescription: to.Ptr("The rate of file operations that do not modify persistent state, and excluding the read operation, that the Cache sends to a particular StorageTarget."), // ID: to.Ptr("/subscriptions/46841c0e-69c8-4b17-af46-6626ecb15fc2/resourceGroups/adgarntptestrg/providers/Microsoft.StorageCache/caches/adgarntptestcache/providers/microsoft.insights/metricdefinitions/StorageTargetMetadataReadIOPS"), // IsDimensionRequired: to.Ptr(false), // MetricAvailabilities: []*armmonitor.MetricAvailability{ // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT5M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT15M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT30M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT6H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT12H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("P1D"), // }}, // MetricClass: to.Ptr(armmonitor.MetricClassTransactions), // Namespace: to.Ptr("microsoft.storagecache/caches"), // PrimaryAggregationType: to.Ptr(armmonitor.AggregationTypeAverage), // ResourceID: to.Ptr("/subscriptions/46841c0e-69c8-4b17-af46-6626ecb15fc2/resourceGroups/adgarntptestrg/providers/Microsoft.StorageCache/caches/adgarntptestcache"), // SupportedAggregationTypes: []*armmonitor.AggregationType{ // to.Ptr(armmonitor.AggregationTypeMinimum), // to.Ptr(armmonitor.AggregationTypeMaximum), // to.Ptr(armmonitor.AggregationTypeAverage)}, // Unit: to.Ptr(armmonitor.MetricUnitCountPerSecond), // }, // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("StorageTarget Metadata Write IOPS"), // Value: to.Ptr("StorageTargetMetadataWriteIOPS"), // }, // Dimensions: []*armmonitor.LocalizableString{ // { // LocalizedValue: to.Ptr("StorageTarget"), // Value: to.Ptr("StorageTarget"), // }}, // DisplayDescription: to.Ptr("The rate of file operations that do modify persistent state and excluding the write operation, that the Cache sends to a particular StorageTarget."), // ID: to.Ptr("/subscriptions/46841c0e-69c8-4b17-af46-6626ecb15fc2/resourceGroups/adgarntptestrg/providers/Microsoft.StorageCache/caches/adgarntptestcache/providers/microsoft.insights/metricdefinitions/StorageTargetMetadataWriteIOPS"), // IsDimensionRequired: to.Ptr(false), // MetricAvailabilities: []*armmonitor.MetricAvailability{ // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT5M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT15M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT30M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT6H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT12H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("P1D"), // }}, // MetricClass: to.Ptr(armmonitor.MetricClassTransactions), // Namespace: to.Ptr("microsoft.storagecache/caches"), // PrimaryAggregationType: to.Ptr(armmonitor.AggregationTypeAverage), // ResourceID: to.Ptr("/subscriptions/46841c0e-69c8-4b17-af46-6626ecb15fc2/resourceGroups/adgarntptestrg/providers/Microsoft.StorageCache/caches/adgarntptestcache"), // SupportedAggregationTypes: []*armmonitor.AggregationType{ // to.Ptr(armmonitor.AggregationTypeMinimum), // to.Ptr(armmonitor.AggregationTypeMaximum), // to.Ptr(armmonitor.AggregationTypeAverage)}, // Unit: to.Ptr(armmonitor.MetricUnitCountPerSecond), // }, // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("StorageTarget Read IOPS"), // Value: to.Ptr("StorageTargetReadIOPS"), // }, // Dimensions: []*armmonitor.LocalizableString{ // { // LocalizedValue: to.Ptr("StorageTarget"), // Value: to.Ptr("StorageTarget"), // }}, // DisplayDescription: to.Ptr("The rate of file read operations the Cache sends to a particular StorageTarget."), // ID: to.Ptr("/subscriptions/46841c0e-69c8-4b17-af46-6626ecb15fc2/resourceGroups/adgarntptestrg/providers/Microsoft.StorageCache/caches/adgarntptestcache/providers/microsoft.insights/metricdefinitions/StorageTargetReadIOPS"), // IsDimensionRequired: to.Ptr(false), // MetricAvailabilities: []*armmonitor.MetricAvailability{ // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT5M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT15M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT30M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT6H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT12H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("P1D"), // }}, // MetricClass: to.Ptr(armmonitor.MetricClassTransactions), // Namespace: to.Ptr("microsoft.storagecache/caches"), // PrimaryAggregationType: to.Ptr(armmonitor.AggregationTypeAverage), // ResourceID: to.Ptr("/subscriptions/46841c0e-69c8-4b17-af46-6626ecb15fc2/resourceGroups/adgarntptestrg/providers/Microsoft.StorageCache/caches/adgarntptestcache"), // SupportedAggregationTypes: []*armmonitor.AggregationType{ // to.Ptr(armmonitor.AggregationTypeMinimum), // to.Ptr(armmonitor.AggregationTypeMaximum), // to.Ptr(armmonitor.AggregationTypeAverage)}, // Unit: to.Ptr(armmonitor.MetricUnitCountPerSecond), // }, // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("StorageTarget Read Ahead Throughput"), // Value: to.Ptr("StorageTargetReadAheadThroughput"), // }, // Dimensions: []*armmonitor.LocalizableString{ // { // LocalizedValue: to.Ptr("StorageTarget"), // Value: to.Ptr("StorageTarget"), // }}, // DisplayDescription: to.Ptr("The rate the Cache opportunisticly reads data from the StorageTarget."), // ID: to.Ptr("/subscriptions/46841c0e-69c8-4b17-af46-6626ecb15fc2/resourceGroups/adgarntptestrg/providers/Microsoft.StorageCache/caches/adgarntptestcache/providers/microsoft.insights/metricdefinitions/StorageTargetReadAheadThroughput"), // IsDimensionRequired: to.Ptr(false), // MetricAvailabilities: []*armmonitor.MetricAvailability{ // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT5M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT15M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT30M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT6H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT12H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("P1D"), // }}, // MetricClass: to.Ptr(armmonitor.MetricClassTransactions), // Namespace: to.Ptr("microsoft.storagecache/caches"), // PrimaryAggregationType: to.Ptr(armmonitor.AggregationTypeAverage), // ResourceID: to.Ptr("/subscriptions/46841c0e-69c8-4b17-af46-6626ecb15fc2/resourceGroups/adgarntptestrg/providers/Microsoft.StorageCache/caches/adgarntptestcache"), // SupportedAggregationTypes: []*armmonitor.AggregationType{ // to.Ptr(armmonitor.AggregationTypeMinimum), // to.Ptr(armmonitor.AggregationTypeMaximum), // to.Ptr(armmonitor.AggregationTypeAverage)}, // Unit: to.Ptr(armmonitor.MetricUnitBytesPerSecond), // }, // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("StorageTarget Fill Throughput"), // Value: to.Ptr("StorageTargetFillThroughput"), // }, // Dimensions: []*armmonitor.LocalizableString{ // { // LocalizedValue: to.Ptr("StorageTarget"), // Value: to.Ptr("StorageTarget"), // }}, // DisplayDescription: to.Ptr("The rate the Cache reads data from the StorageTarget to handle a cache miss."), // ID: to.Ptr("/subscriptions/46841c0e-69c8-4b17-af46-6626ecb15fc2/resourceGroups/adgarntptestrg/providers/Microsoft.StorageCache/caches/adgarntptestcache/providers/microsoft.insights/metricdefinitions/StorageTargetFillThroughput"), // IsDimensionRequired: to.Ptr(false), // MetricAvailabilities: []*armmonitor.MetricAvailability{ // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT5M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT15M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT30M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT6H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT12H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("P1D"), // }}, // MetricClass: to.Ptr(armmonitor.MetricClassTransactions), // Namespace: to.Ptr("microsoft.storagecache/caches"), // PrimaryAggregationType: to.Ptr(armmonitor.AggregationTypeAverage), // ResourceID: to.Ptr("/subscriptions/46841c0e-69c8-4b17-af46-6626ecb15fc2/resourceGroups/adgarntptestrg/providers/Microsoft.StorageCache/caches/adgarntptestcache"), // SupportedAggregationTypes: []*armmonitor.AggregationType{ // to.Ptr(armmonitor.AggregationTypeMinimum), // to.Ptr(armmonitor.AggregationTypeMaximum), // to.Ptr(armmonitor.AggregationTypeAverage)}, // Unit: to.Ptr(armmonitor.MetricUnitBytesPerSecond), // }, // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("StorageTarget Total Read Throughput"), // Value: to.Ptr("StorageTargetTotalReadThroughput"), // }, // Dimensions: []*armmonitor.LocalizableString{ // { // LocalizedValue: to.Ptr("StorageTarget"), // Value: to.Ptr("StorageTarget"), // }}, // DisplayDescription: to.Ptr("The total rate that the Cache reads data from a particular StorageTarget."), // ID: to.Ptr("/subscriptions/46841c0e-69c8-4b17-af46-6626ecb15fc2/resourceGroups/adgarntptestrg/providers/Microsoft.StorageCache/caches/adgarntptestcache/providers/microsoft.insights/metricdefinitions/StorageTargetTotalReadThroughput"), // IsDimensionRequired: to.Ptr(false), // MetricAvailabilities: []*armmonitor.MetricAvailability{ // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT5M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT15M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT30M"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT1H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT6H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("PT12H"), // }, // { // Retention: to.Ptr("P93D"), // TimeGrain: to.Ptr("P1D"), // }}, // MetricClass: to.Ptr(armmonitor.MetricClassTransactions), // Namespace: to.Ptr("microsoft.storagecache/caches"), // PrimaryAggregationType: to.Ptr(armmonitor.AggregationTypeAverage), // ResourceID: to.Ptr("/subscriptions/46841c0e-69c8-4b17-af46-6626ecb15fc2/resourceGroups/adgarntptestrg/providers/Microsoft.StorageCache/caches/adgarntptestcache"), // SupportedAggregationTypes: []*armmonitor.AggregationType{ // to.Ptr(armmonitor.AggregationTypeMinimum), // to.Ptr(armmonitor.AggregationTypeMaximum), // to.Ptr(armmonitor.AggregationTypeAverage)}, // Unit: to.Ptr(armmonitor.MetricUnitBytesPerSecond), // }}, // } } }
Output:
type MetricDefinitionsClientListAtSubscriptionScopeOptions ¶ added in v0.9.0
type MetricDefinitionsClientListAtSubscriptionScopeOptions struct { // Metric namespace where the metrics you want reside. Metricnamespace *string }
MetricDefinitionsClientListAtSubscriptionScopeOptions contains the optional parameters for the MetricDefinitionsClient.NewListAtSubscriptionScopePager method.
type MetricDefinitionsClientListAtSubscriptionScopeResponse ¶ added in v0.9.0
type MetricDefinitionsClientListAtSubscriptionScopeResponse struct { // Represents collection of metric definitions. SubscriptionScopeMetricDefinitionCollection }
MetricDefinitionsClientListAtSubscriptionScopeResponse contains the response from method MetricDefinitionsClient.NewListAtSubscriptionScopePager.
type MetricDefinitionsClientListOptions ¶ added in v0.4.0
type MetricDefinitionsClientListOptions struct { // Metric namespace where the metrics you want reside. Metricnamespace *string }
MetricDefinitionsClientListOptions contains the optional parameters for the MetricDefinitionsClient.NewListPager method.
type MetricDefinitionsClientListResponse ¶ added in v0.4.0
type MetricDefinitionsClientListResponse struct { // Represents collection of metric definitions. MetricDefinitionCollection }
MetricDefinitionsClientListResponse contains the response from method MetricDefinitionsClient.NewListPager.
type MetricDimension ¶
type MetricDimension struct { // REQUIRED; Name of the dimension. Name *string // REQUIRED; the dimension operator. Only 'Include' and 'Exclude' are supported Operator *string // REQUIRED; list of dimension values. Values []*string }
MetricDimension - Specifies a metric dimension.
func (MetricDimension) MarshalJSON ¶
func (m MetricDimension) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type MetricDimension.
func (*MetricDimension) UnmarshalJSON ¶ added in v0.8.0
func (m *MetricDimension) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type MetricDimension.
type MetricNamespace ¶
type MetricNamespace struct { // Kind of namespace Classification *NamespaceClassification // The ID of the metric namespace. ID *string // The escaped name of the namespace. Name *string // Properties which include the fully qualified namespace name. Properties *MetricNamespaceName // The type of the namespace. Type *string }
MetricNamespace - Metric namespace class specifies the metadata for a metric namespace.
func (MetricNamespace) MarshalJSON ¶ added in v0.8.0
func (m MetricNamespace) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type MetricNamespace.
func (*MetricNamespace) UnmarshalJSON ¶ added in v0.8.0
func (m *MetricNamespace) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type MetricNamespace.
type MetricNamespaceCollection ¶
type MetricNamespaceCollection struct { // REQUIRED; The values for the metric namespaces. Value []*MetricNamespace }
MetricNamespaceCollection - Represents collection of metric namespaces.
func (MetricNamespaceCollection) MarshalJSON ¶
func (m MetricNamespaceCollection) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type MetricNamespaceCollection.
func (*MetricNamespaceCollection) UnmarshalJSON ¶ added in v0.8.0
func (m *MetricNamespaceCollection) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type MetricNamespaceCollection.
type MetricNamespaceName ¶
type MetricNamespaceName struct { // The metric namespace name. MetricNamespaceName *string }
MetricNamespaceName - The fully qualified metric namespace name.
func (MetricNamespaceName) MarshalJSON ¶ added in v0.8.0
func (m MetricNamespaceName) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type MetricNamespaceName.
func (*MetricNamespaceName) UnmarshalJSON ¶ added in v0.8.0
func (m *MetricNamespaceName) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type MetricNamespaceName.
type MetricNamespacesClient ¶
type MetricNamespacesClient struct {
// contains filtered or unexported fields
}
MetricNamespacesClient contains the methods for the MetricNamespaces group. Don't use this type directly, use NewMetricNamespacesClient() instead.
func NewMetricNamespacesClient ¶
func NewMetricNamespacesClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*MetricNamespacesClient, error)
NewMetricNamespacesClient creates a new instance of MetricNamespacesClient with the specified values.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - pass nil to accept the default values.
func (*MetricNamespacesClient) NewListPager ¶ added in v0.6.0
func (client *MetricNamespacesClient) NewListPager(resourceURI string, options *MetricNamespacesClientListOptions) *runtime.Pager[MetricNamespacesClientListResponse]
NewListPager - Lists the metric namespaces for the resource.
Generated from API version 2017-12-01-preview
- resourceURI - The identifier of the resource.
- options - MetricNamespacesClientListOptions contains the optional parameters for the MetricNamespacesClient.NewListPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Insights/preview/2017-12-01-preview/examples/GetMetricNamespaces.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewMetricNamespacesClient().NewListPager("subscriptions/182c901a-129a-4f5d-86e4-cc6b294590a2/resourceGroups/hyr-log/providers/microsoft.insights/components/f1-bill", &armmonitor.MetricNamespacesClientListOptions{StartTime: to.Ptr("2020-08-31T15:53:00Z")}) 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.MetricNamespaceCollection = armmonitor.MetricNamespaceCollection{ // Value: []*armmonitor.MetricNamespace{ // { // Name: to.Ptr("Azure.ApplicationInsights"), // Type: to.Ptr("Microsoft.Insights/metricNamespaces"), // Classification: to.Ptr(armmonitor.NamespaceClassificationCustom), // ID: to.Ptr("/subscriptions/182c901a-129a-4f5d-86e4-cc6b294590a2/resourceGroups/hyr-log/providers/microsoft.insights/components/f1-bill/providers/microsoft.insights/metricNamespaces/Azure.ApplicationInsights"), // Properties: &armmonitor.MetricNamespaceName{ // MetricNamespaceName: to.Ptr("Azure.ApplicationInsights"), // }, // }, // { // Name: to.Ptr("microsoft.insights-components"), // Type: to.Ptr("Microsoft.Insights/metricNamespaces"), // Classification: to.Ptr(armmonitor.NamespaceClassificationPlatform), // ID: to.Ptr("/subscriptions/182c901a-129a-4f5d-86e4-cc6b294590a2/resourceGroups/hyr-log/providers/microsoft.insights/components/f1-bill/providers/microsoft.insights/metricNamespaces/microsoft.insights-components"), // Properties: &armmonitor.MetricNamespaceName{ // MetricNamespaceName: to.Ptr("microsoft.insights/components"), // }, // }}, // } } }
Output:
type MetricNamespacesClientListOptions ¶ added in v0.4.0
type MetricNamespacesClientListOptions struct { // The ISO 8601 conform Date start time from which to query for metric namespaces. StartTime *string }
MetricNamespacesClientListOptions contains the optional parameters for the MetricNamespacesClient.NewListPager method.
type MetricNamespacesClientListResponse ¶ added in v0.4.0
type MetricNamespacesClientListResponse struct { // Represents collection of metric namespaces. MetricNamespaceCollection }
MetricNamespacesClientListResponse contains the response from method MetricNamespacesClient.NewListPager.
type MetricResultType ¶ added in v0.9.0
type MetricResultType string
MetricResultType - Reduces the set of data collected. The syntax allowed depends on the operation. See the operation's description for details.
const ( MetricResultTypeData MetricResultType = "Data" MetricResultTypeMetadata MetricResultType = "Metadata" )
func PossibleMetricResultTypeValues ¶ added in v0.9.0
func PossibleMetricResultTypeValues() []MetricResultType
PossibleMetricResultTypeValues returns the possible values for the MetricResultType const type.
type MetricSettings ¶
type MetricSettings struct { // REQUIRED; a value indicating whether this category is enabled. Enabled *bool // Name of a Diagnostic Metric category for a resource type this setting is applied to. To obtain the list of Diagnostic metric // categories for a resource, first perform a GET diagnostic settings // operation. Category *string // the retention policy for this category. RetentionPolicy *RetentionPolicy // the timegrain of the metric in ISO8601 format. TimeGrain *string }
MetricSettings - Part of MultiTenantDiagnosticSettings. Specifies the settings for a particular metric.
func (MetricSettings) MarshalJSON ¶ added in v0.8.0
func (m MetricSettings) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type MetricSettings.
func (*MetricSettings) UnmarshalJSON ¶ added in v0.8.0
func (m *MetricSettings) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type MetricSettings.
type MetricSingleDimension ¶
type MetricSingleDimension struct { // REQUIRED; Name of the dimension. Name *string // REQUIRED; Value of the dimension. Value *string }
MetricSingleDimension - The metric dimension name and value.
func (MetricSingleDimension) MarshalJSON ¶ added in v0.8.0
func (m MetricSingleDimension) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type MetricSingleDimension.
func (*MetricSingleDimension) UnmarshalJSON ¶ added in v0.8.0
func (m *MetricSingleDimension) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type MetricSingleDimension.
type MetricStatisticType ¶
type MetricStatisticType string
MetricStatisticType - the metric statistic type. How the metrics from multiple instances are combined.
const ( MetricStatisticTypeAverage MetricStatisticType = "Average" MetricStatisticTypeCount MetricStatisticType = "Count" MetricStatisticTypeMax MetricStatisticType = "Max" MetricStatisticTypeMin MetricStatisticType = "Min" MetricStatisticTypeSum MetricStatisticType = "Sum" )
func PossibleMetricStatisticTypeValues ¶
func PossibleMetricStatisticTypeValues() []MetricStatisticType
PossibleMetricStatisticTypeValues returns the possible values for the MetricStatisticType const type.
type MetricTrigger ¶
type MetricTrigger struct { // REQUIRED; the name of the metric that defines what the rule monitors. MetricName *string // REQUIRED; the resource identifier of the resource the rule monitors. MetricResourceURI *string // REQUIRED; the operator that is used to compare the metric data and the threshold. Operator *ComparisonOperationType // REQUIRED; the metric statistic type. How the metrics from multiple instances are combined. Statistic *MetricStatisticType // REQUIRED; the threshold of the metric that triggers the scale action. Threshold *float64 // REQUIRED; time aggregation type. How the data that is collected should be combined over time. The default value is Average. TimeAggregation *TimeAggregationType // REQUIRED; the granularity of metrics the rule monitors. Must be one of the predefined values returned from metric definitions // for the metric. Must be between 12 hours and 1 minute. TimeGrain *string // REQUIRED; the range of time in which instance data is collected. This value must be greater than the delay in metric collection, // which can vary from resource-to-resource. Must be between 12 hours and 5 minutes. TimeWindow *string // List of dimension conditions. For example: [{"DimensionName":"AppName","Operator":"Equals","Values":["App1"]},{"DimensionName":"Deployment","Operator":"Equals","Values":["default"]}]. Dimensions []*ScaleRuleMetricDimension // a value indicating whether metric should divide per instance. DividePerInstance *bool // the namespace of the metric that defines what the rule monitors. MetricNamespace *string // the location of the resource the rule monitors. MetricResourceLocation *string }
MetricTrigger - The trigger that results in a scaling action.
func (MetricTrigger) MarshalJSON ¶
func (m MetricTrigger) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type MetricTrigger.
func (*MetricTrigger) UnmarshalJSON ¶ added in v0.8.0
func (m *MetricTrigger) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type MetricTrigger.
type MetricUnit ¶
type MetricUnit string
MetricUnit - The unit of the metric.
const ( MetricUnitBitsPerSecond MetricUnit = "BitsPerSecond" MetricUnitByteSeconds MetricUnit = "ByteSeconds" MetricUnitBytes MetricUnit = "Bytes" MetricUnitBytesPerSecond MetricUnit = "BytesPerSecond" MetricUnitCores MetricUnit = "Cores" MetricUnitCount MetricUnit = "Count" MetricUnitCountPerSecond MetricUnit = "CountPerSecond" MetricUnitMilliCores MetricUnit = "MilliCores" MetricUnitMilliSeconds MetricUnit = "MilliSeconds" MetricUnitNanoCores MetricUnit = "NanoCores" MetricUnitPercent MetricUnit = "Percent" MetricUnitSeconds MetricUnit = "Seconds" MetricUnitUnspecified MetricUnit = "Unspecified" )
func PossibleMetricUnitValues ¶
func PossibleMetricUnitValues() []MetricUnit
PossibleMetricUnitValues returns the possible values for the MetricUnit const type.
type MetricValue ¶
type MetricValue struct { // REQUIRED; the timestamp for the metric value in ISO 8601 format. TimeStamp *time.Time // the average value in the time range. Average *float64 // the number of samples in the time range. Can be used to determine the number of values that contributed to the average // value. Count *float64 // the greatest value in the time range. Maximum *float64 // the least value in the time range. Minimum *float64 // the sum of all of the values in the time range. Total *float64 }
MetricValue - Represents a metric value.
func (MetricValue) MarshalJSON ¶
func (m MetricValue) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type MetricValue.
func (*MetricValue) UnmarshalJSON ¶
func (m *MetricValue) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type MetricValue.
type Metrics ¶ added in v0.9.0
type Metrics struct { // READ-ONLY; An internal identifier for the metrics container. Only to be used by the system InternalID *string // READ-ONLY; The Prometheus query endpoint for the workspace PrometheusQueryEndpoint *string }
Metrics - Information about metrics for the workspace
func (Metrics) MarshalJSON ¶ added in v0.9.0
MarshalJSON implements the json.Marshaller interface for type Metrics.
func (*Metrics) UnmarshalJSON ¶ added in v0.9.0
UnmarshalJSON implements the json.Unmarshaller interface for type Metrics.
type MetricsClient ¶
type MetricsClient struct {
// contains filtered or unexported fields
}
MetricsClient contains the methods for the Metrics group. Don't use this type directly, use NewMetricsClient() instead.
func NewMetricsClient ¶
func NewMetricsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*MetricsClient, error)
NewMetricsClient creates a new instance of MetricsClient with the specified values.
- subscriptionID - The ID of the target subscription.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - pass nil to accept the default values.
func (*MetricsClient) List ¶
func (client *MetricsClient) List(ctx context.Context, resourceURI string, options *MetricsClientListOptions) (MetricsClientListResponse, error)
List - Lists the metric values for a resource. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2021-05-01
- resourceURI - The identifier of the resource.
- options - MetricsClientListOptions contains the optional parameters for the MetricsClient.List method.
Example (GetMetricForData) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Insights/stable/2021-05-01/examples/GetMetric.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewMetricsClient().List(ctx, "subscriptions/1f3fa6d2-851c-4a91-9087-1a050f3a9c38/resourceGroups/todking/providers/Microsoft.Storage/storageAccounts/tkfileserv/blobServices/default", &armmonitor.MetricsClientListOptions{Timespan: to.Ptr("2021-04-20T09:00:00.000Z/2021-04-20T14:00:00.000Z"), Interval: to.Ptr("PT6H"), Metricnames: to.Ptr("BlobCount,BlobCapacity"), Aggregation: to.Ptr("average,minimum,maximum"), Top: to.Ptr[int32](5), Orderby: to.Ptr("average asc"), Filter: to.Ptr("Tier eq '*'"), ResultType: nil, Metricnamespace: to.Ptr("Microsoft.Storage/storageAccounts/blobServices"), AutoAdjustTimegrain: to.Ptr(true), ValidateDimensions: to.Ptr(false), }) 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.Response = armmonitor.Response{ // Cost: to.Ptr[int32](598), // Interval: to.Ptr("PT1H"), // Namespace: to.Ptr("microsoft.storage/storageaccounts/blobservices"), // Resourceregion: to.Ptr("westus2"), // Timespan: to.Ptr("2021-04-20T09:00:00Z/2021-04-20T14:00:00Z"), // Value: []*armmonitor.Metric{ // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("Blob Count"), // Value: to.Ptr("BlobCount"), // }, // Type: to.Ptr("Microsoft.Insights/metrics"), // DisplayDescription: to.Ptr("The number of blob objects stored in the storage account."), // ErrorCode: to.Ptr("Success"), // ID: to.Ptr("/subscriptions/1f3fa6d2-851c-4a91-9087-1a050f3a9c38/resourceGroups/todking/providers/Microsoft.Storage/storageAccounts/tkfileserv/blobServices/default/providers/Microsoft.Insights/metrics/BlobCount"), // Timeseries: []*armmonitor.TimeSeriesElement{ // { // Data: []*armmonitor.MetricValue{ // { // Average: to.Ptr[float64](7), // Maximum: to.Ptr[float64](7), // Minimum: to.Ptr[float64](7), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-20T09:00:00.000Z"); return t}()), // }, // { // Average: to.Ptr[float64](7), // Maximum: to.Ptr[float64](7), // Minimum: to.Ptr[float64](7), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-20T10:00:00.000Z"); return t}()), // }, // { // Average: to.Ptr[float64](7), // Maximum: to.Ptr[float64](7), // Minimum: to.Ptr[float64](7), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-20T11:00:00.000Z"); return t}()), // }, // { // Average: to.Ptr[float64](7), // Maximum: to.Ptr[float64](7), // Minimum: to.Ptr[float64](7), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-20T12:00:00.000Z"); return t}()), // }, // { // Average: to.Ptr[float64](7), // Maximum: to.Ptr[float64](7), // Minimum: to.Ptr[float64](7), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-20T13:00:00.000Z"); return t}()), // }}, // Metadatavalues: []*armmonitor.MetadataValue{ // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("tier"), // Value: to.Ptr("tier"), // }, // Value: to.Ptr("Hot"), // }}, // }, // { // Data: []*armmonitor.MetricValue{ // { // Average: to.Ptr[float64](2), // Maximum: to.Ptr[float64](2), // Minimum: to.Ptr[float64](2), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-20T09:00:00.000Z"); return t}()), // }, // { // Average: to.Ptr[float64](2), // Maximum: to.Ptr[float64](2), // Minimum: to.Ptr[float64](2), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-20T10:00:00.000Z"); return t}()), // }, // { // Average: to.Ptr[float64](2), // Maximum: to.Ptr[float64](2), // Minimum: to.Ptr[float64](2), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-20T11:00:00.000Z"); return t}()), // }, // { // Average: to.Ptr[float64](2), // Maximum: to.Ptr[float64](2), // Minimum: to.Ptr[float64](2), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-20T12:00:00.000Z"); return t}()), // }, // { // Average: to.Ptr[float64](2), // Maximum: to.Ptr[float64](2), // Minimum: to.Ptr[float64](2), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-20T13:00:00.000Z"); return t}()), // }}, // Metadatavalues: []*armmonitor.MetadataValue{ // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("tier"), // Value: to.Ptr("tier"), // }, // Value: to.Ptr("Standard"), // }}, // }, // { // Data: []*armmonitor.MetricValue{ // { // Average: to.Ptr[float64](0), // Maximum: to.Ptr[float64](0), // Minimum: to.Ptr[float64](0), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-20T09:00:00.000Z"); return t}()), // }, // { // Average: to.Ptr[float64](0), // Maximum: to.Ptr[float64](0), // Minimum: to.Ptr[float64](0), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-20T10:00:00.000Z"); return t}()), // }, // { // Average: to.Ptr[float64](0), // Maximum: to.Ptr[float64](0), // Minimum: to.Ptr[float64](0), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-20T11:00:00.000Z"); return t}()), // }, // { // Average: to.Ptr[float64](0), // Maximum: to.Ptr[float64](0), // Minimum: to.Ptr[float64](0), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-20T12:00:00.000Z"); return t}()), // }, // { // Average: to.Ptr[float64](0), // Maximum: to.Ptr[float64](0), // Minimum: to.Ptr[float64](0), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-20T13:00:00.000Z"); return t}()), // }}, // Metadatavalues: []*armmonitor.MetadataValue{ // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("tier"), // Value: to.Ptr("tier"), // }, // Value: to.Ptr("Cool"), // }}, // }, // { // Data: []*armmonitor.MetricValue{ // { // Average: to.Ptr[float64](0), // Maximum: to.Ptr[float64](0), // Minimum: to.Ptr[float64](0), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-20T09:00:00.000Z"); return t}()), // }, // { // Average: to.Ptr[float64](0), // Maximum: to.Ptr[float64](0), // Minimum: to.Ptr[float64](0), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-20T10:00:00.000Z"); return t}()), // }, // { // Average: to.Ptr[float64](0), // Maximum: to.Ptr[float64](0), // Minimum: to.Ptr[float64](0), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-20T11:00:00.000Z"); return t}()), // }, // { // Average: to.Ptr[float64](0), // Maximum: to.Ptr[float64](0), // Minimum: to.Ptr[float64](0), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-20T12:00:00.000Z"); return t}()), // }, // { // Average: to.Ptr[float64](0), // Maximum: to.Ptr[float64](0), // Minimum: to.Ptr[float64](0), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-20T13:00:00.000Z"); return t}()), // }}, // Metadatavalues: []*armmonitor.MetadataValue{ // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("tier"), // Value: to.Ptr("tier"), // }, // Value: to.Ptr("Archive"), // }}, // }, // { // Data: []*armmonitor.MetricValue{ // { // Average: to.Ptr[float64](0), // Maximum: to.Ptr[float64](0), // Minimum: to.Ptr[float64](0), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-20T09:00:00.000Z"); return t}()), // }, // { // Average: to.Ptr[float64](0), // Maximum: to.Ptr[float64](0), // Minimum: to.Ptr[float64](0), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-20T10:00:00.000Z"); return t}()), // }, // { // Average: to.Ptr[float64](0), // Maximum: to.Ptr[float64](0), // Minimum: to.Ptr[float64](0), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-20T11:00:00.000Z"); return t}()), // }, // { // Average: to.Ptr[float64](0), // Maximum: to.Ptr[float64](0), // Minimum: to.Ptr[float64](0), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-20T12:00:00.000Z"); return t}()), // }, // { // Average: to.Ptr[float64](0), // Maximum: to.Ptr[float64](0), // Minimum: to.Ptr[float64](0), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-20T13:00:00.000Z"); return t}()), // }}, // Metadatavalues: []*armmonitor.MetadataValue{ // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("tier"), // Value: to.Ptr("tier"), // }, // Value: to.Ptr("Untiered"), // }}, // }}, // Unit: to.Ptr(armmonitor.UnitCount), // }, // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("Blob Capacity"), // Value: to.Ptr("BlobCapacity"), // }, // Type: to.Ptr("Microsoft.Insights/metrics"), // DisplayDescription: to.Ptr("The amount of storage used by the storage account’s Blob service in bytes."), // ErrorCode: to.Ptr("Success"), // ID: to.Ptr("/subscriptions/1f3fa6d2-851c-4a91-9087-1a050f3a9c38/resourceGroups/todking/providers/Microsoft.Storage/storageAccounts/tkfileserv/blobServices/default/providers/Microsoft.Insights/metrics/BlobCapacity"), // Timeseries: []*armmonitor.TimeSeriesElement{ // { // Data: []*armmonitor.MetricValue{ // { // Average: to.Ptr[float64](621492), // Maximum: to.Ptr[float64](621492), // Minimum: to.Ptr[float64](621492), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-20T09:00:00.000Z"); return t}()), // }, // { // Average: to.Ptr[float64](621492), // Maximum: to.Ptr[float64](621492), // Minimum: to.Ptr[float64](621492), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-20T10:00:00.000Z"); return t}()), // }, // { // Average: to.Ptr[float64](621492), // Maximum: to.Ptr[float64](621492), // Minimum: to.Ptr[float64](621492), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-20T11:00:00.000Z"); return t}()), // }, // { // Average: to.Ptr[float64](621492), // Maximum: to.Ptr[float64](621492), // Minimum: to.Ptr[float64](621492), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-20T12:00:00.000Z"); return t}()), // }, // { // Average: to.Ptr[float64](621492), // Maximum: to.Ptr[float64](621492), // Minimum: to.Ptr[float64](621492), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-20T13:00:00.000Z"); return t}()), // }}, // Metadatavalues: []*armmonitor.MetadataValue{ // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("tier"), // Value: to.Ptr("tier"), // }, // Value: to.Ptr("Standard"), // }}, // }, // { // Data: []*armmonitor.MetricValue{ // { // Average: to.Ptr[float64](4733), // Maximum: to.Ptr[float64](4733), // Minimum: to.Ptr[float64](4733), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-20T09:00:00.000Z"); return t}()), // }, // { // Average: to.Ptr[float64](4733), // Maximum: to.Ptr[float64](4733), // Minimum: to.Ptr[float64](4733), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-20T10:00:00.000Z"); return t}()), // }, // { // Average: to.Ptr[float64](4733), // Maximum: to.Ptr[float64](4733), // Minimum: to.Ptr[float64](4733), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-20T11:00:00.000Z"); return t}()), // }, // { // Average: to.Ptr[float64](4733), // Maximum: to.Ptr[float64](4733), // Minimum: to.Ptr[float64](4733), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-20T12:00:00.000Z"); return t}()), // }, // { // Average: to.Ptr[float64](4733), // Maximum: to.Ptr[float64](4733), // Minimum: to.Ptr[float64](4733), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-20T13:00:00.000Z"); return t}()), // }}, // Metadatavalues: []*armmonitor.MetadataValue{ // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("tier"), // Value: to.Ptr("tier"), // }, // Value: to.Ptr("Hot"), // }}, // }, // { // Data: []*armmonitor.MetricValue{ // { // Average: to.Ptr[float64](0), // Maximum: to.Ptr[float64](0), // Minimum: to.Ptr[float64](0), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-20T09:00:00.000Z"); return t}()), // }, // { // Average: to.Ptr[float64](0), // Maximum: to.Ptr[float64](0), // Minimum: to.Ptr[float64](0), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-20T10:00:00.000Z"); return t}()), // }, // { // Average: to.Ptr[float64](0), // Maximum: to.Ptr[float64](0), // Minimum: to.Ptr[float64](0), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-20T11:00:00.000Z"); return t}()), // }, // { // Average: to.Ptr[float64](0), // Maximum: to.Ptr[float64](0), // Minimum: to.Ptr[float64](0), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-20T12:00:00.000Z"); return t}()), // }, // { // Average: to.Ptr[float64](0), // Maximum: to.Ptr[float64](0), // Minimum: to.Ptr[float64](0), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-20T13:00:00.000Z"); return t}()), // }}, // Metadatavalues: []*armmonitor.MetadataValue{ // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("tier"), // Value: to.Ptr("tier"), // }, // Value: to.Ptr("Archive"), // }}, // }, // { // Data: []*armmonitor.MetricValue{ // { // Average: to.Ptr[float64](0), // Maximum: to.Ptr[float64](0), // Minimum: to.Ptr[float64](0), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-20T09:00:00.000Z"); return t}()), // }, // { // Average: to.Ptr[float64](0), // Maximum: to.Ptr[float64](0), // Minimum: to.Ptr[float64](0), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-20T10:00:00.000Z"); return t}()), // }, // { // Average: to.Ptr[float64](0), // Maximum: to.Ptr[float64](0), // Minimum: to.Ptr[float64](0), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-20T11:00:00.000Z"); return t}()), // }, // { // Average: to.Ptr[float64](0), // Maximum: to.Ptr[float64](0), // Minimum: to.Ptr[float64](0), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-20T12:00:00.000Z"); return t}()), // }, // { // Average: to.Ptr[float64](0), // Maximum: to.Ptr[float64](0), // Minimum: to.Ptr[float64](0), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-20T13:00:00.000Z"); return t}()), // }}, // Metadatavalues: []*armmonitor.MetadataValue{ // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("tier"), // Value: to.Ptr("tier"), // }, // Value: to.Ptr("Untiered"), // }}, // }, // { // Data: []*armmonitor.MetricValue{ // { // Average: to.Ptr[float64](0), // Maximum: to.Ptr[float64](0), // Minimum: to.Ptr[float64](0), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-20T09:00:00.000Z"); return t}()), // }, // { // Average: to.Ptr[float64](0), // Maximum: to.Ptr[float64](0), // Minimum: to.Ptr[float64](0), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-20T10:00:00.000Z"); return t}()), // }, // { // Average: to.Ptr[float64](0), // Maximum: to.Ptr[float64](0), // Minimum: to.Ptr[float64](0), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-20T11:00:00.000Z"); return t}()), // }, // { // Average: to.Ptr[float64](0), // Maximum: to.Ptr[float64](0), // Minimum: to.Ptr[float64](0), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-20T12:00:00.000Z"); return t}()), // }, // { // Average: to.Ptr[float64](0), // Maximum: to.Ptr[float64](0), // Minimum: to.Ptr[float64](0), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-20T13:00:00.000Z"); return t}()), // }}, // Metadatavalues: []*armmonitor.MetadataValue{ // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("tier"), // Value: to.Ptr("tier"), // }, // Value: to.Ptr("Cool"), // }}, // }}, // Unit: to.Ptr(armmonitor.UnitBytes), // }}, // } }
Output:
Example (GetMetricForMetadata) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Insights/stable/2021-05-01/examples/GetMetricMetadata.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewMetricsClient().List(ctx, "subscriptions/1f3fa6d2-851c-4a91-9087-1a050f3a9c38/resourceGroups/todking/providers/Microsoft.Storage/storageAccounts/tkfileserv/blobServices/default", &armmonitor.MetricsClientListOptions{Timespan: to.Ptr("2017-04-14T02:20:00Z/2017-04-14T04:20:00Z"), Interval: nil, Metricnames: nil, Aggregation: nil, Top: nil, Orderby: nil, Filter: to.Ptr("Tier eq '*'"), ResultType: nil, Metricnamespace: to.Ptr("Microsoft.Storage/storageAccounts/blobServices"), AutoAdjustTimegrain: nil, ValidateDimensions: 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.Response = armmonitor.Response{ // Interval: to.Ptr("PT1H"), // Namespace: to.Ptr("microsoft.storage/storageaccounts/blobservices"), // Resourceregion: to.Ptr("westus2"), // Timespan: to.Ptr("2021-04-15T02:18:00Z/2021-04-22T02:18:00Z"), // Value: []*armmonitor.Metric{ // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("Blob Count"), // Value: to.Ptr("BlobCount"), // }, // Type: to.Ptr("Microsoft.Insights/metrics"), // DisplayDescription: to.Ptr("The number of blob objects stored in the storage account."), // ID: to.Ptr("/subscriptions/1f3fa6d2-851c-4a91-9087-1a050f3a9c38/resourceGroups/todking/providers/Microsoft.Storage/storageAccounts/tkfileserv/blobServices/default/providers/Microsoft.Insights/metrics/BlobCount"), // Timeseries: []*armmonitor.TimeSeriesElement{ // { // Metadatavalues: []*armmonitor.MetadataValue{ // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("tier"), // Value: to.Ptr("tier"), // }, // Value: to.Ptr("Cool"), // }}, // }, // { // Metadatavalues: []*armmonitor.MetadataValue{ // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("tier"), // Value: to.Ptr("tier"), // }, // Value: to.Ptr("Archive"), // }}, // }, // { // Metadatavalues: []*armmonitor.MetadataValue{ // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("tier"), // Value: to.Ptr("tier"), // }, // Value: to.Ptr("Standard"), // }}, // }, // { // Metadatavalues: []*armmonitor.MetadataValue{ // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("tier"), // Value: to.Ptr("tier"), // }, // Value: to.Ptr("Untiered"), // }}, // }, // { // Metadatavalues: []*armmonitor.MetadataValue{ // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("tier"), // Value: to.Ptr("tier"), // }, // Value: to.Ptr("Hot"), // }}, // }}, // Unit: to.Ptr(armmonitor.UnitCount), // }}, // } }
Output:
Example (GetMetricWithError) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Insights/stable/2021-05-01/examples/GetMetricError.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewMetricsClient().List(ctx, "subscriptions/ac41e21f-afd6-4a79-8070-f01eba278f97/resourceGroups/todking/providers/Microsoft.DocumentDb/databaseAccounts/tk-cosmos-mongo", &armmonitor.MetricsClientListOptions{Timespan: to.Ptr("2021-06-07T21:51:00Z/2021-06-08T01:51:00Z"), Interval: to.Ptr("FULL"), Metricnames: to.Ptr("MongoRequestsCount,MongoRequests"), Aggregation: to.Ptr("average"), Top: nil, Orderby: nil, Filter: nil, ResultType: nil, Metricnamespace: to.Ptr("microsoft.documentdb/databaseaccounts"), AutoAdjustTimegrain: to.Ptr(true), ValidateDimensions: to.Ptr(false), }) 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.Response = armmonitor.Response{ // Cost: to.Ptr[int32](239), // Interval: to.Ptr("PT4H"), // Namespace: to.Ptr("microsoft.documentdb/databaseaccounts"), // Resourceregion: to.Ptr("westus2"), // Timespan: to.Ptr("2021-06-07T21:51:00Z/2021-06-08T01:51:00Z"), // Value: []*armmonitor.Metric{ // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("(deprecated) Mongo Request Rate"), // Value: to.Ptr("MongoRequestsCount"), // }, // Type: to.Ptr("Microsoft.Insights/metrics"), // ErrorCode: to.Ptr("InvalidSamplingType"), // ErrorMessage: to.Ptr("Sampling type is not found. Metric:CosmosDBCustomer,AzureMonitor,MongoRequests, SamplingType:NullableAverage."), // ID: to.Ptr("/subscriptions/ac41e21f-afd6-4a79-8070-f01eba278f97/resourceGroups/todking/providers/Microsoft.DocumentDb/databaseAccounts/tk-cosmos-mongo/providers/Microsoft.Insights/metrics/MongoRequestsCount"), // Timeseries: []*armmonitor.TimeSeriesElement{ // }, // Unit: to.Ptr(armmonitor.UnitCountPerSecond), // }, // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("Mongo Requests"), // Value: to.Ptr("MongoRequests"), // }, // Type: to.Ptr("Microsoft.Insights/metrics"), // DisplayDescription: to.Ptr("Number of Mongo Requests Made"), // ErrorCode: to.Ptr("Success"), // ID: to.Ptr("/subscriptions/ac41e21f-afd6-4a79-8070-f01eba278f97/resourceGroups/todking/providers/Microsoft.DocumentDb/databaseAccounts/tk-cosmos-mongo/providers/Microsoft.Insights/metrics/MongoRequests"), // Timeseries: []*armmonitor.TimeSeriesElement{ // { // Data: []*armmonitor.MetricValue{ // { // Average: to.Ptr[float64](0), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-07T21:51:00.000Z"); return t}()), // }}, // Metadatavalues: []*armmonitor.MetadataValue{ // }, // }}, // Unit: to.Ptr(armmonitor.UnitCount), // }}, // } }
Output:
func (*MetricsClient) ListAtSubscriptionScope ¶ added in v0.9.0
func (client *MetricsClient) ListAtSubscriptionScope(ctx context.Context, region string, options *MetricsClientListAtSubscriptionScopeOptions) (MetricsClientListAtSubscriptionScopeResponse, error)
ListAtSubscriptionScope - Lists the metric data for a subscription. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2021-05-01
- region - The region where the metrics you want reside.
- options - MetricsClientListAtSubscriptionScopeOptions contains the optional parameters for the MetricsClient.ListAtSubscriptionScope method.
Example (GetSubscriptionLevelMetricData) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Insights/stable/2021-05-01/examples/GetMultiResourceMetric.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewMetricsClient().ListAtSubscriptionScope(ctx, "westus2", &armmonitor.MetricsClientListAtSubscriptionScopeOptions{Timespan: to.Ptr("2021-06-08T19:00:00Z/2021-06-12T01:00:00Z"), Interval: to.Ptr("PT6H"), Metricnames: to.Ptr("Data Disk Max Burst IOPS"), Aggregation: to.Ptr("count"), Top: to.Ptr[int32](10), Orderby: to.Ptr("count desc"), Filter: to.Ptr("LUN eq '0' and Microsoft.ResourceId eq '*'"), ResultType: nil, Metricnamespace: to.Ptr("microsoft.compute/virtualmachines"), AutoAdjustTimegrain: to.Ptr(true), ValidateDimensions: to.Ptr(false), }) 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.SubscriptionScopeMetricResponse = armmonitor.SubscriptionScopeMetricResponse{ // Cost: to.Ptr[int32](4679), // Interval: to.Ptr("PT6H"), // Namespace: to.Ptr("microsoft.compute/virtualmachines"), // Resourceregion: to.Ptr("westus2"), // Timespan: to.Ptr("2021-06-08T19:00:00Z/2021-06-12T01:00:00Z"), // Value: []*armmonitor.SubscriptionScopeMetric{ // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("Data Disk Max Burst IOPS"), // Value: to.Ptr("Data Disk Max Burst IOPS"), // }, // Type: to.Ptr("Microsoft.Insights/metrics"), // DisplayDescription: to.Ptr("Maximum IOPS Data Disk can achieve with bursting"), // ErrorCode: to.Ptr("Success"), // ID: to.Ptr("subscriptions/92d2a2d8-b514-432d-8cc9-a5f9272630d5/providers/Microsoft.Insights/metrics/Data Disk Max Burst IOPS"), // Timeseries: []*armmonitor.TimeSeriesElement{ // { // Data: []*armmonitor.MetricValue{ // { // Count: to.Ptr[float64](72), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-08T19:00:00.000Z"); return t}()), // }, // { // Count: to.Ptr[float64](72), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-09T01:00:00.000Z"); return t}()), // }, // { // Count: to.Ptr[float64](72), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-09T07:00:00.000Z"); return t}()), // }, // { // Count: to.Ptr[float64](72), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-09T13:00:00.000Z"); return t}()), // }, // { // Count: to.Ptr[float64](72), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-09T19:00:00.000Z"); return t}()), // }, // { // Count: to.Ptr[float64](72), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-10T01:00:00.000Z"); return t}()), // }, // { // Count: to.Ptr[float64](72), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-10T07:00:00.000Z"); return t}()), // }, // { // Count: to.Ptr[float64](413), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-10T13:00:00.000Z"); return t}()), // }, // { // Count: to.Ptr[float64](72), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-10T19:00:00.000Z"); return t}()), // }, // { // Count: to.Ptr[float64](72), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-11T01:00:00.000Z"); return t}()), // }, // { // Count: to.Ptr[float64](72), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-11T07:00:00.000Z"); return t}()), // }, // { // Count: to.Ptr[float64](72), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-11T13:00:00.000Z"); return t}()), // }, // { // Count: to.Ptr[float64](72), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-11T19:00:00.000Z"); return t}()), // }}, // Metadatavalues: []*armmonitor.MetadataValue{ // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("microsoft.resourceid"), // Value: to.Ptr("microsoft.resourceid"), // }, // Value: to.Ptr("/subscriptions/92d2a2d8-b514-432d-8cc9-a5f9272630d5/resourceGroups/sas1/providers/Microsoft.Compute/virtualMachines/sas1-dev"), // }}, // }, // { // Data: []*armmonitor.MetricValue{ // { // Count: to.Ptr[float64](72), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-08T19:00:00.000Z"); return t}()), // }, // { // Count: to.Ptr[float64](133), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-09T01:00:00.000Z"); return t}()), // }, // { // Count: to.Ptr[float64](72), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-09T07:00:00.000Z"); return t}()), // }, // { // Count: to.Ptr[float64](72), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-09T13:00:00.000Z"); return t}()), // }, // { // Count: to.Ptr[float64](72), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-09T19:00:00.000Z"); return t}()), // }, // { // Count: to.Ptr[float64](72), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-10T01:00:00.000Z"); return t}()), // }, // { // Count: to.Ptr[float64](72), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-10T07:00:00.000Z"); return t}()), // }, // { // Count: to.Ptr[float64](72), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-10T13:00:00.000Z"); return t}()), // }, // { // Count: to.Ptr[float64](72), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-10T19:00:00.000Z"); return t}()), // }, // { // Count: to.Ptr[float64](72), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-11T01:00:00.000Z"); return t}()), // }, // { // Count: to.Ptr[float64](72), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-11T07:00:00.000Z"); return t}()), // }, // { // Count: to.Ptr[float64](72), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-11T13:00:00.000Z"); return t}()), // }, // { // Count: to.Ptr[float64](72), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-11T19:00:00.000Z"); return t}()), // }}, // Metadatavalues: []*armmonitor.MetadataValue{ // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("microsoft.resourceid"), // Value: to.Ptr("microsoft.resourceid"), // }, // Value: to.Ptr("/subscriptions/92d2a2d8-b514-432d-8cc9-a5f9272630d5/resourceGroups/sas2/providers/Microsoft.Compute/virtualMachines/sas2-vm"), // }}, // }, // { // Data: []*armmonitor.MetricValue{ // { // Count: to.Ptr[float64](72), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-08T19:00:00.000Z"); return t}()), // }, // { // Count: to.Ptr[float64](72), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-09T01:00:00.000Z"); return t}()), // }, // { // Count: to.Ptr[float64](72), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-09T07:00:00.000Z"); return t}()), // }, // { // Count: to.Ptr[float64](72), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-09T13:00:00.000Z"); return t}()), // }, // { // Count: to.Ptr[float64](72), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-09T19:00:00.000Z"); return t}()), // }, // { // Count: to.Ptr[float64](72), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-10T01:00:00.000Z"); return t}()), // }, // { // Count: to.Ptr[float64](72), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-10T07:00:00.000Z"); return t}()), // }, // { // Count: to.Ptr[float64](72), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-10T13:00:00.000Z"); return t}()), // }, // { // Count: to.Ptr[float64](72), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-10T19:00:00.000Z"); return t}()), // }, // { // Count: to.Ptr[float64](78), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-11T01:00:00.000Z"); return t}()), // }, // { // Count: to.Ptr[float64](72), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-11T07:00:00.000Z"); return t}()), // }, // { // Count: to.Ptr[float64](72), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-11T13:00:00.000Z"); return t}()), // }, // { // Count: to.Ptr[float64](72), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-11T19:00:00.000Z"); return t}()), // }}, // Metadatavalues: []*armmonitor.MetadataValue{ // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("microsoft.resourceid"), // Value: to.Ptr("microsoft.resourceid"), // }, // Value: to.Ptr("/subscriptions/92d2a2d8-b514-432d-8cc9-a5f9272630d5/resourceGroups/sas3/providers/Microsoft.Compute/virtualMachines/sas3-vm"), // }}, // }, // { // Data: []*armmonitor.MetricValue{ // { // Count: to.Ptr[float64](72), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-08T19:00:00.000Z"); return t}()), // }, // { // Count: to.Ptr[float64](72), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-09T01:00:00.000Z"); return t}()), // }, // { // Count: to.Ptr[float64](72), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-09T07:00:00.000Z"); return t}()), // }, // { // Count: to.Ptr[float64](72), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-09T13:00:00.000Z"); return t}()), // }, // { // Count: to.Ptr[float64](72), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-09T19:00:00.000Z"); return t}()), // }, // { // Count: to.Ptr[float64](72), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-10T01:00:00.000Z"); return t}()), // }, // { // Count: to.Ptr[float64](72), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-10T07:00:00.000Z"); return t}()), // }, // { // Count: to.Ptr[float64](72), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-10T13:00:00.000Z"); return t}()), // }, // { // Count: to.Ptr[float64](72), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-10T19:00:00.000Z"); return t}()), // }, // { // Count: to.Ptr[float64](72), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-11T01:00:00.000Z"); return t}()), // }, // { // Count: to.Ptr[float64](72), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-11T07:00:00.000Z"); return t}()), // }, // { // Count: to.Ptr[float64](72), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-11T13:00:00.000Z"); return t}()), // }, // { // Count: to.Ptr[float64](72), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-11T19:00:00.000Z"); return t}()), // }}, // Metadatavalues: []*armmonitor.MetadataValue{ // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("microsoft.resourceid"), // Value: to.Ptr("microsoft.resourceid"), // }, // Value: to.Ptr("/subscriptions/92d2a2d8-b514-432d-8cc9-a5f9272630d5/resourceGroups/sas4/providers/Microsoft.Compute/virtualMachines/sas4-vm"), // }}, // }, // { // Data: []*armmonitor.MetricValue{ // { // Count: to.Ptr[float64](72), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-08T19:00:00.000Z"); return t}()), // }, // { // Count: to.Ptr[float64](72), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-09T01:00:00.000Z"); return t}()), // }, // { // Count: to.Ptr[float64](72), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-09T07:00:00.000Z"); return t}()), // }, // { // Count: to.Ptr[float64](72), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-09T13:00:00.000Z"); return t}()), // }, // { // Count: to.Ptr[float64](72), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-09T19:00:00.000Z"); return t}()), // }, // { // Count: to.Ptr[float64](72), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-10T01:00:00.000Z"); return t}()), // }, // { // Count: to.Ptr[float64](72), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-10T07:00:00.000Z"); return t}()), // }, // { // Count: to.Ptr[float64](72), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-10T13:00:00.000Z"); return t}()), // }, // { // Count: to.Ptr[float64](72), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-10T19:00:00.000Z"); return t}()), // }, // { // Count: to.Ptr[float64](72), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-11T01:00:00.000Z"); return t}()), // }, // { // Count: to.Ptr[float64](72), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-11T07:00:00.000Z"); return t}()), // }, // { // Count: to.Ptr[float64](72), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-11T13:00:00.000Z"); return t}()), // }, // { // Count: to.Ptr[float64](72), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-11T19:00:00.000Z"); return t}()), // }}, // Metadatavalues: []*armmonitor.MetadataValue{ // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("microsoft.resourceid"), // Value: to.Ptr("microsoft.resourceid"), // }, // Value: to.Ptr("/subscriptions/92d2a2d8-b514-432d-8cc9-a5f9272630d5/resourceGroups/sas5/providers/Microsoft.Compute/virtualMachines/sas5-vm-asc"), // }}, // }}, // Unit: to.Ptr(armmonitor.MetricUnitCount), // }}, // } }
Output:
Example (GetSubscriptionLevelMetricMetadata) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Insights/stable/2021-05-01/examples/GetMultiResourceMetricMetadata.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewMetricsClient().ListAtSubscriptionScope(ctx, "westus2", &armmonitor.MetricsClientListAtSubscriptionScopeOptions{Timespan: to.Ptr("2021-06-10T02:23:16.129Z/2021-06-12T02:23:16.129Z"), Interval: nil, Metricnames: to.Ptr("Data Disk Max Burst IOPS"), Aggregation: nil, Top: nil, Orderby: nil, Filter: to.Ptr("LUN eq '0'"), ResultType: nil, Metricnamespace: to.Ptr("microsoft.compute/virtualmachines"), AutoAdjustTimegrain: nil, ValidateDimensions: 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.SubscriptionScopeMetricResponse = armmonitor.SubscriptionScopeMetricResponse{ // Interval: to.Ptr("PT1M"), // Namespace: to.Ptr("microsoft.compute/virtualmachines"), // Resourceregion: to.Ptr("westus2"), // Timespan: to.Ptr("2021-06-10T02:23:16Z/2021-06-12T02:23:16Z"), // Value: []*armmonitor.SubscriptionScopeMetric{ // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("Data Disk Read Bytes/Sec"), // Value: to.Ptr("Data Disk Read Bytes/sec"), // }, // Type: to.Ptr("Microsoft.Insights/metrics"), // DisplayDescription: to.Ptr("Bytes/Sec read from a single disk during monitoring period"), // ID: to.Ptr("subscriptions/92d2a2d8-b514-432d-8cc9-a5f9272630d5/providers/Microsoft.Insights/metrics/Data Disk Read Bytes/sec"), // Timeseries: []*armmonitor.TimeSeriesElement{ // { // Metadatavalues: []*armmonitor.MetadataValue{ // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("lun"), // Value: to.Ptr("lun"), // }, // Value: to.Ptr("0"), // }}, // }, // { // Metadatavalues: []*armmonitor.MetadataValue{ // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("lun"), // Value: to.Ptr("lun"), // }, // Value: to.Ptr("1"), // }}, // }}, // Unit: to.Ptr(armmonitor.MetricUnitBytesPerSecond), // }}, // } }
Output:
func (*MetricsClient) ListAtSubscriptionScopePost ¶ added in v0.9.0
func (client *MetricsClient) ListAtSubscriptionScopePost(ctx context.Context, region string, options *MetricsClientListAtSubscriptionScopePostOptions) (MetricsClientListAtSubscriptionScopePostResponse, error)
ListAtSubscriptionScopePost - Lists the metric data for a subscription. Parameters can be specified on either query params or the body. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2021-05-01
- region - The region where the metrics you want reside.
- options - MetricsClientListAtSubscriptionScopePostOptions contains the optional parameters for the MetricsClient.ListAtSubscriptionScopePost method.
Example (PostRequestForSubscriptionLevelMetricDataUsingBodyParams) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Insights/stable/2021-05-01/examples/PostMultiResourceMetricBody.json
package main import ( "context" "log" "time" "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/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewMetricsClient().ListAtSubscriptionScopePost(ctx, "westus2", &armmonitor.MetricsClientListAtSubscriptionScopePostOptions{Timespan: nil, Interval: nil, Metricnames: nil, Aggregation: nil, Top: nil, Orderby: nil, Filter: nil, ResultType: nil, Metricnamespace: nil, AutoAdjustTimegrain: nil, ValidateDimensions: nil, Body: &armmonitor.SubscriptionScopeMetricsRequestBodyParameters{ Aggregation: to.Ptr("count"), AutoAdjustTimegrain: to.Ptr(true), Filter: to.Ptr("LUN eq '0' and Microsoft.ResourceId eq '*'"), Interval: to.Ptr("PT6H"), MetricNames: to.Ptr("Data Disk Max Burst IOPS"), MetricNamespace: to.Ptr("microsoft.compute/virtualmachines"), OrderBy: to.Ptr("count desc"), RollUpBy: to.Ptr("LUN"), Timespan: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "NaN-NaN-NaNTNaN:NaN:NaN.NaNZ"); return t }()), Top: to.Ptr[int32](10), ValidateDimensions: to.Ptr(false), }, }) 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.SubscriptionScopeMetricResponse = armmonitor.SubscriptionScopeMetricResponse{ // Cost: to.Ptr[int32](4679), // Interval: to.Ptr("PT6H"), // Namespace: to.Ptr("microsoft.compute/virtualmachines"), // Resourceregion: to.Ptr("westus2"), // Timespan: to.Ptr("2021-06-08T19:00:00Z/2021-06-12T01:00:00Z"), // Value: []*armmonitor.SubscriptionScopeMetric{ // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("Data Disk Max Burst IOPS"), // Value: to.Ptr("Data Disk Max Burst IOPS"), // }, // Type: to.Ptr("Microsoft.Insights/metrics"), // DisplayDescription: to.Ptr("Maximum IOPS Data Disk can achieve with bursting"), // ErrorCode: to.Ptr("Success"), // ID: to.Ptr("subscriptions/92d2a2d8-b514-432d-8cc9-a5f9272630d5/providers/Microsoft.Insights/metrics/Data Disk Max Burst IOPS"), // Timeseries: []*armmonitor.TimeSeriesElement{ // { // Data: []*armmonitor.MetricValue{ // { // Count: to.Ptr[float64](72), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-08T19:00:00.000Z"); return t}()), // }, // { // Count: to.Ptr[float64](72), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-09T01:00:00.000Z"); return t}()), // }, // { // Count: to.Ptr[float64](72), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-09T07:00:00.000Z"); return t}()), // }, // { // Count: to.Ptr[float64](72), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-09T13:00:00.000Z"); return t}()), // }, // { // Count: to.Ptr[float64](72), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-09T19:00:00.000Z"); return t}()), // }, // { // Count: to.Ptr[float64](72), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-10T01:00:00.000Z"); return t}()), // }, // { // Count: to.Ptr[float64](72), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-10T07:00:00.000Z"); return t}()), // }, // { // Count: to.Ptr[float64](413), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-10T13:00:00.000Z"); return t}()), // }, // { // Count: to.Ptr[float64](72), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-10T19:00:00.000Z"); return t}()), // }, // { // Count: to.Ptr[float64](72), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-11T01:00:00.000Z"); return t}()), // }, // { // Count: to.Ptr[float64](72), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-11T07:00:00.000Z"); return t}()), // }, // { // Count: to.Ptr[float64](72), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-11T13:00:00.000Z"); return t}()), // }, // { // Count: to.Ptr[float64](72), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-11T19:00:00.000Z"); return t}()), // }}, // Metadatavalues: []*armmonitor.MetadataValue{ // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("microsoft.resourceid"), // Value: to.Ptr("microsoft.resourceid"), // }, // Value: to.Ptr("/subscriptions/92d2a2d8-b514-432d-8cc9-a5f9272630d5/resourceGroups/sas1/providers/Microsoft.Compute/virtualMachines/sas1-dev"), // }}, // }, // { // Data: []*armmonitor.MetricValue{ // { // Count: to.Ptr[float64](72), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-08T19:00:00.000Z"); return t}()), // }, // { // Count: to.Ptr[float64](133), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-09T01:00:00.000Z"); return t}()), // }, // { // Count: to.Ptr[float64](72), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-09T07:00:00.000Z"); return t}()), // }, // { // Count: to.Ptr[float64](72), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-09T13:00:00.000Z"); return t}()), // }, // { // Count: to.Ptr[float64](72), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-09T19:00:00.000Z"); return t}()), // }, // { // Count: to.Ptr[float64](72), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-10T01:00:00.000Z"); return t}()), // }, // { // Count: to.Ptr[float64](72), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-10T07:00:00.000Z"); return t}()), // }, // { // Count: to.Ptr[float64](72), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-10T13:00:00.000Z"); return t}()), // }, // { // Count: to.Ptr[float64](72), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-10T19:00:00.000Z"); return t}()), // }, // { // Count: to.Ptr[float64](72), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-11T01:00:00.000Z"); return t}()), // }, // { // Count: to.Ptr[float64](72), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-11T07:00:00.000Z"); return t}()), // }, // { // Count: to.Ptr[float64](72), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-11T13:00:00.000Z"); return t}()), // }, // { // Count: to.Ptr[float64](72), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-11T19:00:00.000Z"); return t}()), // }}, // Metadatavalues: []*armmonitor.MetadataValue{ // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("microsoft.resourceid"), // Value: to.Ptr("microsoft.resourceid"), // }, // Value: to.Ptr("/subscriptions/92d2a2d8-b514-432d-8cc9-a5f9272630d5/resourceGroups/sas2/providers/Microsoft.Compute/virtualMachines/sas2-vm"), // }}, // }, // { // Data: []*armmonitor.MetricValue{ // { // Count: to.Ptr[float64](72), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-08T19:00:00.000Z"); return t}()), // }, // { // Count: to.Ptr[float64](72), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-09T01:00:00.000Z"); return t}()), // }, // { // Count: to.Ptr[float64](72), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-09T07:00:00.000Z"); return t}()), // }, // { // Count: to.Ptr[float64](72), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-09T13:00:00.000Z"); return t}()), // }, // { // Count: to.Ptr[float64](72), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-09T19:00:00.000Z"); return t}()), // }, // { // Count: to.Ptr[float64](72), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-10T01:00:00.000Z"); return t}()), // }, // { // Count: to.Ptr[float64](72), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-10T07:00:00.000Z"); return t}()), // }, // { // Count: to.Ptr[float64](72), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-10T13:00:00.000Z"); return t}()), // }, // { // Count: to.Ptr[float64](72), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-10T19:00:00.000Z"); return t}()), // }, // { // Count: to.Ptr[float64](78), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-11T01:00:00.000Z"); return t}()), // }, // { // Count: to.Ptr[float64](72), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-11T07:00:00.000Z"); return t}()), // }, // { // Count: to.Ptr[float64](72), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-11T13:00:00.000Z"); return t}()), // }, // { // Count: to.Ptr[float64](72), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-11T19:00:00.000Z"); return t}()), // }}, // Metadatavalues: []*armmonitor.MetadataValue{ // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("microsoft.resourceid"), // Value: to.Ptr("microsoft.resourceid"), // }, // Value: to.Ptr("/subscriptions/92d2a2d8-b514-432d-8cc9-a5f9272630d5/resourceGroups/sas3/providers/Microsoft.Compute/virtualMachines/sas3-vm"), // }}, // }, // { // Data: []*armmonitor.MetricValue{ // { // Count: to.Ptr[float64](72), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-08T19:00:00.000Z"); return t}()), // }, // { // Count: to.Ptr[float64](72), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-09T01:00:00.000Z"); return t}()), // }, // { // Count: to.Ptr[float64](72), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-09T07:00:00.000Z"); return t}()), // }, // { // Count: to.Ptr[float64](72), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-09T13:00:00.000Z"); return t}()), // }, // { // Count: to.Ptr[float64](72), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-09T19:00:00.000Z"); return t}()), // }, // { // Count: to.Ptr[float64](72), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-10T01:00:00.000Z"); return t}()), // }, // { // Count: to.Ptr[float64](72), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-10T07:00:00.000Z"); return t}()), // }, // { // Count: to.Ptr[float64](72), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-10T13:00:00.000Z"); return t}()), // }, // { // Count: to.Ptr[float64](72), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-10T19:00:00.000Z"); return t}()), // }, // { // Count: to.Ptr[float64](72), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-11T01:00:00.000Z"); return t}()), // }, // { // Count: to.Ptr[float64](72), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-11T07:00:00.000Z"); return t}()), // }, // { // Count: to.Ptr[float64](72), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-11T13:00:00.000Z"); return t}()), // }, // { // Count: to.Ptr[float64](72), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-11T19:00:00.000Z"); return t}()), // }}, // Metadatavalues: []*armmonitor.MetadataValue{ // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("microsoft.resourceid"), // Value: to.Ptr("microsoft.resourceid"), // }, // Value: to.Ptr("/subscriptions/92d2a2d8-b514-432d-8cc9-a5f9272630d5/resourceGroups/sas4/providers/Microsoft.Compute/virtualMachines/sas4-vm"), // }}, // }, // { // Data: []*armmonitor.MetricValue{ // { // Count: to.Ptr[float64](72), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-08T19:00:00.000Z"); return t}()), // }, // { // Count: to.Ptr[float64](72), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-09T01:00:00.000Z"); return t}()), // }, // { // Count: to.Ptr[float64](72), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-09T07:00:00.000Z"); return t}()), // }, // { // Count: to.Ptr[float64](72), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-09T13:00:00.000Z"); return t}()), // }, // { // Count: to.Ptr[float64](72), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-09T19:00:00.000Z"); return t}()), // }, // { // Count: to.Ptr[float64](72), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-10T01:00:00.000Z"); return t}()), // }, // { // Count: to.Ptr[float64](72), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-10T07:00:00.000Z"); return t}()), // }, // { // Count: to.Ptr[float64](72), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-10T13:00:00.000Z"); return t}()), // }, // { // Count: to.Ptr[float64](72), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-10T19:00:00.000Z"); return t}()), // }, // { // Count: to.Ptr[float64](72), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-11T01:00:00.000Z"); return t}()), // }, // { // Count: to.Ptr[float64](72), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-11T07:00:00.000Z"); return t}()), // }, // { // Count: to.Ptr[float64](72), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-11T13:00:00.000Z"); return t}()), // }, // { // Count: to.Ptr[float64](72), // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-11T19:00:00.000Z"); return t}()), // }}, // Metadatavalues: []*armmonitor.MetadataValue{ // { // Name: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("microsoft.resourceid"), // Value: to.Ptr("microsoft.resourceid"), // }, // Value: to.Ptr("/subscriptions/92d2a2d8-b514-432d-8cc9-a5f9272630d5/resourceGroups/sas5/providers/Microsoft.Compute/virtualMachines/sas5-vm-asc"), // }}, // }}, // Unit: to.Ptr(armmonitor.MetricUnitCount), // }}, // } }
Output:
type MetricsClientListAtSubscriptionScopeOptions ¶ added in v0.9.0
type MetricsClientListAtSubscriptionScopeOptions struct { // The list of aggregation types (comma separated) to retrieve. Aggregation *string // When set to true, if the timespan passed in is not supported by this metric, the API will return the result using the closest // supported timespan. When set to false, an error is returned for invalid // timespan parameters. Defaults to false. AutoAdjustTimegrain *bool // The $filter is used to reduce the set of metric data returned. // Example: // Metric contains metadata A, B and C. // - Return all time series of C where A = a1 and B = b1 or b2 // $filter=A eq ‘a1’ and B eq ‘b1’ or B eq ‘b2’ and C eq ‘’ // - Invalid variant: // $filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘’ or B = ‘b2’ // This is invalid because the logical or operator cannot separate two different metadata names. // - Return all time series where A = a1, B = b1 and C = c1: // $filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘c1’ // - Return all time series where A = a1 // $filter=A eq ‘a1’ and B eq ‘’ and C eq ‘’. Filter *string // The interval (i.e. timegrain) of the query. Interval *string // The names of the metrics (comma separated) to retrieve. Metricnames *string // Metric namespace where the metrics you want reside. Metricnamespace *string // The aggregation to use for sorting results and the direction of the sort. Only one order can be specified. Examples: sum // asc. Orderby *string // Reduces the set of data collected. The syntax allowed depends on the operation. See the operation's description for details. ResultType *MetricResultType // The timespan of the query. It is a string with the following format 'startDateTimeISO/endDateTimeISO'. Timespan *string // The maximum number of records to retrieve. Valid only if $filter is specified. Defaults to 10. Top *int32 // When set to false, invalid filter parameter values will be ignored. When set to true, an error is returned for invalid // filter parameters. Defaults to true. ValidateDimensions *bool }
MetricsClientListAtSubscriptionScopeOptions contains the optional parameters for the MetricsClient.ListAtSubscriptionScope method.
type MetricsClientListAtSubscriptionScopePostOptions ¶ added in v0.9.0
type MetricsClientListAtSubscriptionScopePostOptions struct { // The list of aggregation types (comma separated) to retrieve. Aggregation *string // When set to true, if the timespan passed in is not supported by this metric, the API will return the result using the closest // supported timespan. When set to false, an error is returned for invalid // timespan parameters. Defaults to false. AutoAdjustTimegrain *bool // Parameters serialized in the body Body *SubscriptionScopeMetricsRequestBodyParameters // The $filter is used to reduce the set of metric data returned. // Example: // Metric contains metadata A, B and C. // - Return all time series of C where A = a1 and B = b1 or b2 // $filter=A eq ‘a1’ and B eq ‘b1’ or B eq ‘b2’ and C eq ‘’ // - Invalid variant: // $filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘’ or B = ‘b2’ // This is invalid because the logical or operator cannot separate two different metadata names. // - Return all time series where A = a1, B = b1 and C = c1: // $filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘c1’ // - Return all time series where A = a1 // $filter=A eq ‘a1’ and B eq ‘’ and C eq ‘’. Filter *string // The interval (i.e. timegrain) of the query. Interval *string // The names of the metrics (comma separated) to retrieve. Metricnames *string // Metric namespace where the metrics you want reside. Metricnamespace *string // The aggregation to use for sorting results and the direction of the sort. Only one order can be specified. Examples: sum // asc. Orderby *string // Reduces the set of data collected. The syntax allowed depends on the operation. See the operation's description for details. ResultType *MetricResultType // The timespan of the query. It is a string with the following format 'startDateTimeISO/endDateTimeISO'. Timespan *string // The maximum number of records to retrieve. Valid only if $filter is specified. Defaults to 10. Top *int32 // When set to false, invalid filter parameter values will be ignored. When set to true, an error is returned for invalid // filter parameters. Defaults to true. ValidateDimensions *bool }
MetricsClientListAtSubscriptionScopePostOptions contains the optional parameters for the MetricsClient.ListAtSubscriptionScopePost method.
type MetricsClientListAtSubscriptionScopePostResponse ¶ added in v0.9.0
type MetricsClientListAtSubscriptionScopePostResponse struct { // The response to a subscription scope metrics query. SubscriptionScopeMetricResponse }
MetricsClientListAtSubscriptionScopePostResponse contains the response from method MetricsClient.ListAtSubscriptionScopePost.
type MetricsClientListAtSubscriptionScopeResponse ¶ added in v0.9.0
type MetricsClientListAtSubscriptionScopeResponse struct { // The response to a subscription scope metrics query. SubscriptionScopeMetricResponse }
MetricsClientListAtSubscriptionScopeResponse contains the response from method MetricsClient.ListAtSubscriptionScope.
type MetricsClientListOptions ¶ added in v0.4.0
type MetricsClientListOptions struct { // The list of aggregation types (comma separated) to retrieve. Aggregation *string // When set to true, if the timespan passed in is not supported by this metric, the API will return the result using the closest // supported timespan. When set to false, an error is returned for invalid // timespan parameters. Defaults to false. AutoAdjustTimegrain *bool // The $filter is used to reduce the set of metric data returned. // Example: // Metric contains metadata A, B and C. // - Return all time series of C where A = a1 and B = b1 or b2 // $filter=A eq ‘a1’ and B eq ‘b1’ or B eq ‘b2’ and C eq ‘’ // - Invalid variant: // $filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘’ or B = ‘b2’ // This is invalid because the logical or operator cannot separate two different metadata names. // - Return all time series where A = a1, B = b1 and C = c1: // $filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘c1’ // - Return all time series where A = a1 // $filter=A eq ‘a1’ and B eq ‘’ and C eq ‘’. Filter *string // The interval (i.e. timegrain) of the query. Interval *string // The names of the metrics (comma separated) to retrieve. Metricnames *string // Metric namespace where the metrics you want reside. Metricnamespace *string // The aggregation to use for sorting results and the direction of the sort. Only one order can be specified. Examples: sum // asc. Orderby *string // Reduces the set of data collected. The syntax allowed depends on the operation. See the operation's description for details. ResultType *ResultType // The timespan of the query. It is a string with the following format 'startDateTimeISO/endDateTimeISO'. Timespan *string // The maximum number of records to retrieve. Valid only if $filter is specified. Defaults to 10. Top *int32 // When set to false, invalid filter parameter values will be ignored. When set to true, an error is returned for invalid // filter parameters. Defaults to true. ValidateDimensions *bool }
MetricsClientListOptions contains the optional parameters for the MetricsClient.List method.
type MetricsClientListResponse ¶ added in v0.4.0
type MetricsClientListResponse struct { // The response to a metrics query. Response }
MetricsClientListResponse contains the response from method MetricsClient.List.
type MetricsIngestionEndpointSpec ¶ added in v0.9.0
type MetricsIngestionEndpointSpec struct { // READ-ONLY; The endpoint. This property is READ-ONLY. Endpoint *string }
MetricsIngestionEndpointSpec - Definition of the endpoint used for ingesting metrics.
func (MetricsIngestionEndpointSpec) MarshalJSON ¶ added in v0.9.0
func (m MetricsIngestionEndpointSpec) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type MetricsIngestionEndpointSpec.
func (*MetricsIngestionEndpointSpec) UnmarshalJSON ¶ added in v0.9.0
func (m *MetricsIngestionEndpointSpec) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type MetricsIngestionEndpointSpec.
type MonitoringAccountDestination ¶ added in v0.9.0
type MonitoringAccountDestination struct { // The resource ID of the monitoring account. AccountResourceID *string // A friendly name for the destination. This name should be unique across all destinations (regardless of type) within the // data collection rule. Name *string // READ-ONLY; The immutable ID of the account. AccountID *string }
MonitoringAccountDestination - Monitoring account destination.
func (MonitoringAccountDestination) MarshalJSON ¶ added in v0.9.0
func (m MonitoringAccountDestination) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type MonitoringAccountDestination.
func (*MonitoringAccountDestination) UnmarshalJSON ¶ added in v0.9.0
func (m *MonitoringAccountDestination) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type MonitoringAccountDestination.
type MultiMetricCriteria ¶
type MultiMetricCriteria struct { // REQUIRED; Specifies the type of threshold criteria CriterionType *CriterionType // REQUIRED; Name of the metric. MetricName *string // REQUIRED; Name of the criteria. Name *string // REQUIRED; the criteria time aggregation types. TimeAggregation *AggregationTypeEnum // OPTIONAL; Contains additional key/value pairs not defined in the schema. AdditionalProperties map[string]any // List of dimension conditions. Dimensions []*MetricDimension // Namespace of the metric. MetricNamespace *string // Allows creating an alert rule on a custom metric that isn't yet emitted, by causing the metric validation to be skipped. SkipMetricValidation *bool }
MultiMetricCriteria - The types of conditions for a multi resource alert.
func (*MultiMetricCriteria) GetMultiMetricCriteria ¶
func (m *MultiMetricCriteria) GetMultiMetricCriteria() *MultiMetricCriteria
GetMultiMetricCriteria implements the MultiMetricCriteriaClassification interface for type MultiMetricCriteria.
func (MultiMetricCriteria) MarshalJSON ¶ added in v0.4.0
func (m MultiMetricCriteria) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type MultiMetricCriteria.
func (*MultiMetricCriteria) UnmarshalJSON ¶
func (m *MultiMetricCriteria) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type MultiMetricCriteria.
type MultiMetricCriteriaClassification ¶
type MultiMetricCriteriaClassification interface { // GetMultiMetricCriteria returns the MultiMetricCriteria content of the underlying type. GetMultiMetricCriteria() *MultiMetricCriteria }
MultiMetricCriteriaClassification provides polymorphic access to related types. Call the interface's GetMultiMetricCriteria() method to access the common type. Use a type switch to determine the concrete type. The possible types are: - *DynamicMetricCriteria, *MetricCriteria, *MultiMetricCriteria
type NamespaceClassification ¶
type NamespaceClassification string
NamespaceClassification - Kind of namespace
const ( NamespaceClassificationCustom NamespaceClassification = "Custom" NamespaceClassificationPlatform NamespaceClassification = "Platform" NamespaceClassificationQos NamespaceClassification = "Qos" )
func PossibleNamespaceClassificationValues ¶
func PossibleNamespaceClassificationValues() []NamespaceClassification
PossibleNamespaceClassificationValues returns the possible values for the NamespaceClassification const type.
type NetworkRuleSet ¶
type NetworkRuleSet struct { // The configuration to set whether network access from public internet to the endpoints are allowed. PublicNetworkAccess *KnownPublicNetworkAccessOptions }
NetworkRuleSet - Definition of the network rules.
func (NetworkRuleSet) MarshalJSON ¶ added in v0.8.0
func (n NetworkRuleSet) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type NetworkRuleSet.
func (*NetworkRuleSet) UnmarshalJSON ¶ added in v0.8.0
func (n *NetworkRuleSet) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type NetworkRuleSet.
type NotificationRequestBody ¶ added in v0.3.0
type NotificationRequestBody struct { // REQUIRED; The value of the supported alert type. Supported alert type values are: servicehealth, metricstaticthreshold, // metricsdynamicthreshold, logalertv2, smartalert, webtestalert, logalertv1numresult, // logalertv1metricmeasurement, resourcehealth, activitylog, actualcostbudget, forecastedbudget AlertType *string // The list of ARM role receivers that are part of this action group. Roles are Azure RBAC roles and only built-in roles are // supported. ArmRoleReceivers []*ArmRoleReceiver // The list of AutomationRunbook receivers that are part of this action group. AutomationRunbookReceivers []*AutomationRunbookReceiver // The list of AzureAppPush receivers that are part of this action group. AzureAppPushReceivers []*AzureAppPushReceiver // The list of azure function receivers that are part of this action group. AzureFunctionReceivers []*AzureFunctionReceiver // The list of email receivers that are part of this action group. EmailReceivers []*EmailReceiver // The list of event hub receivers that are part of this action group. EventHubReceivers []*EventHubReceiver // The list of ITSM receivers that are part of this action group. ItsmReceivers []*ItsmReceiver // The list of logic app receivers that are part of this action group. LogicAppReceivers []*LogicAppReceiver // The list of SMS receivers that are part of this action group. SmsReceivers []*SmsReceiver // The list of voice receivers that are part of this action group. VoiceReceivers []*VoiceReceiver // The list of webhook receivers that are part of this action group. WebhookReceivers []*WebhookReceiver }
NotificationRequestBody - The request body which contain contact detail metadata
func (NotificationRequestBody) MarshalJSON ¶ added in v0.3.0
func (n NotificationRequestBody) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type NotificationRequestBody.
func (*NotificationRequestBody) UnmarshalJSON ¶ added in v0.8.0
func (n *NotificationRequestBody) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type NotificationRequestBody.
type Odatatype ¶
type Odatatype string
Odatatype - specifies the type of the alert criteria.
const ( OdatatypeMicrosoftAzureMonitorMultipleResourceMultipleMetricCriteria Odatatype = "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria" OdatatypeMicrosoftAzureMonitorSingleResourceMultipleMetricCriteria Odatatype = "Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria" OdatatypeMicrosoftAzureMonitorWebtestLocationAvailabilityCriteria Odatatype = "Microsoft.Azure.Monitor.WebtestLocationAvailabilityCriteria" )
func PossibleOdatatypeValues ¶
func PossibleOdatatypeValues() []Odatatype
PossibleOdatatypeValues returns the possible values for the Odatatype const type.
type OnboardingStatus ¶
type OnboardingStatus string
OnboardingStatus - The onboarding status for the resource. Note that, a higher level scope, e.g., resource group or subscription, is considered onboarded if at least one resource under it is onboarded.
const ( OnboardingStatusNotOnboarded OnboardingStatus = "notOnboarded" OnboardingStatusOnboarded OnboardingStatus = "onboarded" OnboardingStatusUnknown OnboardingStatus = "unknown" )
func PossibleOnboardingStatusValues ¶
func PossibleOnboardingStatusValues() []OnboardingStatus
PossibleOnboardingStatusValues returns the possible values for the OnboardingStatus const type.
type Operation ¶
type Operation struct { // Display metadata associated with the operation. Display *OperationDisplay // Operation name: {provider}/{resource}/{operation} Name *string }
Operation - Microsoft Insights API operation definition.
func (Operation) MarshalJSON ¶ added in v0.8.0
MarshalJSON implements the json.Marshaller interface for type Operation.
func (*Operation) UnmarshalJSON ¶ added in v0.8.0
UnmarshalJSON implements the json.Unmarshaller interface for type Operation.
type OperationAutoGenerated ¶ added in v0.9.0
type OperationAutoGenerated struct { // Localized display information for this particular operation. Display *OperationDisplayAutoGenerated // READ-ONLY; 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 ARM/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 }
OperationAutoGenerated - Details of a REST API operation, returned from the Resource Provider Operations API
func (OperationAutoGenerated) MarshalJSON ¶ added in v0.9.0
func (o OperationAutoGenerated) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type OperationAutoGenerated.
func (*OperationAutoGenerated) UnmarshalJSON ¶ added in v0.9.0
func (o *OperationAutoGenerated) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type OperationAutoGenerated.
type OperationDisplay ¶
type OperationDisplay struct { // Operation type: Read, write, delete, etc. Operation *string // Service provider: Microsoft.Insights Provider *string // Resource on which the operation is performed: AlertRules, Autoscale, etc. Resource *string }
OperationDisplay - Display metadata associated with the operation.
func (OperationDisplay) MarshalJSON ¶ added in v0.8.0
func (o OperationDisplay) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type OperationDisplay.
func (*OperationDisplay) UnmarshalJSON ¶ added in v0.8.0
func (o *OperationDisplay) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type OperationDisplay.
type OperationDisplayAutoGenerated ¶ added in v0.9.0
type OperationDisplayAutoGenerated 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 }
OperationDisplayAutoGenerated - Localized display information for this particular operation.
func (OperationDisplayAutoGenerated) MarshalJSON ¶ added in v0.9.0
func (o OperationDisplayAutoGenerated) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type OperationDisplayAutoGenerated.
func (*OperationDisplayAutoGenerated) UnmarshalJSON ¶ added in v0.9.0
func (o *OperationDisplayAutoGenerated) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type OperationDisplayAutoGenerated.
type OperationListResult ¶
type OperationListResult struct { // URL to get the next set of operation list results if there are any. NextLink *string // List of operations supported by the Microsoft.Insights provider. Value []*Operation }
OperationListResult - Result of the request to list Microsoft.Insights operations. It contains a list of operations and a URL link to get the next set of results.
func (OperationListResult) MarshalJSON ¶
func (o OperationListResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type OperationListResult.
func (*OperationListResult) UnmarshalJSON ¶ added in v0.8.0
func (o *OperationListResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type OperationListResult.
type OperationListResultAutoGenerated ¶ added in v0.9.0
type OperationListResultAutoGenerated struct { // READ-ONLY; URL to get the next set of operation list results (if there are any). NextLink *string // READ-ONLY; List of operations supported by the resource provider Value []*OperationAutoGenerated }
OperationListResultAutoGenerated - 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 (OperationListResultAutoGenerated) MarshalJSON ¶ added in v0.9.0
func (o OperationListResultAutoGenerated) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type OperationListResultAutoGenerated.
func (*OperationListResultAutoGenerated) UnmarshalJSON ¶ added in v0.9.0
func (o *OperationListResultAutoGenerated) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type OperationListResultAutoGenerated.
type OperationStatus ¶
type OperationStatus struct { // End time of the job in standard ISO8601 format. EndTime *time.Time // The error detail of the operation if any. Error *ErrorDetail // The operation Id. ID *string // The operation name. Name *string // Start time of the job in standard ISO8601 format. StartTime *time.Time // The status of the operation. Status *string }
OperationStatus - The status of operation.
func (OperationStatus) MarshalJSON ¶
func (o OperationStatus) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type OperationStatus.
func (*OperationStatus) UnmarshalJSON ¶
func (o *OperationStatus) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type OperationStatus.
type OperationsClient ¶
type OperationsClient struct {
// contains filtered or unexported fields
}
OperationsClient contains the methods for the Operations group. Don't use this type directly, use NewOperationsClient() instead.
func NewOperationsClient ¶
func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*OperationsClient, error)
NewOperationsClient creates a new instance of OperationsClient with the specified values.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - pass nil to accept the default values.
func (*OperationsClient) List ¶
func (client *OperationsClient) List(ctx context.Context, options *OperationsClientListOptions) (OperationsClientListResponse, error)
List - Lists all of the available operations from Microsoft.Insights provider. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2015-04-01
- options - OperationsClientListOptions contains the optional parameters for the OperationsClient.List method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Insights/stable/2015-04-01/examples/OperationList.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewOperationsClient().List(ctx, 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.OperationListResult = armmonitor.OperationListResult{ // Value: []*armmonitor.Operation{ // { // Name: to.Ptr("Microsoft.Insights/Operations/Read"), // Display: &armmonitor.OperationDisplay{ // Operation: to.Ptr("Operations read"), // Provider: to.Ptr("Microsoft Monitoring Insights"), // Resource: to.Ptr("Operations"), // }, // }, // { // Name: to.Ptr("Microsoft.Insights/MetricDefinitions/Read"), // Display: &armmonitor.OperationDisplay{ // Operation: to.Ptr("Metric definitions read"), // Provider: to.Ptr("Microsoft Monitoring Insights"), // Resource: to.Ptr("Metric Definitions"), // }, // }, // { // Name: to.Ptr("Microsoft.Insights/Metrics/Read"), // Display: &armmonitor.OperationDisplay{ // Operation: to.Ptr("Metrics read"), // Provider: to.Ptr("Microsoft Monitoring Insights"), // Resource: to.Ptr("Metrics"), // }, // }, // { // Name: to.Ptr("Microsoft.Insights/AlertRules/Write"), // Display: &armmonitor.OperationDisplay{ // Operation: to.Ptr("Alert Rule write"), // Provider: to.Ptr("Microsoft Monitoring Insights"), // Resource: to.Ptr("Alert Rules"), // }, // }, // { // Name: to.Ptr("Microsoft.Insights/AlertRules/Delete"), // Display: &armmonitor.OperationDisplay{ // Operation: to.Ptr("Alert Rule delete"), // Provider: to.Ptr("Microsoft Monitoring Insights"), // Resource: to.Ptr("Alert Rules"), // }, // }, // { // Name: to.Ptr("Microsoft.Insights/AlertRules/Read"), // Display: &armmonitor.OperationDisplay{ // Operation: to.Ptr("Alert Rule read"), // Provider: to.Ptr("Microsoft Monitoring Insights"), // Resource: to.Ptr("Alert Rules"), // }, // }, // { // Name: to.Ptr("Microsoft.Insights/MetricAlerts/Write"), // Display: &armmonitor.OperationDisplay{ // Operation: to.Ptr("Metric alert write"), // Provider: to.Ptr("Microsoft Monitoring Insights"), // Resource: to.Ptr("Metric alerts"), // }, // }, // { // Name: to.Ptr("Microsoft.Insights/MetricAlerts/Delete"), // Display: &armmonitor.OperationDisplay{ // Operation: to.Ptr("Metric alert delete"), // Provider: to.Ptr("Microsoft Monitoring Insights"), // Resource: to.Ptr("Metric alerts"), // }, // }, // { // Name: to.Ptr("Microsoft.Insights/MetricAlerts/Read"), // Display: &armmonitor.OperationDisplay{ // Operation: to.Ptr("Metric alert read"), // Provider: to.Ptr("Microsoft Monitoring Insights"), // Resource: to.Ptr("Metric alerts"), // }, // }, // { // Name: to.Ptr("Microsoft.Insights/AutoscaleSettings/Write"), // Display: &armmonitor.OperationDisplay{ // Operation: to.Ptr("Autoscale Setting write"), // Provider: to.Ptr("Microsoft Monitoring Insights"), // Resource: to.Ptr("Autoscale"), // }, // }, // { // Name: to.Ptr("Microsoft.Insights/AutoscaleSettings/Delete"), // Display: &armmonitor.OperationDisplay{ // Operation: to.Ptr("Autoscale Setting delete"), // Provider: to.Ptr("Microsoft Monitoring Insights"), // Resource: to.Ptr("Autoscale"), // }, // }, // { // Name: to.Ptr("Microsoft.Insights/AutoscaleSettings/Read"), // Display: &armmonitor.OperationDisplay{ // Operation: to.Ptr("Autoscale Setting read"), // Provider: to.Ptr("Microsoft Monitoring Insights"), // Resource: to.Ptr("Autoscale"), // }, // }, // { // Name: to.Ptr("Microsoft.Insights/AlertRules/Incidents/Read"), // Display: &armmonitor.OperationDisplay{ // Operation: to.Ptr("Alert Rule Incidents read"), // Provider: to.Ptr("Microsoft Monitoring Insights"), // Resource: to.Ptr("Alert Rule Incident resource"), // }, // }, // { // Name: to.Ptr("Microsoft.Insights/AutoscaleSettings/providers/Microsoft.Insights/MetricDefinitions/Read"), // Display: &armmonitor.OperationDisplay{ // Operation: to.Ptr("Metric definitions read"), // Provider: to.Ptr("Microsoft Monitoring Insights"), // Resource: to.Ptr("Metric Definitions"), // }, // }, // { // Name: to.Ptr("Microsoft.Insights/ActionGroups/Write"), // Display: &armmonitor.OperationDisplay{ // Operation: to.Ptr("Action group write"), // Provider: to.Ptr("Microsoft Monitoring Insights"), // Resource: to.Ptr("Action groups"), // }, // }, // { // Name: to.Ptr("Microsoft.Insights/ActionGroups/Delete"), // Display: &armmonitor.OperationDisplay{ // Operation: to.Ptr("Action group delete"), // Provider: to.Ptr("Microsoft Monitoring Insights"), // Resource: to.Ptr("Action groups"), // }, // }, // { // Name: to.Ptr("Microsoft.Insights/ActionGroups/Read"), // Display: &armmonitor.OperationDisplay{ // Operation: to.Ptr("Action group read"), // Provider: to.Ptr("Microsoft Monitoring Insights"), // Resource: to.Ptr("Action groups"), // }, // }, // { // Name: to.Ptr("Microsoft.Insights/ActivityLogAlerts/Write"), // Display: &armmonitor.OperationDisplay{ // Operation: to.Ptr("Activity log alert read"), // Provider: to.Ptr("Microsoft Monitoring Insights"), // Resource: to.Ptr("Activity log alert"), // }, // }, // { // Name: to.Ptr("Microsoft.Insights/ActivityLogAlerts/Delete"), // Display: &armmonitor.OperationDisplay{ // Operation: to.Ptr("Activity log alert delete"), // Provider: to.Ptr("Microsoft Monitoring Insights"), // Resource: to.Ptr("Activity log alert"), // }, // }, // { // Name: to.Ptr("Microsoft.Insights/ActivityLogAlerts/Read"), // Display: &armmonitor.OperationDisplay{ // Operation: to.Ptr("Activity log alert read"), // Provider: to.Ptr("Microsoft Monitoring Insights"), // Resource: to.Ptr("Activity log alert"), // }, // }, // { // Name: to.Ptr("Microsoft.Insights/ActivityLogAlerts/Activated/Action"), // Display: &armmonitor.OperationDisplay{ // Operation: to.Ptr("Activity Log Alert Activated"), // Provider: to.Ptr("Microsoft Monitoring Insights"), // Resource: to.Ptr("Activity Log Alert"), // }, // }, // { // Name: to.Ptr("Microsoft.Insights/EventCategories/Read"), // Display: &armmonitor.OperationDisplay{ // Operation: to.Ptr("Event category read"), // Provider: to.Ptr("Microsoft Monitoring Insights"), // Resource: to.Ptr("Event category"), // }, // }, // { // Name: to.Ptr("Microsoft.Insights/eventtypes/values/Read"), // Display: &armmonitor.OperationDisplay{ // Operation: to.Ptr("Event types management values read"), // Provider: to.Ptr("Microsoft Monitoring Insights"), // Resource: to.Ptr("Events"), // }, // }, // { // Name: to.Ptr("Microsoft.Insights/eventtypes/digestevents/Read"), // Display: &armmonitor.OperationDisplay{ // Operation: to.Ptr("Event types management digest read"), // Provider: to.Ptr("Microsoft Monitoring Insights"), // Resource: to.Ptr("Digest events"), // }, // }, // { // Name: to.Ptr("Microsoft.Insights/DiagnosticSettings/Write"), // Display: &armmonitor.OperationDisplay{ // Operation: to.Ptr("Diagnostic settings write"), // Provider: to.Ptr("Microsoft Monitoring Insights"), // Resource: to.Ptr("Diagnostic settings"), // }, // }, // { // Name: to.Ptr("Microsoft.Insights/DiagnosticSettings/Delete"), // Display: &armmonitor.OperationDisplay{ // Operation: to.Ptr("Diagnostic settings delete"), // Provider: to.Ptr("Microsoft Monitoring Insights"), // Resource: to.Ptr("Diagnostic settings"), // }, // }, // { // Name: to.Ptr("Microsoft.Insights/DiagnosticSettings/Read"), // Display: &armmonitor.OperationDisplay{ // Operation: to.Ptr("Diagnostic settings read"), // Provider: to.Ptr("Microsoft Monitoring Insights"), // Resource: to.Ptr("Diagnostic settings"), // }, // }, // { // Name: to.Ptr("Microsoft.Insights/ExtendedDiagnosticSettings/Write"), // Display: &armmonitor.OperationDisplay{ // Operation: to.Ptr("Extended Diagnostic settings write"), // Provider: to.Ptr("Microsoft Monitoring Insights"), // Resource: to.Ptr("Extended Diagnostic settings"), // }, // }, // { // Name: to.Ptr("Microsoft.Insights/ExtendedDiagnosticSettings/Delete"), // Display: &armmonitor.OperationDisplay{ // Operation: to.Ptr("Extended Diagnostic settings delete"), // Provider: to.Ptr("Microsoft Monitoring Insights"), // Resource: to.Ptr("Extended Diagnostic settings"), // }, // }, // { // Name: to.Ptr("Microsoft.Insights/ExtendedDiagnosticSettings/Read"), // Display: &armmonitor.OperationDisplay{ // Operation: to.Ptr("Extended Diagnostic settings read"), // Provider: to.Ptr("Microsoft Monitoring Insights"), // Resource: to.Ptr("Extended Diagnostic settings"), // }, // }, // { // Name: to.Ptr("Microsoft.Insights/LogProfiles/Write"), // Display: &armmonitor.OperationDisplay{ // Operation: to.Ptr("Log profile write"), // Provider: to.Ptr("Microsoft Monitoring Insights"), // Resource: to.Ptr("Log Profiles"), // }, // }, // { // Name: to.Ptr("Microsoft.Insights/LogProfiles/Delete"), // Display: &armmonitor.OperationDisplay{ // Operation: to.Ptr("Log profile delete"), // Provider: to.Ptr("Microsoft Monitoring Insights"), // Resource: to.Ptr("Log Profiles"), // }, // }, // { // Name: to.Ptr("Microsoft.Insights/LogProfiles/Read"), // Display: &armmonitor.OperationDisplay{ // Operation: to.Ptr("Log profile read"), // Provider: to.Ptr("Microsoft Monitoring Insights"), // Resource: to.Ptr("Log Profiles"), // }, // }, // { // Name: to.Ptr("Microsoft.Insights/LogDefinitions/Read"), // Display: &armmonitor.OperationDisplay{ // Operation: to.Ptr("Log Definitions read"), // Provider: to.Ptr("Microsoft Monitoring Insights"), // Resource: to.Ptr("Log Definitions"), // }, // }, // { // Name: to.Ptr("Microsoft.Insights/AutoscaleSettings/Scaleup/Action"), // Display: &armmonitor.OperationDisplay{ // Operation: to.Ptr("Autoscale scale up operation"), // Provider: to.Ptr("Microsoft Monitoring Insights"), // Resource: to.Ptr("Autoscale"), // }, // }, // { // Name: to.Ptr("Microsoft.Insights/AutoscaleSettings/Scaledown/Action"), // Display: &armmonitor.OperationDisplay{ // Operation: to.Ptr("Autoscale scale down operation"), // Provider: to.Ptr("Microsoft Monitoring Insights"), // Resource: to.Ptr("Autoscale"), // }, // }, // { // Name: to.Ptr("Microsoft.Insights/AlertRules/Activated/Action"), // Display: &armmonitor.OperationDisplay{ // Operation: to.Ptr("Alert Rule activated"), // Provider: to.Ptr("Microsoft Monitoring Insights"), // Resource: to.Ptr("Alert Rules"), // }, // }, // { // Name: to.Ptr("Microsoft.Insights/AlertRules/Resolved/Action"), // Display: &armmonitor.OperationDisplay{ // Operation: to.Ptr("Alert Rule resolved"), // Provider: to.Ptr("Microsoft Monitoring Insights"), // Resource: to.Ptr("Alert Rules"), // }, // }, // { // Name: to.Ptr("Microsoft.Insights/AlertRules/Throttled/Action"), // Display: &armmonitor.OperationDisplay{ // Operation: to.Ptr("Alert Rule throttled"), // Provider: to.Ptr("Microsoft Monitoring Insights"), // Resource: to.Ptr("Alert Rules"), // }, // }, // { // Name: to.Ptr("Microsoft.Insights/Register/Action"), // Display: &armmonitor.OperationDisplay{ // Operation: to.Ptr("Register Microsoft.Insights"), // Provider: to.Ptr("Microsoft Monitoring Insights"), // Resource: to.Ptr("Microsoft.Insights"), // }, // }, // { // Name: to.Ptr("Microsoft.Insights/Components/Write"), // Display: &armmonitor.OperationDisplay{ // Operation: to.Ptr("Application insights component write"), // Provider: to.Ptr("Microsoft Monitoring Insights"), // Resource: to.Ptr("Application insights components"), // }, // }, // { // Name: to.Ptr("Microsoft.Insights/Components/Delete"), // Display: &armmonitor.OperationDisplay{ // Operation: to.Ptr("Application insights component delete"), // Provider: to.Ptr("Microsoft Monitoring Insights"), // Resource: to.Ptr("Application insights components"), // }, // }, // { // Name: to.Ptr("Microsoft.Insights/Components/Read"), // Display: &armmonitor.OperationDisplay{ // Operation: to.Ptr("Application insights component read"), // Provider: to.Ptr("Microsoft Monitoring Insights"), // Resource: to.Ptr("Application insights components"), // }, // }, // { // Name: to.Ptr("Microsoft.Insights/Webtests/Write"), // Display: &armmonitor.OperationDisplay{ // Operation: to.Ptr("Webtest write"), // Provider: to.Ptr("Microsoft Monitoring Insights"), // Resource: to.Ptr("Web tests"), // }, // }, // { // Name: to.Ptr("Microsoft.Insights/Webtests/Delete"), // Display: &armmonitor.OperationDisplay{ // Operation: to.Ptr("Webtest delete"), // Provider: to.Ptr("Microsoft Monitoring Insights"), // Resource: to.Ptr("Web tests"), // }, // }, // { // Name: to.Ptr("Microsoft.Insights/Workbooks/Read"), // Display: &armmonitor.OperationDisplay{ // Operation: to.Ptr("Workbooks read"), // Provider: to.Ptr("Microsoft Application Insights"), // Resource: to.Ptr("Workbooks"), // }, // }, // { // Name: to.Ptr("Microsoft.Insights/Workbooks/Write"), // Display: &armmonitor.OperationDisplay{ // Operation: to.Ptr("Workbooks write"), // Provider: to.Ptr("Microsoft Application Insights"), // Resource: to.Ptr("Workbooks"), // }, // }, // { // Name: to.Ptr("Microsoft.Insights/Workbooks/Delete"), // Display: &armmonitor.OperationDisplay{ // Operation: to.Ptr("Workbooks delete"), // Provider: to.Ptr("Microsoft Application Insights"), // Resource: to.Ptr("Workbooks"), // }, // }, // { // Name: to.Ptr("Microsoft.Insights/Workbooks/Read"), // Display: &armmonitor.OperationDisplay{ // Operation: to.Ptr("Workbooks read"), // Provider: to.Ptr("Microsoft Application Insights"), // Resource: to.Ptr("Workbooks"), // }, // }}, // } }
Output:
type OperationsClientListOptions ¶ added in v0.4.0
type OperationsClientListOptions struct { }
OperationsClientListOptions contains the optional parameters for the OperationsClient.List method.
type OperationsClientListResponse ¶ added in v0.4.0
type OperationsClientListResponse struct { // Result of the request to list Microsoft.Insights operations. It contains a list of operations and a URL link to get the // next set of results. OperationListResult }
OperationsClientListResponse contains the response from method OperationsClient.List.
type OperationsForMonitorClient ¶ added in v0.9.0
type OperationsForMonitorClient struct {
// contains filtered or unexported fields
}
OperationsForMonitorClient contains the methods for the OperationsForMonitor group. Don't use this type directly, use NewOperationsForMonitorClient() instead.
func NewOperationsForMonitorClient ¶ added in v0.9.0
func NewOperationsForMonitorClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*OperationsForMonitorClient, error)
NewOperationsForMonitorClient creates a new instance of OperationsForMonitorClient with the specified values.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - pass nil to accept the default values.
func (*OperationsForMonitorClient) NewListPager ¶ added in v0.9.0
func (client *OperationsForMonitorClient) NewListPager(options *OperationsForMonitorClientListOptions) *runtime.Pager[OperationsForMonitorClientListResponse]
NewListPager - Lists available Operations for this Resource Provider
Generated from API version 2021-06-03-preview
- options - OperationsForMonitorClientListOptions contains the optional parameters for the OperationsForMonitorClient.NewListPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Monitor/preview/2021-06-03-preview/examples/OperationsGet.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewOperationsForMonitorClient().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.OperationListResultAutoGenerated = armmonitor.OperationListResultAutoGenerated{ // Value: []*armmonitor.OperationAutoGenerated{ // { // Name: to.Ptr("microsoft.monitor/accounts/read"), // Display: &armmonitor.OperationDisplayAutoGenerated{ // Description: to.Ptr("Read any Azure Monitor Workspace"), // Operation: to.Ptr("Read Azure Monitor Workspaces"), // Provider: to.Ptr("Microsoft Monitoring"), // Resource: to.Ptr("Azure Monitor Workspaces"), // }, // IsDataAction: to.Ptr(false), // Origin: to.Ptr(armmonitor.Origin("user, system")), // }, // { // Name: to.Ptr("microsoft.monitor/accounts/write"), // Display: &armmonitor.OperationDisplayAutoGenerated{ // Description: to.Ptr("Create or Update any Azure Monitor Workspace"), // Operation: to.Ptr("Create or Update Azure Monitor Workspaces"), // Provider: to.Ptr("Microsoft Monitoring"), // Resource: to.Ptr("Azure Monitor Workspaces"), // }, // IsDataAction: to.Ptr(false), // Origin: to.Ptr(armmonitor.Origin("user, system")), // }, // { // Name: to.Ptr("microsoft.monitor/accounts/delete"), // Display: &armmonitor.OperationDisplayAutoGenerated{ // Description: to.Ptr("Delete any Azure Monitor Workspace"), // Operation: to.Ptr("Delete Azure Monitor Workspaces"), // Provider: to.Ptr("Microsoft Monitoring"), // Resource: to.Ptr("Azure Monitor Workspaces"), // }, // IsDataAction: to.Ptr(false), // Origin: to.Ptr(armmonitor.Origin("user, system")), // }, // { // Name: to.Ptr("microsoft.monitor/accounts/metrics/read"), // Display: &armmonitor.OperationDisplayAutoGenerated{ // Description: to.Ptr("Read Azure Monitor Workspace metrics"), // Operation: to.Ptr("Read Azure Monitor Workspace metrics"), // Provider: to.Ptr("Microsoft Monitoring"), // Resource: to.Ptr("Azure Monitor Workspaces"), // }, // IsDataAction: to.Ptr(false), // Origin: to.Ptr(armmonitor.Origin("user, system")), // }, // { // Name: to.Ptr("microsoft.monitor/accounts/data/metrics/read"), // Display: &armmonitor.OperationDisplayAutoGenerated{ // Description: to.Ptr("Read metrics data in any Azure Monitor Workspace"), // Operation: to.Ptr("Read Metrics Data"), // Provider: to.Ptr("Microsoft Monitoring"), // Resource: to.Ptr("Azure Monitor Workspaces"), // }, // IsDataAction: to.Ptr(true), // Origin: to.Ptr(armmonitor.Origin("user, system")), // }}, // } } }
Output:
type OperationsForMonitorClientListOptions ¶ added in v0.9.0
type OperationsForMonitorClientListOptions struct { }
OperationsForMonitorClientListOptions contains the optional parameters for the OperationsForMonitorClient.NewListPager method.
type OperationsForMonitorClientListResponse ¶ added in v0.9.0
type OperationsForMonitorClientListResponse 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. OperationListResultAutoGenerated }
OperationsForMonitorClientListResponse contains the response from method OperationsForMonitorClient.NewListPager.
type Operator ¶
type Operator string
Operator - the criteria operator.
func PossibleOperatorValues ¶
func PossibleOperatorValues() []Operator
PossibleOperatorValues returns the possible values for the Operator const type.
type Origin ¶ added in v0.9.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"
func PossibleOriginValues ¶ added in v0.9.0
func PossibleOriginValues() []Origin
PossibleOriginValues returns the possible values for the Origin const type.
type PerfCounterDataSource ¶
type PerfCounterDataSource struct { // A list of specifier names of the performance counters you want to collect. Use a wildcard (*) to collect a counter for // all instances. To get a list of performance counters on Windows, run the command // 'typeperf'. CounterSpecifiers []*string // A friendly name for the data source. This name should be unique across all data sources (regardless of type) within the // data collection rule. Name *string // The number of seconds between consecutive counter measurements (samples). SamplingFrequencyInSeconds *int32 // List of streams that this data source will be sent to. A stream indicates what schema will be used for this data and usually // what table in Log Analytics the data will be sent to. Streams []*KnownPerfCounterDataSourceStreams }
PerfCounterDataSource - Definition of which performance counters will be collected and how they will be collected by this data collection rule. Collected from both Windows and Linux machines where the counter is present.
func (PerfCounterDataSource) MarshalJSON ¶
func (p PerfCounterDataSource) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type PerfCounterDataSource.
func (*PerfCounterDataSource) UnmarshalJSON ¶ added in v0.8.0
func (p *PerfCounterDataSource) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type PerfCounterDataSource.
type PlatformTelemetryDataSource ¶ added in v0.9.0
type PlatformTelemetryDataSource struct { // REQUIRED; List of platform telemetry streams to collect Streams []*string // A friendly name for the data source. This name should be unique across all data sources (regardless of type) within the // data collection rule. Name *string }
PlatformTelemetryDataSource - Definition of platform telemetry data source configuration
func (PlatformTelemetryDataSource) MarshalJSON ¶ added in v0.9.0
func (p PlatformTelemetryDataSource) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type PlatformTelemetryDataSource.
func (*PlatformTelemetryDataSource) UnmarshalJSON ¶ added in v0.9.0
func (p *PlatformTelemetryDataSource) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type PlatformTelemetryDataSource.
type PredictiveAutoscalePolicy ¶ added in v0.8.0
type PredictiveAutoscalePolicy struct { // REQUIRED; the predictive autoscale mode ScaleMode *PredictiveAutoscalePolicyScaleMode // the amount of time to specify by which instances are launched in advance. It must be between 1 minute and 60 minutes in // ISO 8601 format. ScaleLookAheadTime *string }
PredictiveAutoscalePolicy - The parameters for enabling predictive autoscale.
func (PredictiveAutoscalePolicy) MarshalJSON ¶ added in v0.8.0
func (p PredictiveAutoscalePolicy) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type PredictiveAutoscalePolicy.
func (*PredictiveAutoscalePolicy) UnmarshalJSON ¶ added in v0.8.0
func (p *PredictiveAutoscalePolicy) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type PredictiveAutoscalePolicy.
type PredictiveAutoscalePolicyScaleMode ¶ added in v0.8.0
type PredictiveAutoscalePolicyScaleMode string
PredictiveAutoscalePolicyScaleMode - the predictive autoscale mode
const ( PredictiveAutoscalePolicyScaleModeDisabled PredictiveAutoscalePolicyScaleMode = "Disabled" PredictiveAutoscalePolicyScaleModeEnabled PredictiveAutoscalePolicyScaleMode = "Enabled" PredictiveAutoscalePolicyScaleModeForecastOnly PredictiveAutoscalePolicyScaleMode = "ForecastOnly" )
func PossiblePredictiveAutoscalePolicyScaleModeValues ¶ added in v0.8.0
func PossiblePredictiveAutoscalePolicyScaleModeValues() []PredictiveAutoscalePolicyScaleMode
PossiblePredictiveAutoscalePolicyScaleModeValues returns the possible values for the PredictiveAutoscalePolicyScaleMode const type.
type PredictiveMetricClient ¶ added in v0.8.0
type PredictiveMetricClient struct {
// contains filtered or unexported fields
}
PredictiveMetricClient contains the methods for the PredictiveMetric group. Don't use this type directly, use NewPredictiveMetricClient() instead.
func NewPredictiveMetricClient ¶ added in v0.8.0
func NewPredictiveMetricClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PredictiveMetricClient, error)
NewPredictiveMetricClient creates a new instance of PredictiveMetricClient with the specified values.
- subscriptionID - The ID of the target subscription.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - pass nil to accept the default values.
func (*PredictiveMetricClient) Get ¶ added in v0.8.0
func (client *PredictiveMetricClient) Get(ctx context.Context, resourceGroupName string, autoscaleSettingName string, timespan string, interval string, metricNamespace string, metricName string, aggregation string, options *PredictiveMetricClientGetOptions) (PredictiveMetricClientGetResponse, error)
Get - get predictive autoscale metric future data If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2022-10-01
- resourceGroupName - The name of the resource group. The name is case insensitive.
- autoscaleSettingName - The autoscale setting name.
- timespan - The timespan of the query. It is a string with the following format 'startDateTimeISO/endDateTimeISO'.
- interval - The interval (i.e. timegrain) of the query.
- metricNamespace - Metric namespace to query metric definitions for.
- metricName - The names of the metrics (comma separated) to retrieve. Special case: If a metricname itself has a comma in it then use %2 to indicate it. Eg: 'Metric,Name1' should be 'Metric%2Name1'
- aggregation - The list of aggregation types (comma separated) to retrieve.
- options - PredictiveMetricClientGetOptions contains the optional parameters for the PredictiveMetricClient.Get method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Insights/stable/2022-10-01/examples/GetPredictiveMetric.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewPredictiveMetricClient().Get(ctx, "myRG", "vmss1-Autoscale-775", "2021-10-14T22:00:00.000Z/2021-10-16T22:00:00.000Z", "PT1H", "Microsoft.Compute/virtualMachineScaleSets", "PercentageCPU", "Total", 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.PredictiveResponse = armmonitor.PredictiveResponse{ // Data: []*armmonitor.PredictiveValue{ // { // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-10-14T22:00:00.000Z"); return t}()), // Value: to.Ptr[float64](123), // }, // { // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-10-14T22:02:00.000Z"); return t}()), // Value: to.Ptr[float64](120), // }, // { // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-10-14T22:02:00.000Z"); return t}()), // Value: to.Ptr[float64](88), // }, // { // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-10-14T22:03:00.000Z"); return t}()), // Value: to.Ptr[float64](100), // }}, // Interval: to.Ptr("PT1H"), // MetricName: to.Ptr("PercentageCPU"), // TargetResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myRG/providers/Microsoft.Compute/virtualMachineScaleSets/vmss1"), // Timespan: to.Ptr("2021-10-14T22:00:00.000Z/2021-10-16T22:00:00.000Z"), // } }
Output:
type PredictiveMetricClientGetOptions ¶ added in v0.8.0
type PredictiveMetricClientGetOptions struct { }
PredictiveMetricClientGetOptions contains the optional parameters for the PredictiveMetricClient.Get method.
type PredictiveMetricClientGetResponse ¶ added in v0.8.0
type PredictiveMetricClientGetResponse struct { // The response to a metrics query. PredictiveResponse }
PredictiveMetricClientGetResponse contains the response from method PredictiveMetricClient.Get.
type PredictiveResponse ¶ added in v0.8.0
type PredictiveResponse struct { // the value of the collection. Data []*PredictiveValue // The interval (window size) for which the metric data was returned in. This may be adjusted in the future and returned back // from what was originally requested. This is not present if a metadata request // was made. Interval *string // The metrics being queried MetricName *string // resource of the predictive metric. TargetResourceID *string // The timespan for which the data was retrieved. Its value consists of two datetimes concatenated, separated by '/'. This // may be adjusted in the future and returned back from what was originally // requested. Timespan *string }
PredictiveResponse - The response to a metrics query.
func (PredictiveResponse) MarshalJSON ¶ added in v0.8.0
func (p PredictiveResponse) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type PredictiveResponse.
func (*PredictiveResponse) UnmarshalJSON ¶ added in v0.8.0
func (p *PredictiveResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type PredictiveResponse.
type PredictiveValue ¶ added in v0.8.0
type PredictiveValue struct { // REQUIRED; the timestamp for the metric value in ISO 8601 format. TimeStamp *time.Time // REQUIRED; Predictive value in this time bucket. Value *float64 }
PredictiveValue - Represents a predictive metric value in the given bucket.
func (PredictiveValue) MarshalJSON ¶ added in v0.8.0
func (p PredictiveValue) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type PredictiveValue.
func (*PredictiveValue) UnmarshalJSON ¶ added in v0.8.0
func (p *PredictiveValue) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type PredictiveValue.
type PrivateEndpoint ¶ added in v0.8.0
type PrivateEndpoint struct { // READ-ONLY; The ARM identifier for Private Endpoint ID *string }
PrivateEndpoint - The Private Endpoint resource.
func (PrivateEndpoint) MarshalJSON ¶ added in v0.8.0
func (p PrivateEndpoint) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type PrivateEndpoint.
func (*PrivateEndpoint) UnmarshalJSON ¶ added in v0.8.0
func (p *PrivateEndpoint) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpoint.
type PrivateEndpointConnection ¶
type PrivateEndpointConnection struct { // Resource properties. Properties *PrivateEndpointConnectionProperties // 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; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string }
PrivateEndpointConnection - The Private Endpoint Connection resource.
func (PrivateEndpointConnection) MarshalJSON ¶ added in v0.8.0
func (p PrivateEndpointConnection) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnection.
func (*PrivateEndpointConnection) UnmarshalJSON ¶ added in v0.8.0
func (p *PrivateEndpointConnection) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnection.
type PrivateEndpointConnectionListResult ¶
type PrivateEndpointConnectionListResult struct { // Array of private endpoint connections Value []*PrivateEndpointConnection }
PrivateEndpointConnectionListResult - List of private endpoint connection associated with the specified storage account
func (PrivateEndpointConnectionListResult) MarshalJSON ¶
func (p PrivateEndpointConnectionListResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnectionListResult.
func (*PrivateEndpointConnectionListResult) UnmarshalJSON ¶ added in v0.8.0
func (p *PrivateEndpointConnectionListResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnectionListResult.
type PrivateEndpointConnectionProperties ¶
type PrivateEndpointConnectionProperties struct { // REQUIRED; A collection of information about the state of the connection between service consumer and provider. PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState // The resource of private end point. PrivateEndpoint *PrivateEndpoint // READ-ONLY; The provisioning state of the private endpoint connection resource. ProvisioningState *PrivateEndpointConnectionProvisioningState }
PrivateEndpointConnectionProperties - Properties of the PrivateEndpointConnectProperties.
func (PrivateEndpointConnectionProperties) MarshalJSON ¶ added in v0.8.0
func (p PrivateEndpointConnectionProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnectionProperties.
func (*PrivateEndpointConnectionProperties) UnmarshalJSON ¶ added in v0.8.0
func (p *PrivateEndpointConnectionProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnectionProperties.
type PrivateEndpointConnectionProvisioningState ¶ added in v0.8.0
type PrivateEndpointConnectionProvisioningState string
PrivateEndpointConnectionProvisioningState - The current provisioning state.
const ( PrivateEndpointConnectionProvisioningStateCreating PrivateEndpointConnectionProvisioningState = "Creating" PrivateEndpointConnectionProvisioningStateDeleting PrivateEndpointConnectionProvisioningState = "Deleting" PrivateEndpointConnectionProvisioningStateFailed PrivateEndpointConnectionProvisioningState = "Failed" PrivateEndpointConnectionProvisioningStateSucceeded PrivateEndpointConnectionProvisioningState = "Succeeded" )
func PossiblePrivateEndpointConnectionProvisioningStateValues ¶ added in v0.8.0
func PossiblePrivateEndpointConnectionProvisioningStateValues() []PrivateEndpointConnectionProvisioningState
PossiblePrivateEndpointConnectionProvisioningStateValues returns the possible values for the PrivateEndpointConnectionProvisioningState const type.
type PrivateEndpointConnectionsClient ¶
type PrivateEndpointConnectionsClient struct {
// contains filtered or unexported fields
}
PrivateEndpointConnectionsClient contains the methods for the PrivateEndpointConnections group. Don't use this type directly, use NewPrivateEndpointConnectionsClient() instead.
func NewPrivateEndpointConnectionsClient ¶
func NewPrivateEndpointConnectionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PrivateEndpointConnectionsClient, error)
NewPrivateEndpointConnectionsClient creates a new instance of PrivateEndpointConnectionsClient with the specified values.
- subscriptionID - The ID of the target subscription.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - pass nil to accept the default values.
func (*PrivateEndpointConnectionsClient) BeginCreateOrUpdate ¶
func (client *PrivateEndpointConnectionsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, scopeName string, privateEndpointConnectionName string, parameters PrivateEndpointConnection, options *PrivateEndpointConnectionsClientBeginCreateOrUpdateOptions) (*runtime.Poller[PrivateEndpointConnectionsClientCreateOrUpdateResponse], error)
BeginCreateOrUpdate - Approve or reject a private endpoint connection with a given name. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2021-07-01-preview
- resourceGroupName - The name of the resource group. The name is case insensitive.
- scopeName - The name of the Azure Monitor PrivateLinkScope resource.
- privateEndpointConnectionName - The name of the private endpoint connection.
- options - PrivateEndpointConnectionsClientBeginCreateOrUpdateOptions contains the optional parameters for the PrivateEndpointConnectionsClient.BeginCreateOrUpdate method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateEndpointConnectionUpdate.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewPrivateEndpointConnectionsClient().BeginCreateOrUpdate(ctx, "MyResourceGroup", "MyPrivateLinkScope", "private-endpoint-connection-name", armmonitor.PrivateEndpointConnection{ Properties: &armmonitor.PrivateEndpointConnectionProperties{ PrivateLinkServiceConnectionState: &armmonitor.PrivateLinkServiceConnectionState{ Description: to.Ptr("Approved by johndoe@contoso.com"), Status: to.Ptr(armmonitor.PrivateEndpointServiceConnectionStatusApproved), }, }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %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.PrivateEndpointConnection = armmonitor.PrivateEndpointConnection{ // Name: to.Ptr("private-endpoint-connection-name"), // Type: to.Ptr("Microsoft.Insights/privateLinkScopes/privateEndpointConnections"), // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/MyResourceGroup/providers/Microsoft.Insights/privateLinkScopes/MyPrivateLinkScope/privateEndpointConnections/private-endpoint-connection-name"), // Properties: &armmonitor.PrivateEndpointConnectionProperties{ // PrivateEndpoint: &armmonitor.PrivateEndpoint{ // ID: to.Ptr("/subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-Network/providers/Microsoft.Network/privateEndpoints/private-endpoint-name"), // }, // PrivateLinkServiceConnectionState: &armmonitor.PrivateLinkServiceConnectionState{ // Description: to.Ptr("Approved by johndoe@contoso.com"), // ActionsRequired: to.Ptr("None"), // Status: to.Ptr(armmonitor.PrivateEndpointServiceConnectionStatusApproved), // }, // ProvisioningState: to.Ptr(armmonitor.PrivateEndpointConnectionProvisioningStateSucceeded), // }, // } }
Output:
func (*PrivateEndpointConnectionsClient) BeginDelete ¶
func (client *PrivateEndpointConnectionsClient) BeginDelete(ctx context.Context, resourceGroupName string, scopeName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientBeginDeleteOptions) (*runtime.Poller[PrivateEndpointConnectionsClientDeleteResponse], error)
BeginDelete - Deletes a private endpoint connection with a given name. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2021-07-01-preview
- resourceGroupName - The name of the resource group. The name is case insensitive.
- scopeName - The name of the Azure Monitor PrivateLinkScope resource.
- privateEndpointConnectionName - The name of the private endpoint connection.
- options - PrivateEndpointConnectionsClientBeginDeleteOptions contains the optional parameters for the PrivateEndpointConnectionsClient.BeginDelete method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateEndpointConnectionDelete.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewPrivateEndpointConnectionsClient().BeginDelete(ctx, "MyResourceGroup", "MyPrivateLinkScope", "private-endpoint-connection-name", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } }
Output:
func (*PrivateEndpointConnectionsClient) Get ¶
func (client *PrivateEndpointConnectionsClient) Get(ctx context.Context, resourceGroupName string, scopeName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientGetOptions) (PrivateEndpointConnectionsClientGetResponse, error)
Get - Gets a private endpoint connection. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2021-07-01-preview
- resourceGroupName - The name of the resource group. The name is case insensitive.
- scopeName - The name of the Azure Monitor PrivateLinkScope resource.
- privateEndpointConnectionName - The name of the private endpoint connection.
- options - PrivateEndpointConnectionsClientGetOptions contains the optional parameters for the PrivateEndpointConnectionsClient.Get method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateEndpointConnectionGet.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewPrivateEndpointConnectionsClient().Get(ctx, "MyResourceGroup", "MyPrivateLinkScope", "private-endpoint-connection-name", 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.PrivateEndpointConnection = armmonitor.PrivateEndpointConnection{ // Name: to.Ptr("private-endpoint-connection-name"), // Type: to.Ptr("Microsoft.Insights/privateLinkScopes/privateEndpointConnections"), // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/MyResourceGroup/providers/Microsoft.Insights/privateLinkScopes/MyPrivateLinkScope/privateEndpointConnections/private-endpoint-connection-name"), // Properties: &armmonitor.PrivateEndpointConnectionProperties{ // PrivateEndpoint: &armmonitor.PrivateEndpoint{ // ID: to.Ptr("/subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-Network/providers/Microsoft.Network/privateEndpoints/private-endpoint-name"), // }, // PrivateLinkServiceConnectionState: &armmonitor.PrivateLinkServiceConnectionState{ // Description: to.Ptr("Auto-approved"), // ActionsRequired: to.Ptr("None"), // Status: to.Ptr(armmonitor.PrivateEndpointServiceConnectionStatusApproved), // }, // ProvisioningState: to.Ptr(armmonitor.PrivateEndpointConnectionProvisioningStateSucceeded), // }, // } }
Output:
func (*PrivateEndpointConnectionsClient) ListByPrivateLinkScope ¶
func (client *PrivateEndpointConnectionsClient) ListByPrivateLinkScope(ctx context.Context, resourceGroupName string, scopeName string, options *PrivateEndpointConnectionsClientListByPrivateLinkScopeOptions) (PrivateEndpointConnectionsClientListByPrivateLinkScopeResponse, error)
ListByPrivateLinkScope - Gets all private endpoint connections on a private link scope. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2021-07-01-preview
- resourceGroupName - The name of the resource group. The name is case insensitive.
- scopeName - The name of the Azure Monitor PrivateLinkScope resource.
- options - PrivateEndpointConnectionsClientListByPrivateLinkScopeOptions contains the optional parameters for the PrivateEndpointConnectionsClient.ListByPrivateLinkScope method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateEndpointConnectionList.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewPrivateEndpointConnectionsClient().ListByPrivateLinkScope(ctx, "MyResourceGroup", "MyPrivateLinkScope", 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.PrivateEndpointConnectionListResult = armmonitor.PrivateEndpointConnectionListResult{ // Value: []*armmonitor.PrivateEndpointConnection{ // { // Name: to.Ptr("private-endpoint-connection-name"), // Type: to.Ptr("Microsoft.Insights/privateLinkScopes/privateEndpointConnections"), // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/MyResourceGroup/providers/Microsoft.Insights/privateLinkScopes/MyPrivateLinkScope/privateEndpointConnections/private-endpoint-connection-name-2"), // Properties: &armmonitor.PrivateEndpointConnectionProperties{ // PrivateEndpoint: &armmonitor.PrivateEndpoint{ // ID: to.Ptr("/subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-Network/providers/Microsoft.Network/privateEndpoints/private-endpoint-name"), // }, // PrivateLinkServiceConnectionState: &armmonitor.PrivateLinkServiceConnectionState{ // Description: to.Ptr("Auto-approved"), // ActionsRequired: to.Ptr("None"), // Status: to.Ptr(armmonitor.PrivateEndpointServiceConnectionStatusApproved), // }, // ProvisioningState: to.Ptr(armmonitor.PrivateEndpointConnectionProvisioningStateSucceeded), // }, // }, // { // Name: to.Ptr("private-endpoint-connection-name-2"), // Type: to.Ptr("Microsoft.Insights/privateLinkScopes/privateEndpointConnections"), // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/MyResourceGroup/providers/Microsoft.Insights/privateLinkScopes/MyPrivateLinkScope/privateEndpointConnections/private-endpoint-connection-name-2"), // Properties: &armmonitor.PrivateEndpointConnectionProperties{ // PrivateEndpoint: &armmonitor.PrivateEndpoint{ // ID: to.Ptr("/subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-Network/providers/Microsoft.Network/privateEndpoints/private-endpoint-name-2"), // }, // PrivateLinkServiceConnectionState: &armmonitor.PrivateLinkServiceConnectionState{ // Description: to.Ptr("Please approve my connection."), // ActionsRequired: to.Ptr("None"), // Status: to.Ptr(armmonitor.PrivateEndpointServiceConnectionStatusPending), // }, // ProvisioningState: to.Ptr(armmonitor.PrivateEndpointConnectionProvisioningStateSucceeded), // }, // }}, // } }
Output:
type PrivateEndpointConnectionsClientBeginCreateOrUpdateOptions ¶ added in v0.4.0
type PrivateEndpointConnectionsClientBeginCreateOrUpdateOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
PrivateEndpointConnectionsClientBeginCreateOrUpdateOptions contains the optional parameters for the PrivateEndpointConnectionsClient.BeginCreateOrUpdate method.
type PrivateEndpointConnectionsClientBeginDeleteOptions ¶ added in v0.4.0
type PrivateEndpointConnectionsClientBeginDeleteOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
PrivateEndpointConnectionsClientBeginDeleteOptions contains the optional parameters for the PrivateEndpointConnectionsClient.BeginDelete method.
type PrivateEndpointConnectionsClientCreateOrUpdateResponse ¶ added in v0.4.0
type PrivateEndpointConnectionsClientCreateOrUpdateResponse struct { // The Private Endpoint Connection resource. PrivateEndpointConnection }
PrivateEndpointConnectionsClientCreateOrUpdateResponse contains the response from method PrivateEndpointConnectionsClient.BeginCreateOrUpdate.
type PrivateEndpointConnectionsClientDeleteResponse ¶ added in v0.4.0
type PrivateEndpointConnectionsClientDeleteResponse struct { }
PrivateEndpointConnectionsClientDeleteResponse contains the response from method PrivateEndpointConnectionsClient.BeginDelete.
type PrivateEndpointConnectionsClientGetOptions ¶ added in v0.4.0
type PrivateEndpointConnectionsClientGetOptions struct { }
PrivateEndpointConnectionsClientGetOptions contains the optional parameters for the PrivateEndpointConnectionsClient.Get method.
type PrivateEndpointConnectionsClientGetResponse ¶ added in v0.4.0
type PrivateEndpointConnectionsClientGetResponse struct { // The Private Endpoint Connection resource. PrivateEndpointConnection }
PrivateEndpointConnectionsClientGetResponse contains the response from method PrivateEndpointConnectionsClient.Get.
type PrivateEndpointConnectionsClientListByPrivateLinkScopeOptions ¶ added in v0.4.0
type PrivateEndpointConnectionsClientListByPrivateLinkScopeOptions struct { }
PrivateEndpointConnectionsClientListByPrivateLinkScopeOptions contains the optional parameters for the PrivateEndpointConnectionsClient.ListByPrivateLinkScope method.
type PrivateEndpointConnectionsClientListByPrivateLinkScopeResponse ¶ added in v0.4.0
type PrivateEndpointConnectionsClientListByPrivateLinkScopeResponse struct { // List of private endpoint connection associated with the specified storage account PrivateEndpointConnectionListResult }
PrivateEndpointConnectionsClientListByPrivateLinkScopeResponse contains the response from method PrivateEndpointConnectionsClient.ListByPrivateLinkScope.
type PrivateEndpointServiceConnectionStatus ¶ added in v0.8.0
type PrivateEndpointServiceConnectionStatus string
PrivateEndpointServiceConnectionStatus - The private endpoint connection status.
const ( PrivateEndpointServiceConnectionStatusApproved PrivateEndpointServiceConnectionStatus = "Approved" PrivateEndpointServiceConnectionStatusPending PrivateEndpointServiceConnectionStatus = "Pending" PrivateEndpointServiceConnectionStatusRejected PrivateEndpointServiceConnectionStatus = "Rejected" )
func PossiblePrivateEndpointServiceConnectionStatusValues ¶ added in v0.8.0
func PossiblePrivateEndpointServiceConnectionStatusValues() []PrivateEndpointServiceConnectionStatus
PossiblePrivateEndpointServiceConnectionStatusValues returns the possible values for the PrivateEndpointServiceConnectionStatus const type.
type PrivateLinkResource ¶
type PrivateLinkResource struct { // Resource properties. Properties *PrivateLinkResourceProperties // 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; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string }
PrivateLinkResource - A private link resource
func (PrivateLinkResource) MarshalJSON ¶ added in v0.8.0
func (p PrivateLinkResource) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type PrivateLinkResource.
func (*PrivateLinkResource) UnmarshalJSON ¶ added in v0.8.0
func (p *PrivateLinkResource) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkResource.
type PrivateLinkResourceListResult ¶
type PrivateLinkResourceListResult struct { // Array of private link resources Value []*PrivateLinkResource }
PrivateLinkResourceListResult - A list of private link resources
func (PrivateLinkResourceListResult) MarshalJSON ¶
func (p PrivateLinkResourceListResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type PrivateLinkResourceListResult.
func (*PrivateLinkResourceListResult) UnmarshalJSON ¶ added in v0.8.0
func (p *PrivateLinkResourceListResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkResourceListResult.
type PrivateLinkResourceProperties ¶
type PrivateLinkResourceProperties struct { // The private link resource Private link DNS zone name. RequiredZoneNames []*string // READ-ONLY; The private link resource group id. GroupID *string // READ-ONLY; The private link resource required member names. RequiredMembers []*string }
PrivateLinkResourceProperties - Properties of a private link resource.
func (PrivateLinkResourceProperties) MarshalJSON ¶
func (p PrivateLinkResourceProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type PrivateLinkResourceProperties.
func (*PrivateLinkResourceProperties) UnmarshalJSON ¶ added in v0.8.0
func (p *PrivateLinkResourceProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkResourceProperties.
type PrivateLinkResourcesClient ¶
type PrivateLinkResourcesClient struct {
// contains filtered or unexported fields
}
PrivateLinkResourcesClient contains the methods for the PrivateLinkResources group. Don't use this type directly, use NewPrivateLinkResourcesClient() instead.
func NewPrivateLinkResourcesClient ¶
func NewPrivateLinkResourcesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PrivateLinkResourcesClient, error)
NewPrivateLinkResourcesClient creates a new instance of PrivateLinkResourcesClient with the specified values.
- subscriptionID - The ID of the target subscription.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - pass nil to accept the default values.
func (*PrivateLinkResourcesClient) Get ¶
func (client *PrivateLinkResourcesClient) Get(ctx context.Context, resourceGroupName string, scopeName string, groupName string, options *PrivateLinkResourcesClientGetOptions) (PrivateLinkResourcesClientGetResponse, error)
Get - Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2021-07-01-preview
- resourceGroupName - The name of the resource group. The name is case insensitive.
- scopeName - The name of the Azure Monitor PrivateLinkScope resource.
- groupName - The name of the private link resource.
- options - PrivateLinkResourcesClientGetOptions contains the optional parameters for the PrivateLinkResourcesClient.Get method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateLinkScopePrivateLinkResourceGet.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewPrivateLinkResourcesClient().Get(ctx, "MyResourceGroup", "MyPrivateLinkScope", "azuremonitor", 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.PrivateLinkResource = armmonitor.PrivateLinkResource{ // Name: to.Ptr("azuremonitor"), // Type: to.Ptr("Microsoft.Insights/privateLinkScopes/privateLinkResources"), // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/MyResourceGroup/providers/Microsoft.Insights/privateLinkScopes/MyPrivateLinkScope/privateLinkResources/azuremonitor"), // Properties: &armmonitor.PrivateLinkResourceProperties{ // GroupID: to.Ptr("azuremonitor"), // RequiredMembers: []*string{ // to.Ptr("api"), // to.Ptr("global.in.ai"), // to.Ptr("profiler"), // to.Ptr("live"), // to.Ptr("snapshot"), // to.Ptr("agentsolutionpackstore"), // to.Ptr("dce-global")}, // RequiredZoneNames: []*string{ // to.Ptr("privatelink.monitor.azure.com"), // to.Ptr("privatelink.oms.opinsights.azure.com"), // to.Ptr("privatelink.ods.opinsights.azure.com"), // to.Ptr("privatelink.agentsvc.azure-automation.net"), // to.Ptr("privatelink.blob.core.windows.net")}, // }, // } }
Output:
func (*PrivateLinkResourcesClient) ListByPrivateLinkScope ¶
func (client *PrivateLinkResourcesClient) ListByPrivateLinkScope(ctx context.Context, resourceGroupName string, scopeName string, options *PrivateLinkResourcesClientListByPrivateLinkScopeOptions) (PrivateLinkResourcesClientListByPrivateLinkScopeResponse, error)
ListByPrivateLinkScope - Gets the private link resources that need to be created for a Azure Monitor PrivateLinkScope. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2021-07-01-preview
- resourceGroupName - The name of the resource group. The name is case insensitive.
- scopeName - The name of the Azure Monitor PrivateLinkScope resource.
- options - PrivateLinkResourcesClientListByPrivateLinkScopeOptions contains the optional parameters for the PrivateLinkResourcesClient.ListByPrivateLinkScope method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateLinkScopePrivateLinkResourceListGet.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewPrivateLinkResourcesClient().ListByPrivateLinkScope(ctx, "MyResourceGroup", "MyPrivateLinkScope", 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.PrivateLinkResourceListResult = armmonitor.PrivateLinkResourceListResult{ // Value: []*armmonitor.PrivateLinkResource{ // { // Name: to.Ptr("azuremonitor"), // Type: to.Ptr("Microsoft.Insights/privateLinkScopes/privateLinkResources"), // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/MyResourceGroup/providers/Microsoft.Insights/privateLinkScopes/MyPrivateLinkScope/privateLinkResources/azuremonitor"), // Properties: &armmonitor.PrivateLinkResourceProperties{ // GroupID: to.Ptr("azuremonitor"), // RequiredMembers: []*string{ // to.Ptr("api"), // to.Ptr("global.in.ai"), // to.Ptr("profiler"), // to.Ptr("live"), // to.Ptr("snapshot"), // to.Ptr("agentsolutionpackstore"), // to.Ptr("dce-global")}, // RequiredZoneNames: []*string{ // to.Ptr("privatelink.monitor.azure.com"), // to.Ptr("privatelink.oms.opinsights.azure.com"), // to.Ptr("privatelink.ods.opinsights.azure.com"), // to.Ptr("privatelink.agentsvc.azure-automation.net"), // to.Ptr("privatelink.blob.core.windows.net")}, // }, // }}, // } }
Output:
type PrivateLinkResourcesClientGetOptions ¶ added in v0.4.0
type PrivateLinkResourcesClientGetOptions struct { }
PrivateLinkResourcesClientGetOptions contains the optional parameters for the PrivateLinkResourcesClient.Get method.
type PrivateLinkResourcesClientGetResponse ¶ added in v0.4.0
type PrivateLinkResourcesClientGetResponse struct { // A private link resource PrivateLinkResource }
PrivateLinkResourcesClientGetResponse contains the response from method PrivateLinkResourcesClient.Get.
type PrivateLinkResourcesClientListByPrivateLinkScopeOptions ¶ added in v0.4.0
type PrivateLinkResourcesClientListByPrivateLinkScopeOptions struct { }
PrivateLinkResourcesClientListByPrivateLinkScopeOptions contains the optional parameters for the PrivateLinkResourcesClient.ListByPrivateLinkScope method.
type PrivateLinkResourcesClientListByPrivateLinkScopeResponse ¶ added in v0.4.0
type PrivateLinkResourcesClientListByPrivateLinkScopeResponse struct { // A list of private link resources PrivateLinkResourceListResult }
PrivateLinkResourcesClientListByPrivateLinkScopeResponse contains the response from method PrivateLinkResourcesClient.ListByPrivateLinkScope.
type PrivateLinkScopeOperationStatusClient ¶
type PrivateLinkScopeOperationStatusClient struct {
// contains filtered or unexported fields
}
PrivateLinkScopeOperationStatusClient contains the methods for the PrivateLinkScopeOperationStatus group. Don't use this type directly, use NewPrivateLinkScopeOperationStatusClient() instead.
func NewPrivateLinkScopeOperationStatusClient ¶
func NewPrivateLinkScopeOperationStatusClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PrivateLinkScopeOperationStatusClient, error)
NewPrivateLinkScopeOperationStatusClient creates a new instance of PrivateLinkScopeOperationStatusClient with the specified values.
- subscriptionID - The ID of the target subscription.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - pass nil to accept the default values.
func (*PrivateLinkScopeOperationStatusClient) Get ¶
func (client *PrivateLinkScopeOperationStatusClient) Get(ctx context.Context, asyncOperationID string, resourceGroupName string, options *PrivateLinkScopeOperationStatusClientGetOptions) (PrivateLinkScopeOperationStatusClientGetResponse, error)
Get - Get the status of an azure asynchronous operation associated with a private link scope operation. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2021-07-01-preview
- asyncOperationID - The operation Id.
- resourceGroupName - The name of the resource group. The name is case insensitive.
- options - PrivateLinkScopeOperationStatusClientGetOptions contains the optional parameters for the PrivateLinkScopeOperationStatusClient.Get method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/privateLinkScopeOperationStatuses.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewPrivateLinkScopeOperationStatusClient().Get(ctx, "713192d7-503f-477a-9cfe-4efc3ee2bd11", "MyResourceGroup", 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.OperationStatus = armmonitor.OperationStatus{ // Name: to.Ptr("713192d7-503f-477a-9cfe-4efc3ee2bd11"), // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-01-01T16:13:13.933Z"); return t}()), // ID: to.Ptr("/subscriptions/613192d7-503f-477a-9cfe-4efc3ee2bd60/resourceGroups/MyResourceGroup/providers/Microsoft.Insights/privateLinkScopeOperationStatuses/713192d7-503f-477a-9cfe-4efc3ee2bd11"), // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-01-01T13:13:13.933Z"); return t}()), // Status: to.Ptr("Succeeded"), // } }
Output:
type PrivateLinkScopeOperationStatusClientGetOptions ¶ added in v0.4.0
type PrivateLinkScopeOperationStatusClientGetOptions struct { }
PrivateLinkScopeOperationStatusClientGetOptions contains the optional parameters for the PrivateLinkScopeOperationStatusClient.Get method.
type PrivateLinkScopeOperationStatusClientGetResponse ¶ added in v0.4.0
type PrivateLinkScopeOperationStatusClientGetResponse struct { // The status of operation. OperationStatus }
PrivateLinkScopeOperationStatusClientGetResponse contains the response from method PrivateLinkScopeOperationStatusClient.Get.
type PrivateLinkScopedResource ¶ added in v0.9.0
type PrivateLinkScopedResource struct { // The resourceId of the Azure Monitor Private Link Scope Scoped Resource through which this DCE is associated with a Azure // Monitor Private Link Scope. ResourceID *string // The immutableId of the Azure Monitor Private Link Scope Resource to which the association is. ScopeID *string }
func (PrivateLinkScopedResource) MarshalJSON ¶ added in v0.9.0
func (p PrivateLinkScopedResource) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type PrivateLinkScopedResource.
func (*PrivateLinkScopedResource) UnmarshalJSON ¶ added in v0.9.0
func (p *PrivateLinkScopedResource) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkScopedResource.
type PrivateLinkScopedResourcesClient ¶
type PrivateLinkScopedResourcesClient struct {
// contains filtered or unexported fields
}
PrivateLinkScopedResourcesClient contains the methods for the PrivateLinkScopedResources group. Don't use this type directly, use NewPrivateLinkScopedResourcesClient() instead.
func NewPrivateLinkScopedResourcesClient ¶
func NewPrivateLinkScopedResourcesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PrivateLinkScopedResourcesClient, error)
NewPrivateLinkScopedResourcesClient creates a new instance of PrivateLinkScopedResourcesClient with the specified values.
- subscriptionID - The ID of the target subscription.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - pass nil to accept the default values.
func (*PrivateLinkScopedResourcesClient) BeginCreateOrUpdate ¶
func (client *PrivateLinkScopedResourcesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, scopeName string, name string, parameters ScopedResource, options *PrivateLinkScopedResourcesClientBeginCreateOrUpdateOptions) (*runtime.Poller[PrivateLinkScopedResourcesClientCreateOrUpdateResponse], error)
BeginCreateOrUpdate - Approve or reject a private endpoint connection with a given name. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2021-07-01-preview
- resourceGroupName - The name of the resource group. The name is case insensitive.
- scopeName - The name of the Azure Monitor PrivateLinkScope resource.
- name - The name of the scoped resource object.
- options - PrivateLinkScopedResourcesClientBeginCreateOrUpdateOptions contains the optional parameters for the PrivateLinkScopedResourcesClient.BeginCreateOrUpdate method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateLinkScopedResourceUpdate.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewPrivateLinkScopedResourcesClient().BeginCreateOrUpdate(ctx, "MyResourceGroup", "MyPrivateLinkScope", "scoped-resource-name", armmonitor.ScopedResource{ Properties: &armmonitor.ScopedResourceProperties{ LinkedResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/MyResourceGroup/providers/Microsoft.Insights/components/my-component"), }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %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.ScopedResource = armmonitor.ScopedResource{ // Name: to.Ptr("scoped-resource-name"), // Type: to.Ptr("Microsoft.Insights/privateLinkScopes/scopedResources"), // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/MyResourceGroup/providers/Microsoft.Insights/privateLinkScopes/MyPrivateLinkScope/scopedResources/scoped-resource-name"), // Properties: &armmonitor.ScopedResourceProperties{ // LinkedResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/MyResourceGroup/providers/Microsoft.Insights/components/my-component"), // ProvisioningState: to.Ptr("Succeeded"), // }, // SystemData: &armmonitor.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-16T12:59:57.051Z"); return t}()), // CreatedBy: to.Ptr("bobby@contoso.com"), // CreatedByType: to.Ptr(armmonitor.CreatedByTypeUser), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-16T12:59:57.051Z"); return t}()), // LastModifiedBy: to.Ptr("bobby@contoso.com"), // LastModifiedByType: to.Ptr(armmonitor.CreatedByTypeUser), // }, // } }
Output:
func (*PrivateLinkScopedResourcesClient) BeginDelete ¶
func (client *PrivateLinkScopedResourcesClient) BeginDelete(ctx context.Context, resourceGroupName string, scopeName string, name string, options *PrivateLinkScopedResourcesClientBeginDeleteOptions) (*runtime.Poller[PrivateLinkScopedResourcesClientDeleteResponse], error)
BeginDelete - Deletes a private endpoint connection with a given name. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2021-07-01-preview
- resourceGroupName - The name of the resource group. The name is case insensitive.
- scopeName - The name of the Azure Monitor PrivateLinkScope resource.
- name - The name of the scoped resource object.
- options - PrivateLinkScopedResourcesClientBeginDeleteOptions contains the optional parameters for the PrivateLinkScopedResourcesClient.BeginDelete method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateLinkScopedResourceDelete.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewPrivateLinkScopedResourcesClient().BeginDelete(ctx, "MyResourceGroup", "MyPrivateLinkScope", "scoped-resource-name", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } }
Output:
func (*PrivateLinkScopedResourcesClient) Get ¶
func (client *PrivateLinkScopedResourcesClient) Get(ctx context.Context, resourceGroupName string, scopeName string, name string, options *PrivateLinkScopedResourcesClientGetOptions) (PrivateLinkScopedResourcesClientGetResponse, error)
Get - Gets a scoped resource in a private link scope. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2021-07-01-preview
- resourceGroupName - The name of the resource group. The name is case insensitive.
- scopeName - The name of the Azure Monitor PrivateLinkScope resource.
- name - The name of the scoped resource object.
- options - PrivateLinkScopedResourcesClientGetOptions contains the optional parameters for the PrivateLinkScopedResourcesClient.Get method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateLinkScopedResourceGet.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewPrivateLinkScopedResourcesClient().Get(ctx, "MyResourceGroup", "MyPrivateLinkScope", "scoped-resource-name", 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.ScopedResource = armmonitor.ScopedResource{ // Name: to.Ptr("scoped-resource-name"), // Type: to.Ptr("Microsoft.Insights/privateLinkScopes/scopedResources"), // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/MyResourceGroup/providers/Microsoft.Insights/privateLinkScopes/MyPrivateLinkScope/scopedResources/scoped-resource-name"), // Properties: &armmonitor.ScopedResourceProperties{ // LinkedResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/MyResourceGroup/providers/Microsoft.Insights/components/my-component"), // ProvisioningState: to.Ptr("Succeeded"), // }, // SystemData: &armmonitor.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-16T12:59:57.051Z"); return t}()), // CreatedBy: to.Ptr("bobby@contoso.com"), // CreatedByType: to.Ptr(armmonitor.CreatedByTypeUser), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-16T12:59:57.051Z"); return t}()), // LastModifiedBy: to.Ptr("bobby@contoso.com"), // LastModifiedByType: to.Ptr(armmonitor.CreatedByTypeUser), // }, // } }
Output:
func (*PrivateLinkScopedResourcesClient) NewListByPrivateLinkScopePager ¶ added in v0.6.0
func (client *PrivateLinkScopedResourcesClient) NewListByPrivateLinkScopePager(resourceGroupName string, scopeName string, options *PrivateLinkScopedResourcesClientListByPrivateLinkScopeOptions) *runtime.Pager[PrivateLinkScopedResourcesClientListByPrivateLinkScopeResponse]
NewListByPrivateLinkScopePager - Gets all private endpoint connections on a private link scope.
Generated from API version 2021-07-01-preview
- resourceGroupName - The name of the resource group. The name is case insensitive.
- scopeName - The name of the Azure Monitor PrivateLinkScope resource.
- options - PrivateLinkScopedResourcesClientListByPrivateLinkScopeOptions contains the optional parameters for the PrivateLinkScopedResourcesClient.NewListByPrivateLinkScopePager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateLinkScopedResourceList.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewPrivateLinkScopedResourcesClient().NewListByPrivateLinkScopePager("MyResourceGroup", "MyPrivateLinkScope", 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.ScopedResourceListResult = armmonitor.ScopedResourceListResult{ // Value: []*armmonitor.ScopedResource{ // { // Name: to.Ptr("scoped-resource-name"), // Type: to.Ptr("Microsoft.Insights/privateLinkScopes/scopedResources"), // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/MyResourceGroup/providers/Microsoft.Insights/privateLinkScopes/MyPrivateLinkScope/scopedResources/scoped-resource-name"), // Properties: &armmonitor.ScopedResourceProperties{ // LinkedResourceID: to.Ptr("/subscriptions/00000000-0000-2222-3333-444444444444/resourceGroups/MyComponentResourceGroup/providers/Microsoft.Insights/components/my-component"), // ProvisioningState: to.Ptr("Succeeded"), // }, // SystemData: &armmonitor.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-16T12:59:57.051Z"); return t}()), // CreatedBy: to.Ptr("bobby@contoso.com"), // CreatedByType: to.Ptr(armmonitor.CreatedByTypeUser), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-16T12:59:57.051Z"); return t}()), // LastModifiedBy: to.Ptr("bobby@contoso.com"), // LastModifiedByType: to.Ptr(armmonitor.CreatedByTypeUser), // }, // }, // { // Name: to.Ptr("other-scoped-resource-name"), // Type: to.Ptr("Microsoft.Insights/privateLinkScopes/scopedResources"), // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/MyResourceGroup/providers/Microsoft.Insights/privateLinkScopes/MyPrivateLinkScope/scopedResources/other-scoped-resource-name"), // Properties: &armmonitor.ScopedResourceProperties{ // LinkedResourceID: to.Ptr("/subscriptions/00000000-3333-2222-5555-444444444444/resourceGroups/MyWorkspaceResourceGroup/providers/Microsoft.OperationalInsights/workspaces/my-workspace"), // ProvisioningState: to.Ptr("Succeeded"), // }, // SystemData: &armmonitor.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-16T12:59:57.051Z"); return t}()), // CreatedBy: to.Ptr("bobby@contoso.com"), // CreatedByType: to.Ptr(armmonitor.CreatedByTypeUser), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-16T12:59:57.051Z"); return t}()), // LastModifiedBy: to.Ptr("bobby@contoso.com"), // LastModifiedByType: to.Ptr(armmonitor.CreatedByTypeUser), // }, // }}, // } } }
Output:
type PrivateLinkScopedResourcesClientBeginCreateOrUpdateOptions ¶ added in v0.4.0
type PrivateLinkScopedResourcesClientBeginCreateOrUpdateOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
PrivateLinkScopedResourcesClientBeginCreateOrUpdateOptions contains the optional parameters for the PrivateLinkScopedResourcesClient.BeginCreateOrUpdate method.
type PrivateLinkScopedResourcesClientBeginDeleteOptions ¶ added in v0.4.0
type PrivateLinkScopedResourcesClientBeginDeleteOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
PrivateLinkScopedResourcesClientBeginDeleteOptions contains the optional parameters for the PrivateLinkScopedResourcesClient.BeginDelete method.
type PrivateLinkScopedResourcesClientCreateOrUpdateResponse ¶ added in v0.4.0
type PrivateLinkScopedResourcesClientCreateOrUpdateResponse struct { // A private link scoped resource ScopedResource }
PrivateLinkScopedResourcesClientCreateOrUpdateResponse contains the response from method PrivateLinkScopedResourcesClient.BeginCreateOrUpdate.
type PrivateLinkScopedResourcesClientDeleteResponse ¶ added in v0.4.0
type PrivateLinkScopedResourcesClientDeleteResponse struct { }
PrivateLinkScopedResourcesClientDeleteResponse contains the response from method PrivateLinkScopedResourcesClient.BeginDelete.
type PrivateLinkScopedResourcesClientGetOptions ¶ added in v0.4.0
type PrivateLinkScopedResourcesClientGetOptions struct { }
PrivateLinkScopedResourcesClientGetOptions contains the optional parameters for the PrivateLinkScopedResourcesClient.Get method.
type PrivateLinkScopedResourcesClientGetResponse ¶ added in v0.4.0
type PrivateLinkScopedResourcesClientGetResponse struct { // A private link scoped resource ScopedResource }
PrivateLinkScopedResourcesClientGetResponse contains the response from method PrivateLinkScopedResourcesClient.Get.
type PrivateLinkScopedResourcesClientListByPrivateLinkScopeOptions ¶ added in v0.4.0
type PrivateLinkScopedResourcesClientListByPrivateLinkScopeOptions struct { }
PrivateLinkScopedResourcesClientListByPrivateLinkScopeOptions contains the optional parameters for the PrivateLinkScopedResourcesClient.NewListByPrivateLinkScopePager method.
type PrivateLinkScopedResourcesClientListByPrivateLinkScopeResponse ¶ added in v0.4.0
type PrivateLinkScopedResourcesClientListByPrivateLinkScopeResponse struct { // A list of scoped resources in a private link scope. ScopedResourceListResult }
PrivateLinkScopedResourcesClientListByPrivateLinkScopeResponse contains the response from method PrivateLinkScopedResourcesClient.NewListByPrivateLinkScopePager.
type PrivateLinkScopesClient ¶
type PrivateLinkScopesClient struct {
// contains filtered or unexported fields
}
PrivateLinkScopesClient contains the methods for the PrivateLinkScopes group. Don't use this type directly, use NewPrivateLinkScopesClient() instead.
func NewPrivateLinkScopesClient ¶
func NewPrivateLinkScopesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PrivateLinkScopesClient, error)
NewPrivateLinkScopesClient creates a new instance of PrivateLinkScopesClient with the specified values.
- subscriptionID - The ID of the target subscription.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - pass nil to accept the default values.
func (*PrivateLinkScopesClient) BeginDelete ¶
func (client *PrivateLinkScopesClient) BeginDelete(ctx context.Context, resourceGroupName string, scopeName string, options *PrivateLinkScopesClientBeginDeleteOptions) (*runtime.Poller[PrivateLinkScopesClientDeleteResponse], error)
BeginDelete - Deletes a Azure Monitor PrivateLinkScope. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2021-07-01-preview
- resourceGroupName - The name of the resource group. The name is case insensitive.
- scopeName - The name of the Azure Monitor PrivateLinkScope resource.
- options - PrivateLinkScopesClientBeginDeleteOptions contains the optional parameters for the PrivateLinkScopesClient.BeginDelete method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateLinkScopesDelete.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewPrivateLinkScopesClient().BeginDelete(ctx, "my-resource-group", "my-privatelinkscope", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } }
Output:
func (*PrivateLinkScopesClient) CreateOrUpdate ¶
func (client *PrivateLinkScopesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, scopeName string, azureMonitorPrivateLinkScopePayload AzureMonitorPrivateLinkScope, options *PrivateLinkScopesClientCreateOrUpdateOptions) (PrivateLinkScopesClientCreateOrUpdateResponse, error)
CreateOrUpdate - Creates (or updates) a Azure Monitor PrivateLinkScope. Note: You cannot specify a different value for InstrumentationKey nor AppId in the Put operation. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2021-07-01-preview
- resourceGroupName - The name of the resource group. The name is case insensitive.
- scopeName - The name of the Azure Monitor PrivateLinkScope resource.
- azureMonitorPrivateLinkScopePayload - Properties that need to be specified to create or update a Azure Monitor PrivateLinkScope.
- options - PrivateLinkScopesClientCreateOrUpdateOptions contains the optional parameters for the PrivateLinkScopesClient.CreateOrUpdate method.
Example (PrivateLinkScopeCreate) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateLinkScopesCreate.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewPrivateLinkScopesClient().CreateOrUpdate(ctx, "my-resource-group", "my-privatelinkscope", armmonitor.AzureMonitorPrivateLinkScope{ Location: to.Ptr("Global"), Properties: &armmonitor.AzureMonitorPrivateLinkScopeProperties{ AccessModeSettings: &armmonitor.AccessModeSettings{ Exclusions: []*armmonitor.AccessModeSettingsExclusion{}, IngestionAccessMode: to.Ptr(armmonitor.AccessModeOpen), QueryAccessMode: to.Ptr(armmonitor.AccessModeOpen), }, }, }, 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.AzureMonitorPrivateLinkScope = armmonitor.AzureMonitorPrivateLinkScope{ // Name: to.Ptr("my-privatelinkscope"), // Type: to.Ptr("Microsoft.Insights/privateLinkScopes"), // ID: to.Ptr("/subscriptions/86dc51d3-92ed-4d7e-947a-775ea79b4919/resourceGroups/my-resource-group/providers/microsoft.insights/privateLinkScopes/my-privatelinkscope"), // Location: to.Ptr("Global"), // Tags: map[string]*string{ // }, // Properties: &armmonitor.AzureMonitorPrivateLinkScopeProperties{ // AccessModeSettings: &armmonitor.AccessModeSettings{ // Exclusions: []*armmonitor.AccessModeSettingsExclusion{ // }, // IngestionAccessMode: to.Ptr(armmonitor.AccessModeOpen), // QueryAccessMode: to.Ptr(armmonitor.AccessModeOpen), // }, // ProvisioningState: to.Ptr("Succeeded"), // }, // SystemData: &armmonitor.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-16T12:59:57.051Z"); return t}()), // CreatedBy: to.Ptr("bobby@contoso.com"), // CreatedByType: to.Ptr(armmonitor.CreatedByTypeUser), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-16T12:59:57.051Z"); return t}()), // LastModifiedBy: to.Ptr("bobby@contoso.com"), // LastModifiedByType: to.Ptr(armmonitor.CreatedByTypeUser), // }, // } }
Output:
Example (PrivateLinkScopeUpdate) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateLinkScopesUpdate.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewPrivateLinkScopesClient().CreateOrUpdate(ctx, "my-resource-group", "my-privatelinkscope", armmonitor.AzureMonitorPrivateLinkScope{ Location: to.Ptr("Global"), Tags: map[string]*string{ "Tag1": to.Ptr("Value1"), }, Properties: &armmonitor.AzureMonitorPrivateLinkScopeProperties{ AccessModeSettings: &armmonitor.AccessModeSettings{ Exclusions: []*armmonitor.AccessModeSettingsExclusion{}, IngestionAccessMode: to.Ptr(armmonitor.AccessModeOpen), QueryAccessMode: to.Ptr(armmonitor.AccessModeOpen), }, }, }, 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.AzureMonitorPrivateLinkScope = armmonitor.AzureMonitorPrivateLinkScope{ // Name: to.Ptr("my-privatelinkscope"), // Type: to.Ptr("Microsoft.Insights/privateLinkScopes"), // ID: to.Ptr("/subscriptions/86dc51d3-92ed-4d7e-947a-775ea79b4919/resourceGroups/my-resource-group/providers/microsoft.insights/privateLinkScopes/my-privatelinkscope"), // Location: to.Ptr("Global"), // Tags: map[string]*string{ // "Tag1": to.Ptr("Value1"), // }, // Properties: &armmonitor.AzureMonitorPrivateLinkScopeProperties{ // AccessModeSettings: &armmonitor.AccessModeSettings{ // Exclusions: []*armmonitor.AccessModeSettingsExclusion{ // }, // IngestionAccessMode: to.Ptr(armmonitor.AccessModeOpen), // QueryAccessMode: to.Ptr(armmonitor.AccessModeOpen), // }, // ProvisioningState: to.Ptr("Succeeded"), // }, // SystemData: &armmonitor.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-16T12:59:57.051Z"); return t}()), // CreatedBy: to.Ptr("bobby@contoso.com"), // CreatedByType: to.Ptr(armmonitor.CreatedByTypeUser), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-16T12:59:57.051Z"); return t}()), // LastModifiedBy: to.Ptr("bobby@contoso.com"), // LastModifiedByType: to.Ptr(armmonitor.CreatedByTypeUser), // }, // } }
Output:
func (*PrivateLinkScopesClient) Get ¶
func (client *PrivateLinkScopesClient) Get(ctx context.Context, resourceGroupName string, scopeName string, options *PrivateLinkScopesClientGetOptions) (PrivateLinkScopesClientGetResponse, error)
Get - Returns a Azure Monitor PrivateLinkScope. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2021-07-01-preview
- resourceGroupName - The name of the resource group. The name is case insensitive.
- scopeName - The name of the Azure Monitor PrivateLinkScope resource.
- options - PrivateLinkScopesClientGetOptions contains the optional parameters for the PrivateLinkScopesClient.Get method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateLinkScopesGet.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewPrivateLinkScopesClient().Get(ctx, "my-resource-group", "my-privatelinkscope", 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.AzureMonitorPrivateLinkScope = armmonitor.AzureMonitorPrivateLinkScope{ // Name: to.Ptr("my-privatelinkscope"), // Type: to.Ptr("Microsoft.Insights/privateLinkScopes"), // ID: to.Ptr("/subscriptions/86dc51d3-92ed-4d7e-947a-775ea79b4919/resourceGroups/my-resource-group/providers/microsoft.insights/privateLinkScopes/my-privatelinkscope"), // Location: to.Ptr("Global"), // Tags: map[string]*string{ // }, // Properties: &armmonitor.AzureMonitorPrivateLinkScopeProperties{ // AccessModeSettings: &armmonitor.AccessModeSettings{ // Exclusions: []*armmonitor.AccessModeSettingsExclusion{ // }, // IngestionAccessMode: to.Ptr(armmonitor.AccessModeOpen), // QueryAccessMode: to.Ptr(armmonitor.AccessModeOpen), // }, // ProvisioningState: to.Ptr("Succeeded"), // }, // SystemData: &armmonitor.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-16T12:59:57.051Z"); return t}()), // CreatedBy: to.Ptr("bobby@contoso.com"), // CreatedByType: to.Ptr(armmonitor.CreatedByTypeUser), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-16T12:59:57.051Z"); return t}()), // LastModifiedBy: to.Ptr("bobby@contoso.com"), // LastModifiedByType: to.Ptr(armmonitor.CreatedByTypeUser), // }, // } }
Output:
func (*PrivateLinkScopesClient) NewListByResourceGroupPager ¶ added in v0.6.0
func (client *PrivateLinkScopesClient) NewListByResourceGroupPager(resourceGroupName string, options *PrivateLinkScopesClientListByResourceGroupOptions) *runtime.Pager[PrivateLinkScopesClientListByResourceGroupResponse]
NewListByResourceGroupPager - Gets a list of Azure Monitor PrivateLinkScopes within a resource group.
Generated from API version 2021-07-01-preview
- resourceGroupName - The name of the resource group. The name is case insensitive.
- options - PrivateLinkScopesClientListByResourceGroupOptions contains the optional parameters for the PrivateLinkScopesClient.NewListByResourceGroupPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateLinkScopesListByResourceGroup.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewPrivateLinkScopesClient().NewListByResourceGroupPager("my-resource-group", 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.AzureMonitorPrivateLinkScopeListResult = armmonitor.AzureMonitorPrivateLinkScopeListResult{ // Value: []*armmonitor.AzureMonitorPrivateLinkScope{ // { // Name: to.Ptr("my-privatelinkscope"), // Type: to.Ptr("Microsoft.Insights/privateLinkScopes"), // ID: to.Ptr("/subscriptions/86dc51d3-92ed-4d7e-947a-775ea79b4919/resourceGroups/my-resource-group/providers/microsoft.insights/privateLinkScopes/my-privatelinkscope"), // Location: to.Ptr("Global"), // Tags: map[string]*string{ // }, // Properties: &armmonitor.AzureMonitorPrivateLinkScopeProperties{ // AccessModeSettings: &armmonitor.AccessModeSettings{ // Exclusions: []*armmonitor.AccessModeSettingsExclusion{ // }, // IngestionAccessMode: to.Ptr(armmonitor.AccessModeOpen), // QueryAccessMode: to.Ptr(armmonitor.AccessModeOpen), // }, // ProvisioningState: to.Ptr("Succeeded"), // }, // SystemData: &armmonitor.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-16T12:59:57.051Z"); return t}()), // CreatedBy: to.Ptr("bobby@contoso.com"), // CreatedByType: to.Ptr(armmonitor.CreatedByTypeUser), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-16T12:59:57.051Z"); return t}()), // LastModifiedBy: to.Ptr("bobby@contoso.com"), // LastModifiedByType: to.Ptr(armmonitor.CreatedByTypeUser), // }, // }, // { // Name: to.Ptr("my-other-privatelinkscope"), // Type: to.Ptr("Microsoft.Insights/privateLinkScopes"), // ID: to.Ptr("/subscriptions/86dc51d3-92ed-4d7e-947a-775ea79b4919/resourceGroups/my-resource-group/providers/microsoft.insights/privateLinkScopes/my-other-privatelinkscope"), // Location: to.Ptr("Global"), // Tags: map[string]*string{ // }, // Properties: &armmonitor.AzureMonitorPrivateLinkScopeProperties{ // AccessModeSettings: &armmonitor.AccessModeSettings{ // Exclusions: []*armmonitor.AccessModeSettingsExclusion{ // }, // IngestionAccessMode: to.Ptr(armmonitor.AccessModeOpen), // QueryAccessMode: to.Ptr(armmonitor.AccessModeOpen), // }, // ProvisioningState: to.Ptr("Succeeded"), // }, // SystemData: &armmonitor.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-16T12:59:57.051Z"); return t}()), // CreatedBy: to.Ptr("bobby@contoso.com"), // CreatedByType: to.Ptr(armmonitor.CreatedByTypeUser), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-16T12:59:57.051Z"); return t}()), // LastModifiedBy: to.Ptr("bobby@contoso.com"), // LastModifiedByType: to.Ptr(armmonitor.CreatedByTypeUser), // }, // }}, // } } }
Output:
func (*PrivateLinkScopesClient) NewListPager ¶ added in v0.6.0
func (client *PrivateLinkScopesClient) NewListPager(options *PrivateLinkScopesClientListOptions) *runtime.Pager[PrivateLinkScopesClientListResponse]
NewListPager - Gets a list of all Azure Monitor PrivateLinkScopes within a subscription.
Generated from API version 2021-07-01-preview
- options - PrivateLinkScopesClientListOptions contains the optional parameters for the PrivateLinkScopesClient.NewListPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateLinkScopesList.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewPrivateLinkScopesClient().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.AzureMonitorPrivateLinkScopeListResult = armmonitor.AzureMonitorPrivateLinkScopeListResult{ // Value: []*armmonitor.AzureMonitorPrivateLinkScope{ // { // Name: to.Ptr("my-privatelinkscope"), // Type: to.Ptr("Microsoft.Insights/privateLinkScopes"), // ID: to.Ptr("/subscriptions/86dc51d3-92ed-4d7e-947a-775ea79b4919/resourceGroups/my-resource-group/providers/microsoft.insights/privateLinkScopes/my-privatelinkscope"), // Location: to.Ptr("Global"), // Tags: map[string]*string{ // }, // Properties: &armmonitor.AzureMonitorPrivateLinkScopeProperties{ // AccessModeSettings: &armmonitor.AccessModeSettings{ // Exclusions: []*armmonitor.AccessModeSettingsExclusion{ // }, // IngestionAccessMode: to.Ptr(armmonitor.AccessModeOpen), // QueryAccessMode: to.Ptr(armmonitor.AccessModeOpen), // }, // ProvisioningState: to.Ptr("Succeeded"), // }, // SystemData: &armmonitor.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-16T12:59:57.051Z"); return t}()), // CreatedBy: to.Ptr("bobby@contoso.com"), // CreatedByType: to.Ptr(armmonitor.CreatedByTypeUser), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-16T12:59:57.051Z"); return t}()), // LastModifiedBy: to.Ptr("bobby@contoso.com"), // LastModifiedByType: to.Ptr(armmonitor.CreatedByTypeUser), // }, // }, // { // Name: to.Ptr("my-other-privatelinkscope"), // Type: to.Ptr("Microsoft.Insights/privateLinkScopes"), // ID: to.Ptr("/subscriptions/86dc51d3-92ed-4d7e-947a-775ea79b4919/resourceGroups/my-other-resource-group/providers/microsoft.insights/privateLinkScopes/my-other-privatelinkscope"), // Location: to.Ptr("Global"), // Tags: map[string]*string{ // }, // Properties: &armmonitor.AzureMonitorPrivateLinkScopeProperties{ // AccessModeSettings: &armmonitor.AccessModeSettings{ // Exclusions: []*armmonitor.AccessModeSettingsExclusion{ // }, // IngestionAccessMode: to.Ptr(armmonitor.AccessModeOpen), // QueryAccessMode: to.Ptr(armmonitor.AccessModeOpen), // }, // ProvisioningState: to.Ptr("Succeeded"), // }, // SystemData: &armmonitor.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-16T12:59:57.051Z"); return t}()), // CreatedBy: to.Ptr("bobby@contoso.com"), // CreatedByType: to.Ptr(armmonitor.CreatedByTypeUser), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-16T12:59:57.051Z"); return t}()), // LastModifiedBy: to.Ptr("bobby@contoso.com"), // LastModifiedByType: to.Ptr(armmonitor.CreatedByTypeUser), // }, // }}, // } } }
Output:
func (*PrivateLinkScopesClient) UpdateTags ¶
func (client *PrivateLinkScopesClient) UpdateTags(ctx context.Context, resourceGroupName string, scopeName string, privateLinkScopeTags TagsResource, options *PrivateLinkScopesClientUpdateTagsOptions) (PrivateLinkScopesClientUpdateTagsResponse, error)
UpdateTags - Updates an existing PrivateLinkScope's tags. To update other fields use the CreateOrUpdate method. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2021-07-01-preview
- resourceGroupName - The name of the resource group. The name is case insensitive.
- scopeName - The name of the Azure Monitor PrivateLinkScope resource.
- privateLinkScopeTags - Updated tag information to set into the PrivateLinkScope instance.
- options - PrivateLinkScopesClientUpdateTagsOptions contains the optional parameters for the PrivateLinkScopesClient.UpdateTags method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/examples/PrivateLinkScopesUpdateTagsOnly.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewPrivateLinkScopesClient().UpdateTags(ctx, "my-resource-group", "my-privatelinkscope", armmonitor.TagsResource{ Tags: map[string]*string{ "Tag1": to.Ptr("Value1"), "Tag2": to.Ptr("Value2"), }, }, 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.AzureMonitorPrivateLinkScope = armmonitor.AzureMonitorPrivateLinkScope{ // Name: to.Ptr("my-privatelinkscope"), // Type: to.Ptr("Microsoft.Insights/privateLinkScopes"), // ID: to.Ptr("/subscriptions/subid/resourceGroups/my-resource-group/providers/microsoft.insights/privateLinkScopes/my-privatelinkscope"), // Location: to.Ptr("Global"), // Tags: map[string]*string{ // "Tag1": to.Ptr("Value1"), // "Tag2": to.Ptr("Value2"), // }, // Properties: &armmonitor.AzureMonitorPrivateLinkScopeProperties{ // AccessModeSettings: &armmonitor.AccessModeSettings{ // Exclusions: []*armmonitor.AccessModeSettingsExclusion{ // }, // IngestionAccessMode: to.Ptr(armmonitor.AccessModeOpen), // QueryAccessMode: to.Ptr(armmonitor.AccessModeOpen), // }, // ProvisioningState: to.Ptr("Succeeded"), // }, // SystemData: &armmonitor.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-16T12:59:57.051Z"); return t}()), // CreatedBy: to.Ptr("bobby@contoso.com"), // CreatedByType: to.Ptr(armmonitor.CreatedByTypeUser), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-16T12:59:57.051Z"); return t}()), // LastModifiedBy: to.Ptr("bobby@contoso.com"), // LastModifiedByType: to.Ptr(armmonitor.CreatedByTypeUser), // }, // } }
Output:
type PrivateLinkScopesClientBeginDeleteOptions ¶ added in v0.4.0
type PrivateLinkScopesClientBeginDeleteOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
PrivateLinkScopesClientBeginDeleteOptions contains the optional parameters for the PrivateLinkScopesClient.BeginDelete method.
type PrivateLinkScopesClientCreateOrUpdateOptions ¶ added in v0.4.0
type PrivateLinkScopesClientCreateOrUpdateOptions struct { }
PrivateLinkScopesClientCreateOrUpdateOptions contains the optional parameters for the PrivateLinkScopesClient.CreateOrUpdate method.
type PrivateLinkScopesClientCreateOrUpdateResponse ¶ added in v0.4.0
type PrivateLinkScopesClientCreateOrUpdateResponse struct { // An Azure Monitor PrivateLinkScope definition. AzureMonitorPrivateLinkScope }
PrivateLinkScopesClientCreateOrUpdateResponse contains the response from method PrivateLinkScopesClient.CreateOrUpdate.
type PrivateLinkScopesClientDeleteResponse ¶ added in v0.4.0
type PrivateLinkScopesClientDeleteResponse struct { }
PrivateLinkScopesClientDeleteResponse contains the response from method PrivateLinkScopesClient.BeginDelete.
type PrivateLinkScopesClientGetOptions ¶ added in v0.4.0
type PrivateLinkScopesClientGetOptions struct { }
PrivateLinkScopesClientGetOptions contains the optional parameters for the PrivateLinkScopesClient.Get method.
type PrivateLinkScopesClientGetResponse ¶ added in v0.4.0
type PrivateLinkScopesClientGetResponse struct { // An Azure Monitor PrivateLinkScope definition. AzureMonitorPrivateLinkScope }
PrivateLinkScopesClientGetResponse contains the response from method PrivateLinkScopesClient.Get.
type PrivateLinkScopesClientListByResourceGroupOptions ¶ added in v0.4.0
type PrivateLinkScopesClientListByResourceGroupOptions struct { }
PrivateLinkScopesClientListByResourceGroupOptions contains the optional parameters for the PrivateLinkScopesClient.NewListByResourceGroupPager method.
type PrivateLinkScopesClientListByResourceGroupResponse ¶ added in v0.4.0
type PrivateLinkScopesClientListByResourceGroupResponse struct { // Describes the list of Azure Monitor PrivateLinkScope resources. AzureMonitorPrivateLinkScopeListResult }
PrivateLinkScopesClientListByResourceGroupResponse contains the response from method PrivateLinkScopesClient.NewListByResourceGroupPager.
type PrivateLinkScopesClientListOptions ¶ added in v0.4.0
type PrivateLinkScopesClientListOptions struct { }
PrivateLinkScopesClientListOptions contains the optional parameters for the PrivateLinkScopesClient.NewListPager method.
type PrivateLinkScopesClientListResponse ¶ added in v0.4.0
type PrivateLinkScopesClientListResponse struct { // Describes the list of Azure Monitor PrivateLinkScope resources. AzureMonitorPrivateLinkScopeListResult }
PrivateLinkScopesClientListResponse contains the response from method PrivateLinkScopesClient.NewListPager.
type PrivateLinkScopesClientUpdateTagsOptions ¶ added in v0.4.0
type PrivateLinkScopesClientUpdateTagsOptions struct { }
PrivateLinkScopesClientUpdateTagsOptions contains the optional parameters for the PrivateLinkScopesClient.UpdateTags method.
type PrivateLinkScopesClientUpdateTagsResponse ¶ added in v0.4.0
type PrivateLinkScopesClientUpdateTagsResponse struct { // An Azure Monitor PrivateLinkScope definition. AzureMonitorPrivateLinkScope }
PrivateLinkScopesClientUpdateTagsResponse contains the response from method PrivateLinkScopesClient.UpdateTags.
type PrivateLinkServiceConnectionState ¶ added in v0.8.0
type PrivateLinkServiceConnectionState struct { // A message indicating if changes on the service provider require any updates on the consumer. ActionsRequired *string // The reason for approval/rejection of the connection. Description *string // Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. Status *PrivateEndpointServiceConnectionStatus }
PrivateLinkServiceConnectionState - A collection of information about the state of the connection between service consumer and provider.
func (PrivateLinkServiceConnectionState) MarshalJSON ¶ added in v0.8.0
func (p PrivateLinkServiceConnectionState) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type PrivateLinkServiceConnectionState.
func (*PrivateLinkServiceConnectionState) UnmarshalJSON ¶ added in v0.8.0
func (p *PrivateLinkServiceConnectionState) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkServiceConnectionState.
type PrometheusForwarderDataSource ¶ added in v0.9.0
type PrometheusForwarderDataSource struct { // The list of label inclusion filters in the form of label "name-value" pairs. Currently only one label is supported: 'microsoftmetricsinclude_label'. // Label values are matched case-insensitively. LabelIncludeFilter map[string]*string // A friendly name for the data source. This name should be unique across all data sources (regardless of type) within the // data collection rule. Name *string // List of streams that this data source will be sent to. Streams []*KnownPrometheusForwarderDataSourceStreams }
PrometheusForwarderDataSource - Definition of Prometheus metrics forwarding configuration.
func (PrometheusForwarderDataSource) MarshalJSON ¶ added in v0.9.0
func (p PrometheusForwarderDataSource) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type PrometheusForwarderDataSource.
func (*PrometheusForwarderDataSource) UnmarshalJSON ¶ added in v0.9.0
func (p *PrometheusForwarderDataSource) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type PrometheusForwarderDataSource.
type ProvisioningState ¶
type ProvisioningState string
ProvisioningState - The provisioning state of the Azure Monitor workspace. Set to Succeeded if everything is healthy.
const ( ProvisioningStateCanceled ProvisioningState = "Canceled" ProvisioningStateCreating ProvisioningState = "Creating" ProvisioningStateDeleting ProvisioningState = "Deleting" ProvisioningStateFailed ProvisioningState = "Failed" ProvisioningStateSucceeded ProvisioningState = "Succeeded" )
func PossibleProvisioningStateValues ¶
func PossibleProvisioningStateValues() []ProvisioningState
PossibleProvisioningStateValues returns the possible values for the ProvisioningState const type.
type ProxyResource ¶
type ProxyResource struct { // READ-ONLY; Azure resource Id ID *string // READ-ONLY; Azure resource name Name *string // READ-ONLY; Azure resource type Type *string }
ProxyResource - An azure resource object
func (ProxyResource) MarshalJSON ¶ added in v0.8.0
func (p ProxyResource) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ProxyResource.
func (*ProxyResource) UnmarshalJSON ¶ added in v0.8.0
func (p *ProxyResource) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ProxyResource.
type ProxyResourceAutoGenerated ¶ added in v0.8.0
type ProxyResourceAutoGenerated struct { // 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; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string }
ProxyResourceAutoGenerated - The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location
func (ProxyResourceAutoGenerated) MarshalJSON ¶ added in v0.8.0
func (p ProxyResourceAutoGenerated) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ProxyResourceAutoGenerated.
func (*ProxyResourceAutoGenerated) UnmarshalJSON ¶ added in v0.8.0
func (p *ProxyResourceAutoGenerated) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ProxyResourceAutoGenerated.
type PublicNetworkAccess ¶ added in v0.9.0
type PublicNetworkAccess string
PublicNetworkAccess - This determines if traffic is allowed over public network. By default it is enabled.
const ( PublicNetworkAccessDisabled PublicNetworkAccess = "Disabled" PublicNetworkAccessEnabled PublicNetworkAccess = "Enabled" PublicNetworkAccessSecuredByPerimeter PublicNetworkAccess = "SecuredByPerimeter" )
func PossiblePublicNetworkAccessValues ¶ added in v0.9.0
func PossiblePublicNetworkAccessValues() []PublicNetworkAccess
PossiblePublicNetworkAccessValues returns the possible values for the PublicNetworkAccess const type.
type ReceiverStatus ¶
type ReceiverStatus string
ReceiverStatus - Indicates the status of the receiver. Receivers that are not Enabled will not receive any communications.
const ( ReceiverStatusDisabled ReceiverStatus = "Disabled" ReceiverStatusEnabled ReceiverStatus = "Enabled" ReceiverStatusNotSpecified ReceiverStatus = "NotSpecified" )
func PossibleReceiverStatusValues ¶
func PossibleReceiverStatusValues() []ReceiverStatus
PossibleReceiverStatusValues returns the possible values for the ReceiverStatus const type.
type Recurrence ¶
type Recurrence struct { // REQUIRED; the recurrence frequency. How often the schedule profile should take effect. This value must be Week, meaning // each week will have the same set of profiles. For example, to set a daily schedule, set // schedule to every day of the week. The frequency property specifies that the schedule is repeated weekly. Frequency *RecurrenceFrequency // REQUIRED; the scheduling constraints for when the profile begins. Schedule *RecurrentSchedule }
Recurrence - The repeating times at which this profile begins. This element is not used if the FixedDate element is used.
func (Recurrence) MarshalJSON ¶ added in v0.8.0
func (r Recurrence) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type Recurrence.
func (*Recurrence) UnmarshalJSON ¶ added in v0.8.0
func (r *Recurrence) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type Recurrence.
type RecurrenceFrequency ¶
type RecurrenceFrequency string
RecurrenceFrequency - the recurrence frequency. How often the schedule profile should take effect. This value must be Week, meaning each week will have the same set of profiles. For example, to set a daily schedule, set schedule to every day of the week. The frequency property specifies that the schedule is repeated weekly.
const ( RecurrenceFrequencyDay RecurrenceFrequency = "Day" RecurrenceFrequencyHour RecurrenceFrequency = "Hour" RecurrenceFrequencyMinute RecurrenceFrequency = "Minute" RecurrenceFrequencyMonth RecurrenceFrequency = "Month" RecurrenceFrequencyNone RecurrenceFrequency = "None" RecurrenceFrequencySecond RecurrenceFrequency = "Second" RecurrenceFrequencyWeek RecurrenceFrequency = "Week" RecurrenceFrequencyYear RecurrenceFrequency = "Year" )
func PossibleRecurrenceFrequencyValues ¶
func PossibleRecurrenceFrequencyValues() []RecurrenceFrequency
PossibleRecurrenceFrequencyValues returns the possible values for the RecurrenceFrequency const type.
type RecurrentSchedule ¶
type RecurrentSchedule struct { // REQUIRED; the collection of days that the profile takes effect on. Possible values are Sunday through Saturday. Days []*string // REQUIRED; A collection of hours that the profile takes effect on. Values supported are 0 to 23 on the 24-hour clock (AM/PM // times are not supported). Hours []*int32 // REQUIRED; A collection of minutes at which the profile takes effect at. Minutes []*int32 // REQUIRED; the timezone for the hours of the profile. Some examples of valid time zones are: Dateline Standard Time, UTC-11, // Hawaiian Standard Time, Alaskan Standard Time, Pacific Standard Time (Mexico), Pacific // Standard Time, US Mountain Standard Time, Mountain Standard Time (Mexico), Mountain Standard Time, Central America Standard // Time, Central Standard Time, Central Standard Time (Mexico), Canada Central // Standard Time, SA Pacific Standard Time, Eastern Standard Time, US Eastern Standard Time, Venezuela Standard Time, Paraguay // Standard Time, Atlantic Standard Time, Central Brazilian Standard Time, SA // Western Standard Time, Pacific SA Standard Time, Newfoundland Standard Time, E. South America Standard Time, Argentina // Standard Time, SA Eastern Standard Time, Greenland Standard Time, Montevideo // Standard Time, Bahia Standard Time, UTC-02, Mid-Atlantic Standard Time, Azores Standard Time, Cape Verde Standard Time, // Morocco Standard Time, UTC, GMT Standard Time, Greenwich Standard Time, W. // Europe Standard Time, Central Europe Standard Time, Romance Standard Time, Central European Standard Time, W. Central Africa // Standard Time, Namibia Standard Time, Jordan Standard Time, GTB Standard // Time, Middle East Standard Time, Egypt Standard Time, Syria Standard Time, E. Europe Standard Time, South Africa Standard // Time, FLE Standard Time, Turkey Standard Time, Israel Standard Time, // Kaliningrad Standard Time, Libya Standard Time, Arabic Standard Time, Arab Standard Time, Belarus Standard Time, Russian // Standard Time, E. Africa Standard Time, Iran Standard Time, Arabian Standard // Time, Azerbaijan Standard Time, Russia Time Zone 3, Mauritius Standard Time, Georgian Standard Time, Caucasus Standard // Time, Afghanistan Standard Time, West Asia Standard Time, Ekaterinburg Standard // Time, Pakistan Standard Time, India Standard Time, Sri Lanka Standard Time, Nepal Standard Time, Central Asia Standard // Time, Bangladesh Standard Time, N. Central Asia Standard Time, Myanmar Standard // Time, SE Asia Standard Time, North Asia Standard Time, China Standard Time, North Asia East Standard Time, Singapore Standard // Time, W. Australia Standard Time, Taipei Standard Time, Ulaanbaatar // Standard Time, Tokyo Standard Time, Korea Standard Time, Yakutsk Standard Time, Cen. Australia Standard Time, AUS Central // Standard Time, E. Australia Standard Time, AUS Eastern Standard Time, West // Pacific Standard Time, Tasmania Standard Time, Magadan Standard Time, Vladivostok Standard Time, Russia Time Zone 10, Central // Pacific Standard Time, Russia Time Zone 11, New Zealand Standard Time, // UTC+12, Fiji Standard Time, Kamchatka Standard Time, Tonga Standard Time, Samoa Standard Time, Line Islands Standard Time TimeZone *string }
RecurrentSchedule - The scheduling constraints for when the profile begins.
func (RecurrentSchedule) MarshalJSON ¶
func (r RecurrentSchedule) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type RecurrentSchedule.
func (*RecurrentSchedule) UnmarshalJSON ¶ added in v0.8.0
func (r *RecurrentSchedule) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type RecurrentSchedule.
type Resource ¶
type Resource struct { // REQUIRED; Resource location Location *string // Gets or sets a list of key value pairs that describe the resource. These tags can be used in viewing and grouping this // resource (across resource groups). A maximum of 15 tags can be provided for a // resource. Each tag must have a key no greater in length than 128 characters and a value no greater in length than 256 characters. Tags map[string]*string // READ-ONLY; Azure resource Id ID *string // READ-ONLY; Azure resource name Name *string // READ-ONLY; The system metadata related to the response. SystemData *SystemData // READ-ONLY; Azure resource type Type *string }
Resource - The autoscale setting resource.
func (Resource) MarshalJSON ¶
MarshalJSON implements the json.Marshaller interface for type Resource.
func (*Resource) UnmarshalJSON ¶ added in v0.8.0
UnmarshalJSON implements the json.Unmarshaller interface for type Resource.
type ResourceAutoGenerated ¶ added in v0.8.0
type ResourceAutoGenerated struct { // REQUIRED; Resource location Location *string // Resource tags Tags map[string]*string // READ-ONLY; Azure resource Id ID *string // READ-ONLY; Azure resource name Name *string // READ-ONLY; Azure resource type Type *string }
ResourceAutoGenerated - An azure resource object
func (ResourceAutoGenerated) MarshalJSON ¶ added in v0.8.0
func (r ResourceAutoGenerated) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ResourceAutoGenerated.
func (*ResourceAutoGenerated) UnmarshalJSON ¶ added in v0.8.0
func (r *ResourceAutoGenerated) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ResourceAutoGenerated.
type ResourceAutoGenerated2 ¶ added in v0.8.0
type ResourceAutoGenerated2 struct { // REQUIRED; Resource location Location *string // Resource tags Tags map[string]*string // READ-ONLY; Azure resource Id ID *string // READ-ONLY; Azure resource name Name *string // READ-ONLY; Azure resource type Type *string }
ResourceAutoGenerated2 - An azure resource object
func (ResourceAutoGenerated2) MarshalJSON ¶ added in v0.8.0
func (r ResourceAutoGenerated2) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ResourceAutoGenerated2.
func (*ResourceAutoGenerated2) UnmarshalJSON ¶ added in v0.8.0
func (r *ResourceAutoGenerated2) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ResourceAutoGenerated2.
type ResourceAutoGenerated3 ¶ added in v0.8.0
type ResourceAutoGenerated3 struct { // 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; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string }
ResourceAutoGenerated3 - Common fields that are returned in the response for all Azure Resource Manager resources
func (ResourceAutoGenerated3) MarshalJSON ¶ added in v0.8.0
func (r ResourceAutoGenerated3) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ResourceAutoGenerated3.
func (*ResourceAutoGenerated3) UnmarshalJSON ¶ added in v0.8.0
func (r *ResourceAutoGenerated3) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ResourceAutoGenerated3.
type ResourceAutoGenerated4 ¶ added in v0.8.0
type ResourceAutoGenerated4 struct { // REQUIRED; Resource location Location *string // Resource tags Tags map[string]*string // READ-ONLY; Azure resource Id ID *string // READ-ONLY; Azure resource name Name *string // READ-ONLY; Azure resource type Type *string }
ResourceAutoGenerated4 - An azure resource object
func (ResourceAutoGenerated4) MarshalJSON ¶ added in v0.8.0
func (r ResourceAutoGenerated4) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ResourceAutoGenerated4.
func (*ResourceAutoGenerated4) UnmarshalJSON ¶ added in v0.8.0
func (r *ResourceAutoGenerated4) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ResourceAutoGenerated4.
type ResourceAutoGenerated5 ¶ added in v0.9.0
type ResourceAutoGenerated5 struct { // 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 }
ResourceAutoGenerated5 - Common fields that are returned in the response for all Azure Resource Manager resources
func (ResourceAutoGenerated5) MarshalJSON ¶ added in v0.9.0
func (r ResourceAutoGenerated5) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ResourceAutoGenerated5.
func (*ResourceAutoGenerated5) UnmarshalJSON ¶ added in v0.9.0
func (r *ResourceAutoGenerated5) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ResourceAutoGenerated5.
type ResourceForUpdate ¶
type ResourceForUpdate struct { // Managed Service Identity. Identity *ResourceForUpdateIdentity // Resource tags. Tags map[string]*string }
ResourceForUpdate - Definition of ARM tracked top level resource properties for update operation.
func (ResourceForUpdate) MarshalJSON ¶
func (r ResourceForUpdate) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ResourceForUpdate.
func (*ResourceForUpdate) UnmarshalJSON ¶ added in v0.8.0
func (r *ResourceForUpdate) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ResourceForUpdate.
type ResourceForUpdateIdentity ¶ added in v0.9.0
type ResourceForUpdateIdentity struct { // REQUIRED; Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). Type *ManagedServiceIdentityType // The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM // resource ids in the form: // '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. // The dictionary values can be empty objects ({}) in // requests. UserAssignedIdentities map[string]*UserAssignedIdentity // READ-ONLY; The service principal ID of the system assigned identity. This property will only be provided for a system assigned // identity. PrincipalID *string // READ-ONLY; The tenant ID of the system assigned identity. This property will only be provided for a system assigned identity. TenantID *string }
ResourceForUpdateIdentity - Managed Service Identity.
func (ResourceForUpdateIdentity) MarshalJSON ¶ added in v0.9.0
func (r ResourceForUpdateIdentity) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ResourceForUpdateIdentity.
func (*ResourceForUpdateIdentity) UnmarshalJSON ¶ added in v0.9.0
func (r *ResourceForUpdateIdentity) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ResourceForUpdateIdentity.
type Response ¶
type Response struct { // REQUIRED; The timespan for which the data was retrieved. Its value consists of two datetimes concatenated, separated by // '/'. This may be adjusted in the future and returned back from what was originally // requested. Timespan *string // REQUIRED; the value of the collection. Value []*Metric // The integer value representing the relative cost of the query. Cost *int32 // The interval (window size) for which the metric data was returned in. This may be adjusted in the future and returned back // from what was originally requested. This is not present if a metadata request // was made. Interval *string // The namespace of the metrics being queried Namespace *string // The region of the resource being queried for metrics. Resourceregion *string }
Response - The response to a metrics query.
func (Response) MarshalJSON ¶
MarshalJSON implements the json.Marshaller interface for type Response.
func (*Response) UnmarshalJSON ¶ added in v0.8.0
UnmarshalJSON implements the json.Unmarshaller interface for type Response.
type ResponseWithError ¶
type ResponseWithError struct { // REQUIRED; Error information. Error *Error }
ResponseWithError - An error response from the API.
func (ResponseWithError) MarshalJSON ¶ added in v0.8.0
func (r ResponseWithError) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ResponseWithError.
func (*ResponseWithError) UnmarshalJSON ¶ added in v0.8.0
func (r *ResponseWithError) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ResponseWithError.
type ResultType ¶
type ResultType string
const ( ResultTypeData ResultType = "Data" ResultTypeMetadata ResultType = "Metadata" )
func PossibleResultTypeValues ¶
func PossibleResultTypeValues() []ResultType
PossibleResultTypeValues returns the possible values for the ResultType const type.
type RetentionPolicy ¶
type RetentionPolicy struct { // REQUIRED; the number of days for the retention in days. A value of 0 will retain the events indefinitely. Days *int32 // REQUIRED; a value indicating whether the retention policy is enabled. Enabled *bool }
RetentionPolicy - Specifies the retention policy for the log.
func (RetentionPolicy) MarshalJSON ¶ added in v0.8.0
func (r RetentionPolicy) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type RetentionPolicy.
func (*RetentionPolicy) UnmarshalJSON ¶ added in v0.8.0
func (r *RetentionPolicy) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type RetentionPolicy.
type RuleAction ¶
type RuleAction struct { // REQUIRED; specifies the type of the action. There are two types of actions: RuleEmailAction and RuleWebhookAction. ODataType *string }
RuleAction - The action that is performed when the alert rule becomes active, and when an alert condition is resolved.
func (*RuleAction) GetRuleAction ¶
func (r *RuleAction) GetRuleAction() *RuleAction
GetRuleAction implements the RuleActionClassification interface for type RuleAction.
func (RuleAction) MarshalJSON ¶ added in v0.8.0
func (r RuleAction) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type RuleAction.
func (*RuleAction) UnmarshalJSON ¶
func (r *RuleAction) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type RuleAction.
type RuleActionClassification ¶
type RuleActionClassification interface { // GetRuleAction returns the RuleAction content of the underlying type. GetRuleAction() *RuleAction }
RuleActionClassification provides polymorphic access to related types. Call the interface's GetRuleAction() method to access the common type. Use a type switch to determine the concrete type. The possible types are: - *RuleAction, *RuleEmailAction, *RuleWebhookAction
type RuleCondition ¶
type RuleCondition struct { // REQUIRED; specifies the type of condition. This can be one of three types: ManagementEventRuleCondition (occurrences of // management events), LocationThresholdRuleCondition (based on the number of failures of a // web test), and ThresholdRuleCondition (based on the threshold of a metric). ODataType *string // the resource from which the rule collects its data. For this type dataSource will always be of type RuleMetricDataSource. DataSource RuleDataSourceClassification }
RuleCondition - The condition that results in the alert rule being activated.
func (*RuleCondition) GetRuleCondition ¶
func (r *RuleCondition) GetRuleCondition() *RuleCondition
GetRuleCondition implements the RuleConditionClassification interface for type RuleCondition.
func (RuleCondition) MarshalJSON ¶ added in v0.4.0
func (r RuleCondition) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type RuleCondition.
func (*RuleCondition) UnmarshalJSON ¶
func (r *RuleCondition) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type RuleCondition.
type RuleConditionClassification ¶
type RuleConditionClassification interface { // GetRuleCondition returns the RuleCondition content of the underlying type. GetRuleCondition() *RuleCondition }
RuleConditionClassification provides polymorphic access to related types. Call the interface's GetRuleCondition() method to access the common type. Use a type switch to determine the concrete type. The possible types are: - *LocationThresholdRuleCondition, *ManagementEventRuleCondition, *RuleCondition, *ThresholdRuleCondition
type RuleDataSource ¶
type RuleDataSource struct { // REQUIRED; specifies the type of data source. There are two types of rule data sources: RuleMetricDataSource and RuleManagementEventDataSource ODataType *string // the legacy resource identifier of the resource the rule monitors. NOTE: this property cannot be updated for an existing // rule. LegacyResourceID *string // the namespace of the metric. MetricNamespace *string // the location of the resource. ResourceLocation *string // the resource identifier of the resource the rule monitors. NOTE: this property cannot be updated for an existing rule. ResourceURI *string }
RuleDataSource - The resource from which the rule collects its data.
func (*RuleDataSource) GetRuleDataSource ¶
func (r *RuleDataSource) GetRuleDataSource() *RuleDataSource
GetRuleDataSource implements the RuleDataSourceClassification interface for type RuleDataSource.
func (RuleDataSource) MarshalJSON ¶ added in v0.8.0
func (r RuleDataSource) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type RuleDataSource.
func (*RuleDataSource) UnmarshalJSON ¶
func (r *RuleDataSource) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type RuleDataSource.
type RuleDataSourceClassification ¶
type RuleDataSourceClassification interface { // GetRuleDataSource returns the RuleDataSource content of the underlying type. GetRuleDataSource() *RuleDataSource }
RuleDataSourceClassification provides polymorphic access to related types. Call the interface's GetRuleDataSource() method to access the common type. Use a type switch to determine the concrete type. The possible types are: - *RuleDataSource, *RuleManagementEventDataSource, *RuleMetricDataSource
type RuleEmailAction ¶
type RuleEmailAction struct { // REQUIRED; specifies the type of the action. There are two types of actions: RuleEmailAction and RuleWebhookAction. ODataType *string // the list of administrator's custom email addresses to notify of the activation of the alert. CustomEmails []*string // Whether the administrators (service and co-administrators) of the service should be notified when the alert is activated. SendToServiceOwners *bool }
RuleEmailAction - Specifies the action to send email when the rule condition is evaluated. The discriminator is always RuleEmailAction in this case.
func (*RuleEmailAction) GetRuleAction ¶ added in v0.4.0
func (r *RuleEmailAction) GetRuleAction() *RuleAction
GetRuleAction implements the RuleActionClassification interface for type RuleEmailAction.
func (RuleEmailAction) MarshalJSON ¶
func (r RuleEmailAction) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type RuleEmailAction.
func (*RuleEmailAction) UnmarshalJSON ¶
func (r *RuleEmailAction) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type RuleEmailAction.
type RuleManagementEventClaimsDataSource ¶
type RuleManagementEventClaimsDataSource struct { // the email address. EmailAddress *string }
RuleManagementEventClaimsDataSource - The claims for a rule management event data source.
func (RuleManagementEventClaimsDataSource) MarshalJSON ¶ added in v0.8.0
func (r RuleManagementEventClaimsDataSource) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type RuleManagementEventClaimsDataSource.
func (*RuleManagementEventClaimsDataSource) UnmarshalJSON ¶ added in v0.8.0
func (r *RuleManagementEventClaimsDataSource) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type RuleManagementEventClaimsDataSource.
type RuleManagementEventDataSource ¶
type RuleManagementEventDataSource struct { // REQUIRED; specifies the type of data source. There are two types of rule data sources: RuleMetricDataSource and RuleManagementEventDataSource ODataType *string // the claims. Claims *RuleManagementEventClaimsDataSource // the event name. EventName *string // the event source. EventSource *string // the legacy resource identifier of the resource the rule monitors. NOTE: this property cannot be updated for an existing // rule. LegacyResourceID *string // the level. Level *string // the namespace of the metric. MetricNamespace *string // The name of the operation that should be checked for. If no name is provided, any operation will match. OperationName *string // the resource group name. ResourceGroupName *string // the location of the resource. ResourceLocation *string // the resource provider name. ResourceProviderName *string // the resource identifier of the resource the rule monitors. NOTE: this property cannot be updated for an existing rule. ResourceURI *string // The status of the operation that should be checked for. If no status is provided, any status will match. Status *string // the substatus. SubStatus *string }
RuleManagementEventDataSource - A rule management event data source. The discriminator fields is always RuleManagementEventDataSource in this case.
func (*RuleManagementEventDataSource) GetRuleDataSource ¶ added in v0.4.0
func (r *RuleManagementEventDataSource) GetRuleDataSource() *RuleDataSource
GetRuleDataSource implements the RuleDataSourceClassification interface for type RuleManagementEventDataSource.
func (RuleManagementEventDataSource) MarshalJSON ¶
func (r RuleManagementEventDataSource) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type RuleManagementEventDataSource.
func (*RuleManagementEventDataSource) UnmarshalJSON ¶
func (r *RuleManagementEventDataSource) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type RuleManagementEventDataSource.
type RuleMetricDataSource ¶
type RuleMetricDataSource struct { // REQUIRED; specifies the type of data source. There are two types of rule data sources: RuleMetricDataSource and RuleManagementEventDataSource ODataType *string // the legacy resource identifier of the resource the rule monitors. NOTE: this property cannot be updated for an existing // rule. LegacyResourceID *string // the name of the metric that defines what the rule monitors. MetricName *string // the namespace of the metric. MetricNamespace *string // the location of the resource. ResourceLocation *string // the resource identifier of the resource the rule monitors. NOTE: this property cannot be updated for an existing rule. ResourceURI *string }
RuleMetricDataSource - A rule metric data source. The discriminator value is always RuleMetricDataSource in this case.
func (*RuleMetricDataSource) GetRuleDataSource ¶ added in v0.4.0
func (r *RuleMetricDataSource) GetRuleDataSource() *RuleDataSource
GetRuleDataSource implements the RuleDataSourceClassification interface for type RuleMetricDataSource.
func (RuleMetricDataSource) MarshalJSON ¶
func (r RuleMetricDataSource) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type RuleMetricDataSource.
func (*RuleMetricDataSource) UnmarshalJSON ¶
func (r *RuleMetricDataSource) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type RuleMetricDataSource.
type RuleResolveConfiguration ¶ added in v0.9.0
type RuleResolveConfiguration struct { // The flag that indicates whether or not to auto resolve a fired alert. AutoResolved *bool // The duration a rule must evaluate as healthy before the fired alert is automatically resolved represented in ISO 8601 duration // format. TimeToResolve *string }
RuleResolveConfiguration - TBD. Relevant only for rules of the kind LogAlert.
func (RuleResolveConfiguration) MarshalJSON ¶ added in v0.9.0
func (r RuleResolveConfiguration) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type RuleResolveConfiguration.
func (*RuleResolveConfiguration) UnmarshalJSON ¶ added in v0.9.0
func (r *RuleResolveConfiguration) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type RuleResolveConfiguration.
type RuleWebhookAction ¶
type RuleWebhookAction struct { // REQUIRED; specifies the type of the action. There are two types of actions: RuleEmailAction and RuleWebhookAction. ODataType *string // the dictionary of custom properties to include with the post operation. These data are appended to the webhook payload. Properties map[string]*string // the service uri to Post the notification when the alert activates or resolves. ServiceURI *string }
RuleWebhookAction - Specifies the action to post to service when the rule condition is evaluated. The discriminator is always RuleWebhookAction in this case.
func (*RuleWebhookAction) GetRuleAction ¶ added in v0.4.0
func (r *RuleWebhookAction) GetRuleAction() *RuleAction
GetRuleAction implements the RuleActionClassification interface for type RuleWebhookAction.
func (RuleWebhookAction) MarshalJSON ¶
func (r RuleWebhookAction) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type RuleWebhookAction.
func (*RuleWebhookAction) UnmarshalJSON ¶
func (r *RuleWebhookAction) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type RuleWebhookAction.
type ScaleAction ¶
type ScaleAction struct { // REQUIRED; the amount of time to wait since the last scaling action before this action occurs. It must be between 1 week // and 1 minute in ISO 8601 format. Cooldown *string // REQUIRED; the scale direction. Whether the scaling action increases or decreases the number of instances. Direction *ScaleDirection // REQUIRED; the type of action that should occur when the scale rule fires. Type *ScaleType // the number of instances that are involved in the scaling action. This value must be 1 or greater. The default value is // 1. Value *string }
ScaleAction - The parameters for the scaling action.
func (ScaleAction) MarshalJSON ¶ added in v0.8.0
func (s ScaleAction) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ScaleAction.
func (*ScaleAction) UnmarshalJSON ¶ added in v0.8.0
func (s *ScaleAction) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ScaleAction.
type ScaleCapacity ¶
type ScaleCapacity struct { // REQUIRED; the number of instances that will be set if metrics are not available for evaluation. The default is only used // if the current instance count is lower than the default. Default *string // REQUIRED; the maximum number of instances for the resource. The actual maximum number of instances is limited by the cores // that are available in the subscription. Maximum *string // REQUIRED; the minimum number of instances for the resource. Minimum *string }
ScaleCapacity - The number of instances that can be used during this profile.
func (ScaleCapacity) MarshalJSON ¶ added in v0.8.0
func (s ScaleCapacity) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ScaleCapacity.
func (*ScaleCapacity) UnmarshalJSON ¶ added in v0.8.0
func (s *ScaleCapacity) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ScaleCapacity.
type ScaleDirection ¶
type ScaleDirection string
ScaleDirection - the scale direction. Whether the scaling action increases or decreases the number of instances.
const ( ScaleDirectionDecrease ScaleDirection = "Decrease" ScaleDirectionIncrease ScaleDirection = "Increase" ScaleDirectionNone ScaleDirection = "None" )
func PossibleScaleDirectionValues ¶
func PossibleScaleDirectionValues() []ScaleDirection
PossibleScaleDirectionValues returns the possible values for the ScaleDirection const type.
type ScaleRule ¶
type ScaleRule struct { // REQUIRED; the trigger that results in a scaling action. MetricTrigger *MetricTrigger // REQUIRED; the parameters for the scaling action. ScaleAction *ScaleAction }
ScaleRule - A rule that provide the triggers and parameters for the scaling action.
func (ScaleRule) MarshalJSON ¶ added in v0.8.0
MarshalJSON implements the json.Marshaller interface for type ScaleRule.
func (*ScaleRule) UnmarshalJSON ¶ added in v0.8.0
UnmarshalJSON implements the json.Unmarshaller interface for type ScaleRule.
type ScaleRuleMetricDimension ¶
type ScaleRuleMetricDimension struct { // REQUIRED; Name of the dimension. DimensionName *string // REQUIRED; the dimension operator. Only 'Equals' and 'NotEquals' are supported. 'Equals' being equal to any of the values. // 'NotEquals' being not equal to all of the values Operator *ScaleRuleMetricDimensionOperationType // REQUIRED; list of dimension values. For example: ["App1","App2"]. Values []*string }
ScaleRuleMetricDimension - Specifies an auto scale rule metric dimension.
func (ScaleRuleMetricDimension) MarshalJSON ¶
func (s ScaleRuleMetricDimension) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ScaleRuleMetricDimension.
func (*ScaleRuleMetricDimension) UnmarshalJSON ¶ added in v0.8.0
func (s *ScaleRuleMetricDimension) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ScaleRuleMetricDimension.
type ScaleRuleMetricDimensionOperationType ¶
type ScaleRuleMetricDimensionOperationType string
ScaleRuleMetricDimensionOperationType - the dimension operator. Only 'Equals' and 'NotEquals' are supported. 'Equals' being equal to any of the values. 'NotEquals' being not equal to all of the values
const ( ScaleRuleMetricDimensionOperationTypeEquals ScaleRuleMetricDimensionOperationType = "Equals" ScaleRuleMetricDimensionOperationTypeNotEquals ScaleRuleMetricDimensionOperationType = "NotEquals" )
func PossibleScaleRuleMetricDimensionOperationTypeValues ¶
func PossibleScaleRuleMetricDimensionOperationTypeValues() []ScaleRuleMetricDimensionOperationType
PossibleScaleRuleMetricDimensionOperationTypeValues returns the possible values for the ScaleRuleMetricDimensionOperationType const type.
type ScaleType ¶
type ScaleType string
ScaleType - the type of action that should occur when the scale rule fires.
func PossibleScaleTypeValues ¶
func PossibleScaleTypeValues() []ScaleType
PossibleScaleTypeValues returns the possible values for the ScaleType const type.
type ScheduledQueryRuleCriteria ¶ added in v0.8.0
type ScheduledQueryRuleCriteria struct { // A list of conditions to evaluate against the specified scopes AllOf []*Condition }
ScheduledQueryRuleCriteria - The rule criteria that defines the conditions of the scheduled query rule.
func (ScheduledQueryRuleCriteria) MarshalJSON ¶ added in v0.8.0
func (s ScheduledQueryRuleCriteria) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ScheduledQueryRuleCriteria.
func (*ScheduledQueryRuleCriteria) UnmarshalJSON ¶ added in v0.8.0
func (s *ScheduledQueryRuleCriteria) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ScheduledQueryRuleCriteria.
type ScheduledQueryRuleProperties ¶ added in v0.8.0
type ScheduledQueryRuleProperties struct { // Actions to invoke when the alert fires. Actions *Actions // The flag that indicates whether the alert should be automatically resolved or not. The default is true. Relevant only for // rules of the kind LogAlert. AutoMitigate *bool // The flag which indicates whether this scheduled query rule should be stored in the customer's storage. The default is false. // Relevant only for rules of the kind LogAlert. CheckWorkspaceAlertsStorageConfigured *bool // The rule criteria that defines the conditions of the scheduled query rule. Criteria *ScheduledQueryRuleCriteria // The description of the scheduled query rule. Description *string // The display name of the alert rule DisplayName *string // The flag which indicates whether this scheduled query rule is enabled. Value should be true or false Enabled *bool // How often the scheduled query rule is evaluated represented in ISO 8601 duration format. Relevant and required only for // rules of the kind LogAlert. EvaluationFrequency *string // Mute actions for the chosen period of time (in ISO 8601 duration format) after the alert is fired. Relevant only for rules // of the kind LogAlert. MuteActionsDuration *string // If specified then overrides the query time range (default is WindowSize*NumberOfEvaluationPeriods). Relevant only for rules // of the kind LogAlert. OverrideQueryTimeRange *string // This determines if traffic is allowed over public network. By default it is enabled. PublicNetworkAccess *PublicNetworkAccess // Defines the configuration for resolving fired alerts. Relevant only for rules of the kind LogAlert. RuleResolveConfiguration *RuleResolveConfiguration // The list of resource id's that this scheduled query rule is scoped to. Scopes []*string // Severity of the alert. Should be an integer between [0-4]. Value of 0 is severest. Relevant and required only for rules // of the kind LogAlert. Severity *AlertSeverity // The flag which indicates whether the provided query should be validated or not. The default is false. Relevant only for // rules of the kind LogAlert. SkipQueryValidation *bool // List of resource type of the target resource(s) on which the alert is created/updated. For example if the scope is a resource // group and targetResourceTypes is Microsoft.Compute/virtualMachines, then a // different alert will be fired for each virtual machine in the resource group which meet the alert criteria. Relevant only // for rules of the kind LogAlert TargetResourceTypes []*string // The period of time (in ISO 8601 duration format) on which the Alert query will be executed (bin size). Relevant and required // only for rules of the kind LogAlert. WindowSize *string // READ-ONLY; The api-version used when creating this alert rule CreatedWithAPIVersion *string // READ-ONLY; True if alert rule is legacy Log Analytic rule IsLegacyLogAnalyticsRule *bool // READ-ONLY; The flag which indicates whether this scheduled query rule has been configured to be stored in the customer's // storage. The default is false. IsWorkspaceAlertsStorageConfigured *bool }
ScheduledQueryRuleProperties - scheduled query rule Definition
func (ScheduledQueryRuleProperties) MarshalJSON ¶ added in v0.8.0
func (s ScheduledQueryRuleProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ScheduledQueryRuleProperties.
func (*ScheduledQueryRuleProperties) UnmarshalJSON ¶ added in v0.8.0
func (s *ScheduledQueryRuleProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ScheduledQueryRuleProperties.
type ScheduledQueryRuleResource ¶ added in v0.8.0
type ScheduledQueryRuleResource struct { // REQUIRED; The geo-location where the resource lives Location *string // REQUIRED; The rule properties of the resource. Properties *ScheduledQueryRuleProperties // The identity of the resource. Identity *Identity // Indicates the type of scheduled query rule. The default is LogAlert. Kind *Kind // Resource tags. Tags map[string]*string // READ-ONLY; The etag field is not required. If it is provided in the response body, it must also be provided as a header // per the normal etag convention. Entity tags are used for comparing two or more entities // from the same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section 14.24), If-None-Match // (section 14.26), and If-Range (section 14.27) header fields. Etag *string // 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; SystemData of ScheduledQueryRule. SystemData *SystemData // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string }
ScheduledQueryRuleResource - The scheduled query rule resource.
func (ScheduledQueryRuleResource) MarshalJSON ¶ added in v0.8.0
func (s ScheduledQueryRuleResource) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ScheduledQueryRuleResource.
func (*ScheduledQueryRuleResource) UnmarshalJSON ¶ added in v0.8.0
func (s *ScheduledQueryRuleResource) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ScheduledQueryRuleResource.
type ScheduledQueryRuleResourceCollection ¶ added in v0.8.0
type ScheduledQueryRuleResourceCollection struct { // The values for the scheduled query rule resources. Value []*ScheduledQueryRuleResource // READ-ONLY; Provides the link to retrieve the next set of elements. NextLink *string }
ScheduledQueryRuleResourceCollection - Represents a collection of scheduled query rule resources.
func (ScheduledQueryRuleResourceCollection) MarshalJSON ¶ added in v0.8.0
func (s ScheduledQueryRuleResourceCollection) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ScheduledQueryRuleResourceCollection.
func (*ScheduledQueryRuleResourceCollection) UnmarshalJSON ¶ added in v0.8.0
func (s *ScheduledQueryRuleResourceCollection) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ScheduledQueryRuleResourceCollection.
type ScheduledQueryRuleResourcePatch ¶ added in v0.8.0
type ScheduledQueryRuleResourcePatch struct { // The identity of the resource. Identity *Identity // The scheduled query rule properties of the resource. Properties *ScheduledQueryRuleProperties // Resource tags Tags map[string]*string }
ScheduledQueryRuleResourcePatch - The scheduled query rule resource for patch operations.
func (ScheduledQueryRuleResourcePatch) MarshalJSON ¶ added in v0.8.0
func (s ScheduledQueryRuleResourcePatch) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ScheduledQueryRuleResourcePatch.
func (*ScheduledQueryRuleResourcePatch) UnmarshalJSON ¶ added in v0.8.0
func (s *ScheduledQueryRuleResourcePatch) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ScheduledQueryRuleResourcePatch.
type ScheduledQueryRulesClient ¶
type ScheduledQueryRulesClient struct {
// contains filtered or unexported fields
}
ScheduledQueryRulesClient contains the methods for the ScheduledQueryRules group. Don't use this type directly, use NewScheduledQueryRulesClient() instead.
func NewScheduledQueryRulesClient ¶
func NewScheduledQueryRulesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ScheduledQueryRulesClient, error)
NewScheduledQueryRulesClient creates a new instance of ScheduledQueryRulesClient with the specified values.
- subscriptionID - The ID of the target subscription.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - pass nil to accept the default values.
func (*ScheduledQueryRulesClient) CreateOrUpdate ¶
func (client *ScheduledQueryRulesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, ruleName string, parameters ScheduledQueryRuleResource, options *ScheduledQueryRulesClientCreateOrUpdateOptions) (ScheduledQueryRulesClientCreateOrUpdateResponse, error)
CreateOrUpdate - Creates or updates a scheduled query rule. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2022-08-01-preview
- resourceGroupName - The name of the resource group. The name is case insensitive.
- ruleName - The name of the rule.
- parameters - The parameters of the rule to create or update.
- options - ScheduledQueryRulesClientCreateOrUpdateOptions contains the optional parameters for the ScheduledQueryRulesClient.CreateOrUpdate method.
Example (CreateOrUpdateAScheduledQueryRuleForSingleResource) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Insights/preview/2022-08-01-preview/examples/createOrUpdateScheduledQueryRule.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewScheduledQueryRulesClient().CreateOrUpdate(ctx, "QueryResourceGroupName", "perf", armmonitor.ScheduledQueryRuleResource{ Location: to.Ptr("eastus"), Properties: &armmonitor.ScheduledQueryRuleProperties{ Description: to.Ptr("Performance rule"), Actions: &armmonitor.Actions{ ActionGroups: []*string{ to.Ptr("/subscriptions/1cf177ed-1330-4692-80ea-fd3d7783b147/resourcegroups/sqrapi/providers/microsoft.insights/actiongroups/myactiongroup")}, CustomProperties: map[string]*string{ "key11": to.Ptr("value11"), "key12": to.Ptr("value12"), }, }, CheckWorkspaceAlertsStorageConfigured: to.Ptr(true), Criteria: &armmonitor.ScheduledQueryRuleCriteria{ AllOf: []*armmonitor.Condition{ { Dimensions: []*armmonitor.Dimension{ { Name: to.Ptr("ComputerIp"), Operator: to.Ptr(armmonitor.DimensionOperatorExclude), Values: []*string{ to.Ptr("192.168.1.1")}, }, { Name: to.Ptr("OSType"), Operator: to.Ptr(armmonitor.DimensionOperatorInclude), Values: []*string{ to.Ptr("*")}, }}, FailingPeriods: &armmonitor.ConditionFailingPeriods{ MinFailingPeriodsToAlert: to.Ptr[int64](1), NumberOfEvaluationPeriods: to.Ptr[int64](1), }, MetricMeasureColumn: to.Ptr("% Processor Time"), Operator: to.Ptr(armmonitor.ConditionOperatorGreaterThan), Query: to.Ptr("Perf | where ObjectName == \"Processor\""), ResourceIDColumn: to.Ptr("resourceId"), Threshold: to.Ptr[float64](70), TimeAggregation: to.Ptr(armmonitor.TimeAggregationAverage), }}, }, Enabled: to.Ptr(true), EvaluationFrequency: to.Ptr("PT5M"), MuteActionsDuration: to.Ptr("PT30M"), RuleResolveConfiguration: &armmonitor.RuleResolveConfiguration{ AutoResolved: to.Ptr(true), TimeToResolve: to.Ptr("PT10M"), }, Scopes: []*string{ to.Ptr("/subscriptions/aaf177ed-1330-a9f2-80ea-fd3d7783b147/resourceGroups/scopeResourceGroup1/providers/Microsoft.Compute/virtualMachines/vm1")}, Severity: to.Ptr(armmonitor.AlertSeverity(4)), SkipQueryValidation: to.Ptr(true), WindowSize: to.Ptr("PT10M"), }, }, 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.ScheduledQueryRuleResource = armmonitor.ScheduledQueryRuleResource{ // Name: to.Ptr("perf"), // Type: to.Ptr("microsoft.insights/scheduledqueryrules"), // ID: to.Ptr("/subscriptions/dd4bfc94-a096-412b-9c43-4bd13e35afbc/resourcegroups/QueryResourceGroupName/providers/microsoft.insights/scheduledqueryrules/perf"), // Location: to.Ptr("eastus"), // Properties: &armmonitor.ScheduledQueryRuleProperties{ // Description: to.Ptr("Performance rule"), // Actions: &armmonitor.Actions{ // ActionGroups: []*string{ // to.Ptr("/subscriptions/1cf177ed-1330-4692-80ea-fd3d7783b147/resourcegroups/sqrapi/providers/microsoft.insights/actiongroups/myactiongroup")}, // CustomProperties: map[string]*string{ // "key11": to.Ptr("value11"), // "key12": to.Ptr("value12"), // }, // }, // CheckWorkspaceAlertsStorageConfigured: to.Ptr(true), // Criteria: &armmonitor.ScheduledQueryRuleCriteria{ // AllOf: []*armmonitor.Condition{ // { // Dimensions: []*armmonitor.Dimension{ // { // Name: to.Ptr("ComputerIp"), // Operator: to.Ptr(armmonitor.DimensionOperatorExclude), // Values: []*string{ // to.Ptr("192.168.1.1")}, // }, // { // Name: to.Ptr("OSType"), // Operator: to.Ptr(armmonitor.DimensionOperatorInclude), // Values: []*string{ // to.Ptr("*")}, // }}, // FailingPeriods: &armmonitor.ConditionFailingPeriods{ // MinFailingPeriodsToAlert: to.Ptr[int64](1), // NumberOfEvaluationPeriods: to.Ptr[int64](1), // }, // MetricMeasureColumn: to.Ptr("% Processor Time"), // Operator: to.Ptr(armmonitor.ConditionOperatorGreaterThan), // Query: to.Ptr("Perf | where ObjectName == \"Processor\""), // ResourceIDColumn: to.Ptr("resourceId"), // Threshold: to.Ptr[float64](70), // TimeAggregation: to.Ptr(armmonitor.TimeAggregationAverage), // }}, // }, // Enabled: to.Ptr(true), // EvaluationFrequency: to.Ptr("PT5M"), // IsWorkspaceAlertsStorageConfigured: to.Ptr(true), // MuteActionsDuration: to.Ptr("PT30M"), // RuleResolveConfiguration: &armmonitor.RuleResolveConfiguration{ // AutoResolved: to.Ptr(true), // TimeToResolve: to.Ptr("PT10M"), // }, // Scopes: []*string{ // to.Ptr("/subscriptions/aaf177ed-1330-a9f2-80ea-fd3d7783b147/resourceGroups/scopeResourceGroup1/providers/Microsoft.Compute/virtualMachines/vm1")}, // Severity: to.Ptr(armmonitor.AlertSeverity(4)), // SkipQueryValidation: to.Ptr(true), // WindowSize: to.Ptr("PT10M"), // }, // Tags: map[string]*string{ // }, // } }
Output:
Example (CreateOrUpdateAScheduledQueryRuleOnResourceGroupS) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Insights/preview/2022-08-01-preview/examples/createOrUpdateScheduledQueryRuleResourceGroup.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewScheduledQueryRulesClient().CreateOrUpdate(ctx, "QueryResourceGroupName", "heartbeat", armmonitor.ScheduledQueryRuleResource{ Location: to.Ptr("eastus"), Properties: &armmonitor.ScheduledQueryRuleProperties{ Description: to.Ptr("Health check rule"), Actions: &armmonitor.Actions{ ActionGroups: []*string{ to.Ptr("/subscriptions/1cf177ed-1330-4692-80ea-fd3d7783b147/resourcegroups/sqrapi/providers/microsoft.insights/actiongroups/myactiongroup")}, CustomProperties: map[string]*string{ "key11": to.Ptr("value11"), "key12": to.Ptr("value12"), }, }, CheckWorkspaceAlertsStorageConfigured: to.Ptr(true), Criteria: &armmonitor.ScheduledQueryRuleCriteria{ AllOf: []*armmonitor.Condition{ { Dimensions: []*armmonitor.Dimension{}, FailingPeriods: &armmonitor.ConditionFailingPeriods{ MinFailingPeriodsToAlert: to.Ptr[int64](1), NumberOfEvaluationPeriods: to.Ptr[int64](1), }, Operator: to.Ptr(armmonitor.ConditionOperatorGreaterThan), Query: to.Ptr("Heartbeat"), Threshold: to.Ptr[float64](360), TimeAggregation: to.Ptr(armmonitor.TimeAggregationCount), }}, }, Enabled: to.Ptr(true), EvaluationFrequency: to.Ptr("PT5M"), MuteActionsDuration: to.Ptr("PT30M"), RuleResolveConfiguration: &armmonitor.RuleResolveConfiguration{ AutoResolved: to.Ptr(true), TimeToResolve: to.Ptr("PT10M"), }, Scopes: []*string{ to.Ptr("/subscriptions/aaf177ed-1330-a9f2-80ea-fd3d7783b147/resourceGroups/scopeResourceGroup1")}, Severity: to.Ptr(armmonitor.AlertSeverity(4)), SkipQueryValidation: to.Ptr(true), TargetResourceTypes: []*string{ to.Ptr("Microsoft.Compute/virtualMachines")}, WindowSize: to.Ptr("PT10M"), }, }, 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.ScheduledQueryRuleResource = armmonitor.ScheduledQueryRuleResource{ // Name: to.Ptr("heartbeat"), // Type: to.Ptr("microsoft.insights/scheduledqueryrules"), // ID: to.Ptr("/subscriptions/dd4bfc94-a096-412b-9c43-4bd13e35afbc/resourcegroups/QueryResourceGroupName/providers/microsoft.insights/scheduledqueryrules/heartbeat"), // Location: to.Ptr("eastus"), // Properties: &armmonitor.ScheduledQueryRuleProperties{ // Description: to.Ptr("Health check rule"), // Actions: &armmonitor.Actions{ // ActionGroups: []*string{ // to.Ptr("/subscriptions/1cf177ed-1330-4692-80ea-fd3d7783b147/resourcegroups/sqrapi/providers/microsoft.insights/actiongroups/myactiongroup")}, // CustomProperties: map[string]*string{ // "key11": to.Ptr("value11"), // "key12": to.Ptr("value12"), // }, // }, // CheckWorkspaceAlertsStorageConfigured: to.Ptr(true), // Criteria: &armmonitor.ScheduledQueryRuleCriteria{ // AllOf: []*armmonitor.Condition{ // { // Dimensions: []*armmonitor.Dimension{ // }, // FailingPeriods: &armmonitor.ConditionFailingPeriods{ // MinFailingPeriodsToAlert: to.Ptr[int64](1), // NumberOfEvaluationPeriods: to.Ptr[int64](1), // }, // Operator: to.Ptr(armmonitor.ConditionOperatorGreaterThan), // Query: to.Ptr("Heartbeat"), // Threshold: to.Ptr[float64](360), // TimeAggregation: to.Ptr(armmonitor.TimeAggregationCount), // }}, // }, // Enabled: to.Ptr(true), // EvaluationFrequency: to.Ptr("PT5M"), // IsWorkspaceAlertsStorageConfigured: to.Ptr(true), // MuteActionsDuration: to.Ptr("PT30M"), // RuleResolveConfiguration: &armmonitor.RuleResolveConfiguration{ // AutoResolved: to.Ptr(true), // TimeToResolve: to.Ptr("PT10M"), // }, // Scopes: []*string{ // to.Ptr("/subscriptions/aaf177ed-1330-a9f2-80ea-fd3d7783b147/resourceGroups/scopeResourceGroup1")}, // Severity: to.Ptr(armmonitor.AlertSeverity(4)), // SkipQueryValidation: to.Ptr(true), // TargetResourceTypes: []*string{ // to.Ptr("Microsoft.Compute/virtualMachines")}, // WindowSize: to.Ptr("PT10M"), // }, // Tags: map[string]*string{ // }, // } }
Output:
Example (CreateOrUpdateAScheduledQueryRuleOnSubscription) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Insights/preview/2022-08-01-preview/examples/createOrUpdateScheduledQueryRuleSubscription.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewScheduledQueryRulesClient().CreateOrUpdate(ctx, "QueryResourceGroupName", "perf", armmonitor.ScheduledQueryRuleResource{ Location: to.Ptr("eastus"), Properties: &armmonitor.ScheduledQueryRuleProperties{ Description: to.Ptr("Performance rule"), Actions: &armmonitor.Actions{ ActionGroups: []*string{ to.Ptr("/subscriptions/1cf177ed-1330-4692-80ea-fd3d7783b147/resourcegroups/sqrapi/providers/microsoft.insights/actiongroups/myactiongroup")}, CustomProperties: map[string]*string{ "key11": to.Ptr("value11"), "key12": to.Ptr("value12"), }, }, CheckWorkspaceAlertsStorageConfigured: to.Ptr(true), Criteria: &armmonitor.ScheduledQueryRuleCriteria{ AllOf: []*armmonitor.Condition{ { Dimensions: []*armmonitor.Dimension{ { Name: to.Ptr("ComputerIp"), Operator: to.Ptr(armmonitor.DimensionOperatorExclude), Values: []*string{ to.Ptr("192.168.1.1")}, }, { Name: to.Ptr("OSType"), Operator: to.Ptr(armmonitor.DimensionOperatorInclude), Values: []*string{ to.Ptr("*")}, }}, FailingPeriods: &armmonitor.ConditionFailingPeriods{ MinFailingPeriodsToAlert: to.Ptr[int64](1), NumberOfEvaluationPeriods: to.Ptr[int64](1), }, MetricMeasureColumn: to.Ptr("% Processor Time"), Operator: to.Ptr(armmonitor.ConditionOperatorGreaterThan), Query: to.Ptr("Perf | where ObjectName == \"Processor\""), ResourceIDColumn: to.Ptr("resourceId"), Threshold: to.Ptr[float64](70), TimeAggregation: to.Ptr(armmonitor.TimeAggregationAverage), }}, }, Enabled: to.Ptr(true), EvaluationFrequency: to.Ptr("PT5M"), MuteActionsDuration: to.Ptr("PT30M"), RuleResolveConfiguration: &armmonitor.RuleResolveConfiguration{ AutoResolved: to.Ptr(true), TimeToResolve: to.Ptr("PT10M"), }, Scopes: []*string{ to.Ptr("/subscriptions/aaf177ed-1330-a9f2-80ea-fd3d7783b147")}, Severity: to.Ptr(armmonitor.AlertSeverity(4)), SkipQueryValidation: to.Ptr(true), TargetResourceTypes: []*string{ to.Ptr("Microsoft.Compute/virtualMachines")}, WindowSize: to.Ptr("PT10M"), }, }, 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.ScheduledQueryRuleResource = armmonitor.ScheduledQueryRuleResource{ // Name: to.Ptr("perf"), // Type: to.Ptr("microsoft.insights/scheduledqueryrules"), // ID: to.Ptr("/subscriptions/dd4bfc94-a096-412b-9c43-4bd13e35afbc/resourcegroups/QueryResourceGroupName/providers/microsoft.insights/scheduledqueryrules/perf"), // Location: to.Ptr("eastus"), // Properties: &armmonitor.ScheduledQueryRuleProperties{ // Description: to.Ptr("Performance rule"), // Actions: &armmonitor.Actions{ // ActionGroups: []*string{ // to.Ptr("/subscriptions/1cf177ed-1330-4692-80ea-fd3d7783b147/resourcegroups/sqrapi/providers/microsoft.insights/actiongroups/myactiongroup")}, // CustomProperties: map[string]*string{ // "key11": to.Ptr("value11"), // "key12": to.Ptr("value12"), // }, // }, // CheckWorkspaceAlertsStorageConfigured: to.Ptr(true), // Criteria: &armmonitor.ScheduledQueryRuleCriteria{ // AllOf: []*armmonitor.Condition{ // { // Dimensions: []*armmonitor.Dimension{ // { // Name: to.Ptr("ComputerIp"), // Operator: to.Ptr(armmonitor.DimensionOperatorExclude), // Values: []*string{ // to.Ptr("192.168.1.1")}, // }, // { // Name: to.Ptr("OSType"), // Operator: to.Ptr(armmonitor.DimensionOperatorInclude), // Values: []*string{ // to.Ptr("*")}, // }}, // FailingPeriods: &armmonitor.ConditionFailingPeriods{ // MinFailingPeriodsToAlert: to.Ptr[int64](1), // NumberOfEvaluationPeriods: to.Ptr[int64](1), // }, // MetricMeasureColumn: to.Ptr("% Processor Time"), // Operator: to.Ptr(armmonitor.ConditionOperatorGreaterThan), // Query: to.Ptr("Perf | where ObjectName == \"Processor\""), // ResourceIDColumn: to.Ptr("resourceId"), // Threshold: to.Ptr[float64](70), // TimeAggregation: to.Ptr(armmonitor.TimeAggregationAverage), // }}, // }, // Enabled: to.Ptr(true), // EvaluationFrequency: to.Ptr("PT5M"), // IsWorkspaceAlertsStorageConfigured: to.Ptr(true), // MuteActionsDuration: to.Ptr("PT30M"), // RuleResolveConfiguration: &armmonitor.RuleResolveConfiguration{ // AutoResolved: to.Ptr(true), // TimeToResolve: to.Ptr("PT10M"), // }, // Scopes: []*string{ // to.Ptr("/subscriptions/aaf177ed-1330-a9f2-80ea-fd3d7783b147")}, // Severity: to.Ptr(armmonitor.AlertSeverity(4)), // SkipQueryValidation: to.Ptr(true), // TargetResourceTypes: []*string{ // to.Ptr("Microsoft.Compute/virtualMachines")}, // WindowSize: to.Ptr("PT10M"), // }, // Tags: map[string]*string{ // }, // } }
Output:
func (*ScheduledQueryRulesClient) Delete ¶
func (client *ScheduledQueryRulesClient) Delete(ctx context.Context, resourceGroupName string, ruleName string, options *ScheduledQueryRulesClientDeleteOptions) (ScheduledQueryRulesClientDeleteResponse, error)
Delete - Deletes a scheduled query rule. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2022-08-01-preview
- resourceGroupName - The name of the resource group. The name is case insensitive.
- ruleName - The name of the rule.
- options - ScheduledQueryRulesClientDeleteOptions contains the optional parameters for the ScheduledQueryRulesClient.Delete method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Insights/preview/2022-08-01-preview/examples/deleteScheduledQueryRule.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } _, err = clientFactory.NewScheduledQueryRulesClient().Delete(ctx, "QueryResourceGroupName", "heartbeat", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } }
Output:
func (*ScheduledQueryRulesClient) Get ¶
func (client *ScheduledQueryRulesClient) Get(ctx context.Context, resourceGroupName string, ruleName string, options *ScheduledQueryRulesClientGetOptions) (ScheduledQueryRulesClientGetResponse, error)
Get - Retrieve an scheduled query rule definition. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2022-08-01-preview
- resourceGroupName - The name of the resource group. The name is case insensitive.
- ruleName - The name of the rule.
- options - ScheduledQueryRulesClientGetOptions contains the optional parameters for the ScheduledQueryRulesClient.Get method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Insights/preview/2022-08-01-preview/examples/getScheduledQueryRule.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewScheduledQueryRulesClient().Get(ctx, "QueryResourceGroupName", "perf", 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.ScheduledQueryRuleResource = armmonitor.ScheduledQueryRuleResource{ // Name: to.Ptr("perf"), // Type: to.Ptr("microsoft.insights/scheduledqueryrules"), // ID: to.Ptr("/subscriptions/dd4bfc94-a096-412b-9c43-4bd13e35afbc/resourcegroups/QueryResourceGroupName/providers/microsoft.insights/scheduledqueryrules/perf"), // Location: to.Ptr("eastus"), // Properties: &armmonitor.ScheduledQueryRuleProperties{ // Description: to.Ptr("Performance rule"), // Actions: &armmonitor.Actions{ // ActionGroups: []*string{ // to.Ptr("/subscriptions/1cf177ed-1330-4692-80ea-fd3d7783b147/resourcegroups/sqrapi/providers/microsoft.insights/actiongroups/myactiongroup")}, // CustomProperties: map[string]*string{ // "key11": to.Ptr("value11"), // "key12": to.Ptr("value12"), // }, // }, // CheckWorkspaceAlertsStorageConfigured: to.Ptr(true), // Criteria: &armmonitor.ScheduledQueryRuleCriteria{ // AllOf: []*armmonitor.Condition{ // { // Dimensions: []*armmonitor.Dimension{ // { // Name: to.Ptr("ComputerIp"), // Operator: to.Ptr(armmonitor.DimensionOperatorExclude), // Values: []*string{ // to.Ptr("192.168.1.1")}, // }, // { // Name: to.Ptr("OSType"), // Operator: to.Ptr(armmonitor.DimensionOperatorInclude), // Values: []*string{ // to.Ptr("*")}, // }}, // FailingPeriods: &armmonitor.ConditionFailingPeriods{ // MinFailingPeriodsToAlert: to.Ptr[int64](1), // NumberOfEvaluationPeriods: to.Ptr[int64](1), // }, // MetricMeasureColumn: to.Ptr("% Processor Time"), // Operator: to.Ptr(armmonitor.ConditionOperatorGreaterThan), // Query: to.Ptr("Perf | where ObjectName == \"Processor\""), // ResourceIDColumn: to.Ptr("resourceId"), // Threshold: to.Ptr[float64](70), // TimeAggregation: to.Ptr(armmonitor.TimeAggregationAverage), // }}, // }, // Enabled: to.Ptr(true), // EvaluationFrequency: to.Ptr("PT5M"), // IsWorkspaceAlertsStorageConfigured: to.Ptr(true), // MuteActionsDuration: to.Ptr("PT30M"), // RuleResolveConfiguration: &armmonitor.RuleResolveConfiguration{ // AutoResolved: to.Ptr(true), // TimeToResolve: to.Ptr("PT10M"), // }, // Scopes: []*string{ // to.Ptr("/subscriptions/aaf177ed-1330-a9f2-80ea-fd3d7783b147/resourceGroups/scopeResourceGroup1/providers/Microsoft.Compute/virtualMachines/vm1")}, // Severity: to.Ptr(armmonitor.AlertSeverity(4)), // SkipQueryValidation: to.Ptr(true), // WindowSize: to.Ptr("PT10M"), // }, // Tags: map[string]*string{ // }, // } }
Output:
func (*ScheduledQueryRulesClient) NewListByResourceGroupPager ¶ added in v0.6.0
func (client *ScheduledQueryRulesClient) NewListByResourceGroupPager(resourceGroupName string, options *ScheduledQueryRulesClientListByResourceGroupOptions) *runtime.Pager[ScheduledQueryRulesClientListByResourceGroupResponse]
NewListByResourceGroupPager - Retrieve scheduled query rule definitions in a resource group.
Generated from API version 2022-08-01-preview
- resourceGroupName - The name of the resource group. The name is case insensitive.
- options - ScheduledQueryRulesClientListByResourceGroupOptions contains the optional parameters for the ScheduledQueryRulesClient.NewListByResourceGroupPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Insights/preview/2022-08-01-preview/examples/listScheduledQueryRulesByResourceGroup.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewScheduledQueryRulesClient().NewListByResourceGroupPager("QueryResourceGroupName", 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.ScheduledQueryRuleResourceCollection = armmonitor.ScheduledQueryRuleResourceCollection{ // Value: []*armmonitor.ScheduledQueryRuleResource{ // { // Name: to.Ptr("perf"), // Type: to.Ptr("microsoft.insights/scheduledqueryrules"), // ID: to.Ptr("/subscriptions/dd4bfc94-a096-412b-9c43-4bd13e35afbc/resourcegroups/QueryResourceGroupName/providers/microsoft.insights/scheduledqueryrules/perf"), // Location: to.Ptr("eastus"), // Properties: &armmonitor.ScheduledQueryRuleProperties{ // Description: to.Ptr("Performance rule"), // Actions: &armmonitor.Actions{ // ActionGroups: []*string{ // to.Ptr("/subscriptions/1cf177ed-1330-4692-80ea-fd3d7783b147/resourcegroups/sqrapi/providers/microsoft.insights/actiongroups/myactiongroup")}, // CustomProperties: map[string]*string{ // "key11": to.Ptr("value11"), // "key12": to.Ptr("value12"), // }, // }, // CheckWorkspaceAlertsStorageConfigured: to.Ptr(true), // Criteria: &armmonitor.ScheduledQueryRuleCriteria{ // AllOf: []*armmonitor.Condition{ // { // Dimensions: []*armmonitor.Dimension{ // { // Name: to.Ptr("ComputerIp"), // Operator: to.Ptr(armmonitor.DimensionOperatorExclude), // Values: []*string{ // to.Ptr("192.168.1.1")}, // }, // { // Name: to.Ptr("OSType"), // Operator: to.Ptr(armmonitor.DimensionOperatorInclude), // Values: []*string{ // to.Ptr("*")}, // }}, // FailingPeriods: &armmonitor.ConditionFailingPeriods{ // MinFailingPeriodsToAlert: to.Ptr[int64](1), // NumberOfEvaluationPeriods: to.Ptr[int64](1), // }, // MetricMeasureColumn: to.Ptr("% Processor Time"), // Operator: to.Ptr(armmonitor.ConditionOperatorGreaterThan), // Query: to.Ptr("Perf | where ObjectName == \"Processor\""), // ResourceIDColumn: to.Ptr("resourceId"), // Threshold: to.Ptr[float64](70), // TimeAggregation: to.Ptr(armmonitor.TimeAggregationAverage), // }}, // }, // Enabled: to.Ptr(true), // EvaluationFrequency: to.Ptr("PT5M"), // IsWorkspaceAlertsStorageConfigured: to.Ptr(true), // MuteActionsDuration: to.Ptr("PT30M"), // RuleResolveConfiguration: &armmonitor.RuleResolveConfiguration{ // AutoResolved: to.Ptr(true), // TimeToResolve: to.Ptr("PT10M"), // }, // Scopes: []*string{ // to.Ptr("/subscriptions/aaf177ed-1330-a9f2-80ea-fd3d7783b147/resourceGroups/scopeResourceGroup1")}, // Severity: to.Ptr(armmonitor.AlertSeverity(4)), // SkipQueryValidation: to.Ptr(true), // TargetResourceTypes: []*string{ // to.Ptr("Microsoft.Compute/virtualMachines")}, // WindowSize: to.Ptr("PT10M"), // }, // Tags: map[string]*string{ // }, // }, // { // Name: to.Ptr("heartbeat"), // Type: to.Ptr("microsoft.insights/scheduledqueryrules"), // ID: to.Ptr("/subscriptions/dd4bfc94-a096-412b-9c43-4bd13e35afbc/resourcegroups/QueryResourceGroupName/providers/microsoft.insights/scheduledqueryrules/heartbeat"), // Location: to.Ptr("eastus"), // Properties: &armmonitor.ScheduledQueryRuleProperties{ // Description: to.Ptr("Health check rule"), // Actions: &armmonitor.Actions{ // ActionGroups: []*string{ // to.Ptr("/subscriptions/1cf177ed-1330-4692-80ea-fd3d7783b147/resourcegroups/sqrapi/providers/microsoft.insights/actiongroups/myactiongroup")}, // CustomProperties: map[string]*string{ // "key11": to.Ptr("value11"), // "key12": to.Ptr("value12"), // }, // }, // CheckWorkspaceAlertsStorageConfigured: to.Ptr(true), // Criteria: &armmonitor.ScheduledQueryRuleCriteria{ // AllOf: []*armmonitor.Condition{ // { // Dimensions: []*armmonitor.Dimension{ // }, // FailingPeriods: &armmonitor.ConditionFailingPeriods{ // MinFailingPeriodsToAlert: to.Ptr[int64](1), // NumberOfEvaluationPeriods: to.Ptr[int64](1), // }, // Operator: to.Ptr(armmonitor.ConditionOperatorGreaterThan), // Query: to.Ptr("Heartbeat"), // Threshold: to.Ptr[float64](360), // TimeAggregation: to.Ptr(armmonitor.TimeAggregationCount), // }}, // }, // Enabled: to.Ptr(true), // EvaluationFrequency: to.Ptr("PT5M"), // IsWorkspaceAlertsStorageConfigured: to.Ptr(true), // MuteActionsDuration: to.Ptr("PT30M"), // RuleResolveConfiguration: &armmonitor.RuleResolveConfiguration{ // AutoResolved: to.Ptr(true), // TimeToResolve: to.Ptr("PT10M"), // }, // Scopes: []*string{ // to.Ptr("/subscriptions/aaf177ed-1330-a9f2-80ea-fd3d7783b147/resourceGroups/scopeResourceGroup1")}, // Severity: to.Ptr(armmonitor.AlertSeverity(4)), // SkipQueryValidation: to.Ptr(true), // TargetResourceTypes: []*string{ // to.Ptr("Microsoft.Compute/virtualMachines")}, // WindowSize: to.Ptr("PT10M"), // }, // Tags: map[string]*string{ // }, // }}, // } } }
Output:
func (*ScheduledQueryRulesClient) NewListBySubscriptionPager ¶ added in v0.6.0
func (client *ScheduledQueryRulesClient) NewListBySubscriptionPager(options *ScheduledQueryRulesClientListBySubscriptionOptions) *runtime.Pager[ScheduledQueryRulesClientListBySubscriptionResponse]
NewListBySubscriptionPager - Retrieve a scheduled query rule definitions in a subscription.
Generated from API version 2022-08-01-preview
- options - ScheduledQueryRulesClientListBySubscriptionOptions contains the optional parameters for the ScheduledQueryRulesClient.NewListBySubscriptionPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Insights/preview/2022-08-01-preview/examples/listScheduledQueryRulesBySubscription.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewScheduledQueryRulesClient().NewListBySubscriptionPager(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.ScheduledQueryRuleResourceCollection = armmonitor.ScheduledQueryRuleResourceCollection{ // Value: []*armmonitor.ScheduledQueryRuleResource{ // { // Name: to.Ptr("perf"), // Type: to.Ptr("microsoft.insights/scheduledqueryrules"), // ID: to.Ptr("/subscriptions/dd4bfc94-a096-412b-9c43-4bd13e35afbc/resourcegroups/QueryResourceGroupName/providers/microsoft.insights/scheduledqueryrules/perf"), // Location: to.Ptr("eastus"), // Properties: &armmonitor.ScheduledQueryRuleProperties{ // Description: to.Ptr("Performance rule"), // Actions: &armmonitor.Actions{ // ActionGroups: []*string{ // to.Ptr("/subscriptions/1cf177ed-1330-4692-80ea-fd3d7783b147/resourcegroups/sqrapi/providers/microsoft.insights/actiongroups/myactiongroup")}, // CustomProperties: map[string]*string{ // "key11": to.Ptr("value11"), // "key12": to.Ptr("value12"), // }, // }, // CheckWorkspaceAlertsStorageConfigured: to.Ptr(true), // Criteria: &armmonitor.ScheduledQueryRuleCriteria{ // AllOf: []*armmonitor.Condition{ // { // Dimensions: []*armmonitor.Dimension{ // { // Name: to.Ptr("ComputerIp"), // Operator: to.Ptr(armmonitor.DimensionOperatorExclude), // Values: []*string{ // to.Ptr("192.168.1.1")}, // }, // { // Name: to.Ptr("OSType"), // Operator: to.Ptr(armmonitor.DimensionOperatorInclude), // Values: []*string{ // to.Ptr("*")}, // }}, // FailingPeriods: &armmonitor.ConditionFailingPeriods{ // MinFailingPeriodsToAlert: to.Ptr[int64](1), // NumberOfEvaluationPeriods: to.Ptr[int64](1), // }, // MetricMeasureColumn: to.Ptr("% Processor Time"), // Operator: to.Ptr(armmonitor.ConditionOperatorGreaterThan), // Query: to.Ptr("Perf | where ObjectName == \"Processor\""), // ResourceIDColumn: to.Ptr("resourceId"), // Threshold: to.Ptr[float64](70), // TimeAggregation: to.Ptr(armmonitor.TimeAggregationAverage), // }}, // }, // Enabled: to.Ptr(true), // EvaluationFrequency: to.Ptr("PT5M"), // IsWorkspaceAlertsStorageConfigured: to.Ptr(true), // MuteActionsDuration: to.Ptr("PT30M"), // RuleResolveConfiguration: &armmonitor.RuleResolveConfiguration{ // AutoResolved: to.Ptr(true), // TimeToResolve: to.Ptr("PT10M"), // }, // Scopes: []*string{ // to.Ptr("/subscriptions/aaf177ed-1330-a9f2-80ea-fd3d7783b147")}, // Severity: to.Ptr(armmonitor.AlertSeverity(4)), // SkipQueryValidation: to.Ptr(true), // TargetResourceTypes: []*string{ // to.Ptr("Microsoft.Compute/virtualMachines")}, // WindowSize: to.Ptr("PT10M"), // }, // Tags: map[string]*string{ // }, // }, // { // Name: to.Ptr("heartbeat"), // Type: to.Ptr("microsoft.insights/scheduledqueryrules"), // ID: to.Ptr("/subscriptions/dd4bfc94-a096-412b-9c43-4bd13e35afbc/resourcegroups/MyResourceGroupName2/providers/microsoft.insights/scheduledqueryrules/heartbeat"), // Location: to.Ptr("eastus"), // Properties: &armmonitor.ScheduledQueryRuleProperties{ // Description: to.Ptr("Health check rule"), // Actions: &armmonitor.Actions{ // ActionGroups: []*string{ // to.Ptr("/subscriptions/1cf177ed-1330-4692-80ea-fd3d7783b147/resourcegroups/sqrapi/providers/microsoft.insights/actiongroups/myactiongroup")}, // CustomProperties: map[string]*string{ // "key11": to.Ptr("value11"), // "key12": to.Ptr("value12"), // }, // }, // CheckWorkspaceAlertsStorageConfigured: to.Ptr(true), // Criteria: &armmonitor.ScheduledQueryRuleCriteria{ // AllOf: []*armmonitor.Condition{ // { // Dimensions: []*armmonitor.Dimension{ // }, // FailingPeriods: &armmonitor.ConditionFailingPeriods{ // MinFailingPeriodsToAlert: to.Ptr[int64](1), // NumberOfEvaluationPeriods: to.Ptr[int64](1), // }, // Operator: to.Ptr(armmonitor.ConditionOperatorGreaterThan), // Query: to.Ptr("Heartbeat"), // Threshold: to.Ptr[float64](360), // TimeAggregation: to.Ptr(armmonitor.TimeAggregationCount), // }}, // }, // Enabled: to.Ptr(true), // EvaluationFrequency: to.Ptr("PT5M"), // IsWorkspaceAlertsStorageConfigured: to.Ptr(true), // MuteActionsDuration: to.Ptr("PT30M"), // RuleResolveConfiguration: &armmonitor.RuleResolveConfiguration{ // AutoResolved: to.Ptr(true), // TimeToResolve: to.Ptr("PT10M"), // }, // Scopes: []*string{ // to.Ptr("/subscriptions/aaf177ed-1330-a9f2-80ea-fd3d7783b147")}, // Severity: to.Ptr(armmonitor.AlertSeverity(4)), // SkipQueryValidation: to.Ptr(true), // TargetResourceTypes: []*string{ // to.Ptr("Microsoft.Compute/virtualMachines")}, // WindowSize: to.Ptr("PT10M"), // }, // Tags: map[string]*string{ // }, // }}, // } } }
Output:
func (*ScheduledQueryRulesClient) Update ¶
func (client *ScheduledQueryRulesClient) Update(ctx context.Context, resourceGroupName string, ruleName string, parameters ScheduledQueryRuleResourcePatch, options *ScheduledQueryRulesClientUpdateOptions) (ScheduledQueryRulesClientUpdateResponse, error)
Update - Update a scheduled query rule. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2022-08-01-preview
- resourceGroupName - The name of the resource group. The name is case insensitive.
- ruleName - The name of the rule.
- parameters - The parameters of the rule to update.
- options - ScheduledQueryRulesClientUpdateOptions contains the optional parameters for the ScheduledQueryRulesClient.Update method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Insights/preview/2022-08-01-preview/examples/patchScheduledQueryRule.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewScheduledQueryRulesClient().Update(ctx, "QueryResourceGroupName", "heartbeat", armmonitor.ScheduledQueryRuleResourcePatch{ Properties: &armmonitor.ScheduledQueryRuleProperties{ Enabled: to.Ptr(false), }, }, 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.ScheduledQueryRuleResource = armmonitor.ScheduledQueryRuleResource{ // Name: to.Ptr("heartbeat"), // Type: to.Ptr("microsoft.insights/scheduledqueryrules"), // ID: to.Ptr("/subscriptions/dd4bfc94-a096-412b-9c43-4bd13e35afbc/resourcegroups/QueryResourceGroupName/providers/microsoft.insights/scheduledqueryrules/heartbeat"), // Location: to.Ptr("eastus"), // Properties: &armmonitor.ScheduledQueryRuleProperties{ // Description: to.Ptr("Health check rule"), // Actions: &armmonitor.Actions{ // ActionGroups: []*string{ // to.Ptr("/subscriptions/1cf177ed-1330-4692-80ea-fd3d7783b147/resourcegroups/sqrapi/providers/microsoft.insights/actiongroups/myactiongroup")}, // CustomProperties: map[string]*string{ // "key11": to.Ptr("value11"), // "key12": to.Ptr("value12"), // }, // }, // CheckWorkspaceAlertsStorageConfigured: to.Ptr(true), // Criteria: &armmonitor.ScheduledQueryRuleCriteria{ // AllOf: []*armmonitor.Condition{ // { // Dimensions: []*armmonitor.Dimension{ // }, // FailingPeriods: &armmonitor.ConditionFailingPeriods{ // MinFailingPeriodsToAlert: to.Ptr[int64](1), // NumberOfEvaluationPeriods: to.Ptr[int64](1), // }, // Operator: to.Ptr(armmonitor.ConditionOperatorGreaterThan), // Query: to.Ptr("Heartbeat"), // Threshold: to.Ptr[float64](360), // TimeAggregation: to.Ptr(armmonitor.TimeAggregationCount), // }}, // }, // Enabled: to.Ptr(false), // EvaluationFrequency: to.Ptr("PT5M"), // IsWorkspaceAlertsStorageConfigured: to.Ptr(true), // MuteActionsDuration: to.Ptr("PT30M"), // RuleResolveConfiguration: &armmonitor.RuleResolveConfiguration{ // AutoResolved: to.Ptr(true), // TimeToResolve: to.Ptr("PT10M"), // }, // Scopes: []*string{ // to.Ptr("/subscriptions/aaf177ed-1330-a9f2-80ea-fd3d7783b147")}, // Severity: to.Ptr(armmonitor.AlertSeverity(4)), // SkipQueryValidation: to.Ptr(true), // TargetResourceTypes: []*string{ // to.Ptr("Microsoft.Compute/virtualMachines")}, // WindowSize: to.Ptr("PT10M"), // }, // Tags: map[string]*string{ // }, // } }
Output:
type ScheduledQueryRulesClientCreateOrUpdateOptions ¶ added in v0.4.0
type ScheduledQueryRulesClientCreateOrUpdateOptions struct { }
ScheduledQueryRulesClientCreateOrUpdateOptions contains the optional parameters for the ScheduledQueryRulesClient.CreateOrUpdate method.
type ScheduledQueryRulesClientCreateOrUpdateResponse ¶ added in v0.4.0
type ScheduledQueryRulesClientCreateOrUpdateResponse struct { // The scheduled query rule resource. ScheduledQueryRuleResource }
ScheduledQueryRulesClientCreateOrUpdateResponse contains the response from method ScheduledQueryRulesClient.CreateOrUpdate.
type ScheduledQueryRulesClientDeleteOptions ¶ added in v0.4.0
type ScheduledQueryRulesClientDeleteOptions struct { }
ScheduledQueryRulesClientDeleteOptions contains the optional parameters for the ScheduledQueryRulesClient.Delete method.
type ScheduledQueryRulesClientDeleteResponse ¶ added in v0.4.0
type ScheduledQueryRulesClientDeleteResponse struct { }
ScheduledQueryRulesClientDeleteResponse contains the response from method ScheduledQueryRulesClient.Delete.
type ScheduledQueryRulesClientGetOptions ¶ added in v0.4.0
type ScheduledQueryRulesClientGetOptions struct { }
ScheduledQueryRulesClientGetOptions contains the optional parameters for the ScheduledQueryRulesClient.Get method.
type ScheduledQueryRulesClientGetResponse ¶ added in v0.4.0
type ScheduledQueryRulesClientGetResponse struct { // The scheduled query rule resource. ScheduledQueryRuleResource }
ScheduledQueryRulesClientGetResponse contains the response from method ScheduledQueryRulesClient.Get.
type ScheduledQueryRulesClientListByResourceGroupOptions ¶ added in v0.4.0
type ScheduledQueryRulesClientListByResourceGroupOptions struct { }
ScheduledQueryRulesClientListByResourceGroupOptions contains the optional parameters for the ScheduledQueryRulesClient.NewListByResourceGroupPager method.
type ScheduledQueryRulesClientListByResourceGroupResponse ¶ added in v0.4.0
type ScheduledQueryRulesClientListByResourceGroupResponse struct { // Represents a collection of scheduled query rule resources. ScheduledQueryRuleResourceCollection }
ScheduledQueryRulesClientListByResourceGroupResponse contains the response from method ScheduledQueryRulesClient.NewListByResourceGroupPager.
type ScheduledQueryRulesClientListBySubscriptionOptions ¶ added in v0.4.0
type ScheduledQueryRulesClientListBySubscriptionOptions struct { }
ScheduledQueryRulesClientListBySubscriptionOptions contains the optional parameters for the ScheduledQueryRulesClient.NewListBySubscriptionPager method.
type ScheduledQueryRulesClientListBySubscriptionResponse ¶ added in v0.4.0
type ScheduledQueryRulesClientListBySubscriptionResponse struct { // Represents a collection of scheduled query rule resources. ScheduledQueryRuleResourceCollection }
ScheduledQueryRulesClientListBySubscriptionResponse contains the response from method ScheduledQueryRulesClient.NewListBySubscriptionPager.
type ScheduledQueryRulesClientUpdateOptions ¶ added in v0.4.0
type ScheduledQueryRulesClientUpdateOptions struct { }
ScheduledQueryRulesClientUpdateOptions contains the optional parameters for the ScheduledQueryRulesClient.Update method.
type ScheduledQueryRulesClientUpdateResponse ¶ added in v0.4.0
type ScheduledQueryRulesClientUpdateResponse struct { // The scheduled query rule resource. ScheduledQueryRuleResource }
ScheduledQueryRulesClientUpdateResponse contains the response from method ScheduledQueryRulesClient.Update.
type ScopedResource ¶
type ScopedResource struct { // Resource properties. Properties *ScopedResourceProperties // 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; System data SystemData *SystemData // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string }
ScopedResource - A private link scoped resource
func (ScopedResource) MarshalJSON ¶ added in v0.8.0
func (s ScopedResource) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ScopedResource.
func (*ScopedResource) UnmarshalJSON ¶ added in v0.8.0
func (s *ScopedResource) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ScopedResource.
type ScopedResourceListResult ¶
type ScopedResourceListResult struct { // READ-ONLY; Link to retrieve next page of results. NextLink *string // READ-ONLY; Array of results. Value []*ScopedResource }
ScopedResourceListResult - A list of scoped resources in a private link scope.
func (ScopedResourceListResult) MarshalJSON ¶
func (s ScopedResourceListResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ScopedResourceListResult.
func (*ScopedResourceListResult) UnmarshalJSON ¶ added in v0.8.0
func (s *ScopedResourceListResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ScopedResourceListResult.
type ScopedResourceProperties ¶
type ScopedResourceProperties struct { // The resource id of the scoped Azure monitor resource. LinkedResourceID *string // READ-ONLY; State of the private endpoint connection. ProvisioningState *string }
ScopedResourceProperties - Properties of a private link scoped resource.
func (ScopedResourceProperties) MarshalJSON ¶ added in v0.8.0
func (s ScopedResourceProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ScopedResourceProperties.
func (*ScopedResourceProperties) UnmarshalJSON ¶ added in v0.8.0
func (s *ScopedResourceProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ScopedResourceProperties.
type SenderAuthorization ¶
type SenderAuthorization struct { // the permissible actions. For instance: microsoft.support/supporttickets/write Action *string // the role of the user. For instance: Subscription Admin Role *string // the scope. Scope *string }
SenderAuthorization - the authorization used by the user who has performed the operation that led to this event. This captures the RBAC properties of the event. These usually include the 'action', 'role' and the 'scope'
func (SenderAuthorization) MarshalJSON ¶ added in v0.8.0
func (s SenderAuthorization) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type SenderAuthorization.
func (*SenderAuthorization) UnmarshalJSON ¶ added in v0.8.0
func (s *SenderAuthorization) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type SenderAuthorization.
type SingleBaseline ¶
type SingleBaseline struct { // REQUIRED; The high thresholds of the baseline. HighThresholds []*float64 // REQUIRED; The low thresholds of the baseline. LowThresholds []*float64 // REQUIRED; the sensitivity of the baseline. Sensitivity *BaselineSensitivity }
SingleBaseline - The baseline values for a single sensitivity value.
func (SingleBaseline) MarshalJSON ¶
func (s SingleBaseline) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type SingleBaseline.
func (*SingleBaseline) UnmarshalJSON ¶ added in v0.8.0
func (s *SingleBaseline) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type SingleBaseline.
type SingleMetricBaseline ¶
type SingleMetricBaseline struct { // REQUIRED; The metric baseline Id. ID *string // REQUIRED; The name of the metric for which the baselines were retrieved. Name *string // REQUIRED; The metric baseline properties of the metric. Properties *MetricBaselinesProperties // REQUIRED; The resource type of the metric baseline resource. Type *string }
SingleMetricBaseline - The baseline results of a single metric.
func (SingleMetricBaseline) MarshalJSON ¶ added in v0.8.0
func (s SingleMetricBaseline) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type SingleMetricBaseline.
func (*SingleMetricBaseline) UnmarshalJSON ¶ added in v0.8.0
func (s *SingleMetricBaseline) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type SingleMetricBaseline.
type SmsReceiver ¶
type SmsReceiver struct { // REQUIRED; The country code of the SMS receiver. CountryCode *string // REQUIRED; The name of the SMS receiver. Names must be unique across all receivers within an action group. Name *string // REQUIRED; The phone number of the SMS receiver. PhoneNumber *string // READ-ONLY; The status of the receiver. Status *ReceiverStatus }
SmsReceiver - An SMS receiver.
func (SmsReceiver) MarshalJSON ¶ added in v0.8.0
func (s SmsReceiver) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type SmsReceiver.
func (*SmsReceiver) UnmarshalJSON ¶ added in v0.8.0
func (s *SmsReceiver) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type SmsReceiver.
type SmsReceiverAutoGenerated ¶ added in v0.9.0
type SmsReceiverAutoGenerated struct { // REQUIRED; The country code of the SMS receiver. CountryCode *string // REQUIRED; The name of the SMS receiver. Names must be unique across all receivers within a tenant action group. Name *string // REQUIRED; The phone number of the SMS receiver. PhoneNumber *string // READ-ONLY; The status of the receiver. Status *ReceiverStatus }
SmsReceiverAutoGenerated - An SMS receiver.
func (SmsReceiverAutoGenerated) MarshalJSON ¶ added in v0.9.0
func (s SmsReceiverAutoGenerated) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type SmsReceiverAutoGenerated.
func (*SmsReceiverAutoGenerated) UnmarshalJSON ¶ added in v0.9.0
func (s *SmsReceiverAutoGenerated) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type SmsReceiverAutoGenerated.
type StorageBlobDestination ¶ added in v0.9.0
type StorageBlobDestination struct { // The container name of the Storage Blob. ContainerName *string // A friendly name for the destination. This name should be unique across all destinations (regardless of type) within the // data collection rule. Name *string // The resource ID of the storage account. StorageAccountResourceID *string }
func (StorageBlobDestination) MarshalJSON ¶ added in v0.9.0
func (s StorageBlobDestination) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type StorageBlobDestination.
func (*StorageBlobDestination) UnmarshalJSON ¶ added in v0.9.0
func (s *StorageBlobDestination) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type StorageBlobDestination.
type StorageTableDestination ¶ added in v0.9.0
type StorageTableDestination struct { // A friendly name for the destination. This name should be unique across all destinations (regardless of type) within the // data collection rule. Name *string // The resource ID of the storage account. StorageAccountResourceID *string // The name of the Storage Table. TableName *string }
func (StorageTableDestination) MarshalJSON ¶ added in v0.9.0
func (s StorageTableDestination) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type StorageTableDestination.
func (*StorageTableDestination) UnmarshalJSON ¶ added in v0.9.0
func (s *StorageTableDestination) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type StorageTableDestination.
type StreamDeclaration ¶ added in v0.5.0
type StreamDeclaration struct { // List of columns used by data in this stream. Columns []*ColumnDefinition }
StreamDeclaration - Declaration of a custom stream.
func (StreamDeclaration) MarshalJSON ¶ added in v0.5.0
func (s StreamDeclaration) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type StreamDeclaration.
func (*StreamDeclaration) UnmarshalJSON ¶ added in v0.8.0
func (s *StreamDeclaration) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type StreamDeclaration.
type SubscriptionScopeMetric ¶ added in v0.9.0
type SubscriptionScopeMetric struct { // REQUIRED; the metric Id. ID *string // REQUIRED; the name and the display name of the metric, i.e. it is localizable string. Name *LocalizableString // REQUIRED; the time series returned when a data query is performed. Timeseries []*TimeSeriesElement // REQUIRED; the resource type of the metric resource. Type *string // REQUIRED; The unit of the metric. Unit *MetricUnit // Detailed description of this metric. DisplayDescription *string // 'Success' or the error details on query failures for this metric. ErrorCode *string // Error message encountered querying this specific metric. ErrorMessage *string }
SubscriptionScopeMetric - The result data of a query.
func (SubscriptionScopeMetric) MarshalJSON ¶ added in v0.9.0
func (s SubscriptionScopeMetric) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type SubscriptionScopeMetric.
func (*SubscriptionScopeMetric) UnmarshalJSON ¶ added in v0.9.0
func (s *SubscriptionScopeMetric) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type SubscriptionScopeMetric.
type SubscriptionScopeMetricDefinition ¶ added in v0.9.0
type SubscriptionScopeMetricDefinition struct { // Custom category name for this metric. Category *string // the name and the display name of the dimension, i.e. it is a localizable string. Dimensions []*LocalizableString // Detailed description of this metric. DisplayDescription *string // the resource identifier of the metric definition. ID *string // Flag to indicate whether the dimension is required. IsDimensionRequired *bool // the collection of what aggregation intervals are available to be queried. MetricAvailabilities []*MetricAvailability // The class of the metric. MetricClass *MetricClass // the name and the display name of the metric, i.e. it is a localizable string. Name *LocalizableString // the namespace the metric belongs to. Namespace *string // the primary aggregation type value defining how to use the values for display. PrimaryAggregationType *MetricAggregationType // the resource identifier of the resource that emitted the metric. ResourceID *string // the collection of what aggregation types are supported. SupportedAggregationTypes []*MetricAggregationType // the unit of the metric. Unit *MetricUnit }
SubscriptionScopeMetricDefinition - Metric definition class specifies the metadata for a metric.
func (SubscriptionScopeMetricDefinition) MarshalJSON ¶ added in v0.9.0
func (s SubscriptionScopeMetricDefinition) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type SubscriptionScopeMetricDefinition.
func (*SubscriptionScopeMetricDefinition) UnmarshalJSON ¶ added in v0.9.0
func (s *SubscriptionScopeMetricDefinition) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type SubscriptionScopeMetricDefinition.
type SubscriptionScopeMetricDefinitionCollection ¶ added in v0.9.0
type SubscriptionScopeMetricDefinitionCollection struct { // REQUIRED; The values for the metric definitions. Value []*SubscriptionScopeMetricDefinition }
SubscriptionScopeMetricDefinitionCollection - Represents collection of metric definitions.
func (SubscriptionScopeMetricDefinitionCollection) MarshalJSON ¶ added in v0.9.0
func (s SubscriptionScopeMetricDefinitionCollection) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type SubscriptionScopeMetricDefinitionCollection.
func (*SubscriptionScopeMetricDefinitionCollection) UnmarshalJSON ¶ added in v0.9.0
func (s *SubscriptionScopeMetricDefinitionCollection) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type SubscriptionScopeMetricDefinitionCollection.
type SubscriptionScopeMetricResponse ¶ added in v0.9.0
type SubscriptionScopeMetricResponse struct { // REQUIRED; The timespan for which the data was retrieved. Its value consists of two datetimes concatenated, separated by // '/'. This may be adjusted in the future and returned back from what was originally // requested. Timespan *string // REQUIRED; the value of the collection. Value []*SubscriptionScopeMetric // The integer value representing the relative cost of the query. Cost *int32 // The interval (window size) for which the metric data was returned in. This may be adjusted in the future and returned back // from what was originally requested. This is not present if a metadata request // was made. Interval *string // The namespace of the metrics being queried Namespace *string // The region of the resource being queried for metrics. Resourceregion *string }
SubscriptionScopeMetricResponse - The response to a subscription scope metrics query.
func (SubscriptionScopeMetricResponse) MarshalJSON ¶ added in v0.9.0
func (s SubscriptionScopeMetricResponse) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type SubscriptionScopeMetricResponse.
func (*SubscriptionScopeMetricResponse) UnmarshalJSON ¶ added in v0.9.0
func (s *SubscriptionScopeMetricResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type SubscriptionScopeMetricResponse.
type SubscriptionScopeMetricsRequestBodyParameters ¶ added in v0.9.0
type SubscriptionScopeMetricsRequestBodyParameters struct { // The list of aggregation types (comma separated) to retrieve. Aggregation *string // When set to true, if the timespan passed in is not supported by this metric, the API will return the result using the closest // supported timespan. When set to false, an error is returned for invalid // timespan parameters. Defaults to false. AutoAdjustTimegrain *bool // The $filter is used to reduce the set of metric data returned. // Example: // Metric contains metadata A, B and C. // - Return all time series of C where A = a1 and B = b1 or b2 // $filter=A eq ‘a1’ and B eq ‘b1’ or B eq ‘b2’ and C eq ‘’ // - Invalid variant: // $filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘’ or B = ‘b2’ // This is invalid because the logical or operator cannot separate two different metadata names. // - Return all time series where A = a1, B = b1 and C = c1: // $filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘c1’ // - Return all time series where A = a1 // $filter=A eq ‘a1’ and B eq ‘’ and C eq ‘’. Filter *string // The interval (i.e. timegrain) of the query. Interval *string // The names of the metrics (comma separated) to retrieve. MetricNames *string // Metric namespace where the metrics you want reside. MetricNamespace *string // The aggregation to use for sorting results and the direction of the sort. Only one order can be specified. Examples: sum // asc. OrderBy *string // Reduces the set of data collected. The syntax allowed depends on the operation. See the operation's description for details. ResultType *MetricResultType // Dimension name(s) to rollup results by. For example if you only want to see metric values with a filter like 'City eq Seattle // or City eq Tacoma' but don't want to see separate values for each city, // you can specify 'RollUpBy=City' to see the results for Seattle and Tacoma rolled up into one timeseries. RollUpBy *string // The timespan of the query. It is a string with the following format 'startDateTimeISO/endDateTimeISO'. Timespan *time.Time // The maximum number of records to retrieve. Valid only if $filter is specified. Defaults to 10. Top *int32 // When set to false, invalid filter parameter values will be ignored. When set to true, an error is returned for invalid // filter parameters. Defaults to true. ValidateDimensions *bool }
SubscriptionScopeMetricsRequestBodyParameters - Query parameters can also be specified in the body, specifying the same parameter in both the body and query parameters will result in an error.
func (SubscriptionScopeMetricsRequestBodyParameters) MarshalJSON ¶ added in v0.9.0
func (s SubscriptionScopeMetricsRequestBodyParameters) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type SubscriptionScopeMetricsRequestBodyParameters.
func (*SubscriptionScopeMetricsRequestBodyParameters) UnmarshalJSON ¶ added in v0.9.0
func (s *SubscriptionScopeMetricsRequestBodyParameters) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type SubscriptionScopeMetricsRequestBodyParameters.
type SyslogDataSource ¶
type SyslogDataSource struct { // The list of facility names. FacilityNames []*KnownSyslogDataSourceFacilityNames // The log levels to collect. LogLevels []*KnownSyslogDataSourceLogLevels // A friendly name for the data source. This name should be unique across all data sources (regardless of type) within the // data collection rule. Name *string // List of streams that this data source will be sent to. A stream indicates what schema will be used for this data and usually // what table in Log Analytics the data will be sent to. Streams []*KnownSyslogDataSourceStreams }
SyslogDataSource - Definition of which syslog data will be collected and how it will be collected. Only collected from Linux machines.
func (SyslogDataSource) MarshalJSON ¶
func (s SyslogDataSource) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type SyslogDataSource.
func (*SyslogDataSource) UnmarshalJSON ¶ added in v0.8.0
func (s *SyslogDataSource) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type SyslogDataSource.
type SystemData ¶
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 ¶
func (s SystemData) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type SystemData.
func (*SystemData) UnmarshalJSON ¶
func (s *SystemData) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type SystemData.
type TagsResource ¶
TagsResource - A container holding only the Tags for a resource, allowing the user to update the tags on a PrivateLinkScope instance.
func (TagsResource) MarshalJSON ¶
func (t TagsResource) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type TagsResource.
func (*TagsResource) UnmarshalJSON ¶ added in v0.8.0
func (t *TagsResource) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type TagsResource.
type TenantActionGroup ¶ added in v0.9.0
type TenantActionGroup struct { // REQUIRED; Indicates whether this tenant action group is enabled. If a tenant action group is not enabled, then none of // its receivers will receive communications. Enabled *bool // REQUIRED; The short name of the action group. This will be used in SMS messages. GroupShortName *string // The list of AzureAppPush receivers that are part of this tenant action group. AzureAppPushReceivers []*AzureAppPushReceiverAutoGenerated // The list of email receivers that are part of this tenant action group. EmailReceivers []*EmailReceiverAutoGenerated // The list of SMS receivers that are part of this tenant action group. SmsReceivers []*SmsReceiverAutoGenerated // The list of voice receivers that are part of this tenant action group. VoiceReceivers []*VoiceReceiverAutoGenerated // The list of webhook receivers that are part of this tenant action group. WebhookReceivers []*WebhookReceiverAutoGenerated }
TenantActionGroup - A tenant action group.
func (TenantActionGroup) MarshalJSON ¶ added in v0.9.0
func (t TenantActionGroup) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type TenantActionGroup.
func (*TenantActionGroup) UnmarshalJSON ¶ added in v0.9.0
func (t *TenantActionGroup) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type TenantActionGroup.
type TenantActionGroupList ¶ added in v0.9.0
type TenantActionGroupList struct { // Provides the link to retrieve the next set of elements. NextLink *string // The list of tenant action groups. Value []*TenantActionGroupResource }
TenantActionGroupList - A list of tenant action groups.
func (TenantActionGroupList) MarshalJSON ¶ added in v0.9.0
func (t TenantActionGroupList) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type TenantActionGroupList.
func (*TenantActionGroupList) UnmarshalJSON ¶ added in v0.9.0
func (t *TenantActionGroupList) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type TenantActionGroupList.
type TenantActionGroupResource ¶ added in v0.9.0
type TenantActionGroupResource struct { // REQUIRED; Resource location Location *string // The tenant action groups properties of the resource. Properties *TenantActionGroup // Resource tags Tags map[string]*string // READ-ONLY; Azure resource Id ID *string // READ-ONLY; Azure resource name Name *string // READ-ONLY; Azure resource type Type *string }
TenantActionGroupResource - A tenant action group resource.
func (TenantActionGroupResource) MarshalJSON ¶ added in v0.9.0
func (t TenantActionGroupResource) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type TenantActionGroupResource.
func (*TenantActionGroupResource) UnmarshalJSON ¶ added in v0.9.0
func (t *TenantActionGroupResource) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type TenantActionGroupResource.
type TenantActionGroupsClient ¶ added in v0.9.0
type TenantActionGroupsClient struct {
// contains filtered or unexported fields
}
TenantActionGroupsClient contains the methods for the TenantActionGroups group. Don't use this type directly, use NewTenantActionGroupsClient() instead.
func NewTenantActionGroupsClient ¶ added in v0.9.0
func NewTenantActionGroupsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*TenantActionGroupsClient, error)
NewTenantActionGroupsClient creates a new instance of TenantActionGroupsClient with the specified values.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - pass nil to accept the default values.
func (*TenantActionGroupsClient) CreateOrUpdate ¶ added in v0.9.0
func (client *TenantActionGroupsClient) CreateOrUpdate(ctx context.Context, managementGroupID string, tenantActionGroupName string, xmsClientTenantID string, actionGroup TenantActionGroupResource, options *TenantActionGroupsClientCreateOrUpdateOptions) (TenantActionGroupsClientCreateOrUpdateResponse, error)
CreateOrUpdate - Create a new tenant action group or update an existing one. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2023-03-01-preview
- managementGroupID - The management group id.
- tenantActionGroupName - The name of the action group.
- xmsClientTenantID - The tenant ID of the client making the request.
- actionGroup - The tenant action group to create or use for the update.
- options - TenantActionGroupsClientCreateOrUpdateOptions contains the optional parameters for the TenantActionGroupsClient.CreateOrUpdate method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Insights/preview/2023-03-01-preview/examples/createOrUpdateTenantActionGroup.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewTenantActionGroupsClient().CreateOrUpdate(ctx, "72f988bf-86f1-41af-91ab-2d7cd011db47", "testTenantActionGroup", "72f988bf-86f1-41af-91ab-2d7cd011db47", armmonitor.TenantActionGroupResource{ Location: to.Ptr("Global"), Tags: map[string]*string{}, Properties: &armmonitor.TenantActionGroup{ AzureAppPushReceivers: []*armmonitor.AzureAppPushReceiverAutoGenerated{ { Name: to.Ptr("Sample azureAppPush"), EmailAddress: to.Ptr("johndoe@email.com"), }}, EmailReceivers: []*armmonitor.EmailReceiverAutoGenerated{ { Name: to.Ptr("John Doe's email"), EmailAddress: to.Ptr("johndoe@email.com"), UseCommonAlertSchema: to.Ptr(false), }, { Name: to.Ptr("Jane Smith's email"), EmailAddress: to.Ptr("janesmith@email.com"), UseCommonAlertSchema: to.Ptr(true), }}, Enabled: to.Ptr(true), GroupShortName: to.Ptr("sample"), SmsReceivers: []*armmonitor.SmsReceiverAutoGenerated{ { Name: to.Ptr("John Doe's mobile"), CountryCode: to.Ptr("1"), PhoneNumber: to.Ptr("2062022299"), }, { Name: to.Ptr("Jane Smith's mobile"), CountryCode: to.Ptr("1"), PhoneNumber: to.Ptr("0987654321"), }}, VoiceReceivers: []*armmonitor.VoiceReceiverAutoGenerated{ { Name: to.Ptr("Sample voice"), CountryCode: to.Ptr("1"), PhoneNumber: to.Ptr("2062022299"), }}, WebhookReceivers: []*armmonitor.WebhookReceiverAutoGenerated{ { Name: to.Ptr("Sample webhook 1"), ServiceURI: to.Ptr("http://www.example.com/webhook1"), UseCommonAlertSchema: to.Ptr(true), }, { Name: to.Ptr("Sample webhook 2"), IdentifierURI: to.Ptr("http://someidentifier/d7811ba3-7996-4a93-99b6-6b2f3f355f8a"), ObjectID: to.Ptr("d3bb868c-fe44-452c-aa26-769a6538c808"), ServiceURI: to.Ptr("http://www.example.com/webhook2"), TenantID: to.Ptr("68a4459a-ccb8-493c-b9da-dd30457d1b84"), UseAADAuth: to.Ptr(true), UseCommonAlertSchema: to.Ptr(true), }}, }, }, 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.TenantActionGroupResource = armmonitor.TenantActionGroupResource{ // Name: to.Ptr("testTenantActionGroup"), // Type: to.Ptr("Microsoft.Insights/TenantActionGroups"), // ID: to.Ptr("/providers/Microsoft.Management/managementGroups/72f988bf-86f1-41af-91ab-2d7cd011db47/providers/Microsoft.Insights/tenantActionGroups/testTenantActionGroup"), // Location: to.Ptr("Global"), // Tags: map[string]*string{ // }, // Properties: &armmonitor.TenantActionGroup{ // EmailReceivers: []*armmonitor.EmailReceiverAutoGenerated{ // { // Name: to.Ptr("John Doe's email"), // EmailAddress: to.Ptr("johndoe@email.com"), // Status: to.Ptr(armmonitor.ReceiverStatusEnabled), // UseCommonAlertSchema: to.Ptr(false), // }, // { // Name: to.Ptr("Jane Smith's email"), // EmailAddress: to.Ptr("janesmith@email.com"), // Status: to.Ptr(armmonitor.ReceiverStatusEnabled), // UseCommonAlertSchema: to.Ptr(true), // }}, // Enabled: to.Ptr(true), // GroupShortName: to.Ptr("sample"), // SmsReceivers: []*armmonitor.SmsReceiverAutoGenerated{ // { // Name: to.Ptr("John Doe's mobile"), // CountryCode: to.Ptr("1"), // PhoneNumber: to.Ptr("2062022299"), // Status: to.Ptr(armmonitor.ReceiverStatusEnabled), // }, // { // Name: to.Ptr("Jane Smith's mobile"), // CountryCode: to.Ptr("1"), // PhoneNumber: to.Ptr("0987654321"), // Status: to.Ptr(armmonitor.ReceiverStatusEnabled), // }}, // VoiceReceivers: []*armmonitor.VoiceReceiverAutoGenerated{ // { // Name: to.Ptr("Sample voice"), // CountryCode: to.Ptr("1"), // PhoneNumber: to.Ptr("2062022299"), // }}, // WebhookReceivers: []*armmonitor.WebhookReceiverAutoGenerated{ // { // Name: to.Ptr("Sample webhook 1"), // ServiceURI: to.Ptr("http://www.example.com/webhook1"), // UseCommonAlertSchema: to.Ptr(true), // }, // { // Name: to.Ptr("Sample webhook 2"), // IdentifierURI: to.Ptr("http://someidentifier/d7811ba3-7996-4a93-99b6-6b2f3f355f8a"), // ObjectID: to.Ptr("d3bb868c-fe44-452c-aa26-769a6538c808"), // ServiceURI: to.Ptr("http://www.example.com/webhook2"), // TenantID: to.Ptr("68a4459a-ccb8-493c-b9da-dd30457d1b84"), // UseAADAuth: to.Ptr(true), // UseCommonAlertSchema: to.Ptr(true), // }}, // }, // } }
Output:
func (*TenantActionGroupsClient) Delete ¶ added in v0.9.0
func (client *TenantActionGroupsClient) Delete(ctx context.Context, managementGroupID string, tenantActionGroupName string, xmsClientTenantID string, options *TenantActionGroupsClientDeleteOptions) (TenantActionGroupsClientDeleteResponse, error)
Delete - Delete a tenant action group. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2023-03-01-preview
- managementGroupID - The management group id.
- tenantActionGroupName - The name of the action group.
- xmsClientTenantID - The tenant ID of the client making the request.
- options - TenantActionGroupsClientDeleteOptions contains the optional parameters for the TenantActionGroupsClient.Delete method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Insights/preview/2023-03-01-preview/examples/deleteTenantActionGroup.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } _, err = clientFactory.NewTenantActionGroupsClient().Delete(ctx, "72f988bf-86f1-41af-91ab-2d7cd011db47", "testTenantActionGroup", "72f988bf-86f1-41af-91ab-2d7cd011db47", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } }
Output:
func (*TenantActionGroupsClient) Get ¶ added in v0.9.0
func (client *TenantActionGroupsClient) Get(ctx context.Context, managementGroupID string, tenantActionGroupName string, xmsClientTenantID string, options *TenantActionGroupsClientGetOptions) (TenantActionGroupsClientGetResponse, error)
Get - Get a tenant action group. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2023-03-01-preview
- managementGroupID - The management group id.
- tenantActionGroupName - The name of the action group.
- xmsClientTenantID - The tenant ID of the client making the request.
- options - TenantActionGroupsClientGetOptions contains the optional parameters for the TenantActionGroupsClient.Get method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Insights/preview/2023-03-01-preview/examples/getTenantActionGroup.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewTenantActionGroupsClient().Get(ctx, "72f988bf-86f1-41af-91ab-2d7cd011db47", "testTenantActionGroup", "72f988bf-86f1-41af-91ab-2d7cd011db47", 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.TenantActionGroupResource = armmonitor.TenantActionGroupResource{ // Name: to.Ptr("testTenantActionGroup"), // Type: to.Ptr("Microsoft.Insights/TenantActionGroups"), // ID: to.Ptr("/providers/Microsoft.Management/managementGroups/72f988bf-86f1-41af-91ab-2d7cd011db47/providers/Microsoft.Insights/tenantActionGroups/testTenantActionGroup"), // Location: to.Ptr("Global"), // Tags: map[string]*string{ // }, // Properties: &armmonitor.TenantActionGroup{ // EmailReceivers: []*armmonitor.EmailReceiverAutoGenerated{ // { // Name: to.Ptr("John Doe's email"), // EmailAddress: to.Ptr("johndoe@email.com"), // Status: to.Ptr(armmonitor.ReceiverStatusEnabled), // UseCommonAlertSchema: to.Ptr(false), // }, // { // Name: to.Ptr("Jane Smith's email"), // EmailAddress: to.Ptr("janesmith@email.com"), // Status: to.Ptr(armmonitor.ReceiverStatusEnabled), // UseCommonAlertSchema: to.Ptr(true), // }}, // Enabled: to.Ptr(true), // GroupShortName: to.Ptr("sample"), // SmsReceivers: []*armmonitor.SmsReceiverAutoGenerated{ // { // Name: to.Ptr("John Doe's mobile"), // CountryCode: to.Ptr("1"), // PhoneNumber: to.Ptr("2062022299"), // Status: to.Ptr(armmonitor.ReceiverStatusEnabled), // }, // { // Name: to.Ptr("Jane Smith's mobile"), // CountryCode: to.Ptr("1"), // PhoneNumber: to.Ptr("0987654321"), // Status: to.Ptr(armmonitor.ReceiverStatusEnabled), // }}, // VoiceReceivers: []*armmonitor.VoiceReceiverAutoGenerated{ // { // Name: to.Ptr("Sample voice"), // CountryCode: to.Ptr("1"), // PhoneNumber: to.Ptr("2062022299"), // }}, // WebhookReceivers: []*armmonitor.WebhookReceiverAutoGenerated{ // { // Name: to.Ptr("Sample webhook 1"), // ServiceURI: to.Ptr("http://www.example.com/webhook1"), // UseCommonAlertSchema: to.Ptr(true), // }, // { // Name: to.Ptr("Sample webhook 2"), // IdentifierURI: to.Ptr("http://someidentifier/d7811ba3-7996-4a93-99b6-6b2f3f355f8a"), // ObjectID: to.Ptr("d3bb868c-fe44-452c-aa26-769a6538c808"), // ServiceURI: to.Ptr("http://www.example.com/webhook2"), // TenantID: to.Ptr("68a4459a-ccb8-493c-b9da-dd30457d1b84"), // UseAADAuth: to.Ptr(true), // UseCommonAlertSchema: to.Ptr(true), // }}, // }, // } }
Output:
func (*TenantActionGroupsClient) NewListByManagementGroupIDPager ¶ added in v0.9.0
func (client *TenantActionGroupsClient) NewListByManagementGroupIDPager(managementGroupID string, xmsClientTenantID string, options *TenantActionGroupsClientListByManagementGroupIDOptions) *runtime.Pager[TenantActionGroupsClientListByManagementGroupIDResponse]
NewListByManagementGroupIDPager - Get a list of all tenant action groups in a management group.
Generated from API version 2023-03-01-preview
- managementGroupID - The management group id.
- xmsClientTenantID - The tenant ID of the client making the request.
- options - TenantActionGroupsClientListByManagementGroupIDOptions contains the optional parameters for the TenantActionGroupsClient.NewListByManagementGroupIDPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Insights/preview/2023-03-01-preview/examples/listTenantActionGroups.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewTenantActionGroupsClient().NewListByManagementGroupIDPager("72f988bf-86f1-41af-91ab-2d7cd011db47", "72f988bf-86f1-41af-91ab-2d7cd011db47", 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.TenantActionGroupList = armmonitor.TenantActionGroupList{ // Value: []*armmonitor.TenantActionGroupResource{ // { // Name: to.Ptr("testTenantActionGroup"), // Type: to.Ptr("Microsoft.Insights/TenantActionGroups"), // ID: to.Ptr("/providers/Microsoft.Management/managementGroups/72f988bf-86f1-41af-91ab-2d7cd011db47/providers/Microsoft.Insights/tenantActionGroups/testTenantActionGroup"), // Location: to.Ptr("Global"), // Tags: map[string]*string{ // }, // Properties: &armmonitor.TenantActionGroup{ // EmailReceivers: []*armmonitor.EmailReceiverAutoGenerated{ // { // Name: to.Ptr("John Doe's email"), // EmailAddress: to.Ptr("johndoe@email.com"), // Status: to.Ptr(armmonitor.ReceiverStatusEnabled), // UseCommonAlertSchema: to.Ptr(false), // }, // { // Name: to.Ptr("Jane Smith's email"), // EmailAddress: to.Ptr("janesmith@email.com"), // Status: to.Ptr(armmonitor.ReceiverStatusEnabled), // UseCommonAlertSchema: to.Ptr(true), // }}, // Enabled: to.Ptr(true), // GroupShortName: to.Ptr("sample"), // SmsReceivers: []*armmonitor.SmsReceiverAutoGenerated{ // { // Name: to.Ptr("John Doe's mobile"), // CountryCode: to.Ptr("1"), // PhoneNumber: to.Ptr("2062022299"), // Status: to.Ptr(armmonitor.ReceiverStatusEnabled), // }, // { // Name: to.Ptr("Jane Smith's mobile"), // CountryCode: to.Ptr("1"), // PhoneNumber: to.Ptr("0987654321"), // Status: to.Ptr(armmonitor.ReceiverStatusEnabled), // }}, // VoiceReceivers: []*armmonitor.VoiceReceiverAutoGenerated{ // { // Name: to.Ptr("Sample voice"), // CountryCode: to.Ptr("1"), // PhoneNumber: to.Ptr("2062022299"), // }}, // WebhookReceivers: []*armmonitor.WebhookReceiverAutoGenerated{ // { // Name: to.Ptr("Sample webhook 1"), // ServiceURI: to.Ptr("http://www.example.com/webhook1"), // UseCommonAlertSchema: to.Ptr(true), // }, // { // Name: to.Ptr("Sample webhook 2"), // IdentifierURI: to.Ptr("http://someidentifier/d7811ba3-7996-4a93-99b6-6b2f3f355f8a"), // ObjectID: to.Ptr("d3bb868c-fe44-452c-aa26-769a6538c808"), // ServiceURI: to.Ptr("http://www.example.com/webhook2"), // TenantID: to.Ptr("68a4459a-ccb8-493c-b9da-dd30457d1b84"), // UseAADAuth: to.Ptr(true), // UseCommonAlertSchema: to.Ptr(true), // }}, // }, // }}, // } } }
Output:
func (*TenantActionGroupsClient) Update ¶ added in v0.9.0
func (client *TenantActionGroupsClient) Update(ctx context.Context, managementGroupID string, tenantActionGroupName string, xmsClientTenantID string, tenantActionGroupPatch ActionGroupPatchBodyAutoGenerated, options *TenantActionGroupsClientUpdateOptions) (TenantActionGroupsClientUpdateResponse, error)
Update - Updates an existing tenant action group's tags. To update other fields use the CreateOrUpdate method. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2023-03-01-preview
- managementGroupID - The management group id.
- tenantActionGroupName - The name of the action group.
- xmsClientTenantID - The tenant ID of the client making the request.
- tenantActionGroupPatch - Parameters supplied to the operation.
- options - TenantActionGroupsClientUpdateOptions contains the optional parameters for the TenantActionGroupsClient.Update method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Insights/preview/2023-03-01-preview/examples/patchTenantActionGroup.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewTenantActionGroupsClient().Update(ctx, "72f988bf-86f1-41af-91ab-2d7cd011db47", "testTenantActionGroup", "72f988bf-86f1-41af-91ab-2d7cd011db47", armmonitor.ActionGroupPatchBodyAutoGenerated{ Properties: &armmonitor.ActionGroupPatchAutoGenerated{ Enabled: to.Ptr(false), }, Tags: map[string]*string{ "key1": to.Ptr("value1"), "key2": to.Ptr("value2"), }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // 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.TenantActionGroupResource = armmonitor.TenantActionGroupResource{ // Name: to.Ptr("testTenantActionGroup"), // Type: to.Ptr("Microsoft.Insights/TenantActionGroups"), // ID: to.Ptr("/providers/Microsoft.Management/managementGroups/72f988bf-86f1-41af-91ab-2d7cd011db47/providers/Microsoft.Insights/tenantActionGroups/testTenantActionGroup"), // Location: to.Ptr("Global"), // Tags: map[string]*string{ // "key1": to.Ptr("value1"), // "key2": to.Ptr("value2"), // }, // Properties: &armmonitor.TenantActionGroup{ // EmailReceivers: []*armmonitor.EmailReceiverAutoGenerated{ // { // Name: to.Ptr("John Doe's email"), // EmailAddress: to.Ptr("johndoe@email.com"), // Status: to.Ptr(armmonitor.ReceiverStatusEnabled), // UseCommonAlertSchema: to.Ptr(false), // }, // { // Name: to.Ptr("Jane Smith's email"), // EmailAddress: to.Ptr("janesmith@email.com"), // Status: to.Ptr(armmonitor.ReceiverStatusEnabled), // UseCommonAlertSchema: to.Ptr(true), // }}, // Enabled: to.Ptr(false), // GroupShortName: to.Ptr("sample"), // SmsReceivers: []*armmonitor.SmsReceiverAutoGenerated{ // { // Name: to.Ptr("John Doe's mobile"), // CountryCode: to.Ptr("1"), // PhoneNumber: to.Ptr("2062022299"), // Status: to.Ptr(armmonitor.ReceiverStatusEnabled), // }, // { // Name: to.Ptr("Jane Smith's mobile"), // CountryCode: to.Ptr("1"), // PhoneNumber: to.Ptr("0987654321"), // Status: to.Ptr(armmonitor.ReceiverStatusEnabled), // }}, // VoiceReceivers: []*armmonitor.VoiceReceiverAutoGenerated{ // { // Name: to.Ptr("Sample voice"), // CountryCode: to.Ptr("1"), // PhoneNumber: to.Ptr("2062022299"), // }}, // WebhookReceivers: []*armmonitor.WebhookReceiverAutoGenerated{ // { // Name: to.Ptr("Sample webhook 1"), // ServiceURI: to.Ptr("http://www.example.com/webhook1"), // UseCommonAlertSchema: to.Ptr(true), // }, // { // Name: to.Ptr("Sample webhook 2"), // IdentifierURI: to.Ptr("http://someidentifier/d7811ba3-7996-4a93-99b6-6b2f3f355f8a"), // ObjectID: to.Ptr("d3bb868c-fe44-452c-aa26-769a6538c808"), // ServiceURI: to.Ptr("http://www.example.com/webhook2"), // TenantID: to.Ptr("68a4459a-ccb8-493c-b9da-dd30457d1b84"), // UseAADAuth: to.Ptr(true), // UseCommonAlertSchema: to.Ptr(true), // }}, // }, // } }
Output:
type TenantActionGroupsClientCreateOrUpdateOptions ¶ added in v0.9.0
type TenantActionGroupsClientCreateOrUpdateOptions struct { }
TenantActionGroupsClientCreateOrUpdateOptions contains the optional parameters for the TenantActionGroupsClient.CreateOrUpdate method.
type TenantActionGroupsClientCreateOrUpdateResponse ¶ added in v0.9.0
type TenantActionGroupsClientCreateOrUpdateResponse struct { // A tenant action group resource. TenantActionGroupResource }
TenantActionGroupsClientCreateOrUpdateResponse contains the response from method TenantActionGroupsClient.CreateOrUpdate.
type TenantActionGroupsClientDeleteOptions ¶ added in v0.9.0
type TenantActionGroupsClientDeleteOptions struct { }
TenantActionGroupsClientDeleteOptions contains the optional parameters for the TenantActionGroupsClient.Delete method.
type TenantActionGroupsClientDeleteResponse ¶ added in v0.9.0
type TenantActionGroupsClientDeleteResponse struct { }
TenantActionGroupsClientDeleteResponse contains the response from method TenantActionGroupsClient.Delete.
type TenantActionGroupsClientGetOptions ¶ added in v0.9.0
type TenantActionGroupsClientGetOptions struct { }
TenantActionGroupsClientGetOptions contains the optional parameters for the TenantActionGroupsClient.Get method.
type TenantActionGroupsClientGetResponse ¶ added in v0.9.0
type TenantActionGroupsClientGetResponse struct { // A tenant action group resource. TenantActionGroupResource }
TenantActionGroupsClientGetResponse contains the response from method TenantActionGroupsClient.Get.
type TenantActionGroupsClientListByManagementGroupIDOptions ¶ added in v0.9.0
type TenantActionGroupsClientListByManagementGroupIDOptions struct { }
TenantActionGroupsClientListByManagementGroupIDOptions contains the optional parameters for the TenantActionGroupsClient.NewListByManagementGroupIDPager method.
type TenantActionGroupsClientListByManagementGroupIDResponse ¶ added in v0.9.0
type TenantActionGroupsClientListByManagementGroupIDResponse struct { // A list of tenant action groups. TenantActionGroupList }
TenantActionGroupsClientListByManagementGroupIDResponse contains the response from method TenantActionGroupsClient.NewListByManagementGroupIDPager.
type TenantActionGroupsClientUpdateOptions ¶ added in v0.9.0
type TenantActionGroupsClientUpdateOptions struct { }
TenantActionGroupsClientUpdateOptions contains the optional parameters for the TenantActionGroupsClient.Update method.
type TenantActionGroupsClientUpdateResponse ¶ added in v0.9.0
type TenantActionGroupsClientUpdateResponse struct { // A tenant action group resource. TenantActionGroupResource }
TenantActionGroupsClientUpdateResponse contains the response from method TenantActionGroupsClient.Update.
type TenantActivityLogsClient ¶
type TenantActivityLogsClient struct {
// contains filtered or unexported fields
}
TenantActivityLogsClient contains the methods for the TenantActivityLogs group. Don't use this type directly, use NewTenantActivityLogsClient() instead.
func NewTenantActivityLogsClient ¶
func NewTenantActivityLogsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*TenantActivityLogsClient, error)
NewTenantActivityLogsClient creates a new instance of TenantActivityLogsClient with the specified values.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - pass nil to accept the default values.
func (*TenantActivityLogsClient) NewListPager ¶ added in v0.6.0
func (client *TenantActivityLogsClient) NewListPager(options *TenantActivityLogsClientListOptions) *runtime.Pager[TenantActivityLogsClientListResponse]
NewListPager - Gets the Activity Logs for the Tenant. Everything that is applicable to the API to get the Activity Logs for the subscription is applicable to this API (the parameters, $filter, etc.). One thing to point out here is that this API does not retrieve the logs at the individual subscription of the tenant but only surfaces the logs that were generated at the tenant level.
Generated from API version 2015-04-01
- options - TenantActivityLogsClientListOptions contains the optional parameters for the TenantActivityLogsClient.NewListPager method.
Example (GetTenantActivityLogsWithFilter) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Insights/stable/2015-04-01/examples/GetTenantActivityLogsFiltered.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewTenantActivityLogsClient().NewListPager(&armmonitor.TenantActivityLogsClientListOptions{Filter: to.Ptr("eventTimestamp ge '2015-01-21T20:00:00Z' and eventTimestamp le '2015-01-23T20:00:00Z' and resourceGroupName eq 'MSSupportGroup'"), Select: 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.EventDataCollection = armmonitor.EventDataCollection{ // Value: []*armmonitor.EventData{ // { // OperationID: to.Ptr("1e121103-0ba6-4300-ac9d-952bb5d0c80f"), // Description: to.Ptr(""), // Authorization: &armmonitor.SenderAuthorization{ // Action: to.Ptr("microsoft.support/supporttickets/write"), // Role: to.Ptr("Subscription Admin"), // Scope: to.Ptr("/subscriptions/089bd33f-d4ec-47fe-8ba5-0753aa5c5b33/resourceGroups/MSSupportGroup/providers/microsoft.support/supporttickets/115012112305841"), // }, // Caller: to.Ptr("admin@contoso.com"), // Claims: map[string]*string{ // "name": to.Ptr("John Smith"), // "appid": to.Ptr("c44b4083-3bq0-49c1-b47d-974e53cbdf3c"), // "appidacr": to.Ptr("2"), // "aud": to.Ptr("https://management.core.windows.net/"), // "exp": to.Ptr("1421880271"), // "groups": to.Ptr("cacfe77c-e058-4712-83qw-f9b08849fd60,7f71d11d-4c41-4b23-99d2-d32ce7aa621c,31522864-0578-4ea0-9gdc-e66cc564d18c"), // "http://schemas.microsoft.com/claims/authnclassreference": to.Ptr("1"), // "http://schemas.microsoft.com/claims/authnmethodsreferences": to.Ptr("pwd"), // "http://schemas.microsoft.com/identity/claims/objectidentifier": to.Ptr("2468adf0-8211-44e3-95xq-85137af64708"), // "http://schemas.microsoft.com/identity/claims/scope": to.Ptr("user_impersonation"), // "http://schemas.microsoft.com/identity/claims/tenantid": to.Ptr("1e8d8218-c5e7-4578-9acc-9abbd5d23315"), // "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/givenname": to.Ptr("John"), // "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name": to.Ptr("admin@contoso.com"), // "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier": to.Ptr("9vckmEGF7zDKk1YzIY8k0t1_EAPaXoeHyPRn6f413zM"), // "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/surname": to.Ptr("Smith"), // "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/upn": to.Ptr("admin@contoso.com"), // "iat": to.Ptr("1421876371"), // "iss": to.Ptr("https://sts.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47/"), // "nbf": to.Ptr("1421876371"), // "puid": to.Ptr("20030000801A118C"), // "ver": to.Ptr("1.0"), // }, // CorrelationID: to.Ptr("1e121103-0ba6-4300-ac9d-952bb5d0c80f"), // EventDataID: to.Ptr("44ade6b4-3813-45e6-ae27-7420a95fa2f8"), // EventName: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("End request"), // Value: to.Ptr("EndRequest"), // }, // EventTimestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-01-21T22:14:26.979Z"); return t}()), // HTTPRequest: &armmonitor.HTTPRequestInfo{ // Method: to.Ptr("PUT"), // ClientIPAddress: to.Ptr("192.168.35.115"), // ClientRequestID: to.Ptr("27003b25-91d3-418f-8eb1-29e537dcb249"), // }, // ID: to.Ptr("/subscriptions/089bd33f-d4ec-47fe-8ba5-0753aa5c5b33/resourceGroups/MSSupportGroup/providers/microsoft.support/supporttickets/115012112305841/events/44ade6b4-3813-45e6-ae27-7420a95fa2f8/ticks/635574752669792776"), // Level: to.Ptr(armmonitor.EventLevelInformational), // OperationName: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("microsoft.support/supporttickets/write"), // Value: to.Ptr("microsoft.support/supporttickets/write"), // }, // Properties: map[string]*string{ // "statusCode": to.Ptr("Created"), // }, // ResourceGroupName: to.Ptr("MSSupportGroup"), // ResourceProviderName: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("microsoft.support"), // Value: to.Ptr("microsoft.support"), // }, // Status: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("Succeeded"), // Value: to.Ptr("Succeeded"), // }, // SubStatus: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("Created (HTTP Status Code: 201)"), // Value: to.Ptr("Created"), // }, // SubmissionTimestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-01-21T22:14:39.993Z"); return t}()), // SubscriptionID: to.Ptr("089bd33f-d4ec-47fe-8ba5-0753aa5c5b33"), // }}, // } } }
Output:
Example (GetTenantActivityLogsWithFilterAndSelect) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Insights/stable/2015-04-01/examples/GetTenantActivityLogsFilteredAndSelected.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewTenantActivityLogsClient().NewListPager(&armmonitor.TenantActivityLogsClientListOptions{Filter: to.Ptr("eventTimestamp ge '2015-01-21T20:00:00Z' and eventTimestamp le '2015-01-23T20:00:00Z' and resourceGroupName eq 'MSSupportGroup'"), Select: to.Ptr("eventName,id,resourceGroupName,resourceProviderName,operationName,status,eventTimestamp,correlationId,submissionTimestamp,level"), }) 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.EventDataCollection = armmonitor.EventDataCollection{ // Value: []*armmonitor.EventData{ // { // CorrelationID: to.Ptr("1e121103-0ba6-4300-ac9d-952bb5d0c80f"), // EventName: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("End request"), // Value: to.Ptr("EndRequest"), // }, // EventTimestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-01-21T22:14:26.979Z"); return t}()), // ID: to.Ptr("/subscriptions/089bd33f-d4ec-47fe-8ba5-0753aa5c5b33/resourceGroups/MSSupportGroup/providers/microsoft.support/supporttickets/115012112305841/events/44ade6b4-3813-45e6-ae27-7420a95fa2f8/ticks/635574752669792776"), // Level: to.Ptr(armmonitor.EventLevelInformational), // OperationName: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("microsoft.support/supporttickets/write"), // Value: to.Ptr("microsoft.support/supporttickets/write"), // }, // ResourceGroupName: to.Ptr("MSSupportGroup"), // ResourceProviderName: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("microsoft.support"), // Value: to.Ptr("microsoft.support"), // }, // Status: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("Succeeded"), // Value: to.Ptr("Succeeded"), // }, // SubmissionTimestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-01-21T22:14:39.993Z"); return t}()), // }}, // } } }
Output:
Example (GetTenantActivityLogsWithSelect) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Insights/stable/2015-04-01/examples/GetTenantActivityLogsSelected.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewTenantActivityLogsClient().NewListPager(&armmonitor.TenantActivityLogsClientListOptions{Filter: nil, Select: to.Ptr("eventName,id,resourceGroupName,resourceProviderName,operationName,status,eventTimestamp,correlationId,submissionTimestamp,level"), }) 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.EventDataCollection = armmonitor.EventDataCollection{ // Value: []*armmonitor.EventData{ // { // CorrelationID: to.Ptr("1e121103-0ba6-4300-ac9d-952bb5d0c80f"), // EventName: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("End request"), // Value: to.Ptr("EndRequest"), // }, // EventTimestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-01-21T22:14:26.979Z"); return t}()), // ID: to.Ptr("/subscriptions/089bd33f-d4ec-47fe-8ba5-0753aa5c5b33/resourceGroups/MSSupportGroup/providers/microsoft.support/supporttickets/115012112305841/events/44ade6b4-3813-45e6-ae27-7420a95fa2f8/ticks/635574752669792776"), // Level: to.Ptr(armmonitor.EventLevelInformational), // OperationName: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("microsoft.support/supporttickets/write"), // Value: to.Ptr("microsoft.support/supporttickets/write"), // }, // ResourceGroupName: to.Ptr("MSSupportGroup"), // ResourceProviderName: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("microsoft.support"), // Value: to.Ptr("microsoft.support"), // }, // Status: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("Succeeded"), // Value: to.Ptr("Succeeded"), // }, // SubmissionTimestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-01-21T22:14:39.993Z"); return t}()), // }}, // } } }
Output:
Example (GetTenantActivityLogsWithoutFilterOrSelect) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Insights/stable/2015-04-01/examples/GetTenantActivityLogsNoParams.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewTenantActivityLogsClient().NewListPager(&armmonitor.TenantActivityLogsClientListOptions{Filter: nil, Select: 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.EventDataCollection = armmonitor.EventDataCollection{ // Value: []*armmonitor.EventData{ // { // OperationID: to.Ptr("1e121103-0ba6-4300-ac9d-952bb5d0c80f"), // Description: to.Ptr(""), // Authorization: &armmonitor.SenderAuthorization{ // Action: to.Ptr("microsoft.support/supporttickets/write"), // Role: to.Ptr("Subscription Admin"), // Scope: to.Ptr("/subscriptions/089bd33f-d4ec-47fe-8ba5-0753aa5c5b33/resourceGroups/MSSupportGroup/providers/microsoft.support/supporttickets/115012112305841"), // }, // Caller: to.Ptr("admin@contoso.com"), // Claims: map[string]*string{ // "name": to.Ptr("John Smith"), // "appid": to.Ptr("c44b4083-3bq0-49c1-b47d-974e53cbdf3c"), // "appidacr": to.Ptr("2"), // "aud": to.Ptr("https://management.core.windows.net/"), // "exp": to.Ptr("1421880271"), // "groups": to.Ptr("cacfe77c-e058-4712-83qw-f9b08849fd60,7f71d11d-4c41-4b23-99d2-d32ce7aa621c,31522864-0578-4ea0-9gdc-e66cc564d18c"), // "http://schemas.microsoft.com/claims/authnclassreference": to.Ptr("1"), // "http://schemas.microsoft.com/claims/authnmethodsreferences": to.Ptr("pwd"), // "http://schemas.microsoft.com/identity/claims/objectidentifier": to.Ptr("2468adf0-8211-44e3-95xq-85137af64708"), // "http://schemas.microsoft.com/identity/claims/scope": to.Ptr("user_impersonation"), // "http://schemas.microsoft.com/identity/claims/tenantid": to.Ptr("1e8d8218-c5e7-4578-9acc-9abbd5d23315"), // "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/givenname": to.Ptr("John"), // "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name": to.Ptr("admin@contoso.com"), // "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier": to.Ptr("9vckmEGF7zDKk1YzIY8k0t1_EAPaXoeHyPRn6f413zM"), // "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/surname": to.Ptr("Smith"), // "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/upn": to.Ptr("admin@contoso.com"), // "iat": to.Ptr("1421876371"), // "iss": to.Ptr("https://sts.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47/"), // "nbf": to.Ptr("1421876371"), // "puid": to.Ptr("20030000801A118C"), // "ver": to.Ptr("1.0"), // }, // CorrelationID: to.Ptr("1e121103-0ba6-4300-ac9d-952bb5d0c80f"), // EventDataID: to.Ptr("44ade6b4-3813-45e6-ae27-7420a95fa2f8"), // EventName: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("End request"), // Value: to.Ptr("EndRequest"), // }, // EventTimestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-01-21T22:14:26.979Z"); return t}()), // HTTPRequest: &armmonitor.HTTPRequestInfo{ // Method: to.Ptr("PUT"), // ClientIPAddress: to.Ptr("192.168.35.115"), // ClientRequestID: to.Ptr("27003b25-91d3-418f-8eb1-29e537dcb249"), // }, // ID: to.Ptr("/subscriptions/089bd33f-d4ec-47fe-8ba5-0753aa5c5b33/resourceGroups/MSSupportGroup/providers/microsoft.support/supporttickets/115012112305841/events/44ade6b4-3813-45e6-ae27-7420a95fa2f8/ticks/635574752669792776"), // Level: to.Ptr(armmonitor.EventLevelInformational), // OperationName: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("microsoft.support/supporttickets/write"), // Value: to.Ptr("microsoft.support/supporttickets/write"), // }, // Properties: map[string]*string{ // "statusCode": to.Ptr("Created"), // }, // ResourceGroupName: to.Ptr("MSSupportGroup"), // ResourceProviderName: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("microsoft.support"), // Value: to.Ptr("microsoft.support"), // }, // Status: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("Succeeded"), // Value: to.Ptr("Succeeded"), // }, // SubStatus: &armmonitor.LocalizableString{ // LocalizedValue: to.Ptr("Created (HTTP Status Code: 201)"), // Value: to.Ptr("Created"), // }, // SubmissionTimestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-01-21T22:14:39.993Z"); return t}()), // SubscriptionID: to.Ptr("089bd33f-d4ec-47fe-8ba5-0753aa5c5b33"), // }}, // } } }
Output:
type TenantActivityLogsClientListOptions ¶ added in v0.4.0
type TenantActivityLogsClientListOptions struct { // Reduces the set of data collected. // The $filter is very restricted and allows only the following patterns. // - List events for a resource group: $filter=eventTimestamp ge ” and eventTimestamp le ” and eventChannels eq 'Admin, // Operation' and resourceGroupName eq ”. // - List events for resource: $filter=eventTimestamp ge ” and eventTimestamp le ” and eventChannels eq 'Admin, Operation' // and resourceUri eq ”. // - List events for a subscription: $filter=eventTimestamp ge ” and eventTimestamp le ” and eventChannels eq 'Admin, Operation'. // - List events for a resource provider: $filter=eventTimestamp ge ” and eventTimestamp le ” and eventChannels eq 'Admin, // Operation' and resourceProvider eq ”. // - List events for a correlation Id: api-version=2014-04-01&$filter=eventTimestamp ge '2014-07-16T04:36:37.6407898Z' and // eventTimestamp le '2014-07-20T04:36:37.6407898Z' and eventChannels eq 'Admin, // Operation' and correlationId eq ”. // NOTE: No other syntax is allowed. Filter *string // Used to fetch events with only the given properties. // The $select argument is a comma separated list of property names to be returned. Possible values are: authorization, claims, // correlationId, description, eventDataId, eventName, eventTimestamp, // httpRequest, level, operationId, operationName, properties, resourceGroupName, resourceProviderName, resourceId, status, // submissionTimestamp, subStatus, subscriptionId Select *string }
TenantActivityLogsClientListOptions contains the optional parameters for the TenantActivityLogsClient.NewListPager method.
type TenantActivityLogsClientListResponse ¶ added in v0.4.0
type TenantActivityLogsClientListResponse struct { // Represents collection of events. EventDataCollection }
TenantActivityLogsClientListResponse contains the response from method TenantActivityLogsClient.NewListPager.
type TestNotificationDetailsResponse ¶ added in v0.3.0
type TestNotificationDetailsResponse struct { // REQUIRED; The overall state State *string // The list of action detail ActionDetails []*ActionDetail // The completed time CompletedTime *string // The context info Context *Context // The created time CreatedTime *string }
TestNotificationDetailsResponse - The details of the test notification results.
func (TestNotificationDetailsResponse) MarshalJSON ¶ added in v0.3.0
func (t TestNotificationDetailsResponse) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type TestNotificationDetailsResponse.
func (*TestNotificationDetailsResponse) UnmarshalJSON ¶ added in v0.8.0
func (t *TestNotificationDetailsResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type TestNotificationDetailsResponse.
type ThresholdRuleCondition ¶
type ThresholdRuleCondition struct { // REQUIRED; specifies the type of condition. This can be one of three types: ManagementEventRuleCondition (occurrences of // management events), LocationThresholdRuleCondition (based on the number of failures of a // web test), and ThresholdRuleCondition (based on the threshold of a metric). ODataType *string // REQUIRED; the operator used to compare the data and the threshold. Operator *ConditionOperator // REQUIRED; the threshold value that activates the alert. Threshold *float64 // the resource from which the rule collects its data. For this type dataSource will always be of type RuleMetricDataSource. DataSource RuleDataSourceClassification // the time aggregation operator. How the data that are collected should be combined over time. The default value is the PrimaryAggregationType // of the Metric. TimeAggregation *TimeAggregationOperator // the period of time (in ISO 8601 duration format) that is used to monitor alert activity based on the threshold. If specified // then it must be between 5 minutes and 1 day. WindowSize *string }
ThresholdRuleCondition - A rule condition based on a metric crossing a threshold.
func (*ThresholdRuleCondition) GetRuleCondition ¶ added in v0.4.0
func (t *ThresholdRuleCondition) GetRuleCondition() *RuleCondition
GetRuleCondition implements the RuleConditionClassification interface for type ThresholdRuleCondition.
func (ThresholdRuleCondition) MarshalJSON ¶
func (t ThresholdRuleCondition) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ThresholdRuleCondition.
func (*ThresholdRuleCondition) UnmarshalJSON ¶
func (t *ThresholdRuleCondition) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ThresholdRuleCondition.
type TimeAggregation ¶ added in v0.8.0
type TimeAggregation string
TimeAggregation - Aggregation type. Relevant and required only for rules of the kind LogAlert.
const ( TimeAggregationAverage TimeAggregation = "Average" TimeAggregationCount TimeAggregation = "Count" TimeAggregationMaximum TimeAggregation = "Maximum" TimeAggregationMinimum TimeAggregation = "Minimum" TimeAggregationTotal TimeAggregation = "Total" )
func PossibleTimeAggregationValues ¶ added in v0.8.0
func PossibleTimeAggregationValues() []TimeAggregation
PossibleTimeAggregationValues returns the possible values for the TimeAggregation const type.
type TimeAggregationOperator ¶
type TimeAggregationOperator string
TimeAggregationOperator - Aggregation operators allowed in a rule.
const ( TimeAggregationOperatorAverage TimeAggregationOperator = "Average" TimeAggregationOperatorLast TimeAggregationOperator = "Last" TimeAggregationOperatorMaximum TimeAggregationOperator = "Maximum" TimeAggregationOperatorMinimum TimeAggregationOperator = "Minimum" TimeAggregationOperatorTotal TimeAggregationOperator = "Total" )
func PossibleTimeAggregationOperatorValues ¶
func PossibleTimeAggregationOperatorValues() []TimeAggregationOperator
PossibleTimeAggregationOperatorValues returns the possible values for the TimeAggregationOperator const type.
type TimeAggregationType ¶
type TimeAggregationType string
TimeAggregationType - time aggregation type. How the data that is collected should be combined over time. The default value is Average.
const ( TimeAggregationTypeAverage TimeAggregationType = "Average" TimeAggregationTypeCount TimeAggregationType = "Count" TimeAggregationTypeLast TimeAggregationType = "Last" TimeAggregationTypeMaximum TimeAggregationType = "Maximum" TimeAggregationTypeMinimum TimeAggregationType = "Minimum" TimeAggregationTypeTotal TimeAggregationType = "Total" )
func PossibleTimeAggregationTypeValues ¶
func PossibleTimeAggregationTypeValues() []TimeAggregationType
PossibleTimeAggregationTypeValues returns the possible values for the TimeAggregationType const type.
type TimeSeriesBaseline ¶
type TimeSeriesBaseline struct { // REQUIRED; The aggregation type of the metric. Aggregation *string // REQUIRED; The baseline values for each sensitivity. Data []*SingleBaseline // REQUIRED; The list of timestamps of the baselines. Timestamps []*time.Time // The dimensions of this time series. Dimensions []*MetricSingleDimension // The baseline metadata values. MetadataValues []*BaselineMetadata }
TimeSeriesBaseline - The baseline values for a single time series.
func (TimeSeriesBaseline) MarshalJSON ¶
func (t TimeSeriesBaseline) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type TimeSeriesBaseline.
func (*TimeSeriesBaseline) UnmarshalJSON ¶ added in v0.8.0
func (t *TimeSeriesBaseline) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type TimeSeriesBaseline.
type TimeSeriesElement ¶
type TimeSeriesElement struct { // An array of data points representing the metric values. This is only returned if a result type of data is specified. Data []*MetricValue // the metadata values returned if $filter was specified in the call. Metadatavalues []*MetadataValue }
TimeSeriesElement - A time series result type. The discriminator value is always TimeSeries in this case.
func (TimeSeriesElement) MarshalJSON ¶
func (t TimeSeriesElement) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type TimeSeriesElement.
func (*TimeSeriesElement) UnmarshalJSON ¶ added in v0.8.0
func (t *TimeSeriesElement) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type TimeSeriesElement.
type TimeWindow ¶
type TimeWindow struct { // REQUIRED; the end time for the profile in ISO 8601 format. End *time.Time // REQUIRED; the start time for the profile in ISO 8601 format. Start *time.Time // the timezone of the start and end times for the profile. Some examples of valid time zones are: Dateline Standard Time, // UTC-11, Hawaiian Standard Time, Alaskan Standard Time, Pacific Standard Time // (Mexico), Pacific Standard Time, US Mountain Standard Time, Mountain Standard Time (Mexico), Mountain Standard Time, Central // America Standard Time, Central Standard Time, Central Standard Time // (Mexico), Canada Central Standard Time, SA Pacific Standard Time, Eastern Standard Time, US Eastern Standard Time, Venezuela // Standard Time, Paraguay Standard Time, Atlantic Standard Time, Central // Brazilian Standard Time, SA Western Standard Time, Pacific SA Standard Time, Newfoundland Standard Time, E. South America // Standard Time, Argentina Standard Time, SA Eastern Standard Time, Greenland // Standard Time, Montevideo Standard Time, Bahia Standard Time, UTC-02, Mid-Atlantic Standard Time, Azores Standard Time, // Cape Verde Standard Time, Morocco Standard Time, UTC, GMT Standard Time, // Greenwich Standard Time, W. Europe Standard Time, Central Europe Standard Time, Romance Standard Time, Central European // Standard Time, W. Central Africa Standard Time, Namibia Standard Time, Jordan // Standard Time, GTB Standard Time, Middle East Standard Time, Egypt Standard Time, Syria Standard Time, E. Europe Standard // Time, South Africa Standard Time, FLE Standard Time, Turkey Standard Time, // Israel Standard Time, Kaliningrad Standard Time, Libya Standard Time, Arabic Standard Time, Arab Standard Time, Belarus // Standard Time, Russian Standard Time, E. Africa Standard Time, Iran Standard // Time, Arabian Standard Time, Azerbaijan Standard Time, Russia Time Zone 3, Mauritius Standard Time, Georgian Standard Time, // Caucasus Standard Time, Afghanistan Standard Time, West Asia Standard Time, // Ekaterinburg Standard Time, Pakistan Standard Time, India Standard Time, Sri Lanka Standard Time, Nepal Standard Time, // Central Asia Standard Time, Bangladesh Standard Time, N. Central Asia Standard // Time, Myanmar Standard Time, SE Asia Standard Time, North Asia Standard Time, China Standard Time, North Asia East Standard // Time, Singapore Standard Time, W. Australia Standard Time, Taipei Standard // Time, Ulaanbaatar Standard Time, Tokyo Standard Time, Korea Standard Time, Yakutsk Standard Time, Cen. Australia Standard // Time, AUS Central Standard Time, E. Australia Standard Time, AUS Eastern // Standard Time, West Pacific Standard Time, Tasmania Standard Time, Magadan Standard Time, Vladivostok Standard Time, Russia // Time Zone 10, Central Pacific Standard Time, Russia Time Zone 11, New // Zealand Standard Time, UTC+12, Fiji Standard Time, Kamchatka Standard Time, Tonga Standard Time, Samoa Standard Time, Line // Islands Standard Time TimeZone *string }
TimeWindow - A specific date-time for the profile.
func (TimeWindow) MarshalJSON ¶
func (t TimeWindow) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type TimeWindow.
func (*TimeWindow) UnmarshalJSON ¶
func (t *TimeWindow) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type TimeWindow.
type TrackedResource ¶ added in v0.8.0
type TrackedResource struct { // REQUIRED; The geo-location where the resource lives Location *string // Resource tags. Tags map[string]*string // 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; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string }
TrackedResource - The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location'
func (TrackedResource) MarshalJSON ¶ added in v0.8.0
func (t TrackedResource) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type TrackedResource.
func (*TrackedResource) UnmarshalJSON ¶ added in v0.8.0
func (t *TrackedResource) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type TrackedResource.
type TrackedResourceAutoGenerated ¶ added in v0.9.0
type TrackedResourceAutoGenerated struct { // REQUIRED; The geo-location where the resource lives Location *string // Resource tags. Tags map[string]*string // 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 }
TrackedResourceAutoGenerated - The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location'
func (TrackedResourceAutoGenerated) MarshalJSON ¶ added in v0.9.0
func (t TrackedResourceAutoGenerated) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type TrackedResourceAutoGenerated.
func (*TrackedResourceAutoGenerated) UnmarshalJSON ¶ added in v0.9.0
func (t *TrackedResourceAutoGenerated) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type TrackedResourceAutoGenerated.
type Unit ¶ added in v0.9.0
type Unit string
Unit - The unit of the metric.
const ( UnitBitsPerSecond Unit = "BitsPerSecond" UnitByteSeconds Unit = "ByteSeconds" UnitBytes Unit = "Bytes" UnitBytesPerSecond Unit = "BytesPerSecond" UnitCores Unit = "Cores" UnitCount Unit = "Count" UnitCountPerSecond Unit = "CountPerSecond" UnitMilliCores Unit = "MilliCores" UnitMilliSeconds Unit = "MilliSeconds" UnitNanoCores Unit = "NanoCores" UnitPercent Unit = "Percent" UnitSeconds Unit = "Seconds" UnitUnspecified Unit = "Unspecified" )
func PossibleUnitValues ¶ added in v0.9.0
func PossibleUnitValues() []Unit
PossibleUnitValues returns the possible values for the Unit const type.
type UserAssignedIdentity ¶ added in v0.9.0
type UserAssignedIdentity struct { // READ-ONLY; The client ID of the assigned identity. ClientID *string // READ-ONLY; The principal ID of the assigned identity. PrincipalID *string }
UserAssignedIdentity - User assigned identity properties
func (UserAssignedIdentity) MarshalJSON ¶ added in v0.9.0
func (u UserAssignedIdentity) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type UserAssignedIdentity.
func (*UserAssignedIdentity) UnmarshalJSON ¶ added in v0.9.0
func (u *UserAssignedIdentity) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type UserAssignedIdentity.
type UserIdentityProperties ¶ added in v0.9.0
type UserIdentityProperties struct { // READ-ONLY; The client id of user assigned identity. ClientID *string // READ-ONLY; The principal id of user assigned identity. PrincipalID *string }
UserIdentityProperties - User assigned identity properties.
func (UserIdentityProperties) MarshalJSON ¶ added in v0.9.0
func (u UserIdentityProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type UserIdentityProperties.
func (*UserIdentityProperties) UnmarshalJSON ¶ added in v0.9.0
func (u *UserIdentityProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type UserIdentityProperties.
type VMInsightsClient ¶
type VMInsightsClient struct {
// contains filtered or unexported fields
}
VMInsightsClient contains the methods for the VMInsights group. Don't use this type directly, use NewVMInsightsClient() instead.
func NewVMInsightsClient ¶
func NewVMInsightsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*VMInsightsClient, error)
NewVMInsightsClient creates a new instance of VMInsightsClient with the specified values.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - pass nil to accept the default values.
func (*VMInsightsClient) GetOnboardingStatus ¶
func (client *VMInsightsClient) GetOnboardingStatus(ctx context.Context, resourceURI string, options *VMInsightsClientGetOnboardingStatusOptions) (VMInsightsClientGetOnboardingStatusResponse, error)
GetOnboardingStatus - Retrieves the VM Insights onboarding status for the specified resource or resource scope. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2018-11-27-preview
- resourceURI - The fully qualified Azure Resource manager identifier of the resource, or scope, whose status to retrieve.
- options - VMInsightsClientGetOnboardingStatusOptions contains the optional parameters for the VMInsightsClient.GetOnboardingStatus method.
Example (GetStatusForAResourceGroupThatHasAtLeastOneVmThatIsActivelyReportingData) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Insights/preview/2018-11-27-preview/examples/getOnboardingStatusResourceGroup.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewVMInsightsClient().GetOnboardingStatus(ctx, "subscriptions/3d51de47-8d1c-4d24-b42f-bcae075dfa87/resourceGroups/resource-group-with-vms", 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.VMInsightsOnboardingStatus = armmonitor.VMInsightsOnboardingStatus{ // Name: to.Ptr("default"), // Type: to.Ptr("Microsoft.Insights/vmInsightsOnboardingStatuses"), // ID: to.Ptr("/subscriptions/3d51de47-8d1c-4d24-b42f-bcae075dfa87/resourceGroups/resource-group-with-vms/providers/Microsoft.Insights/vmInsightsOnboardingStatuses/default"), // Properties: &armmonitor.VMInsightsOnboardingStatusProperties{ // Data: []*armmonitor.DataContainer{ // { // Workspace: &armmonitor.WorkspaceInfo{ // ID: to.Ptr("/subscriptions/3d51de47-8d1c-4d24-b42f-bcae075dfa87/resourcegroups/monitoring/providers/microsoft.operationalinsights/workspaces/vm-monitoring"), // Location: to.Ptr("eastus"), // Properties: &armmonitor.WorkspaceInfoProperties{ // CustomerID: to.Ptr("c7f8f44d-d8ee-4b79-9d9a-4d8a1f2a112a"), // }, // }, // }}, // DataStatus: to.Ptr(armmonitor.DataStatusPresent), // OnboardingStatus: to.Ptr(armmonitor.OnboardingStatusOnboarded), // ResourceID: to.Ptr("/subscriptions/3d51de47-8d1c-4d24-b42f-bcae075dfa87/resourceGroups/resource-group-with-vms"), // }, // } }
Output:
Example (GetStatusForASubscriptionThatHasAtLeastOneVmThatIsActivelyReportingData) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Insights/preview/2018-11-27-preview/examples/getOnboardingStatusSubscription.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewVMInsightsClient().GetOnboardingStatus(ctx, "subscriptions/3d51de47-8d1c-4d24-b42f-bcae075dfa87", 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.VMInsightsOnboardingStatus = armmonitor.VMInsightsOnboardingStatus{ // Name: to.Ptr("default"), // Type: to.Ptr("Microsoft.Insights/vmInsightsOnboardingStatuses"), // ID: to.Ptr("/subscriptions/3d51de47-8d1c-4d24-b42f-bcae075dfa87/providers/Microsoft.Insights/vmInsightsOnboardingStatuses/default"), // Properties: &armmonitor.VMInsightsOnboardingStatusProperties{ // Data: []*armmonitor.DataContainer{ // { // Workspace: &armmonitor.WorkspaceInfo{ // ID: to.Ptr("/subscriptions/3d51de47-8d1c-4d24-b42f-bcae075dfa87/resourcegroups/monitoring/providers/microsoft.operationalinsights/workspaces/vm-monitoring-secondary"), // Location: to.Ptr("eastus"), // Properties: &armmonitor.WorkspaceInfoProperties{ // CustomerID: to.Ptr("f096d163-206e-4abf-9db3-2c62af003d68"), // }, // }, // }, // { // Workspace: &armmonitor.WorkspaceInfo{ // ID: to.Ptr("/subscriptions/3d51de47-8d1c-4d24-b42f-bcae075dfa87/resourcegroups/monitoring/providers/microsoft.operationalinsights/workspaces/vm-monitoring"), // Location: to.Ptr("eastus"), // Properties: &armmonitor.WorkspaceInfoProperties{ // CustomerID: to.Ptr("c7f8f44d-d8ee-4b79-9d9a-4d8a1f2a112a"), // }, // }, // }}, // DataStatus: to.Ptr(armmonitor.DataStatusPresent), // OnboardingStatus: to.Ptr(armmonitor.OnboardingStatusOnboarded), // ResourceID: to.Ptr("/subscriptions/3d51de47-8d1c-4d24-b42f-bcae075dfa87"), // }, // } }
Output:
Example (GetStatusForAVmScaleSetThatIsActivelyReportingData) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Insights/preview/2018-11-27-preview/examples/getOnboardingStatusVMScaleSet.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewVMInsightsClient().GetOnboardingStatus(ctx, "subscriptions/3d51de47-8d1c-4d24-b42f-bcae075dfa87/resourceGroups/my-service-cluster/providers/Microsoft.Compute/virtualMachineScaleSets/scale-set-01", 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.VMInsightsOnboardingStatus = armmonitor.VMInsightsOnboardingStatus{ // Name: to.Ptr("default"), // Type: to.Ptr("Microsoft.Insights/vmInsightsOnboardingStatuses"), // ID: to.Ptr("/subscriptions/3d51de47-8d1c-4d24-b42f-bcae075dfa87/resourceGroups/my-service-cluster/providers/Microsoft.Compute/virtualMachineScaleSets/scale-set-01/providers/Microsoft.Insights/vmInsightsOnboardingStatuses/default"), // Properties: &armmonitor.VMInsightsOnboardingStatusProperties{ // Data: []*armmonitor.DataContainer{ // { // Workspace: &armmonitor.WorkspaceInfo{ // ID: to.Ptr("/subscriptions/3d51de47-8d1c-4d24-b42f-bcae075dfa87/resourcegroups/monitoring/providers/microsoft.operationalinsights/workspaces/vm-monitoring"), // Location: to.Ptr("eastus"), // Properties: &armmonitor.WorkspaceInfoProperties{ // CustomerID: to.Ptr("c7f8f44d-d8ee-4b79-9d9a-4d8a1f2a112a"), // }, // }, // }}, // DataStatus: to.Ptr(armmonitor.DataStatusPresent), // OnboardingStatus: to.Ptr(armmonitor.OnboardingStatusOnboarded), // ResourceID: to.Ptr("/subscriptions/3d51de47-8d1c-4d24-b42f-bcae075dfa87/resourceGroups/my-service-cluster/providers/Microsoft.Compute/virtualMachineScaleSets/scale-set-01"), // }, // } }
Output:
Example (GetStatusForAVmThatHasNotYetReportedData) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Insights/preview/2018-11-27-preview/examples/getOnboardingStatusSingleVMUnknown.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewVMInsightsClient().GetOnboardingStatus(ctx, "subscriptions/3d51de47-8d1c-4d24-b42f-bcae075dfa87/resourceGroups/vm-resource-group/providers/Microsoft.Compute/virtualMachines/ubuntu-vm", 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.VMInsightsOnboardingStatus = armmonitor.VMInsightsOnboardingStatus{ // Name: to.Ptr("default"), // Type: to.Ptr("Microsoft.Insights/vmInsightsOnboardingStatuses"), // ID: to.Ptr("/subscriptions/3d51de47-8d1c-4d24-b42f-bcae075dfa87/resourceGroups/vm-resource-group/providers/Microsoft.Compute/virtualMachines/ubuntu-vm/providers/Microsoft.Insights/vmInsightsOnboardingStatuses/default"), // Properties: &armmonitor.VMInsightsOnboardingStatusProperties{ // Data: []*armmonitor.DataContainer{ // }, // DataStatus: to.Ptr(armmonitor.DataStatusNotPresent), // OnboardingStatus: to.Ptr(armmonitor.OnboardingStatusUnknown), // ResourceID: to.Ptr("/subscriptions/3d51de47-8d1c-4d24-b42f-bcae075dfa87/resourceGroups/vm-resource-group/providers/Microsoft.Compute/virtualMachines/ubuntu-vm"), // }, // } }
Output:
Example (GetStatusForAVmThatIsActivelyReportingData) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Insights/preview/2018-11-27-preview/examples/getOnboardingStatusSingleVM.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewVMInsightsClient().GetOnboardingStatus(ctx, "subscriptions/3d51de47-8d1c-4d24-b42f-bcae075dfa87/resourceGroups/vm-resource-group/providers/Microsoft.Compute/virtualMachines/ubuntu-vm", 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.VMInsightsOnboardingStatus = armmonitor.VMInsightsOnboardingStatus{ // Name: to.Ptr("default"), // Type: to.Ptr("Microsoft.Insights/vmInsightsOnboardingStatuses"), // ID: to.Ptr("/subscriptions/3d51de47-8d1c-4d24-b42f-bcae075dfa87/resourceGroups/vm-resource-group/providers/Microsoft.Compute/virtualMachines/ubuntu-vm/providers/Microsoft.Insights/vmInsightsOnboardingStatuses/default"), // Properties: &armmonitor.VMInsightsOnboardingStatusProperties{ // Data: []*armmonitor.DataContainer{ // { // Workspace: &armmonitor.WorkspaceInfo{ // ID: to.Ptr("/subscriptions/3d51de47-8d1c-4d24-b42f-bcae075dfa87/resourcegroups/monitoring/providers/microsoft.operationalinsights/workspaces/vm-monitoring"), // Location: to.Ptr("eastus"), // Properties: &armmonitor.WorkspaceInfoProperties{ // CustomerID: to.Ptr("c7f8f44d-d8ee-4b79-9d9a-4d8a1f2a112a"), // }, // }, // }}, // DataStatus: to.Ptr(armmonitor.DataStatusPresent), // OnboardingStatus: to.Ptr(armmonitor.OnboardingStatusOnboarded), // ResourceID: to.Ptr("/subscriptions/3d51de47-8d1c-4d24-b42f-bcae075dfa87/resourceGroups/vm-resource-group/providers/Microsoft.Compute/virtualMachines/ubuntu-vm"), // }, // } }
Output:
type VMInsightsClientGetOnboardingStatusOptions ¶ added in v0.4.0
type VMInsightsClientGetOnboardingStatusOptions struct { }
VMInsightsClientGetOnboardingStatusOptions contains the optional parameters for the VMInsightsClient.GetOnboardingStatus method.
type VMInsightsClientGetOnboardingStatusResponse ¶ added in v0.4.0
type VMInsightsClientGetOnboardingStatusResponse struct { // VM Insights onboarding status for a resource. VMInsightsOnboardingStatus }
VMInsightsClientGetOnboardingStatusResponse contains the response from method VMInsightsClient.GetOnboardingStatus.
type VMInsightsOnboardingStatus ¶
type VMInsightsOnboardingStatus struct { // Resource properties. Properties *VMInsightsOnboardingStatusProperties // READ-ONLY; Azure resource Id ID *string // READ-ONLY; Azure resource name Name *string // READ-ONLY; Azure resource type Type *string }
VMInsightsOnboardingStatus - VM Insights onboarding status for a resource.
func (VMInsightsOnboardingStatus) MarshalJSON ¶ added in v0.8.0
func (v VMInsightsOnboardingStatus) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type VMInsightsOnboardingStatus.
func (*VMInsightsOnboardingStatus) UnmarshalJSON ¶ added in v0.8.0
func (v *VMInsightsOnboardingStatus) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type VMInsightsOnboardingStatus.
type VMInsightsOnboardingStatusProperties ¶
type VMInsightsOnboardingStatusProperties struct { // REQUIRED; The status of VM Insights data from the resource. When reported as present the data array will contain information // about the data containers to which data for the specified resource is being routed. DataStatus *DataStatus // REQUIRED; The onboarding status for the resource. Note that, a higher level scope, e.g., resource group or subscription, // is considered onboarded if at least one resource under it is onboarded. OnboardingStatus *OnboardingStatus // REQUIRED; Azure Resource Manager identifier of the resource whose onboarding status is being represented. ResourceID *string // Containers that currently store VM Insights data for the specified resource. Data []*DataContainer }
VMInsightsOnboardingStatusProperties - Resource properties.
func (VMInsightsOnboardingStatusProperties) MarshalJSON ¶
func (v VMInsightsOnboardingStatusProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type VMInsightsOnboardingStatusProperties.
func (*VMInsightsOnboardingStatusProperties) UnmarshalJSON ¶ added in v0.8.0
func (v *VMInsightsOnboardingStatusProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type VMInsightsOnboardingStatusProperties.
type VoiceReceiver ¶
type VoiceReceiver struct { // REQUIRED; The country code of the voice receiver. CountryCode *string // REQUIRED; The name of the voice receiver. Names must be unique across all receivers within an action group. Name *string // REQUIRED; The phone number of the voice receiver. PhoneNumber *string }
VoiceReceiver - A voice receiver.
func (VoiceReceiver) MarshalJSON ¶ added in v0.8.0
func (v VoiceReceiver) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type VoiceReceiver.
func (*VoiceReceiver) UnmarshalJSON ¶ added in v0.8.0
func (v *VoiceReceiver) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type VoiceReceiver.
type VoiceReceiverAutoGenerated ¶ added in v0.9.0
type VoiceReceiverAutoGenerated struct { // REQUIRED; The country code of the voice receiver. CountryCode *string // REQUIRED; The name of the voice receiver. Names must be unique across all receivers within a tenant action group. Name *string // REQUIRED; The phone number of the voice receiver. PhoneNumber *string }
VoiceReceiverAutoGenerated - A voice receiver.
func (VoiceReceiverAutoGenerated) MarshalJSON ¶ added in v0.9.0
func (v VoiceReceiverAutoGenerated) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type VoiceReceiverAutoGenerated.
func (*VoiceReceiverAutoGenerated) UnmarshalJSON ¶ added in v0.9.0
func (v *VoiceReceiverAutoGenerated) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type VoiceReceiverAutoGenerated.
type WebhookNotification ¶
type WebhookNotification struct { // a property bag of settings. This value can be empty. Properties map[string]*string // the service address to receive the notification. ServiceURI *string }
WebhookNotification - Webhook notification of an autoscale event.
func (WebhookNotification) MarshalJSON ¶
func (w WebhookNotification) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type WebhookNotification.
func (*WebhookNotification) UnmarshalJSON ¶ added in v0.8.0
func (w *WebhookNotification) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type WebhookNotification.
type WebhookReceiver ¶
type WebhookReceiver struct { // REQUIRED; The name of the webhook receiver. Names must be unique across all receivers within an action group. Name *string // REQUIRED; The URI where webhooks should be sent. ServiceURI *string // Indicates the identifier uri for aad auth. IdentifierURI *string // Indicates the webhook app object Id for aad auth. ObjectID *string // Indicates the tenant id for aad auth. TenantID *string // Indicates whether or not use AAD authentication. UseAADAuth *bool // Indicates whether to use common alert schema. UseCommonAlertSchema *bool }
WebhookReceiver - A webhook receiver.
func (WebhookReceiver) MarshalJSON ¶ added in v0.8.0
func (w WebhookReceiver) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type WebhookReceiver.
func (*WebhookReceiver) UnmarshalJSON ¶ added in v0.8.0
func (w *WebhookReceiver) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type WebhookReceiver.
type WebhookReceiverAutoGenerated ¶ added in v0.9.0
type WebhookReceiverAutoGenerated struct { // REQUIRED; The name of the webhook receiver. Names must be unique across all receivers within a tenant action group. Name *string // REQUIRED; The URI where webhooks should be sent. ServiceURI *string // Indicates the identifier uri for aad auth. IdentifierURI *string // Indicates the webhook app object Id for aad auth. ObjectID *string // Indicates the tenant id for aad auth. TenantID *string // Indicates whether or not use AAD authentication. UseAADAuth *bool // Indicates whether to use common alert schema. UseCommonAlertSchema *bool }
WebhookReceiverAutoGenerated - A webhook receiver.
func (WebhookReceiverAutoGenerated) MarshalJSON ¶ added in v0.9.0
func (w WebhookReceiverAutoGenerated) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type WebhookReceiverAutoGenerated.
func (*WebhookReceiverAutoGenerated) UnmarshalJSON ¶ added in v0.9.0
func (w *WebhookReceiverAutoGenerated) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type WebhookReceiverAutoGenerated.
type WebtestLocationAvailabilityCriteria ¶
type WebtestLocationAvailabilityCriteria struct { // REQUIRED; The Application Insights resource Id. ComponentID *string // REQUIRED; The number of failed locations. FailedLocationCount *float32 // REQUIRED; specifies the type of the alert criteria. ODataType *Odatatype // REQUIRED; The Application Insights web test Id. WebTestID *string // OPTIONAL; Contains additional key/value pairs not defined in the schema. AdditionalProperties map[string]any }
WebtestLocationAvailabilityCriteria - Specifies the metric alert rule criteria for a web test resource.
func (*WebtestLocationAvailabilityCriteria) GetMetricAlertCriteria ¶ added in v0.4.0
func (w *WebtestLocationAvailabilityCriteria) GetMetricAlertCriteria() *MetricAlertCriteria
GetMetricAlertCriteria implements the MetricAlertCriteriaClassification interface for type WebtestLocationAvailabilityCriteria.
func (WebtestLocationAvailabilityCriteria) MarshalJSON ¶
func (w WebtestLocationAvailabilityCriteria) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type WebtestLocationAvailabilityCriteria.
func (*WebtestLocationAvailabilityCriteria) UnmarshalJSON ¶
func (w *WebtestLocationAvailabilityCriteria) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type WebtestLocationAvailabilityCriteria.
type WindowsEventLogDataSource ¶
type WindowsEventLogDataSource struct { // A friendly name for the data source. This name should be unique across all data sources (regardless of type) within the // data collection rule. Name *string // List of streams that this data source will be sent to. A stream indicates what schema will be used for this data and usually // what table in Log Analytics the data will be sent to. Streams []*KnownWindowsEventLogDataSourceStreams // A list of Windows Event Log queries in XPATH format. XPathQueries []*string }
WindowsEventLogDataSource - Definition of which Windows Event Log events will be collected and how they will be collected. Only collected from Windows machines.
func (WindowsEventLogDataSource) MarshalJSON ¶
func (w WindowsEventLogDataSource) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type WindowsEventLogDataSource.
func (*WindowsEventLogDataSource) UnmarshalJSON ¶ added in v0.8.0
func (w *WindowsEventLogDataSource) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type WindowsEventLogDataSource.
type WindowsFirewallLogsDataSource ¶ added in v0.9.0
type WindowsFirewallLogsDataSource struct { // REQUIRED; Firewall logs streams Streams []*string // A friendly name for the data source. This name should be unique across all data sources (regardless of type) within the // data collection rule. Name *string }
WindowsFirewallLogsDataSource - Enables Firewall logs to be collected by this data collection rule.
func (WindowsFirewallLogsDataSource) MarshalJSON ¶ added in v0.9.0
func (w WindowsFirewallLogsDataSource) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type WindowsFirewallLogsDataSource.
func (*WindowsFirewallLogsDataSource) UnmarshalJSON ¶ added in v0.9.0
func (w *WindowsFirewallLogsDataSource) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type WindowsFirewallLogsDataSource.
type WorkspaceInfo ¶
type WorkspaceInfo struct { // REQUIRED; Azure Resource Manager identifier of the Log Analytics Workspace. ID *string // REQUIRED; Location of the Log Analytics workspace. Location *string // REQUIRED; Resource properties. Properties *WorkspaceInfoProperties }
WorkspaceInfo - Information about a Log Analytics Workspace.
func (WorkspaceInfo) MarshalJSON ¶ added in v0.8.0
func (w WorkspaceInfo) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type WorkspaceInfo.
func (*WorkspaceInfo) UnmarshalJSON ¶ added in v0.8.0
func (w *WorkspaceInfo) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type WorkspaceInfo.
type WorkspaceInfoProperties ¶
type WorkspaceInfoProperties struct { // REQUIRED; Log Analytics workspace identifier. CustomerID *string }
WorkspaceInfoProperties - Resource properties.
func (WorkspaceInfoProperties) MarshalJSON ¶ added in v0.8.0
func (w WorkspaceInfoProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type WorkspaceInfoProperties.
func (*WorkspaceInfoProperties) UnmarshalJSON ¶ added in v0.8.0
func (w *WorkspaceInfoProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type WorkspaceInfoProperties.
Source Files ¶
- actiongroups_client.go
- activitylogalerts_client.go
- activitylogs_client.go
- alertruleincidents_client.go
- alertrules_client.go
- autoscalesettings_client.go
- azuremonitorworkspaces_client.go
- baselines_client.go
- build.go
- client_factory.go
- constants.go
- datacollectionendpoints_client.go
- datacollectionruleassociations_client.go
- datacollectionrules_client.go
- diagnosticsettings_client.go
- diagnosticsettingscategory_client.go
- eventcategories_client.go
- interfaces.go
- logprofiles_client.go
- metricalerts_client.go
- metricalertsstatus_client.go
- metricdefinitions_client.go
- metricnamespaces_client.go
- metrics_client.go
- models.go
- models_serde.go
- operations_client.go
- operationsformonitor_client.go
- options.go
- polymorphic_helpers.go
- predictivemetric_client.go
- privateendpointconnections_client.go
- privatelinkresources_client.go
- privatelinkscopedresources_client.go
- privatelinkscopeoperationstatus_client.go
- privatelinkscopes_client.go
- response_types.go
- scheduledqueryrules_client.go
- tenantactiongroups_client.go
- tenantactivitylogs_client.go
- time_rfc3339.go
- vminsights_client.go