Documentation
¶
Index ¶
- type AccessMode
- type AccessModeSettings
- type AccessModeSettingsExclusion
- type AccessRule
- type AccessRuleDirection
- type AccessRuleProperties
- type AccessRulePropertiesSubscriptionsItem
- type ActionDetail
- type ActionGroup
- type ActionGroupList
- type ActionGroupPatch
- type ActionGroupPatchBody
- type ActionGroupResource
- type ActionGroupsClient
- func (client *ActionGroupsClient) BeginCreateNotificationsAtActionGroupResourceLevel(ctx context.Context, resourceGroupName string, actionGroupName string, ...) (...)
- func (client *ActionGroupsClient) BeginReconcileNSP(ctx context.Context, resourceGroupName string, actionGroupName string, ...) (*runtime.Poller[ActionGroupsClientReconcileNSPResponse], error)
- 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) GetNSP(ctx context.Context, resourceGroupName string, actionGroupName string, ...) (ActionGroupsClientGetNSPResponse, 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) NewListNSPPager(resourceGroupName string, actionGroupName string, ...) *runtime.Pager[ActionGroupsClientListNSPResponse]
- func (client *ActionGroupsClient) Update(ctx context.Context, resourceGroupName string, actionGroupName string, ...) (ActionGroupsClientUpdateResponse, error)
- type ActionGroupsClientBeginCreateNotificationsAtActionGroupResourceLevelOptions
- type ActionGroupsClientBeginReconcileNSPOptions
- type ActionGroupsClientCreateNotificationsAtActionGroupResourceLevelResponse
- type ActionGroupsClientCreateOrUpdateOptions
- type ActionGroupsClientCreateOrUpdateResponse
- type ActionGroupsClientDeleteOptions
- type ActionGroupsClientDeleteResponse
- type ActionGroupsClientEnableReceiverOptions
- type ActionGroupsClientEnableReceiverResponse
- type ActionGroupsClientGetNSPOptions
- type ActionGroupsClientGetNSPResponse
- type ActionGroupsClientGetOptions
- type ActionGroupsClientGetResponse
- type ActionGroupsClientGetTestNotificationsAtActionGroupResourceLevelOptions
- type ActionGroupsClientGetTestNotificationsAtActionGroupResourceLevelResponse
- type ActionGroupsClientListByResourceGroupOptions
- type ActionGroupsClientListByResourceGroupResponse
- type ActionGroupsClientListBySubscriptionIDOptions
- type ActionGroupsClientListBySubscriptionIDResponse
- type ActionGroupsClientListNSPOptions
- type ActionGroupsClientListNSPResponse
- type ActionGroupsClientReconcileNSPResponse
- type ActionGroupsClientUpdateOptions
- type ActionGroupsClientUpdateResponse
- type ActionList
- type Actions
- type ActivityLogAlertActionGroup
- 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 AdxDestination
- type AgentSetting
- type AggregationType
- type AggregationTypeEnum
- 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 AlertSeverity
- type ApplicationInsights
- type ArmRoleReceiver
- type AutomationRunbookReceiver
- 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 AzureFunctionReceiver
- type AzureMonitorPrivateLinkScope
- type AzureMonitorPrivateLinkScopeListResult
- type AzureMonitorPrivateLinkScopeProperties
- type BaselineMetadata
- type BaselineSensitivity
- type BaselinesClient
- type BaselinesClientListOptions
- type BaselinesClientListResponse
- 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) NewAutoscaleSettingsClient() *AutoscaleSettingsClient
- func (c *ClientFactory) NewBaselinesClient() *BaselinesClient
- func (c *ClientFactory) NewDataCollectionEndpointsClient() *DataCollectionEndpointsClient
- func (c *ClientFactory) NewDataCollectionRuleAssociationsClient() *DataCollectionRuleAssociationsClient
- func (c *ClientFactory) NewDataCollectionRulesClient() *DataCollectionRulesClient
- 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) 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) NewScheduledQueryRuleClient() *ScheduledQueryRuleClient
- func (c *ClientFactory) NewScheduledQueryRulesClient() *ScheduledQueryRulesClient
- func (c *ClientFactory) NewServiceDiagnosticSettingsClient() *ServiceDiagnosticSettingsClient
- func (c *ClientFactory) NewTenantActivityLogsClient() *TenantActivityLogsClient
- type ColumnDefinition
- type ComparisonOperationType
- type Condition
- type ConditionFailingPeriods
- type ConditionOperator
- type Context
- type CreatedByType
- type CriterionType
- type DataCollectionEndpointConfigurationAccess
- type DataCollectionEndpointFailoverConfiguration
- type DataCollectionEndpointLogsIngestion
- type DataCollectionEndpointMetadata
- type DataCollectionEndpointMetricsIngestion
- type DataCollectionEndpointNetworkACLs
- type DataCollectionEndpointResource
- type DataCollectionEndpointResourceIdentity
- type DataCollectionEndpointResourceListResult
- type DataCollectionEndpointResourceProperties
- type DataCollectionEndpointResourceSKU
- type DataCollectionEndpointsClient
- func (client *DataCollectionEndpointsClient) BeginReconcileNSP(ctx context.Context, resourceGroupName string, ...) (*runtime.Poller[DataCollectionEndpointsClientReconcileNSPResponse], error)
- 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) GetNSP(ctx context.Context, resourceGroupName string, ...) (DataCollectionEndpointsClientGetNSPResponse, error)
- func (client *DataCollectionEndpointsClient) NewListByResourceGroupPager(resourceGroupName string, ...) *runtime.Pager[DataCollectionEndpointsClientListByResourceGroupResponse]
- func (client *DataCollectionEndpointsClient) NewListBySubscriptionPager(options *DataCollectionEndpointsClientListBySubscriptionOptions) *runtime.Pager[DataCollectionEndpointsClientListBySubscriptionResponse]
- func (client *DataCollectionEndpointsClient) NewListNSPPager(resourceGroupName string, dataCollectionEndpointName string, ...) *runtime.Pager[DataCollectionEndpointsClientListNSPResponse]
- func (client *DataCollectionEndpointsClient) Update(ctx context.Context, resourceGroupName string, ...) (DataCollectionEndpointsClientUpdateResponse, error)
- type DataCollectionEndpointsClientBeginReconcileNSPOptions
- type DataCollectionEndpointsClientCreateOptions
- type DataCollectionEndpointsClientCreateResponse
- type DataCollectionEndpointsClientDeleteOptions
- type DataCollectionEndpointsClientDeleteResponse
- type DataCollectionEndpointsClientGetNSPOptions
- type DataCollectionEndpointsClientGetNSPResponse
- type DataCollectionEndpointsClientGetOptions
- type DataCollectionEndpointsClientGetResponse
- type DataCollectionEndpointsClientListByResourceGroupOptions
- type DataCollectionEndpointsClientListByResourceGroupResponse
- type DataCollectionEndpointsClientListBySubscriptionOptions
- type DataCollectionEndpointsClientListBySubscriptionResponse
- type DataCollectionEndpointsClientListNSPOptions
- type DataCollectionEndpointsClientListNSPResponse
- type DataCollectionEndpointsClientReconcileNSPResponse
- type DataCollectionEndpointsClientUpdateOptions
- type DataCollectionEndpointsClientUpdateResponse
- type DataCollectionRuleAgentSettings
- type DataCollectionRuleAssociationMetadata
- type DataCollectionRuleAssociationProxyOnlyResource
- type DataCollectionRuleAssociationProxyOnlyResourceListResult
- type DataCollectionRuleAssociationProxyOnlyResourceProperties
- 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 DataCollectionRuleDirectDataSources
- type DataCollectionRuleEndpoints
- type DataCollectionRuleIngestionQuotas
- type DataCollectionRuleMetadata
- type DataCollectionRuleReferences
- type DataCollectionRuleResource
- type DataCollectionRuleResourceIdentity
- type DataCollectionRuleResourceListResult
- type DataCollectionRuleResourceProperties
- type DataCollectionRuleResourceSKU
- 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 DataFlow
- type DataImportSourcesEventHub
- type DataSourcesSpecDataImports
- type DestinationsSpecAzureMonitorMetrics
- type Dimension
- type DimensionOperator
- type DynamicMetricCriteria
- type DynamicPromQLCriteria
- type DynamicThresholdFailingPeriods
- type DynamicThresholdOperator
- type DynamicThresholdSensitivity
- type EmailNotification
- type EmailReceiver
- type EnableRequest
- type ErrorAdditionalInfo
- type ErrorDetail
- type EtwProviderDataSource
- type EventCategoriesClient
- type EventCategoriesClientListOptions
- type EventCategoriesClientListResponse
- type EventCategoryCollection
- type EventData
- type EventDataCollection
- type EventHubDestination
- type EventHubDirectDestination
- type EventHubReceiver
- type EventLevel
- type ExtensionDataSource
- type HTTPRequestInfo
- type Identity
- type IdentityType
- type IisLogsDataSource
- type Incident
- type IncidentListResult
- type IncidentManagementService
- type IncidentReceiver
- type IncidentServiceConnection
- type IngestionQuotasLogs
- type IssueType
- type ItsmReceiver
- type Kind
- type KnownAgentSettingName
- type KnownColumnDefinitionType
- type KnownDataCollectionEndpointProvisioningState
- type KnownDataCollectionEndpointResourceKind
- type KnownDataCollectionRuleAssociationProvisioningState
- type KnownDataCollectionRuleProvisioningState
- type KnownDataCollectionRuleResourceKind
- type KnownDataFlowStreams
- type KnownEtwProviderDataSourceLogLevel
- type KnownEtwProviderType
- type KnownExtensionDataSourceStreams
- type KnownLocationSpecProvisioningStatus
- type KnownLogFileTextSettingsRecordStartTimestampFormat
- type KnownLogFilesDataSourceFormat
- type KnownOtelLogsDataSourceStreams
- type KnownOtelLogsDirectDataSourceStreams
- type KnownOtelTracesDataSourceStreams
- type KnownOtelTracesDirectDataSourceStreams
- type KnownPerfCounterDataSourceStreams
- type KnownPerformanceCountersOTelDataSourceStreams
- type KnownPrometheusForwarderDataSourceStreams
- type KnownPublicNetworkAccessOptions
- type KnownStorageBlobLookupType
- type KnownSyslogDataSourceFacilityNames
- type KnownSyslogDataSourceLogLevels
- type KnownSyslogDataSourceStreams
- type KnownWindowsEventLogDataSourceStreams
- type KnownWindowsFirewallLogsDataSourceProfileFilter
- type LocalizableString
- type LocationSpec
- type LogAnalyticsDestination
- type LogFileSettingsText
- 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 ManagedServiceIdentity
- type ManagedServiceIdentityType
- 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 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 MicrosoftFabricDestination
- type MonitoringAccountDestination
- type MultiMetricCriteria
- type MultiMetricCriteriaClassification
- type MultiPromQLCriteria
- type MultiPromQLCriteriaClassification
- type NamespaceClassification
- type NetworkSecurityPerimeter
- type NetworkSecurityPerimeterConfiguration
- type NetworkSecurityPerimeterConfigurationListResult
- type NetworkSecurityPerimeterConfigurationProperties
- type NetworkSecurityPerimeterConfigurationProvisioningState
- type NetworkSecurityProfile
- type NotificationRequestBody
- type Odatatype
- type OperationStatus
- type Operator
- type OtelLogsDataSource
- type OtelLogsDataSourceResourceAttributeRouting
- type OtelLogsDirectDataSource
- type OtelMetricsDataSource
- type OtelMetricsDataSourceResourceAttributeRouting
- type OtelMetricsDirectDataSource
- type OtelTracesDataSource
- type OtelTracesDataSourceResourceAttributeRouting
- type OtelTracesDirectDataSource
- type PerfCounterDataSource
- type PerformanceCountersOTelDataSource
- 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 PrivateLinkScopeProvisioningState
- 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 PromQLCriteria
- type PrometheusForwarderDataSource
- type ProvisioningIssue
- type ProvisioningIssueProperties
- type QueryFailingPeriods
- type ReceiverStatus
- type Recurrence
- type RecurrenceFrequency
- type RecurrentSchedule
- type ReferencesSpecEnrichmentData
- type ResolveConfiguration
- type ResourceAssociation
- type ResourceAssociationAccessMode
- type ResourceForUpdate
- type ResourceForUpdateIdentity
- type Response
- type ResultType
- type RetentionPolicy
- type RuleResolveConfiguration
- type SKUTier
- type ScaleAction
- type ScaleCapacity
- type ScaleDirection
- type ScaleRule
- type ScaleRuleMetricDimension
- type ScaleRuleMetricDimensionOperationType
- type ScaleType
- type ScheduledQueryRuleClient
- func (client *ScheduledQueryRuleClient) BeginReconcileNSP(ctx context.Context, resourceGroupName string, ruleName string, ...) (*runtime.Poller[ScheduledQueryRuleClientReconcileNSPResponse], error)
- func (client *ScheduledQueryRuleClient) GetNSP(ctx context.Context, resourceGroupName string, ruleName string, ...) (ScheduledQueryRuleClientGetNSPResponse, error)
- func (client *ScheduledQueryRuleClient) NewListNSPPager(resourceGroupName string, ruleName string, ...) *runtime.Pager[ScheduledQueryRuleClientListNSPResponse]
- type ScheduledQueryRuleClientBeginReconcileNSPOptions
- type ScheduledQueryRuleClientGetNSPOptions
- type ScheduledQueryRuleClientGetNSPResponse
- type ScheduledQueryRuleClientListNSPOptions
- type ScheduledQueryRuleClientListNSPResponse
- type ScheduledQueryRuleClientReconcileNSPResponse
- 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 ScopedResourceKind
- type ScopedResourceListResult
- type ScopedResourceProperties
- type ScopedResourceProvisioningState
- type SenderAuthorization
- type ServiceDiagnosticSettings
- type ServiceDiagnosticSettingsClient
- func (client *ServiceDiagnosticSettingsClient) CreateOrUpdate(ctx context.Context, resourceURI string, ...) (ServiceDiagnosticSettingsClientCreateOrUpdateResponse, error)
- func (client *ServiceDiagnosticSettingsClient) Get(ctx context.Context, resourceURI string, ...) (ServiceDiagnosticSettingsClientGetResponse, error)
- func (client *ServiceDiagnosticSettingsClient) Update(ctx context.Context, resourceURI string, ...) (ServiceDiagnosticSettingsClientUpdateResponse, error)
- type ServiceDiagnosticSettingsClientCreateOrUpdateOptions
- type ServiceDiagnosticSettingsClientCreateOrUpdateResponse
- type ServiceDiagnosticSettingsClientGetOptions
- type ServiceDiagnosticSettingsClientGetResponse
- type ServiceDiagnosticSettingsClientUpdateOptions
- type ServiceDiagnosticSettingsClientUpdateResponse
- type ServiceDiagnosticSettingsResource
- type ServiceDiagnosticSettingsResourcePatch
- type Severity
- type SingleBaseline
- type SingleMetricBaseline
- type SmsReceiver
- type StaticPromQLCriteria
- type StorageBlob
- type StorageBlobDestination
- type StorageTableDestination
- type StreamDeclaration
- type SubscriptionScopeMetricDefinition
- type SubscriptionScopeMetricDefinitionCollection
- type SubscriptionScopeMetricsRequestBodyParameters
- type SyslogDataSource
- type SystemData
- type TagsResource
- type TenantActivityLogsClient
- type TenantActivityLogsClientListOptions
- type TenantActivityLogsClientListResponse
- type TestNotificationDetailsResponse
- type TimeAggregation
- type TimeAggregationType
- type TimeSeriesBaseline
- type TimeSeriesElement
- type TimeWindow
- type UserAssignedIdentity
- type UserIdentityProperties
- type VoiceReceiver
- type WebhookNotification
- type WebhookReceiver
- type WebtestLocationAvailabilityCriteria
- type WindowsEventLogDataSource
- type WindowsFirewallLogsDataSource
Examples ¶
- ActionGroupsClient.BeginCreateNotificationsAtActionGroupResourceLevel
- ActionGroupsClient.BeginReconcileNSP
- ActionGroupsClient.CreateOrUpdate
- ActionGroupsClient.Delete
- ActionGroupsClient.EnableReceiver
- ActionGroupsClient.Get
- ActionGroupsClient.GetNSP
- ActionGroupsClient.GetTestNotificationsAtActionGroupResourceLevel
- ActionGroupsClient.NewListByResourceGroupPager
- ActionGroupsClient.NewListBySubscriptionIDPager
- ActionGroupsClient.NewListNSPPager
- ActionGroupsClient.Update
- ActivityLogAlertsClient.CreateOrUpdate (CreateOrUpdateAnActivityLogAlertRule)
- ActivityLogAlertsClient.CreateOrUpdate (CreateOrUpdateAnActivityLogAlertRuleForTenantLevelEvents)
- 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
- AutoscaleSettingsClient.CreateOrUpdate
- AutoscaleSettingsClient.Delete
- AutoscaleSettingsClient.Get
- AutoscaleSettingsClient.NewListByResourceGroupPager
- AutoscaleSettingsClient.NewListBySubscriptionPager
- AutoscaleSettingsClient.Update
- BaselinesClient.NewListPager
- DataCollectionEndpointsClient.BeginReconcileNSP
- DataCollectionEndpointsClient.Create (CreateADataCollectionEndpoint)
- DataCollectionEndpointsClient.Create (UpdateADataCollectionEndpoint)
- DataCollectionEndpointsClient.Delete
- DataCollectionEndpointsClient.Get
- DataCollectionEndpointsClient.GetNSP
- DataCollectionEndpointsClient.NewListByResourceGroupPager
- DataCollectionEndpointsClient.NewListBySubscriptionPager
- DataCollectionEndpointsClient.NewListNSPPager
- DataCollectionEndpointsClient.Update
- DataCollectionRuleAssociationsClient.Create (CreateOrUpdateAssociation)
- DataCollectionRuleAssociationsClient.Create (CreateOrUpdateAssociationWithADataCollectionEndpoint)
- DataCollectionRuleAssociationsClient.Delete
- DataCollectionRuleAssociationsClient.Get
- DataCollectionRuleAssociationsClient.NewListByDataCollectionEndpointPager
- DataCollectionRuleAssociationsClient.NewListByResourcePager
- DataCollectionRuleAssociationsClient.NewListByRulePager
- DataCollectionRulesClient.Create (CreateOrUpdateAnAgentSettingsConfiguration)
- DataCollectionRulesClient.Create (CreateOrUpdateDataCollectionRule)
- DataCollectionRulesClient.Create (CreateOrUpdateDataCollectionRuleWithEmbeddedIngestionEndpoints)
- DataCollectionRulesClient.Create (CreateOrUpdateDataCollectionRuleWithEnrichment)
- DataCollectionRulesClient.Delete
- DataCollectionRulesClient.Get
- DataCollectionRulesClient.NewListByResourceGroupPager
- DataCollectionRulesClient.NewListBySubscriptionPager
- DataCollectionRulesClient.Update
- EventCategoriesClient.NewListPager
- LogProfilesClient.CreateOrUpdate
- LogProfilesClient.Delete
- LogProfilesClient.Get
- LogProfilesClient.NewListPager
- LogProfilesClient.Update
- MetricAlertsClient.CreateOrUpdate (CreateOrUpdateADynamicAlertRuleForMultipleResources)
- MetricAlertsClient.CreateOrUpdate (CreateOrUpdateADynamicAlertRuleForSingleResource)
- MetricAlertsClient.CreateOrUpdate (CreateOrUpdateAQueryBasedAlertRule)
- MetricAlertsClient.CreateOrUpdate (CreateOrUpdateAQueryBasedAlertRuleWithDynamicThreshold)
- MetricAlertsClient.CreateOrUpdate (CreateOrUpdateAResourceCentricQueryBasedAlertRule)
- MetricAlertsClient.CreateOrUpdate (CreateOrUpdateAResourceCentricQueryBasedAlertRuleForMultipleResources)
- 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 (GetAQueryBasedAlertRule)
- MetricAlertsClient.Get (GetAWebTestAlertRule)
- MetricAlertsClient.Get (GetAnAlertRuleForMultipleResources)
- MetricAlertsClient.Get (GetAnAlertRuleForSingleResource)
- MetricAlertsClient.Get (GetAnAlertRuleOnResourceGroupS)
- MetricAlertsClient.Get (GetAnAlertRuleOnSubscription)
- MetricAlertsClient.NewListByResourceGroupPager
- 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 (PostRequestForSubscriptionLevelMetricData)
- MetricsClient.ListAtSubscriptionScopePost (PostRequestForSubscriptionLevelMetricDataUsingBodyParams)
- MetricsClient.ListAtSubscriptionScopePost (PostRequestForSubscriptionLevelMetricMetadata)
- PredictiveMetricClient.Get
- PrivateEndpointConnectionsClient.BeginCreateOrUpdate
- PrivateEndpointConnectionsClient.BeginDelete
- PrivateEndpointConnectionsClient.Get
- PrivateEndpointConnectionsClient.ListByPrivateLinkScope
- PrivateLinkResourcesClient.Get
- PrivateLinkResourcesClient.ListByPrivateLinkScope
- PrivateLinkScopeOperationStatusClient.Get
- PrivateLinkScopedResourcesClient.BeginCreateOrUpdate (UpdateAScopedPlatformMetricsSubscriptionInAPrivateLinkScope)
- PrivateLinkScopedResourcesClient.BeginCreateOrUpdate (UpdateAScopedResourceInAPrivateLinkScope)
- PrivateLinkScopedResourcesClient.BeginDelete
- PrivateLinkScopedResourcesClient.Get
- PrivateLinkScopedResourcesClient.NewListByPrivateLinkScopePager (GetsListOfScopedResourcesInAPrivateLinkScope)
- PrivateLinkScopedResourcesClient.NewListByPrivateLinkScopePager (GetsListOfScopedResourcesInAPrivateLinkScopeFilteredByKind)
- PrivateLinkScopesClient.BeginDelete
- PrivateLinkScopesClient.CreateOrUpdate (PrivateLinkScopeCreate)
- PrivateLinkScopesClient.CreateOrUpdate (PrivateLinkScopeUpdate)
- PrivateLinkScopesClient.Get
- PrivateLinkScopesClient.NewListByResourceGroupPager
- PrivateLinkScopesClient.NewListPager
- PrivateLinkScopesClient.UpdateTags
- ScheduledQueryRuleClient.BeginReconcileNSP
- ScheduledQueryRuleClient.GetNSP
- ScheduledQueryRuleClient.NewListNSPPager
- ScheduledQueryRulesClient.CreateOrUpdate (CreateOrUpdateAScheduledQueryRuleForSingleResource)
- ScheduledQueryRulesClient.CreateOrUpdate (CreateOrUpdateAScheduledQueryRuleOnResourceGroupS)
- ScheduledQueryRulesClient.CreateOrUpdate (CreateOrUpdateAScheduledQueryRuleOnSubscription)
- ScheduledQueryRulesClient.CreateOrUpdate (CreateOrUpdateASimpleLogAlertScheduledQueryRuleOnSubscription)
- ScheduledQueryRulesClient.CreateOrUpdate (CreateOrUpdateDynamicThresholdScheduledQueryRuleOnSubscription)
- ScheduledQueryRulesClient.Delete
- ScheduledQueryRulesClient.Get
- ScheduledQueryRulesClient.NewListByResourceGroupPager
- ScheduledQueryRulesClient.NewListBySubscriptionPager
- ScheduledQueryRulesClient.Update
- ServiceDiagnosticSettingsClient.CreateOrUpdate
- ServiceDiagnosticSettingsClient.Get
- ServiceDiagnosticSettingsClient.Update
- TenantActivityLogsClient.NewListPager (GetTenantActivityLogsWithFilter)
- TenantActivityLogsClient.NewListPager (GetTenantActivityLogsWithFilterAndSelect)
- TenantActivityLogsClient.NewListPager (GetTenantActivityLogsWithSelect)
- TenantActivityLogsClient.NewListPager (GetTenantActivityLogsWithoutFilterOrSelect)
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 - Open AccessModeOpen AccessMode = "Open" // AccessModePrivateOnly - PrivateOnly 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 AccessRule ¶ added in v0.12.0
type AccessRule struct {
// Name of the access rule
Name *string
Properties *AccessRuleProperties
}
AccessRule - Access rule in a network security perimeter configuration profile
func (AccessRule) MarshalJSON ¶ added in v0.12.0
func (a AccessRule) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type AccessRule.
func (*AccessRule) UnmarshalJSON ¶ added in v0.12.0
func (a *AccessRule) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type AccessRule.
type AccessRuleDirection ¶ added in v0.12.0
type AccessRuleDirection string
AccessRuleDirection - Direction of Access Rule
const ( // AccessRuleDirectionInbound - Applies to inbound network traffic to the secured resources. AccessRuleDirectionInbound AccessRuleDirection = "Inbound" // AccessRuleDirectionOutbound - Applies to outbound network traffic from the secured resources AccessRuleDirectionOutbound AccessRuleDirection = "Outbound" )
func PossibleAccessRuleDirectionValues ¶ added in v0.12.0
func PossibleAccessRuleDirectionValues() []AccessRuleDirection
PossibleAccessRuleDirectionValues returns the possible values for the AccessRuleDirection const type.
type AccessRuleProperties ¶ added in v0.12.0
type AccessRuleProperties struct {
// Address prefixes in the CIDR format for inbound rules
AddressPrefixes []*string
Direction *AccessRuleDirection
// Email addresses for outbound rules
EmailAddresses []*string
// Fully qualified domain names (FQDN) for outbound rules
FullyQualifiedDomainNames []*string
// Network security perimeters for inbound rules
NetworkSecurityPerimeters []*NetworkSecurityPerimeter
// Phone numbers for outbound rules
PhoneNumbers []*string
// Subscriptions for inbound rules
Subscriptions *AccessRulePropertiesSubscriptionsItem
}
AccessRuleProperties - Properties of Access Rule
func (AccessRuleProperties) MarshalJSON ¶ added in v0.12.0
func (a AccessRuleProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type AccessRuleProperties.
func (*AccessRuleProperties) UnmarshalJSON ¶ added in v0.12.0
func (a *AccessRuleProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type AccessRuleProperties.
type AccessRulePropertiesSubscriptionsItem ¶ added in v0.12.0
type AccessRulePropertiesSubscriptionsItem struct {
// The fully qualified Azure resource ID of the subscription e.g. ('/subscriptions/00000000-0000-0000-0000-000000000000')
ID *string
}
AccessRulePropertiesSubscriptionsItem - we add this model in order to replace subscriptions model in CommonTypes with this model via alternateType decorator
func (AccessRulePropertiesSubscriptionsItem) MarshalJSON ¶ added in v0.12.0
func (a AccessRulePropertiesSubscriptionsItem) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type AccessRulePropertiesSubscriptionsItem.
func (*AccessRulePropertiesSubscriptionsItem) UnmarshalJSON ¶ added in v0.12.0
func (a *AccessRulePropertiesSubscriptionsItem) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type AccessRulePropertiesSubscriptionsItem.
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 incident receivers that are part of this action group.
IncidentReceivers []*IncidentReceiver
// 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 ActionGroupList ¶
type ActionGroupList struct {
// REQUIRED; The ActionGroupResource items on this page
Value []*ActionGroupResource
// The link to the next page of items
NextLink *string
}
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 ActionGroupPatchBody ¶
type ActionGroupPatchBody struct {
// Managed service identity (system assigned and/or user assigned identities)
Identity *ManagedServiceIdentity
// 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 ActionGroupResource ¶
type ActionGroupResource struct {
// REQUIRED; The geo-location where the resource lives
Location *string
// The managed service identities assigned to this resource.
Identity *ManagedServiceIdentity
// The action groups properties of the resource.
Properties *ActionGroup
// 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
}
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.
Generated from API versions 2021-10-01, 2024-10-01-preview
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. The value must be an UUID.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - Contains optional client configuration. 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.
- 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: 2024-10-01-preview/postTestNotificationsAtActionGroupResourceLevel.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("11111111-1111-1111-1111-111111111111", 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"),
ManagedIdentity: to.Ptr("f11979a4-36d1-45d0-9097-a0da3c7e855d"),
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"),
ManagedIdentity: to.Ptr("f11979a4-36d1-45d0-9097-a0da3c7e855d"),
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 poll 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 = armmonitor.ActionGroupsClientCreateNotificationsAtActionGroupResourceLevelResponse{
// 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) BeginReconcileNSP ¶ added in v0.12.0
func (client *ActionGroupsClient) BeginReconcileNSP(ctx context.Context, resourceGroupName string, actionGroupName string, networkSecurityPerimeterConfigurationName string, options *ActionGroupsClientBeginReconcileNSPOptions) (*runtime.Poller[ActionGroupsClientReconcileNSPResponse], error)
BeginReconcileNSP - Reconciles a specified NSP configuration for specified action group. If the operation fails it returns an *azcore.ResponseError type.
- resourceGroupName - The name of the resource group. The name is case insensitive.
- actionGroupName - The name of the action group.
- networkSecurityPerimeterConfigurationName - The name for a network security perimeter configuration
- options - ActionGroupsClientBeginReconcileNSPOptions contains the optional parameters for the ActionGroupsClient.BeginReconcileNSP method.
Example ¶
Generated from example definition: 2021-10-01/NSPForActionGroups_Reconcile.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("00000000-1111-2222-3333-444444444444", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewActionGroupsClient().BeginReconcileNSP(ctx, "exampleRG", "someActionGroup", "somePerimeterConfiguration", 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 poll the result: %v", err)
}
}
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.
- 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: 2024-10-01-preview/createOrUpdateActionGroup.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("187f412d-1758-44d9-b052-169e2564721d", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewActionGroupsClient().CreateOrUpdate(ctx, "Default-NotificationRules", "SampleActionGroup", armmonitor.ActionGroupResource{
Identity: &armmonitor.ManagedServiceIdentity{
Type: to.Ptr(armmonitor.ManagedServiceIdentityTypeUserAssigned),
UserAssignedIdentities: map[string]*armmonitor.UserAssignedIdentity{
"/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/AzSecPackAutoConfigRG/providers/Microsoft.ManagedIdentity/userAssignedIdentities/ThomasTestManagedIdentity_123": {},
"/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/AzSecPackAutoConfigRG/providers/Microsoft.ManagedIdentity/userAssignedIdentities/ThomasTestManagedIdentity_456": {},
},
},
Location: to.Ptr("Global"),
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),
ManagedIdentity: to.Ptr("30fe7a91-cd31-4edf-96ab-52883b3199cd"),
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"),
ManagedIdentity: to.Ptr("30fe7a91-cd31-4edf-96ab-52883b3199cd"),
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"),
ManagedIdentity: to.Ptr("30fe7a91-cd31-4edf-96ab-52883b3199cd"),
SubscriptionID: to.Ptr("187f412d-1758-44d9-b052-169e2564721d"),
TenantID: to.Ptr("68a4459a-ccb8-493c-b9da-dd30457d1b84"),
},
},
GroupShortName: to.Ptr("sample"),
IncidentReceivers: []*armmonitor.IncidentReceiver{
{
Name: to.Ptr("IncidentAction"),
Connection: &armmonitor.IncidentServiceConnection{
Name: to.Ptr("IncidentConnection"),
ID: to.Ptr("8be638e7-1419-42d4-a059-437a5f4f4e4e"),
},
IncidentManagementService: to.Ptr(armmonitor.IncidentManagementServiceIcm),
Mappings: map[string]*string{
"icm.automitigationenabled": to.Ptr("true"),
"icm.correlationid": to.Ptr("${data.essentials.signalType}://${data.essentials.originAlertId}"),
"icm.monitorid": to.Ptr("${data.essentials.alertRule}"),
"icm.occurringlocation.environment": to.Ptr("PROD"),
"icm.routingid": to.Ptr("${data.essentials.monitoringService}://${data.essentials.signalType}"),
"icm.title": to.Ptr("${data.essentials.severity}:${data.essentials.monitorCondition} ${data.essentials.monitoringService}:${data.essentials.signalType} ${data.essentials.alertTargetIds}"),
"icm.tsgid": to.Ptr("https://microsoft.com"),
},
},
},
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"),
ManagedIdentity: to.Ptr("30fe7a91-cd31-4edf-96ab-52883b3199cd"),
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"),
ManagedIdentity: to.Ptr("30fe7a91-cd31-4edf-96ab-52883b3199cd"),
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),
},
},
},
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 = armmonitor.ActionGroupsClientCreateOrUpdateResponse{
// 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"),
// Identity: &armmonitor.ManagedServiceIdentity{
// Type: to.Ptr(armmonitor.ManagedServiceIdentityTypeUserAssigned),
// UserAssignedIdentities: map[string]*armmonitor.UserAssignedIdentity{
// "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/AzSecPackAutoConfigRG/providers/Microsoft.ManagedIdentity/userAssignedIdentities/ThomasTestManagedIdentity_123": &armmonitor.UserAssignedIdentity{
// ClientID: to.Ptr("73525f7b-16f5-439f-b150-e6f737b8cb16"),
// PrincipalID: to.Ptr("30fe7a91-cd31-4edf-96ab-52883b3199cd"),
// },
// "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/AzSecPackAutoConfigRG/providers/Microsoft.ManagedIdentity/userAssignedIdentities/ThomasTestManagedIdentity_456": &armmonitor.UserAssignedIdentity{
// ClientID: to.Ptr("4dfa770d-290d-465b-ad06-4a787b65c641"),
// PrincipalID: to.Ptr("92b72e3e-dc08-4697-8643-32426387ebce"),
// },
// },
// },
// Location: to.Ptr("Global"),
// 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),
// ManagedIdentity: to.Ptr("30fe7a91-cd31-4edf-96ab-52883b3199cd"),
// 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>"),
// ManagedIdentity: to.Ptr("30fe7a91-cd31-4edf-96ab-52883b3199cd"),
// 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"),
// ManagedIdentity: to.Ptr("30fe7a91-cd31-4edf-96ab-52883b3199cd"),
// SubscriptionID: to.Ptr("187f412d-1758-44d9-b052-169e2564721d"),
// TenantID: to.Ptr("68a4459a-ccb8-493c-b9da-dd30457d1b84"),
// UseCommonAlertSchema: to.Ptr(false),
// },
// },
// GroupShortName: to.Ptr("sample"),
// IncidentReceivers: []*armmonitor.IncidentReceiver{
// {
// Name: to.Ptr("IncidentAction"),
// Connection: &armmonitor.IncidentServiceConnection{
// Name: to.Ptr("IncidentConnection"),
// ID: to.Ptr("8be638e7-1419-42d4-a059-437a5f4f4e4e"),
// },
// IncidentManagementService: to.Ptr(armmonitor.IncidentManagementServiceIcm),
// Mappings: map[string]*string{
// "icm.automitigationenabled": to.Ptr("true"),
// "icm.correlationid": to.Ptr("${data.essentials.signalType}://${data.essentials.originAlertId}"),
// "icm.monitorid": to.Ptr("${data.essentials.alertRule}"),
// "icm.occurringlocation.environment": to.Ptr("PROD"),
// "icm.routingid": to.Ptr("${data.essentials.monitoringService}://${data.essentials.signalType}"),
// "icm.title": to.Ptr("${data.essentials.severity}:${data.essentials.monitorCondition} ${data.essentials.monitoringService}:${data.essentials.signalType} ${data.essentials.alertTargetIds}"),
// "icm.tsgid": to.Ptr("https://microsoft.com"),
// },
// },
// },
// 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"),
// ManagedIdentity: to.Ptr("30fe7a91-cd31-4edf-96ab-52883b3199cd"),
// 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"),
// ManagedIdentity: to.Ptr("30fe7a91-cd31-4edf-96ab-52883b3199cd"),
// 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),
// },
// },
// },
// Tags: map[string]*string{
// },
// },
// }
}
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.
- 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: 2024-10-01-preview/deleteActionGroup.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("187f412d-1758-44d9-b052-169e2564721d", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewActionGroupsClient().Delete(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 = armmonitor.ActionGroupsClientDeleteResponse{
// }
}
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.
- 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: 2024-10-01-preview/enableReceiver.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("187f412d-1758-44d9-b052-169e2564721d", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, 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)
}
// 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 = armmonitor.ActionGroupsClientEnableReceiverResponse{
// }
}
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.
- 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: 2024-10-01-preview/getActionGroup.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("187f412d-1758-44d9-b052-169e2564721d", 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 = armmonitor.ActionGroupsClientGetResponse{
// 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"),
// Identity: &armmonitor.ManagedServiceIdentity{
// Type: to.Ptr(armmonitor.ManagedServiceIdentityTypeUserAssigned),
// UserAssignedIdentities: map[string]*armmonitor.UserAssignedIdentity{
// "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/AzSecPackAutoConfigRG/providers/Microsoft.ManagedIdentity/userAssignedIdentities/ThomasTestManagedIdentity_123": &armmonitor.UserAssignedIdentity{
// ClientID: to.Ptr("73525f7b-16f5-439f-b150-e6f737b8cb16"),
// PrincipalID: to.Ptr("30fe7a91-cd31-4edf-96ab-52883b3199cd"),
// },
// "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/AzSecPackAutoConfigRG/providers/Microsoft.ManagedIdentity/userAssignedIdentities/ThomasTestManagedIdentity_456": &armmonitor.UserAssignedIdentity{
// ClientID: to.Ptr("4dfa770d-290d-465b-ad06-4a787b65c641"),
// PrincipalID: to.Ptr("92b72e3e-dc08-4697-8643-32426387ebce"),
// },
// },
// },
// Location: to.Ptr("Global"),
// 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"),
// IncidentReceivers: []*armmonitor.IncidentReceiver{
// },
// 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"),
// ManagedIdentity: to.Ptr("30fe7a91-cd31-4edf-96ab-52883b3199cd"),
// 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),
// },
// },
// },
// Tags: map[string]*string{
// },
// },
// }
}
Output:
func (*ActionGroupsClient) GetNSP ¶ added in v0.12.0
func (client *ActionGroupsClient) GetNSP(ctx context.Context, resourceGroupName string, actionGroupName string, networkSecurityPerimeterConfigurationName string, options *ActionGroupsClientGetNSPOptions) (ActionGroupsClientGetNSPResponse, error)
GetNSP - Gets a specified NSP configuration for specified action group. If the operation fails it returns an *azcore.ResponseError type.
- resourceGroupName - The name of the resource group. The name is case insensitive.
- actionGroupName - The name of the action group.
- networkSecurityPerimeterConfigurationName - The name for a network security perimeter configuration
- options - ActionGroupsClientGetNSPOptions contains the optional parameters for the ActionGroupsClient.GetNSP method.
Example ¶
Generated from example definition: 2021-10-01/NSPForActionGroups_Get.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("00000000-1111-2222-3333-444444444444", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewActionGroupsClient().GetNSP(ctx, "exampleRG", "someActionGroup", "somePerimeterConfiguration", 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 = armmonitor.ActionGroupsClientGetNSPResponse{
// NetworkSecurityPerimeterConfiguration: armmonitor.NetworkSecurityPerimeterConfiguration{
// Name: to.Ptr("somePerimeterConfiguration"),
// Type: to.Ptr("Microsoft.Insights/actionGroups/networkSecurityPerimeterConfigurations"),
// ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/exampleRG/providers/Microsoft.Insights/actionGroups/someActionGroup/networkSecurityPerimeterConfigurations/somePerimeterConfiguration"),
// Properties: &armmonitor.NetworkSecurityPerimeterConfigurationProperties{
// NetworkSecurityPerimeter: &armmonitor.NetworkSecurityPerimeter{
// ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/networkRG/providers/Microsoft.Network/networkSecurityPerimeters/perimeter1"),
// Location: to.Ptr("japaneast"),
// },
// Profile: &armmonitor.NetworkSecurityProfile{
// Name: to.Ptr("profile1"),
// AccessRules: []*armmonitor.AccessRule{
// {
// Name: to.Ptr("rule1"),
// Properties: &armmonitor.AccessRuleProperties{
// AddressPrefixes: []*string{
// to.Ptr("148.0.0.0/8"),
// to.Ptr("152.4.6.0/24"),
// },
// Direction: to.Ptr(armmonitor.AccessRuleDirectionInbound),
// },
// },
// },
// AccessRulesVersion: to.Ptr[int32](0),
// },
// ProvisioningState: to.Ptr(armmonitor.NetworkSecurityPerimeterConfigurationProvisioningStateAccepted),
// ResourceAssociation: &armmonitor.ResourceAssociation{
// Name: to.Ptr("assoc1"),
// AccessMode: to.Ptr(armmonitor.ResourceAssociationAccessModeEnforced),
// },
// },
// },
// }
}
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.
- 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: 2024-10-01-preview/getTestNotificationsAtActionGroupResourceLevel.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("11111111-1111-1111-1111-111111111111", 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 = armmonitor.ActionGroupsClientGetTestNotificationsAtActionGroupResourceLevelResponse{
// 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.
- resourceGroupName - The name of the resource group. The name is case insensitive.
- options - ActionGroupsClientListByResourceGroupOptions contains the optional parameters for the ActionGroupsClient.NewListByResourceGroupPager method.
Example ¶
Generated from example definition: 2024-10-01-preview/listActionGroupsByResourceGroup.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("187f412d-1758-44d9-b052-169e2564721d", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewActionGroupsClient().NewListByResourceGroupPager("Default-NotificationRules", 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 = armmonitor.ActionGroupsClientListByResourceGroupResponse{
// 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"),
// Identity: &armmonitor.ManagedServiceIdentity{
// Type: to.Ptr(armmonitor.ManagedServiceIdentityType("UserAssigned, SystemAssigned")),
// PrincipalID: to.Ptr("f11979a4-36d1-45d0-9097-a0da3c7e855d"),
// TenantID: to.Ptr("72f988bf-86f1-41af-91ab-2d7cd011db47"),
// UserAssignedIdentities: map[string]*armmonitor.UserAssignedIdentity{
// "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/AzSecPackAutoConfigRG/providers/Microsoft.ManagedIdentity/userAssignedIdentities/ThomasTestManagedIdentity_123": &armmonitor.UserAssignedIdentity{
// ClientID: to.Ptr("73525f7b-16f5-439f-b150-e6f737b8cb16"),
// PrincipalID: to.Ptr("30fe7a91-cd31-4edf-96ab-52883b3199cd"),
// },
// "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/AzSecPackAutoConfigRG/providers/Microsoft.ManagedIdentity/userAssignedIdentities/ThomasTestManagedIdentity_456": &armmonitor.UserAssignedIdentity{
// ClientID: to.Ptr("4dfa770d-290d-465b-ad06-4a787b65c641"),
// PrincipalID: to.Ptr("92b72e3e-dc08-4697-8643-32426387ebce"),
// },
// },
// },
// Location: to.Ptr("Global"),
// 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"),
// IncidentReceivers: []*armmonitor.IncidentReceiver{
// },
// 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"),
// ManagedIdentity: to.Ptr("f11979a4-36d1-45d0-9097-a0da3c7e855d"),
// 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),
// },
// },
// },
// Tags: map[string]*string{
// },
// },
// {
// 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"),
// 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"),
// IncidentReceivers: []*armmonitor.IncidentReceiver{
// },
// 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{
// },
// },
// Tags: map[string]*string{
// },
// },
// },
// },
// }
}
}
Output:
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.
- options - ActionGroupsClientListBySubscriptionIDOptions contains the optional parameters for the ActionGroupsClient.NewListBySubscriptionIDPager method.
Example ¶
Generated from example definition: 2024-10-01-preview/listActionGroups.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("187f412d-1758-44d9-b052-169e2564721d", 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 = armmonitor.ActionGroupsClientListBySubscriptionIDResponse{
// 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"),
// Identity: &armmonitor.ManagedServiceIdentity{
// Type: to.Ptr(armmonitor.ManagedServiceIdentityType("UserAssigned, SystemAssigned")),
// PrincipalID: to.Ptr("f11979a4-36d1-45d0-9097-a0da3c7e855d"),
// TenantID: to.Ptr("72f988bf-86f1-41af-91ab-2d7cd011db47"),
// UserAssignedIdentities: map[string]*armmonitor.UserAssignedIdentity{
// "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/AzSecPackAutoConfigRG/providers/Microsoft.ManagedIdentity/userAssignedIdentities/ThomasTestManagedIdentity_123": &armmonitor.UserAssignedIdentity{
// ClientID: to.Ptr("73525f7b-16f5-439f-b150-e6f737b8cb16"),
// PrincipalID: to.Ptr("30fe7a91-cd31-4edf-96ab-52883b3199cd"),
// },
// "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/AzSecPackAutoConfigRG/providers/Microsoft.ManagedIdentity/userAssignedIdentities/ThomasTestManagedIdentity_456": &armmonitor.UserAssignedIdentity{
// ClientID: to.Ptr("4dfa770d-290d-465b-ad06-4a787b65c641"),
// PrincipalID: to.Ptr("92b72e3e-dc08-4697-8643-32426387ebce"),
// },
// },
// },
// Location: to.Ptr("Global"),
// 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"),
// IncidentReceivers: []*armmonitor.IncidentReceiver{
// },
// 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"),
// ManagedIdentity: to.Ptr("f11979a4-36d1-45d0-9097-a0da3c7e855d"),
// 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),
// },
// },
// },
// Tags: map[string]*string{
// },
// },
// {
// 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"),
// 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"),
// IncidentReceivers: []*armmonitor.IncidentReceiver{
// },
// 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{
// },
// },
// Tags: map[string]*string{
// },
// },
// },
// },
// }
}
}
Output:
func (*ActionGroupsClient) NewListNSPPager ¶ added in v0.12.0
func (client *ActionGroupsClient) NewListNSPPager(resourceGroupName string, actionGroupName string, options *ActionGroupsClientListNSPOptions) *runtime.Pager[ActionGroupsClientListNSPResponse]
NewListNSPPager - Gets a list of NSP configurations for specified action group.
- resourceGroupName - The name of the resource group. The name is case insensitive.
- actionGroupName - The name of the action group.
- options - ActionGroupsClientListNSPOptions contains the optional parameters for the ActionGroupsClient.NewListNSPPager method.
Example ¶
Generated from example definition: 2021-10-01/NSPForActionGroups_List.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("00000000-1111-2222-3333-444444444444", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewActionGroupsClient().NewListNSPPager("exampleRG", "someActionGroup", 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 = armmonitor.ActionGroupsClientListNSPResponse{
// NetworkSecurityPerimeterConfigurationListResult: armmonitor.NetworkSecurityPerimeterConfigurationListResult{
// Value: []*armmonitor.NetworkSecurityPerimeterConfiguration{
// {
// Name: to.Ptr("somePerimeterConfiguration"),
// Type: to.Ptr("Microsoft.Insights/actionGroups/networkSecurityPerimeterConfigurations"),
// ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/exampleRG/providers/Microsoft.Insights/actionGroups/someActionGroup/networkSecurityPerimeterConfigurations/somePerimeterConfiguration"),
// Properties: &armmonitor.NetworkSecurityPerimeterConfigurationProperties{
// NetworkSecurityPerimeter: &armmonitor.NetworkSecurityPerimeter{
// ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/networkRG/providers/Microsoft.Network/networkSecurityPerimeters/perimeter1"),
// Location: to.Ptr("japaneast"),
// },
// Profile: &armmonitor.NetworkSecurityProfile{
// Name: to.Ptr("profile1"),
// AccessRules: []*armmonitor.AccessRule{
// {
// Name: to.Ptr("rule1"),
// Properties: &armmonitor.AccessRuleProperties{
// AddressPrefixes: []*string{
// to.Ptr("148.0.0.0/8"),
// to.Ptr("152.4.6.0/24"),
// },
// Direction: to.Ptr(armmonitor.AccessRuleDirectionInbound),
// },
// },
// },
// AccessRulesVersion: to.Ptr[int32](0),
// },
// ProvisioningState: to.Ptr(armmonitor.NetworkSecurityPerimeterConfigurationProvisioningStateAccepted),
// ResourceAssociation: &armmonitor.ResourceAssociation{
// Name: to.Ptr("assoc1"),
// AccessMode: to.Ptr(armmonitor.ResourceAssociationAccessModeEnforced),
// },
// },
// },
// },
// },
// }
}
}
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.
- 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: 2024-10-01-preview/patchActionGroup.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("187f412d-1758-44d9-b052-169e2564721d", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewActionGroupsClient().Update(ctx, "Default-NotificationRules", "SampleActionGroup", armmonitor.ActionGroupPatchBody{
Identity: &armmonitor.ManagedServiceIdentity{
Type: to.Ptr(armmonitor.ManagedServiceIdentityTypeSystemAssigned),
},
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 = armmonitor.ActionGroupsClientUpdateResponse{
// 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"),
// Identity: &armmonitor.ManagedServiceIdentity{
// Type: to.Ptr(armmonitor.ManagedServiceIdentityTypeSystemAssigned),
// PrincipalID: to.Ptr("f11979a4-36d1-45d0-9097-a0da3c7e855d"),
// TenantID: to.Ptr("72f988bf-86f1-41af-91ab-2d7cd011db47"),
// },
// Location: to.Ptr("Global"),
// 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"),
// IncidentReceivers: []*armmonitor.IncidentReceiver{
// },
// 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),
// },
// },
// },
// Tags: map[string]*string{
// "key1": to.Ptr("value1"),
// "key2": to.Ptr("value2"),
// },
// },
// }
}
Output:
type ActionGroupsClientBeginCreateNotificationsAtActionGroupResourceLevelOptions ¶ added in v0.7.0
type ActionGroupsClientBeginCreateNotificationsAtActionGroupResourceLevelOptions struct {
// Resumes the long-running operation from the provided token.
ResumeToken string
}
ActionGroupsClientBeginCreateNotificationsAtActionGroupResourceLevelOptions contains the optional parameters for the ActionGroupsClient.BeginCreateNotificationsAtActionGroupResourceLevel method.
type ActionGroupsClientBeginReconcileNSPOptions ¶ added in v0.12.0
type ActionGroupsClientBeginReconcileNSPOptions struct {
// Resumes the long-running operation from the provided token.
ResumeToken string
}
ActionGroupsClientBeginReconcileNSPOptions contains the optional parameters for the ActionGroupsClient.BeginReconcileNSP 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 ActionGroupsClientGetNSPOptions ¶ added in v0.12.0
type ActionGroupsClientGetNSPOptions struct {
}
ActionGroupsClientGetNSPOptions contains the optional parameters for the ActionGroupsClient.GetNSP method.
type ActionGroupsClientGetNSPResponse ¶ added in v0.12.0
type ActionGroupsClientGetNSPResponse struct {
// Network security perimeter (NSP) configuration resource
NetworkSecurityPerimeterConfiguration
}
ActionGroupsClientGetNSPResponse contains the response from method ActionGroupsClient.GetNSP.
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 ActionGroupsClientListNSPOptions ¶ added in v0.12.0
type ActionGroupsClientListNSPOptions struct {
}
ActionGroupsClientListNSPOptions contains the optional parameters for the ActionGroupsClient.NewListNSPPager method.
type ActionGroupsClientListNSPResponse ¶ added in v0.12.0
type ActionGroupsClientListNSPResponse struct {
// Result of a list NSP (network security perimeter) configurations request.
NetworkSecurityPerimeterConfigurationListResult
}
ActionGroupsClientListNSPResponse contains the response from method ActionGroupsClient.NewListNSPPager.
type ActionGroupsClientReconcileNSPResponse ¶ added in v0.12.0
type ActionGroupsClientReconcileNSPResponse struct {
}
ActionGroupsClientReconcileNSPResponse contains the response from method ActionGroupsClient.BeginReconcileNSP.
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 []*ActivityLogAlertActionGroup
}
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 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 action properties.
ActionProperties map[string]*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 ActivityLogAlertActionGroup ¶
type ActivityLogAlertActionGroup struct {
// REQUIRED; The resource ID of the Action Group. This cannot be null or empty.
ActionGroupID *string
// Predefined list of properties and configuration items for the action group.
ActionProperties map[string]*string
// the dictionary of custom properties to include with the post operation. These data are appended to the webhook payload.
WebhookProperties map[string]*string
}
ActivityLogAlertActionGroup - A pointer to an Azure Action Group.
func (ActivityLogAlertActionGroup) MarshalJSON ¶
func (a ActivityLogAlertActionGroup) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ActivityLogAlertActionGroup.
func (*ActivityLogAlertActionGroup) UnmarshalJSON ¶ added in v0.12.0
func (a *ActivityLogAlertActionGroup) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ActivityLogAlertActionGroup.
type ActivityLogAlertResource ¶
type ActivityLogAlertResource struct {
// The location of the resource. Azure Activity Log Alert rules are supported on Global, West Europe and North Europe regions.
Location *string
// The Activity Log Alert rule properties of the resource.
Properties *AlertRuleProperties
// The tags of the resource.
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
}
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.
Generated from API version 2023-01-01-preview
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. The value must be an UUID.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - Contains optional client configuration. 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.
- 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: 2023-01-01-preview/ActivityLogAlertRule_CreateOrUpdate.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("187f412d-1758-44d9-b052-169e2564721d", 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"),
Properties: &armmonitor.AlertRuleProperties{
Description: to.Ptr("Description of sample Activity Log Alert rule."),
Actions: &armmonitor.ActionList{
ActionGroups: []*armmonitor.ActivityLogAlertActionGroup{
{
ActionGroupID: to.Ptr("/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/MyResourceGroup/providers/Microsoft.Insights/actionGroups/SampleActionGroup"),
ActionProperties: map[string]*string{
"Email.Title": to.Ptr("my email title"),
},
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"),
},
},
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 = armmonitor.ActivityLogAlertsClientCreateOrUpdateResponse{
// 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"),
// Properties: &armmonitor.AlertRuleProperties{
// Description: to.Ptr("Description of sample Activity Log Alert rule."),
// Actions: &armmonitor.ActionList{
// ActionGroups: []*armmonitor.ActivityLogAlertActionGroup{
// {
// ActionGroupID: to.Ptr("/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/MyResourceGroup/providers/microsoft.insights/actionGroups/SampleActionGroup"),
// ActionProperties: map[string]*string{
// "Email.Title": to.Ptr("my email title"),
// },
// 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"),
// },
// },
// Tags: map[string]*string{
// },
// },
// }
}
Output:
Example (CreateOrUpdateAnActivityLogAlertRuleForTenantLevelEvents) ¶
Generated from example definition: 2023-01-01-preview/ActivityLogAlertRule_CreateOrUpdateTenantLevelServiceHealthRule.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("187f412d-1758-44d9-b052-169e2564721d", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewActivityLogAlertsClient().CreateOrUpdate(ctx, "MyResourceGroup", "SampleActivityLogAlertSHRuleOnTenantLevel", armmonitor.ActivityLogAlertResource{
Location: to.Ptr("Global"),
Properties: &armmonitor.AlertRuleProperties{
Description: to.Ptr("Description of sample Activity Log Alert service health rule on tenant level events."),
Actions: &armmonitor.ActionList{
ActionGroups: []*armmonitor.ActivityLogAlertActionGroup{
{
ActionGroupID: to.Ptr("/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/MyResourceGroup/providers/Microsoft.Insights/actionGroups/SampleActionGroup"),
ActionProperties: map[string]*string{
"Email.Title": to.Ptr("my email title"),
},
WebhookProperties: map[string]*string{
"sampleWebhookProperty": to.Ptr("SamplePropertyValue"),
},
},
},
},
Condition: &armmonitor.AlertRuleAllOfCondition{
AllOf: []*armmonitor.AlertRuleAnyOfOrLeafCondition{
{
Equals: to.Ptr("ServiceHealth"),
Field: to.Ptr("category"),
},
},
},
Enabled: to.Ptr(true),
TenantScope: to.Ptr("72f988bf-86f1-41af-91ab-2d7cd011db47"),
},
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 = armmonitor.ActivityLogAlertsClientCreateOrUpdateResponse{
// ActivityLogAlertResource: armmonitor.ActivityLogAlertResource{
// Name: to.Ptr("SampleActivityLogAlertSHRuleOnTenantLevel"),
// Type: to.Ptr("Microsoft.Insights/ActivityLogAlerts"),
// ID: to.Ptr("/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/MyResourceGroup/providers/microsoft.insights/activityLogAlerts/SampleActivityLogAlertSHRuleOnTenantLevel"),
// Location: to.Ptr("Global"),
// Properties: &armmonitor.AlertRuleProperties{
// Description: to.Ptr("Description of sample Activity Log Alert service health rule on tenant level events."),
// Actions: &armmonitor.ActionList{
// ActionGroups: []*armmonitor.ActivityLogAlertActionGroup{
// {
// ActionGroupID: to.Ptr("/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/MyResourceGroup/providers/microsoft.insights/actionGroups/SampleActionGroup"),
// ActionProperties: map[string]*string{
// "Email.Title": to.Ptr("my email title"),
// },
// WebhookProperties: map[string]*string{
// "sampleWebhookProperty": to.Ptr("SamplePropertyValue"),
// },
// },
// },
// },
// Condition: &armmonitor.AlertRuleAllOfCondition{
// AllOf: []*armmonitor.AlertRuleAnyOfOrLeafCondition{
// {
// Equals: to.Ptr("ServiceHealth"),
// Field: to.Ptr("category"),
// },
// },
// },
// Enabled: to.Ptr(true),
// TenantScope: to.Ptr("72f988bf-86f1-41af-91ab-2d7cd011db47"),
// },
// Tags: map[string]*string{
// },
// },
// }
}
Output:
Example (CreateOrUpdateAnActivityLogAlertRuleWithAnyOfCondition) ¶
Generated from example definition: 2023-01-01-preview/ActivityLogAlertRule_CreateOrUpdateRuleWithAnyOfCondition.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("187f412d-1758-44d9-b052-169e2564721d", 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"),
Properties: &armmonitor.AlertRuleProperties{
Description: to.Ptr("Description of sample Activity Log Alert rule with 'anyOf' condition."),
Actions: &armmonitor.ActionList{
ActionGroups: []*armmonitor.ActivityLogAlertActionGroup{
{
ActionGroupID: to.Ptr("/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/MyResourceGroup/providers/Microsoft.Insights/actionGroups/SampleActionGroup"),
ActionProperties: map[string]*string{
"Email.Title": to.Ptr("my email title"),
},
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"),
},
},
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 = armmonitor.ActivityLogAlertsClientCreateOrUpdateResponse{
// 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"),
// Properties: &armmonitor.AlertRuleProperties{
// Description: to.Ptr("Description of sample Activity Log Alert rule with 'anyOf' condition."),
// Actions: &armmonitor.ActionList{
// ActionGroups: []*armmonitor.ActivityLogAlertActionGroup{
// {
// ActionGroupID: to.Ptr("/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/MyResourceGroup/providers/Microsoft.Insights/actionGroups/SampleActionGroup"),
// ActionProperties: map[string]*string{
// "Email.Title": to.Ptr("my email title"),
// },
// 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"),
// },
// },
// Tags: map[string]*string{
// },
// },
// }
}
Output:
Example (CreateOrUpdateAnActivityLogAlertRuleWithContainsAny) ¶
Generated from example definition: 2023-01-01-preview/ActivityLogAlertRule_CreateOrUpdateRuleWithContainsAny.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("187f412d-1758-44d9-b052-169e2564721d", 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"),
Properties: &armmonitor.AlertRuleProperties{
Description: to.Ptr("Description of sample Activity Log Alert rule with 'containsAny'."),
Actions: &armmonitor.ActionList{
ActionGroups: []*armmonitor.ActivityLogAlertActionGroup{
{
ActionGroupID: to.Ptr("/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/MyResourceGroup/providers/Microsoft.Insights/actionGroups/SampleActionGroup"),
ActionProperties: map[string]*string{
"Email.Title": to.Ptr("my email title"),
},
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"),
},
},
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 = armmonitor.ActivityLogAlertsClientCreateOrUpdateResponse{
// 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"),
// Properties: &armmonitor.AlertRuleProperties{
// Description: to.Ptr("Description of sample Activity Log Alert rule with 'containsAny'."),
// Actions: &armmonitor.ActionList{
// ActionGroups: []*armmonitor.ActivityLogAlertActionGroup{
// {
// ActionGroupID: to.Ptr("/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/MyResourceGroup/providers/Microsoft.Insights/actionGroups/SampleActionGroup"),
// ActionProperties: map[string]*string{
// "Email.Title": to.Ptr("my email title"),
// },
// 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"),
// },
// },
// Tags: map[string]*string{
// },
// },
// }
}
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.
- 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: 2023-01-01-preview/ActivityLogAlertRule_Delete.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("187f412d-1758-44d9-b052-169e2564721d", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewActivityLogAlertsClient().Delete(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 = armmonitor.ActivityLogAlertsClientDeleteResponse{
// }
}
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.
- 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: 2023-01-01-preview/ActivityLogAlertRule_Get.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("187f412d-1758-44d9-b052-169e2564721d", 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 = armmonitor.ActivityLogAlertsClientGetResponse{
// 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"),
// Properties: &armmonitor.AlertRuleProperties{
// Description: to.Ptr("Description of sample Activity Log Alert rule."),
// Actions: &armmonitor.ActionList{
// ActionGroups: []*armmonitor.ActivityLogAlertActionGroup{
// {
// ActionGroupID: to.Ptr("/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/MyResourceGroup/providers/microsoft.insights/actionGroups/SampleActionGroup"),
// ActionProperties: map[string]*string{
// "Email.Title": to.Ptr("my email title"),
// },
// 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"),
// },
// },
// Tags: map[string]*string{
// },
// },
// }
}
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.
- 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: 2023-01-01-preview/ActivityLogAlertRule_ListByResourceGroupName.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("187f412d-1758-44d9-b052-169e2564721d", 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 = armmonitor.ActivityLogAlertsClientListByResourceGroupResponse{
// 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"),
// Properties: &armmonitor.AlertRuleProperties{
// Description: to.Ptr("Description of sample Activity Log Alert rule."),
// Actions: &armmonitor.ActionList{
// ActionGroups: []*armmonitor.ActivityLogAlertActionGroup{
// {
// ActionGroupID: to.Ptr("/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/MyResourceGroup/providers/microsoft.insights/actionGroups/SampleActionGroup"),
// ActionProperties: map[string]*string{
// "Email.Title": to.Ptr("my email title"),
// },
// 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"),
// },
// },
// Tags: map[string]*string{
// },
// },
// {
// 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"),
// Properties: &armmonitor.AlertRuleProperties{
// Description: to.Ptr("Description of sample Activity Log Alert rule."),
// Actions: &armmonitor.ActionList{
// ActionGroups: []*armmonitor.ActivityLogAlertActionGroup{
// {
// ActionGroupID: to.Ptr("/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/MyResourceGroup/providers/microsoft.insights/actionGroups/SampleActionGroup"),
// ActionProperties: map[string]*string{
// "Email.Title": to.Ptr("my email title"),
// },
// 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"),
// },
// },
// Tags: map[string]*string{
// },
// },
// },
// },
// }
}
}
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.
- options - ActivityLogAlertsClientListBySubscriptionIDOptions contains the optional parameters for the ActivityLogAlertsClient.NewListBySubscriptionIDPager method.
Example ¶
Generated from example definition: 2023-01-01-preview/ActivityLogAlertRule_ListBySubscriptionId.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("187f412d-1758-44d9-b052-169e2564721d", 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 = armmonitor.ActivityLogAlertsClientListBySubscriptionIDResponse{
// 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"),
// Properties: &armmonitor.AlertRuleProperties{
// Description: to.Ptr("Description of sample Activity Log Alert rule."),
// Actions: &armmonitor.ActionList{
// ActionGroups: []*armmonitor.ActivityLogAlertActionGroup{
// {
// ActionGroupID: to.Ptr("/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/MyResourceGroup1/providers/microsoft.insights/actionGroups/SampleActionGroup"),
// ActionProperties: map[string]*string{
// "Email.Title": to.Ptr("my email title"),
// },
// 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"),
// },
// },
// Tags: map[string]*string{
// },
// },
// {
// 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"),
// Properties: &armmonitor.AlertRuleProperties{
// Description: to.Ptr("Description of sample Activity Log Alert rule."),
// Actions: &armmonitor.ActionList{
// ActionGroups: []*armmonitor.ActivityLogAlertActionGroup{
// {
// ActionGroupID: to.Ptr("/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/MyResourceGroup2/providers/microsoft.insights/actionGroups/SampleActionGroup"),
// ActionProperties: map[string]*string{
// "Email.Title": to.Ptr("my email title"),
// },
// 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"),
// },
// },
// Tags: map[string]*string{
// },
// },
// },
// },
// }
}
}
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.
- 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: 2023-01-01-preview/ActivityLogAlertRule_Update.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("187f412d-1758-44d9-b052-169e2564721d", 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 = armmonitor.ActivityLogAlertsClientUpdateResponse{
// 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"),
// Properties: &armmonitor.AlertRuleProperties{
// Description: to.Ptr("Description of sample Activity Log Alert rule."),
// Actions: &armmonitor.ActionList{
// ActionGroups: []*armmonitor.ActivityLogAlertActionGroup{
// {
// ActionGroupID: to.Ptr("/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/MyResourceGroup/providers/microsoft.insights/actionGroups/SampleActionGroup"),
// ActionProperties: map[string]*string{
// "Email.Title": to.Ptr("my email title"),
// },
// 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"),
// },
// },
// Tags: map[string]*string{
// "key1": to.Ptr("value1"),
// "key2": to.Ptr("value2"),
// },
// },
// }
}
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.
Generated from API version 2015-04-01
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. The value must be an UUID.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - Contains optional client configuration. 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.
- filter - Reduces the set of data collected.<br>This argument is required and it also requires at least the start date/time.<br>The **$filter** argument is very restricted and allows only the following patterns.<br>- *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'.<br>- *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'.<br>- *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'.<br>- *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'.<br>- *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'.<br><br>**NOTE**: No other syntax is allowed.
- options - ActivityLogsClientListOptions contains the optional parameters for the ActivityLogsClient.NewListPager method.
Example (GetActivityLogsWithFilter) ¶
Generated from example definition: 2015-04-01/GetActivityLogsFiltered.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("089bd33f-d4ec-47fe-8ba5-0753aa5c5b33", 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'", 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 = armmonitor.ActivityLogsClientListResponse{
// EventDataCollection: armmonitor.EventDataCollection{
// NextLink: to.Ptr("https://management.azure.com/subscriptions/089bd33f-d4ec-47fe-8ba5-0753aa5c5b33/providers/microsoft.insights/eventtypes/management/values?$skiptoken=opaqueSkipToken"),
// 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.9792776Z"); 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.9936304Z"); return t}()),
// SubscriptionID: to.Ptr("089bd33f-d4ec-47fe-8ba5-0753aa5c5b33"),
// },
// },
// },
// }
}
}
Output:
Example (GetActivityLogsWithFilterAndSelect) ¶
Generated from example definition: 2015-04-01/GetActivityLogsFilteredAndSelected.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("089bd33f-d4ec-47fe-8ba5-0753aa5c5b33", 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 = armmonitor.ActivityLogsClientListResponse{
// EventDataCollection: armmonitor.EventDataCollection{
// NextLink: to.Ptr("https://management.azure.com/subscriptions/089bd33f-d4ec-47fe-8ba5-0753aa5c5b33/providers/microsoft.insights/eventtypes/management/values?$skiptoken=opaqueSkipToken"),
// 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.9792776Z"); 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.9936304Z"); return t}()),
// },
// },
// },
// }
}
}
Output:
type ActivityLogsClientListOptions ¶ added in v0.4.0
type ActivityLogsClientListOptions struct {
// Used to fetch events with only the given properties.<br>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 AdxDestination ¶ added in v0.12.0
type AdxDestination struct {
// The name of the database to which data will be ingested.
DatabaseName *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 ARM resource id of the Adx resource.
ResourceID *string
// READ-ONLY; The ingestion uri of the Adx resource.
IngestionURI *string
}
AdxDestination - Azure Data Explorer (Adx) destination.
func (AdxDestination) MarshalJSON ¶ added in v0.12.0
func (a AdxDestination) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type AdxDestination.
func (*AdxDestination) UnmarshalJSON ¶ added in v0.12.0
func (a *AdxDestination) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type AdxDestination.
type AgentSetting ¶ added in v0.12.0
type AgentSetting struct {
// The name of the setting.
// Must be part of the list of supported settings
Name *KnownAgentSettingName
// The value of the setting
Value *string
}
AgentSetting - A setting used to control an agent behavior on a host machine
func (AgentSetting) MarshalJSON ¶ added in v0.12.0
func (a AgentSetting) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type AgentSetting.
func (*AgentSetting) UnmarshalJSON ¶ added in v0.12.0
func (a *AgentSetting) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type AgentSetting.
type AggregationType ¶
type AggregationType string
AggregationType - The aggregation type of the metric.
const ( // AggregationTypeAverage - Average AggregationTypeAverage AggregationType = "Average" // AggregationTypeCount - Count AggregationTypeCount AggregationType = "Count" // AggregationTypeMaximum - Maximum AggregationTypeMaximum AggregationType = "Maximum" // AggregationTypeMinimum - Minimum AggregationTypeMinimum AggregationType = "Minimum" // AggregationTypeNone - None AggregationTypeNone AggregationType = "None" // AggregationTypeTotal - Total 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. Previously undocumented values might be returned
const ( // AggregationTypeEnumAverage - Average AggregationTypeEnumAverage AggregationTypeEnum = "Average" // AggregationTypeEnumCount - Count AggregationTypeEnumCount AggregationTypeEnum = "Count" // AggregationTypeEnumMaximum - Maximum AggregationTypeEnumMaximum AggregationTypeEnum = "Maximum" // AggregationTypeEnumMinimum - Minimum AggregationTypeEnumMinimum AggregationTypeEnum = "Minimum" // AggregationTypeEnumTotal - Total AggregationTypeEnumTotal AggregationTypeEnum = "Total" )
func PossibleAggregationTypeEnumValues ¶
func PossibleAggregationTypeEnumValues() []AggregationTypeEnum
PossibleAggregationTypeEnumValues returns the possible values for the AggregationTypeEnum const type.
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.
Generated from API version 2016-03-01
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. The value must be an UUID.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - Contains optional client configuration. 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.
- 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: 2016-03-01/getAlertRuleIncident.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("b67f7fec-69fc-4974-9099-a26bd6ffeda3", 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 = armmonitor.AlertRuleIncidentsClientGetResponse{
// Incident: armmonitor.Incident{
// Name: to.Ptr("Website_started"),
// ActivatedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-09-13T15:45:26.9792776Z"); return t}()),
// IsActive: to.Ptr(true),
// ResolvedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-09-13T22:14:28.9792776Z"); 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
- 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: 2016-03-01/listAlertRuleIncidents.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("b67f7fec-69fc-4974-9099-a26bd6ffeda3", 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 = armmonitor.AlertRuleIncidentsClientListByAlertRuleResponse{
// 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.9792776Z"); return t}()),
// IsActive: to.Ptr(true),
// ResolvedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-09-13T22:14:28.9792776Z"); 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 {
// REQUIRED; The ActivityLogAlertResource items on this page
Value []*ActivityLogAlertResource
// The link to the next page of items
NextLink *string
}
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
// 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
// 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
// The tenant GUID. Must be provided for tenant-level and management group events rules.
TenantScope *string
}
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 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 - 4 AlertSeverityFour AlertSeverity = 4 // AlertSeverityOne - 1 AlertSeverityOne AlertSeverity = 1 // AlertSeverityThree - 3 AlertSeverityThree AlertSeverity = 3 // AlertSeverityTwo - 2 AlertSeverityTwo AlertSeverity = 2 // AlertSeverityZero - 0 AlertSeverityZero AlertSeverity = 0 )
func PossibleAlertSeverityValues ¶
func PossibleAlertSeverityValues() []AlertSeverity
PossibleAlertSeverityValues returns the possible values for the AlertSeverity const type.
type ApplicationInsights ¶ added in v0.12.0
type ApplicationInsights struct {
// REQUIRED; The name of the reference used as an alias when referencing this application insights in Otel data sources
Name *string
// REQUIRED; Id of the application insights resource
ResourceID *string
}
func (ApplicationInsights) MarshalJSON ¶ added in v0.12.0
func (a ApplicationInsights) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ApplicationInsights.
func (*ApplicationInsights) UnmarshalJSON ¶ added in v0.12.0
func (a *ApplicationInsights) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationInsights.
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
// The principal id of the managed identity. The value can be "None", "SystemAssigned"
ManagedIdentity *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 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; The geo-location where the resource lives
Location *string
// REQUIRED; The autoscale setting of the resource.
Properties *AutoscaleSetting
// 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
}
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 AutoscaleSettingResource items on this page
Value []*AutoscaleSettingResource
// The link to the next page of items
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.
Generated from API version 2022-10-01
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. The value must be an UUID.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - Contains optional client configuration. 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.
- 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: 2022-10-01/createOrUpdateAutoscaleSetting.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
"time"
)
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("b67f7fec-69fc-4974-9099-a26bd6ffeda3", 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"),
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:00Z"); return t }()),
Start: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-03-05T14:00:00Z"); 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"),
"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 = armmonitor.AutoscaleSettingsClientCreateOrUpdateResponse{
// 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"),
// 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:00Z"); return t}()),
// Start: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-03-05T14:00:00Z"); 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"),
// "key2": to.Ptr("value2"),
// },
// },
// }
}
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.
- 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: 2022-10-01/deleteAutoscaleSetting.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("b67f7fec-69fc-4974-9099-a26bd6ffeda3", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewAutoscaleSettingsClient().Delete(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 = armmonitor.AutoscaleSettingsClientDeleteResponse{
// }
}
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.
- 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: 2022-10-01/getAutoscaleSetting.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("b67f7fec-69fc-4974-9099-a26bd6ffeda3", 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 = armmonitor.AutoscaleSettingsClientGetResponse{
// 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"),
// 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:00Z"); return t}()),
// Start: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-03-05T14:00:00Z"); 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"),
// },
// },
// }
}
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
- 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: 2022-10-01/listAutoscaleSetting.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("b67f7fec-69fc-4974-9099-a26bd6ffeda3", 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 = armmonitor.AutoscaleSettingsClientListByResourceGroupResponse{
// AutoscaleSettingResourceCollection: armmonitor.AutoscaleSettingResourceCollection{
// NextLink: to.Ptr("https://management.azure.com/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/microsoft.insights/autoscalesettings?$skiptoken=opaqueSkipToken"),
// 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"),
// 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:00Z"); return t}()),
// Start: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-03-05T14:00:00Z"); 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"),
// "key2": to.Ptr("value2"),
// },
// },
// },
// },
// }
}
}
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
- options - AutoscaleSettingsClientListBySubscriptionOptions contains the optional parameters for the AutoscaleSettingsClient.NewListBySubscriptionPager method.
Example ¶
Generated from example definition: 2022-10-01/listAutoscaleSettingBySubscription.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("b67f7fec-69fc-4974-9099-a26bd6ffeda3", 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 = armmonitor.AutoscaleSettingsClientListBySubscriptionResponse{
// AutoscaleSettingResourceCollection: armmonitor.AutoscaleSettingResourceCollection{
// NextLink: to.Ptr("https://management.azure.com/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/providers/microsoft.insights/autoscalesettings?$skiptoken=opaqueSkipToken"),
// 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"),
// 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:00Z"); return t}()),
// Start: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-03-05T14:00:00Z"); 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"),
// },
// },
// },
// },
// }
}
}
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.
- 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: 2022-10-01/patchAutoscaleSetting.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
"time"
)
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("b67f7fec-69fc-4974-9099-a26bd6ffeda3", 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:00Z"); return t }()),
Start: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-03-05T14:00:00Z"); 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 = armmonitor.AutoscaleSettingsClientUpdateResponse{
// 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"),
// 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:00Z"); return t}()),
// Start: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-03-05T14:00:00Z"); 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{
// "$type": to.Ptr("Microsoft.WindowsAzure.Management.Common.Storage.CasePreservedDictionary"),
// },
// },
// }
}
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 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
// The principal id of the managed identity. The value can be "None", "SystemAssigned"
ManagedIdentity *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 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; 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
}
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; The AzureMonitorPrivateLinkScope items on this page
Value []*AzureMonitorPrivateLinkScope
// The link to the next page of items
NextLink *string
}
AzureMonitorPrivateLinkScopeListResult - The response of a AzureMonitorPrivateLinkScope list operation.
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.
ProvisioningState *PrivateLinkScopeProvisioningState
}
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 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 - High BaselineSensitivityHigh BaselineSensitivity = "High" // BaselineSensitivityLow - Low BaselineSensitivityLow BaselineSensitivity = "Low" // BaselineSensitivityMedium - Medium 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.
Generated from API version 2019-03-01
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 - Contains optional client configuration. 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**.
- resourceURI - The fully qualified Azure Resource manager identifier of the resource.
- options - BaselinesClientListOptions contains the optional parameters for the BaselinesClient.NewListPager method.
Example ¶
Generated from example definition: 2019-03-01/metricBaselines.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("<subscriptionID>", 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{
Aggregation: to.Ptr("average"),
Interval: to.Ptr("PT1H"),
Sensitivities: to.Ptr("Low,Medium"),
Timespan: to.Ptr("2019-03-12T11:00:00.000Z/2019-03-12T12:00:00.000Z")})
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 = armmonitor.BaselinesClientListResponse{
// 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 that contains the requested metric names.
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 'startDateTime_ISO/endDateTime_ISO'.
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 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. The value must be an UUID.
- 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) NewAutoscaleSettingsClient ¶ added in v0.9.0
func (c *ClientFactory) NewAutoscaleSettingsClient() *AutoscaleSettingsClient
NewAutoscaleSettingsClient creates a new instance of AutoscaleSettingsClient.
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) 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) 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) NewScheduledQueryRuleClient ¶ added in v0.12.0
func (c *ClientFactory) NewScheduledQueryRuleClient() *ScheduledQueryRuleClient
NewScheduledQueryRuleClient creates a new instance of ScheduledQueryRuleClient.
func (*ClientFactory) NewScheduledQueryRulesClient ¶ added in v0.9.0
func (c *ClientFactory) NewScheduledQueryRulesClient() *ScheduledQueryRulesClient
NewScheduledQueryRulesClient creates a new instance of ScheduledQueryRulesClient.
func (*ClientFactory) NewServiceDiagnosticSettingsClient ¶ added in v0.12.0
func (c *ClientFactory) NewServiceDiagnosticSettingsClient() *ServiceDiagnosticSettingsClient
NewServiceDiagnosticSettingsClient creates a new instance of ServiceDiagnosticSettingsClient.
func (*ClientFactory) NewTenantActivityLogsClient ¶ added in v0.9.0
func (c *ClientFactory) NewTenantActivityLogsClient() *TenantActivityLogsClient
NewTenantActivityLogsClient creates a new instance of TenantActivityLogsClient.
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 - Equals ComparisonOperationTypeEquals ComparisonOperationType = "Equals" // ComparisonOperationTypeGreaterThan - GreaterThan ComparisonOperationTypeGreaterThan ComparisonOperationType = "GreaterThan" // ComparisonOperationTypeGreaterThanOrEqual - GreaterThanOrEqual ComparisonOperationTypeGreaterThanOrEqual ComparisonOperationType = "GreaterThanOrEqual" // ComparisonOperationTypeLessThan - LessThan ComparisonOperationTypeLessThan ComparisonOperationType = "LessThan" // ComparisonOperationTypeLessThanOrEqual - LessThanOrEqual ComparisonOperationTypeLessThanOrEqual ComparisonOperationType = "LessThanOrEqual" // ComparisonOperationTypeNotEquals - NotEquals 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 {
// The extent of deviation required to trigger an alert. Allowed values are 'Low', 'Medium' and 'High'. This will affect how
// tight the threshold is to the metric series pattern. Relevant only for dynamic threshold rules of the kind LogAlert.
AlertSensitivity *string
// Specifies the type of threshold criteria
CriterionType *CriterionType
// 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
// Use this option to set the date from which to start learning the metric historical data and calculate the dynamic thresholds
// (in ISO8601 format). Relevant only for dynamic threshold rules of the kind LogAlert.
IgnoreDataBefore *time.Time
// 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 minimum results count that should be found for triggering an alert. Relevant only for rules of the kind SimpleLogAlert.
MinRecurrenceCount *int64
// 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 static threshold 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 - The criteria operator. Relevant and required only for rules of the kind LogAlert.
const ( // ConditionOperatorEquals - Equals ConditionOperatorEquals ConditionOperator = "Equals" // ConditionOperatorGreaterOrLessThan - GreaterOrLessThan ConditionOperatorGreaterOrLessThan ConditionOperator = "GreaterOrLessThan" // ConditionOperatorGreaterThan - GreaterThan ConditionOperatorGreaterThan ConditionOperator = "GreaterThan" // ConditionOperatorGreaterThanOrEqual - GreaterThanOrEqual ConditionOperatorGreaterThanOrEqual ConditionOperator = "GreaterThanOrEqual" // ConditionOperatorLessThan - LessThan ConditionOperatorLessThan ConditionOperator = "LessThan" // ConditionOperatorLessThanOrEqual - LessThanOrEqual ConditionOperatorLessThanOrEqual ConditionOperator = "LessThanOrEqual" )
func PossibleConditionOperatorValues ¶
func PossibleConditionOperatorValues() []ConditionOperator
PossibleConditionOperatorValues returns the possible values for the ConditionOperator const type.
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 kind of entity that created the resource.
const ( // CreatedByTypeApplication - The entity was created by an application. CreatedByTypeApplication CreatedByType = "Application" // CreatedByTypeKey - The entity was created by a key. CreatedByTypeKey CreatedByType = "Key" // CreatedByTypeManagedIdentity - The entity was created by a managed identity. CreatedByTypeManagedIdentity CreatedByType = "ManagedIdentity" // CreatedByTypeUser - The entity was created by a user. CreatedByTypeUser CreatedByType = "User" )
func PossibleCreatedByTypeValues ¶
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. Previously undocumented values might be returned
const ( // CriterionTypeDynamicThresholdCriterion - DynamicThresholdCriterion CriterionTypeDynamicThresholdCriterion CriterionType = "DynamicThresholdCriterion" // CriterionTypeStaticThresholdCriterion - StaticThresholdCriterion CriterionTypeStaticThresholdCriterion CriterionType = "StaticThresholdCriterion" )
func PossibleCriterionTypeValues ¶
func PossibleCriterionTypeValues() []CriterionType
PossibleCriterionTypeValues returns the possible values for the CriterionType const type.
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 - Metadata for the resource. This property can only be updated by Log Analytics Control Plane for Data Collection Endpoint with Log Analytics Destination.
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; Immutable Id of azure offering managing this resource on-behalf-of customer.
ProvisionedByImmutableID *string
// READ-ONLY; Resource Id of azure offering managing this resource on-behalf-of customer.
ProvisionedByResourceID *string
}
DataCollectionEndpointMetadata - Metadata for the resource. This property can only be updated by Log Analytics Control Plane for Data Collection Endpoint with Log Analytics Destination.
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
Properties *DataCollectionEndpointResourceProperties
// The SKU of the resource.
SKU *DataCollectionEndpointResourceSKU
// 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
}
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; The type of managed identity assigned to this resource.
Type *ManagedServiceIdentityType
// The identities assigned to this resource by the user.
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; The DataCollectionEndpointResource items on this page
Value []*DataCollectionEndpointResource
// The link to the next page of items
NextLink *string
}
DataCollectionEndpointResourceListResult - The response of a DataCollectionEndpointResource list operation.
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; Metadata for the resource. This property can only be updated by Log Analytics Control Plane for Data Collection
// Endpoint with Log Analytics Destination.
FailoverConfiguration *DataCollectionEndpointFailoverConfiguration
// READ-ONLY; Metadata for the resource. This property can only be updated by Log Analytics Control Plane for Data Collection
// Endpoint with Log Analytics Destination.
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
}
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 DataCollectionEndpointResourceSKU ¶ added in v0.12.0
type DataCollectionEndpointResourceSKU struct {
// REQUIRED; The name of the SKU. Ex - P3. It is typically a letter+number code
Name *string
// If the SKU supports scale out/in then the capacity integer should be included. If scale out/in is not possible for the
// resource this may be omitted.
Capacity *int32
// If the service has different generations of hardware, for the same SKU, then that can be captured here.
Family *string
// The SKU size. When the name field is the combination of tier and some other value, this would be the standalone code.
Size *string
// This field is required to be implemented by the Resource Provider if the service has more than one tier, but is not required
// on a PUT.
Tier *SKUTier
}
DataCollectionEndpointResourceSKU - The SKU of the resource.
func (DataCollectionEndpointResourceSKU) MarshalJSON ¶ added in v0.12.0
func (d DataCollectionEndpointResourceSKU) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DataCollectionEndpointResourceSKU.
func (*DataCollectionEndpointResourceSKU) UnmarshalJSON ¶ added in v0.12.0
func (d *DataCollectionEndpointResourceSKU) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DataCollectionEndpointResourceSKU.
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.
Generated from API versions 2021-10-01, 2024-03-11
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. The value must be an UUID.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - Contains optional client configuration. Pass nil to accept the default values.
func (*DataCollectionEndpointsClient) BeginReconcileNSP ¶ added in v0.12.0
func (client *DataCollectionEndpointsClient) BeginReconcileNSP(ctx context.Context, resourceGroupName string, dataCollectionEndpointName string, networkSecurityPerimeterConfigurationName string, options *DataCollectionEndpointsClientBeginReconcileNSPOptions) (*runtime.Poller[DataCollectionEndpointsClientReconcileNSPResponse], error)
BeginReconcileNSP - Reconciles the specified NSP configuration for the specified data collection endpoint.
Reconciles the specified NSP configuration for the specified data collection endpoint. If the operation fails it returns an *azcore.ResponseError type.
- 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.
- networkSecurityPerimeterConfigurationName - The name for a network security perimeter configuration
- options - DataCollectionEndpointsClientBeginReconcileNSPOptions contains the optional parameters for the DataCollectionEndpointsClient.BeginReconcileNSP method.
Example ¶
Generated from example definition: 2021-10-01/NSPForDataCollectionEndpoints_Reconcile.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("00000000-1111-2222-3333-444444444444", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewDataCollectionEndpointsClient().BeginReconcileNSP(ctx, "exampleRG", "someDataCollectionEndpoint", "somePerimeterConfiguration", 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 poll the result: %v", err)
}
}
Output:
func (*DataCollectionEndpointsClient) Create ¶
func (client *DataCollectionEndpointsClient) Create(ctx context.Context, resourceGroupName string, dataCollectionEndpointName string, body DataCollectionEndpointResource, options *DataCollectionEndpointsClientCreateOptions) (DataCollectionEndpointsClientCreateResponse, error)
Create - Creates or updates a data collection endpoint.
Creates or updates a data collection endpoint. If the operation fails it returns an *azcore.ResponseError type.
- 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.
- body - The payload
- options - DataCollectionEndpointsClientCreateOptions contains the optional parameters for the DataCollectionEndpointsClient.Create method.
Example (CreateADataCollectionEndpoint) ¶
Generated from example definition: 2024-03-11/DataCollectionEndpointsCreate.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("703362b3-f278-4e4b-9179-c76eaf41ffc2", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewDataCollectionEndpointsClient().Create(ctx, "myResourceGroup", "myDataCollectionEndpoint", armmonitor.DataCollectionEndpointResource{
Location: to.Ptr("eastus"),
Properties: &armmonitor.DataCollectionEndpointResourceProperties{
NetworkACLs: &armmonitor.DataCollectionEndpointNetworkACLs{
PublicNetworkAccess: to.Ptr(armmonitor.KnownPublicNetworkAccessOptionsEnabled),
},
},
}, 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 = armmonitor.DataCollectionEndpointsClientCreateResponse{
// DataCollectionEndpointResource: armmonitor.DataCollectionEndpointResource{
// Name: to.Ptr("myDataCollectionEndpoint"),
// Type: to.Ptr("Microsoft.Insights/dataCollectionEndpoints"),
// Etag: to.Ptr("0000ae31-0000-0100-0000-65fd441c0000"),
// ID: to.Ptr("/subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.Insights/dataCollectionEndpoints/myDataCollectionEndpoint"),
// Location: to.Ptr("eastus"),
// Properties: &armmonitor.DataCollectionEndpointResourceProperties{
// ConfigurationAccess: &armmonitor.DataCollectionEndpointConfigurationAccess{
// Endpoint: to.Ptr("https://mydatacollectionendpoint-71ib.eastus-1.handler.control.monitor.azure.com"),
// },
// ImmutableID: to.Ptr("dce-cd85a330eb664aa3bc7883cc394b0000"),
// LogsIngestion: &armmonitor.DataCollectionEndpointLogsIngestion{
// Endpoint: to.Ptr("https://mydatacollectionendpoint-71ib.eastus-1.ingest.monitor.azure.com"),
// },
// MetricsIngestion: &armmonitor.DataCollectionEndpointMetricsIngestion{
// Endpoint: to.Ptr("https://mydatacollectionendpoint-71ib.eastus-1.metrics.ingest.monitor.azure.com"),
// },
// NetworkACLs: &armmonitor.DataCollectionEndpointNetworkACLs{
// PublicNetworkAccess: to.Ptr(armmonitor.KnownPublicNetworkAccessOptionsEnabled),
// },
// ProvisioningState: to.Ptr(armmonitor.KnownDataCollectionEndpointProvisioningStateSucceeded),
// },
// SystemData: &armmonitor.SystemData{
// CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-03-22T08:40:59.2431682Z"); return t}()),
// CreatedBy: to.Ptr("user1"),
// CreatedByType: to.Ptr(armmonitor.CreatedByTypeUser),
// LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-03-22T08:40:59.2431682Z"); return t}()),
// LastModifiedBy: to.Ptr("user1"),
// LastModifiedByType: to.Ptr(armmonitor.CreatedByTypeUser),
// },
// },
// }
}
Output:
Example (UpdateADataCollectionEndpoint) ¶
Generated from example definition: 2024-03-11/DataCollectionEndpointsUpdate.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("703362b3-f278-4e4b-9179-c76eaf41ffc2", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewDataCollectionEndpointsClient().Create(ctx, "myResourceGroup", "myDataCollectionEndpoint", armmonitor.DataCollectionEndpointResource{
Location: to.Ptr("eastus"),
Properties: &armmonitor.DataCollectionEndpointResourceProperties{},
Tags: map[string]*string{
"tag1": to.Ptr("A"),
"tag2": to.Ptr("B"),
"tag3": to.Ptr("C"),
},
}, 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 = armmonitor.DataCollectionEndpointsClientCreateResponse{
// DataCollectionEndpointResource: armmonitor.DataCollectionEndpointResource{
// Name: to.Ptr("myDataCollectionEndpoint"),
// Type: to.Ptr("Microsoft.Insights/dataCollectionEndpoints"),
// Etag: to.Ptr("0000ae31-0000-0100-0000-65fd441c0000"),
// ID: to.Ptr("/subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.Insights/dataCollectionEndpoints/myDataCollectionEndpoint"),
// Location: to.Ptr("eastus"),
// Properties: &armmonitor.DataCollectionEndpointResourceProperties{
// ConfigurationAccess: &armmonitor.DataCollectionEndpointConfigurationAccess{
// Endpoint: to.Ptr("https://mydatacollectionendpoint-71ib.eastus-1.handler.control.monitor.azure.com"),
// },
// ImmutableID: to.Ptr("dce-cd85a330eb664aa3bc7883cc394b0000"),
// LogsIngestion: &armmonitor.DataCollectionEndpointLogsIngestion{
// Endpoint: to.Ptr("https://mydatacollectionendpoint-71ib.eastus-1.ingest.monitor.azure.com"),
// },
// MetricsIngestion: &armmonitor.DataCollectionEndpointMetricsIngestion{
// Endpoint: to.Ptr("https://mydatacollectionendpoint-71ib.eastus-1.metrics.ingest.monitor.azure.com"),
// },
// NetworkACLs: &armmonitor.DataCollectionEndpointNetworkACLs{
// PublicNetworkAccess: to.Ptr(armmonitor.KnownPublicNetworkAccessOptionsEnabled),
// },
// ProvisioningState: to.Ptr(armmonitor.KnownDataCollectionEndpointProvisioningStateSucceeded),
// },
// SystemData: &armmonitor.SystemData{
// CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-03-22T08:40:59.2431682Z"); return t}()),
// CreatedBy: to.Ptr("user1"),
// CreatedByType: to.Ptr(armmonitor.CreatedByTypeUser),
// LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-03-22T08:51:04.551992Z"); return t}()),
// LastModifiedBy: to.Ptr("user1"),
// LastModifiedByType: to.Ptr(armmonitor.CreatedByTypeUser),
// },
// Tags: map[string]*string{
// "tag1": to.Ptr("A"),
// "tag2": to.Ptr("B"),
// "tag3": to.Ptr("C"),
// },
// },
// }
}
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.
Deletes a data collection endpoint. If the operation fails it returns an *azcore.ResponseError type.
- 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: 2024-03-11/DataCollectionEndpointsDelete.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("703362b3-f278-4e4b-9179-c76eaf41ffc2", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewDataCollectionEndpointsClient().Delete(ctx, "myResourceGroup", "myDataCollectionEndpoint", 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 = armmonitor.DataCollectionEndpointsClientDeleteResponse{
// }
}
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.
Returns the specified data collection endpoint. If the operation fails it returns an *azcore.ResponseError type.
- 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: 2024-03-11/DataCollectionEndpointsGet.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("703362b3-f278-4e4b-9179-c76eaf41ffc2", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewDataCollectionEndpointsClient().Get(ctx, "myResourceGroup", "myDataCollectionEndpoint", 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 = armmonitor.DataCollectionEndpointsClientGetResponse{
// DataCollectionEndpointResource: armmonitor.DataCollectionEndpointResource{
// Name: to.Ptr("myDataCollectionEndpoint"),
// Type: to.Ptr("Microsoft.Insights/dataCollectionEndpoints"),
// Etag: to.Ptr("0000ae31-0000-0100-0000-65fd441c0000"),
// ID: to.Ptr("/subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.Insights/dataCollectionEndpoints/myDataCollectionEndpoint"),
// Location: to.Ptr("eastus"),
// Properties: &armmonitor.DataCollectionEndpointResourceProperties{
// ConfigurationAccess: &armmonitor.DataCollectionEndpointConfigurationAccess{
// Endpoint: to.Ptr("https://mydatacollectionendpoint-71ib.eastus-1.handler.control.monitor.azure.com"),
// },
// ImmutableID: to.Ptr("dce-cd85a330eb664aa3bc7883cc394b0000"),
// LogsIngestion: &armmonitor.DataCollectionEndpointLogsIngestion{
// Endpoint: to.Ptr("https://mydatacollectionendpoint-71ib.eastus-1.ingest.monitor.azure.com"),
// },
// MetricsIngestion: &armmonitor.DataCollectionEndpointMetricsIngestion{
// Endpoint: to.Ptr("https://mydatacollectionendpoint-71ib.eastus-1.metrics.ingest.monitor.azure.com"),
// },
// NetworkACLs: &armmonitor.DataCollectionEndpointNetworkACLs{
// PublicNetworkAccess: to.Ptr(armmonitor.KnownPublicNetworkAccessOptionsEnabled),
// },
// ProvisioningState: to.Ptr(armmonitor.KnownDataCollectionEndpointProvisioningStateSucceeded),
// },
// SystemData: &armmonitor.SystemData{
// CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-03-22T08:40:59.2431682Z"); return t}()),
// CreatedBy: to.Ptr("user1"),
// CreatedByType: to.Ptr(armmonitor.CreatedByTypeUser),
// LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-03-22T08:40:59.2431682Z"); return t}()),
// LastModifiedBy: to.Ptr("user1"),
// LastModifiedByType: to.Ptr(armmonitor.CreatedByTypeUser),
// },
// },
// }
}
Output:
func (*DataCollectionEndpointsClient) GetNSP ¶ added in v0.12.0
func (client *DataCollectionEndpointsClient) GetNSP(ctx context.Context, resourceGroupName string, dataCollectionEndpointName string, networkSecurityPerimeterConfigurationName string, options *DataCollectionEndpointsClientGetNSPOptions) (DataCollectionEndpointsClientGetNSPResponse, error)
GetNSP - Gets the specified NSP configuration for the specified data collection endpoint.
Gets the specified NSP configuration for the specified data collection endpoint. If the operation fails it returns an *azcore.ResponseError type.
- 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.
- networkSecurityPerimeterConfigurationName - The name for a network security perimeter configuration
- options - DataCollectionEndpointsClientGetNSPOptions contains the optional parameters for the DataCollectionEndpointsClient.GetNSP method.
Example ¶
Generated from example definition: 2021-10-01/NSPForDataCollectionEndpoints_Get.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("00000000-1111-2222-3333-444444444444", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewDataCollectionEndpointsClient().GetNSP(ctx, "exampleRG", "someDataCollectionEndpoint", "somePerimeterConfiguration", 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 = armmonitor.DataCollectionEndpointsClientGetNSPResponse{
// NetworkSecurityPerimeterConfiguration: armmonitor.NetworkSecurityPerimeterConfiguration{
// Name: to.Ptr("somePerimeterConfiguration"),
// Type: to.Ptr("Microsoft.Insights/dataCollectionEndpoints/networkSecurityPerimeterConfigurations"),
// ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/exampleRG/providers/Microsoft.Insights/dataCollectionEndpoints/someDataCollectionEndpoint/networkSecurityPerimeterConfigurations/somePerimeterConfiguration"),
// Properties: &armmonitor.NetworkSecurityPerimeterConfigurationProperties{
// NetworkSecurityPerimeter: &armmonitor.NetworkSecurityPerimeter{
// ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/networkRG/providers/Microsoft.Network/networkSecurityPerimeters/perimeter1"),
// Location: to.Ptr("japaneast"),
// },
// Profile: &armmonitor.NetworkSecurityProfile{
// Name: to.Ptr("profile1"),
// AccessRules: []*armmonitor.AccessRule{
// {
// Name: to.Ptr("rule1"),
// Properties: &armmonitor.AccessRuleProperties{
// AddressPrefixes: []*string{
// to.Ptr("148.0.0.0/8"),
// to.Ptr("152.4.6.0/24"),
// },
// Direction: to.Ptr(armmonitor.AccessRuleDirectionInbound),
// },
// },
// },
// AccessRulesVersion: to.Ptr[int32](0),
// },
// ProvisioningState: to.Ptr(armmonitor.NetworkSecurityPerimeterConfigurationProvisioningStateAccepted),
// ResourceAssociation: &armmonitor.ResourceAssociation{
// Name: to.Ptr("assoc1"),
// AccessMode: to.Ptr(armmonitor.ResourceAssociationAccessModeEnforced),
// },
// },
// },
// }
}
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.
Lists all data collection endpoints in the specified resource group.
- 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: 2024-03-11/DataCollectionEndpointsListByResourceGroup.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("703362b3-f278-4e4b-9179-c76eaf41ffc2", 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 = armmonitor.DataCollectionEndpointsClientListByResourceGroupResponse{
// DataCollectionEndpointResourceListResult: armmonitor.DataCollectionEndpointResourceListResult{
// Value: []*armmonitor.DataCollectionEndpointResource{
// {
// Name: to.Ptr("myDataCollectionEndpoint"),
// Type: to.Ptr("Microsoft.Insights/dataCollectionEndpoints"),
// Etag: to.Ptr("0000ae31-0000-0100-0000-65fd441c0000"),
// ID: to.Ptr("/subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.Insights/dataCollectionEndpoints/myDataCollectionEndpoint"),
// Location: to.Ptr("eastus"),
// Properties: &armmonitor.DataCollectionEndpointResourceProperties{
// ConfigurationAccess: &armmonitor.DataCollectionEndpointConfigurationAccess{
// Endpoint: to.Ptr("https://mydatacollectionendpoint-71ib.eastus-1.handler.control.monitor.azure.com"),
// },
// ImmutableID: to.Ptr("dce-cd85a330eb664aa3bc7883cc394b0000"),
// LogsIngestion: &armmonitor.DataCollectionEndpointLogsIngestion{
// Endpoint: to.Ptr("https://mydatacollectionendpoint-71ib.eastus-1.ingest.monitor.azure.com"),
// },
// MetricsIngestion: &armmonitor.DataCollectionEndpointMetricsIngestion{
// Endpoint: to.Ptr("https://mydatacollectionendpoint-71ib.eastus-1.metrics.ingest.monitor.azure.com"),
// },
// NetworkACLs: &armmonitor.DataCollectionEndpointNetworkACLs{
// PublicNetworkAccess: to.Ptr(armmonitor.KnownPublicNetworkAccessOptionsEnabled),
// },
// ProvisioningState: to.Ptr(armmonitor.KnownDataCollectionEndpointProvisioningStateSucceeded),
// },
// SystemData: &armmonitor.SystemData{
// CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-03-22T08:40:59.2431682Z"); return t}()),
// CreatedBy: to.Ptr("user1"),
// CreatedByType: to.Ptr(armmonitor.CreatedByTypeUser),
// LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-03-22T08:40:59.2431682Z"); return t}()),
// LastModifiedBy: to.Ptr("user1"),
// LastModifiedByType: to.Ptr(armmonitor.CreatedByTypeUser),
// },
// },
// {
// Name: to.Ptr("herDataCollectionEndpoint"),
// Type: to.Ptr("Microsoft.Insights/dataCollectionEndpoints"),
// Etag: to.Ptr("0000f831-0000-0100-0000-65fd4c290000"),
// ID: to.Ptr("/subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.Insights/dataCollectionEndpoints/herDataCollectionEndpoint"),
// Location: to.Ptr("eastus"),
// Properties: &armmonitor.DataCollectionEndpointResourceProperties{
// ConfigurationAccess: &armmonitor.DataCollectionEndpointConfigurationAccess{
// Endpoint: to.Ptr("https://herdatacollectionendpoint-6uww.eastus-1.handler.control.monitor.azure.com"),
// },
// ImmutableID: to.Ptr("dce-b4ab5f4638d54d38932ac69699e40000"),
// LogsIngestion: &armmonitor.DataCollectionEndpointLogsIngestion{
// Endpoint: to.Ptr("https://herdatacollectionendpoint-6uww.eastus-1.ingest.monitor.azure.com"),
// },
// MetricsIngestion: &armmonitor.DataCollectionEndpointMetricsIngestion{
// Endpoint: to.Ptr("https://herdatacollectionendpoint-6uww.eastus-1.metrics.ingest.monitor.azure.com"),
// },
// NetworkACLs: &armmonitor.DataCollectionEndpointNetworkACLs{
// PublicNetworkAccess: to.Ptr(armmonitor.KnownPublicNetworkAccessOptionsEnabled),
// },
// ProvisioningState: to.Ptr(armmonitor.KnownDataCollectionEndpointProvisioningStateSucceeded),
// },
// SystemData: &armmonitor.SystemData{
// CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-03-22T09:15:20.578873Z"); return t}()),
// CreatedBy: to.Ptr("user2"),
// CreatedByType: to.Ptr(armmonitor.CreatedByTypeUser),
// LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-03-22T09:15:20.578873Z"); return t}()),
// LastModifiedBy: to.Ptr("user2"),
// LastModifiedByType: to.Ptr(armmonitor.CreatedByTypeUser),
// },
// Tags: map[string]*string{
// "tag1": to.Ptr("A"),
// },
// },
// },
// },
// }
}
}
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
Lists all data collection endpoints in the specified subscription
- options - DataCollectionEndpointsClientListBySubscriptionOptions contains the optional parameters for the DataCollectionEndpointsClient.NewListBySubscriptionPager method.
Example ¶
Generated from example definition: 2024-03-11/DataCollectionEndpointsListBySubscription.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("703362b3-f278-4e4b-9179-c76eaf41ffc2", 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 = armmonitor.DataCollectionEndpointsClientListBySubscriptionResponse{
// DataCollectionEndpointResourceListResult: armmonitor.DataCollectionEndpointResourceListResult{
// Value: []*armmonitor.DataCollectionEndpointResource{
// {
// Name: to.Ptr("myDataCollectionEndpoint"),
// Type: to.Ptr("Microsoft.Insights/dataCollectionEndpoints"),
// Etag: to.Ptr("0000ae31-0000-0100-0000-65fd441c0000"),
// ID: to.Ptr("/subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.Insights/dataCollectionEndpoints/myDataCollectionEndpoint"),
// Location: to.Ptr("eastus"),
// Properties: &armmonitor.DataCollectionEndpointResourceProperties{
// ConfigurationAccess: &armmonitor.DataCollectionEndpointConfigurationAccess{
// Endpoint: to.Ptr("https://mydatacollectionendpoint-71ib.eastus-1.handler.control.monitor.azure.com"),
// },
// ImmutableID: to.Ptr("dce-cd85a330eb664aa3bc7883cc394b0000"),
// LogsIngestion: &armmonitor.DataCollectionEndpointLogsIngestion{
// Endpoint: to.Ptr("https://mydatacollectionendpoint-71ib.eastus-1.ingest.monitor.azure.com"),
// },
// MetricsIngestion: &armmonitor.DataCollectionEndpointMetricsIngestion{
// Endpoint: to.Ptr("https://mydatacollectionendpoint-71ib.eastus-1.metrics.ingest.monitor.azure.com"),
// },
// NetworkACLs: &armmonitor.DataCollectionEndpointNetworkACLs{
// PublicNetworkAccess: to.Ptr(armmonitor.KnownPublicNetworkAccessOptionsEnabled),
// },
// ProvisioningState: to.Ptr(armmonitor.KnownDataCollectionEndpointProvisioningStateSucceeded),
// },
// SystemData: &armmonitor.SystemData{
// CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-03-22T08:40:59.2431682Z"); return t}()),
// CreatedBy: to.Ptr("user1"),
// CreatedByType: to.Ptr(armmonitor.CreatedByTypeUser),
// LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-03-22T08:40:59.2431682Z"); return t}()),
// LastModifiedBy: to.Ptr("user1"),
// LastModifiedByType: to.Ptr(armmonitor.CreatedByTypeUser),
// },
// },
// {
// Name: to.Ptr("herDataCollectionEndpoint"),
// Type: to.Ptr("Microsoft.Insights/dataCollectionEndpoints"),
// Etag: to.Ptr("0000f831-0000-0100-0000-65fd4c290000"),
// ID: to.Ptr("/subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.Insights/dataCollectionEndpoints/herDataCollectionEndpoint"),
// Location: to.Ptr("eastus"),
// Properties: &armmonitor.DataCollectionEndpointResourceProperties{
// ConfigurationAccess: &armmonitor.DataCollectionEndpointConfigurationAccess{
// Endpoint: to.Ptr("https://herdatacollectionendpoint-6uww.eastus-1.handler.control.monitor.azure.com"),
// },
// ImmutableID: to.Ptr("dce-b4ab5f4638d54d38932ac69699e40000"),
// LogsIngestion: &armmonitor.DataCollectionEndpointLogsIngestion{
// Endpoint: to.Ptr("https://herdatacollectionendpoint-6uww.eastus-1.ingest.monitor.azure.com"),
// },
// MetricsIngestion: &armmonitor.DataCollectionEndpointMetricsIngestion{
// Endpoint: to.Ptr("https://herdatacollectionendpoint-6uww.eastus-1.metrics.ingest.monitor.azure.com"),
// },
// NetworkACLs: &armmonitor.DataCollectionEndpointNetworkACLs{
// PublicNetworkAccess: to.Ptr(armmonitor.KnownPublicNetworkAccessOptionsEnabled),
// },
// ProvisioningState: to.Ptr(armmonitor.KnownDataCollectionEndpointProvisioningStateSucceeded),
// },
// SystemData: &armmonitor.SystemData{
// CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-03-22T09:15:20.578873Z"); return t}()),
// CreatedBy: to.Ptr("user2"),
// CreatedByType: to.Ptr(armmonitor.CreatedByTypeUser),
// LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-03-22T09:15:20.578873Z"); return t}()),
// LastModifiedBy: to.Ptr("user2"),
// LastModifiedByType: to.Ptr(armmonitor.CreatedByTypeUser),
// },
// Tags: map[string]*string{
// "tag1": to.Ptr("A"),
// },
// },
// },
// },
// }
}
}
Output:
func (*DataCollectionEndpointsClient) NewListNSPPager ¶ added in v0.12.0
func (client *DataCollectionEndpointsClient) NewListNSPPager(resourceGroupName string, dataCollectionEndpointName string, options *DataCollectionEndpointsClientListNSPOptions) *runtime.Pager[DataCollectionEndpointsClientListNSPResponse]
NewListNSPPager - Gets a list of NSP configurations for the specified data collection endpoint.
Gets a list of NSP configurations for the specified data collection endpoint.
- 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 - DataCollectionEndpointsClientListNSPOptions contains the optional parameters for the DataCollectionEndpointsClient.NewListNSPPager method.
Example ¶
Generated from example definition: 2021-10-01/NSPForDataCollectionEndpoints_List.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("00000000-1111-2222-3333-444444444444", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewDataCollectionEndpointsClient().NewListNSPPager("exampleRG", "someDataCollectionEndpoint", 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 = armmonitor.DataCollectionEndpointsClientListNSPResponse{
// NetworkSecurityPerimeterConfigurationListResult: armmonitor.NetworkSecurityPerimeterConfigurationListResult{
// Value: []*armmonitor.NetworkSecurityPerimeterConfiguration{
// {
// Name: to.Ptr("somePerimeterConfiguration"),
// Type: to.Ptr("Microsoft.Insights/dataCollectionEndpoints/networkSecurityPerimeterConfigurations"),
// ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/exampleRG/providers/Microsoft.Insights/dataCollectionEndpoints/someDataCollectionEndpoint/networkSecurityPerimeterConfigurations/somePerimeterConfiguration"),
// Properties: &armmonitor.NetworkSecurityPerimeterConfigurationProperties{
// NetworkSecurityPerimeter: &armmonitor.NetworkSecurityPerimeter{
// ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/networkRG/providers/Microsoft.Network/networkSecurityPerimeters/perimeter1"),
// Location: to.Ptr("japaneast"),
// },
// Profile: &armmonitor.NetworkSecurityProfile{
// Name: to.Ptr("profile1"),
// AccessRules: []*armmonitor.AccessRule{
// {
// Name: to.Ptr("rule1"),
// Properties: &armmonitor.AccessRuleProperties{
// AddressPrefixes: []*string{
// to.Ptr("148.0.0.0/8"),
// to.Ptr("152.4.6.0/24"),
// },
// Direction: to.Ptr(armmonitor.AccessRuleDirectionInbound),
// },
// },
// },
// AccessRulesVersion: to.Ptr[int32](0),
// },
// ProvisioningState: to.Ptr(armmonitor.NetworkSecurityPerimeterConfigurationProvisioningStateAccepted),
// ResourceAssociation: &armmonitor.ResourceAssociation{
// Name: to.Ptr("assoc1"),
// AccessMode: to.Ptr(armmonitor.ResourceAssociationAccessModeEnforced),
// },
// },
// },
// },
// },
// }
}
}
Output:
func (*DataCollectionEndpointsClient) Update ¶
func (client *DataCollectionEndpointsClient) Update(ctx context.Context, resourceGroupName string, dataCollectionEndpointName string, body ResourceForUpdate, options *DataCollectionEndpointsClientUpdateOptions) (DataCollectionEndpointsClientUpdateResponse, error)
Update - Updates part of a data collection endpoint.
Updates part of a data collection endpoint. If the operation fails it returns an *azcore.ResponseError type.
- 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.
- body - The payload
- options - DataCollectionEndpointsClientUpdateOptions contains the optional parameters for the DataCollectionEndpointsClient.Update method.
Example ¶
Generated from example definition: 2024-03-11/DataCollectionEndpointsPatch.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("703362b3-f278-4e4b-9179-c76eaf41ffc2", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewDataCollectionEndpointsClient().Update(ctx, "myResourceGroup", "myDataCollectionEndpoint", armmonitor.ResourceForUpdate{
Tags: map[string]*string{
"tag1": to.Ptr("A"),
},
}, 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 = armmonitor.DataCollectionEndpointsClientUpdateResponse{
// DataCollectionEndpointResource: armmonitor.DataCollectionEndpointResource{
// Name: to.Ptr("myDataCollectionEndpoint"),
// Type: to.Ptr("Microsoft.Insights/dataCollectionEndpoints"),
// Etag: to.Ptr("0000ae31-0000-0100-0000-65fd441c0000"),
// ID: to.Ptr("/subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.Insights/dataCollectionEndpoints/myDataCollectionEndpoint"),
// Location: to.Ptr("eastus"),
// Properties: &armmonitor.DataCollectionEndpointResourceProperties{
// ConfigurationAccess: &armmonitor.DataCollectionEndpointConfigurationAccess{
// Endpoint: to.Ptr("https://mydatacollectionendpoint-71ib.eastus-1.handler.control.monitor.azure.com"),
// },
// ImmutableID: to.Ptr("dce-cd85a330eb664aa3bc7883cc394b0000"),
// LogsIngestion: &armmonitor.DataCollectionEndpointLogsIngestion{
// Endpoint: to.Ptr("https://mydatacollectionendpoint-71ib.eastus-1.ingest.monitor.azure.com"),
// },
// MetricsIngestion: &armmonitor.DataCollectionEndpointMetricsIngestion{
// Endpoint: to.Ptr("https://mydatacollectionendpoint-71ib.eastus-1.metrics.ingest.monitor.azure.com"),
// },
// NetworkACLs: &armmonitor.DataCollectionEndpointNetworkACLs{
// PublicNetworkAccess: to.Ptr(armmonitor.KnownPublicNetworkAccessOptionsEnabled),
// },
// ProvisioningState: to.Ptr(armmonitor.KnownDataCollectionEndpointProvisioningStateSucceeded),
// },
// SystemData: &armmonitor.SystemData{
// CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-03-22T08:40:59.2431682Z"); return t}()),
// CreatedBy: to.Ptr("user1"),
// CreatedByType: to.Ptr(armmonitor.CreatedByTypeUser),
// LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-03-22T11:55:22.5074142Z"); return t}()),
// LastModifiedBy: to.Ptr("user1"),
// LastModifiedByType: to.Ptr(armmonitor.CreatedByTypeUser),
// },
// Tags: map[string]*string{
// "tag1": to.Ptr("A"),
// },
// },
// }
}
Output:
type DataCollectionEndpointsClientBeginReconcileNSPOptions ¶ added in v0.12.0
type DataCollectionEndpointsClientBeginReconcileNSPOptions struct {
// Resumes the long-running operation from the provided token.
ResumeToken string
}
DataCollectionEndpointsClientBeginReconcileNSPOptions contains the optional parameters for the DataCollectionEndpointsClient.BeginReconcileNSP method.
type DataCollectionEndpointsClientCreateOptions ¶ added in v0.4.0
type DataCollectionEndpointsClientCreateOptions struct {
}
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 DataCollectionEndpointsClientGetNSPOptions ¶ added in v0.12.0
type DataCollectionEndpointsClientGetNSPOptions struct {
}
DataCollectionEndpointsClientGetNSPOptions contains the optional parameters for the DataCollectionEndpointsClient.GetNSP method.
type DataCollectionEndpointsClientGetNSPResponse ¶ added in v0.12.0
type DataCollectionEndpointsClientGetNSPResponse struct {
// Network security perimeter (NSP) configuration resource
NetworkSecurityPerimeterConfiguration
}
DataCollectionEndpointsClientGetNSPResponse contains the response from method DataCollectionEndpointsClient.GetNSP.
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 {
// The response of a DataCollectionEndpointResource list operation.
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 {
// The response of a DataCollectionEndpointResource list operation.
DataCollectionEndpointResourceListResult
}
DataCollectionEndpointsClientListBySubscriptionResponse contains the response from method DataCollectionEndpointsClient.NewListBySubscriptionPager.
type DataCollectionEndpointsClientListNSPOptions ¶ added in v0.12.0
type DataCollectionEndpointsClientListNSPOptions struct {
}
DataCollectionEndpointsClientListNSPOptions contains the optional parameters for the DataCollectionEndpointsClient.NewListNSPPager method.
type DataCollectionEndpointsClientListNSPResponse ¶ added in v0.12.0
type DataCollectionEndpointsClientListNSPResponse struct {
// Result of a list NSP (network security perimeter) configurations request.
NetworkSecurityPerimeterConfigurationListResult
}
DataCollectionEndpointsClientListNSPResponse contains the response from method DataCollectionEndpointsClient.NewListNSPPager.
type DataCollectionEndpointsClientReconcileNSPResponse ¶ added in v0.12.0
type DataCollectionEndpointsClientReconcileNSPResponse struct {
}
DataCollectionEndpointsClientReconcileNSPResponse contains the response from method DataCollectionEndpointsClient.BeginReconcileNSP.
type DataCollectionEndpointsClientUpdateOptions ¶ added in v0.4.0
type DataCollectionEndpointsClientUpdateOptions struct {
}
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 DataCollectionRuleAgentSettings ¶ added in v0.12.0
type DataCollectionRuleAgentSettings struct {
// All the settings that are applicable to the logs agent (AMA)
Logs []*AgentSetting
}
DataCollectionRuleAgentSettings - Agent settings used to modify agent behavior on a given host
func (DataCollectionRuleAgentSettings) MarshalJSON ¶ added in v0.12.0
func (d DataCollectionRuleAgentSettings) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DataCollectionRuleAgentSettings.
func (*DataCollectionRuleAgentSettings) UnmarshalJSON ¶ added in v0.12.0
func (d *DataCollectionRuleAgentSettings) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DataCollectionRuleAgentSettings.
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; Immutable Id of azure offering managing this resource on-behalf-of customer.
ProvisionedByImmutableID *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 {
Properties *DataCollectionRuleAssociationProxyOnlyResourceProperties
// 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
}
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; The DataCollectionRuleAssociationProxyOnlyResource items on this page
Value []*DataCollectionRuleAssociationProxyOnlyResource
// The link to the next page of items
NextLink *string
}
DataCollectionRuleAssociationProxyOnlyResourceListResult - The response of a DataCollectionRuleAssociationProxyOnlyResource list operation.
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
}
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 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.
Generated from API version 2024-03-11
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. The value must be an UUID.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - Contains optional client configuration. Pass nil to accept the default values.
func (*DataCollectionRuleAssociationsClient) Create ¶
func (client *DataCollectionRuleAssociationsClient) Create(ctx context.Context, resourceURI string, associationName string, body DataCollectionRuleAssociationProxyOnlyResource, options *DataCollectionRuleAssociationsClientCreateOptions) (DataCollectionRuleAssociationsClientCreateResponse, error)
Create - Creates or updates an association.
Creates or updates an association. If the operation fails it returns an *azcore.ResponseError type.
- resourceURI - The identifier of the resource.
- associationName - The name of the association. The name is case insensitive.
- body - The payload
- options - DataCollectionRuleAssociationsClientCreateOptions contains the optional parameters for the DataCollectionRuleAssociationsClient.Create method.
Example (CreateOrUpdateAssociation) ¶
Generated from example definition: 2024-03-11/DataCollectionRuleAssociationsCreate.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("<subscriptionID>", 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.DataCollectionRuleAssociationProxyOnlyResource{
Properties: &armmonitor.DataCollectionRuleAssociationProxyOnlyResourceProperties{
DataCollectionRuleID: to.Ptr("/subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.Insights/dataCollectionRules/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 = armmonitor.DataCollectionRuleAssociationsClientCreateResponse{
// DataCollectionRuleAssociationProxyOnlyResource: armmonitor.DataCollectionRuleAssociationProxyOnlyResource{
// Name: to.Ptr("myAssociation"),
// Type: to.Ptr("Microsoft.Insights/dataCollectionRuleAssociations"),
// Etag: to.Ptr("00000836-0000-0100-0000-65fdd8bc0000"),
// 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"),
// },
// SystemData: &armmonitor.SystemData{
// CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-03-22T19:15:08.2155156Z"); return t}()),
// CreatedBy: to.Ptr("user1"),
// CreatedByType: to.Ptr(armmonitor.CreatedByTypeUser),
// LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-03-22T19:15:08.2155156Z"); return t}()),
// LastModifiedBy: to.Ptr("user1"),
// LastModifiedByType: to.Ptr(armmonitor.CreatedByTypeUser),
// },
// },
// }
}
Output:
Example (CreateOrUpdateAssociationWithADataCollectionEndpoint) ¶
Generated from example definition: 2024-03-11/DataCollectionRuleAssociationsCreateEndpointAssoc.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("<subscriptionID>", 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", "configurationAccessEndpoint", armmonitor.DataCollectionRuleAssociationProxyOnlyResource{
Properties: &armmonitor.DataCollectionRuleAssociationProxyOnlyResourceProperties{
DataCollectionEndpointID: to.Ptr("/subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.Insights/dataCollectionEndpoints/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 = armmonitor.DataCollectionRuleAssociationsClientCreateResponse{
// DataCollectionRuleAssociationProxyOnlyResource: armmonitor.DataCollectionRuleAssociationProxyOnlyResource{
// Name: to.Ptr("configurationAccessEndpoint"),
// Type: to.Ptr("Microsoft.Insights/dataCollectionRuleAssociations"),
// Etag: to.Ptr("00000836-0000-0100-0000-65fdd8bc0000"),
// ID: to.Ptr("/subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVm/providers/Microsoft.Insights/dataCollectionRuleAssociations/configurationAccessEndpoint"),
// Properties: &armmonitor.DataCollectionRuleAssociationProxyOnlyResourceProperties{
// DataCollectionEndpointID: to.Ptr("/subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.Insights/dataCollectionEndpoints/myCollectionEndpoint"),
// },
// SystemData: &armmonitor.SystemData{
// CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-03-22T19:15:08.2155156Z"); return t}()),
// CreatedBy: to.Ptr("user1"),
// CreatedByType: to.Ptr(armmonitor.CreatedByTypeUser),
// LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-03-22T19:15:08.2155156Z"); return t}()),
// LastModifiedBy: to.Ptr("user1"),
// 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.
Deletes an association. If the operation fails it returns an *azcore.ResponseError type.
- resourceURI - The fully qualified Azure Resource manager 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: 2024-03-11/DataCollectionRuleAssociationsDelete.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("<subscriptionID>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, 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)
}
// 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 = armmonitor.DataCollectionRuleAssociationsClientDeleteResponse{
// }
}
Output:
func (*DataCollectionRuleAssociationsClient) Get ¶
func (client *DataCollectionRuleAssociationsClient) Get(ctx context.Context, resourceURI string, associationName string, options *DataCollectionRuleAssociationsClientGetOptions) (DataCollectionRuleAssociationsClientGetResponse, error)
Get - Returns the specified association.
Returns the specified association. If the operation fails it returns an *azcore.ResponseError type.
- resourceURI - The fully qualified Azure Resource manager 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: 2024-03-11/DataCollectionRuleAssociationsGet.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("<subscriptionID>", 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 = armmonitor.DataCollectionRuleAssociationsClientGetResponse{
// DataCollectionRuleAssociationProxyOnlyResource: armmonitor.DataCollectionRuleAssociationProxyOnlyResource{
// Name: to.Ptr("myAssociation"),
// Type: to.Ptr("Microsoft.Insights/dataCollectionRuleAssociations"),
// Etag: to.Ptr("00000836-0000-0100-0000-65fdd8bc0000"),
// 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"),
// },
// SystemData: &armmonitor.SystemData{
// CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-03-22T19:15:08.2155156Z"); return t}()),
// CreatedBy: to.Ptr("user1"),
// CreatedByType: to.Ptr(armmonitor.CreatedByTypeUser),
// LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-03-22T19:15:08.2155156Z"); return t}()),
// LastModifiedBy: to.Ptr("user1"),
// 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.
Lists associations for the specified data collection endpoint.
- 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: 2024-03-11/DataCollectionRuleAssociationsListByDataCollectionEndpoint.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("703362b3-f278-4e4b-9179-c76eaf41ffc2", 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 = armmonitor.DataCollectionRuleAssociationsClientListByDataCollectionEndpointResponse{
// DataCollectionRuleAssociationProxyOnlyResourceListResult: armmonitor.DataCollectionRuleAssociationProxyOnlyResourceListResult{
// Value: []*armmonitor.DataCollectionRuleAssociationProxyOnlyResource{
// {
// Name: to.Ptr("configurationAccessEndpoint"),
// Type: to.Ptr("Microsoft.Insights/dataCollectionRuleAssociations"),
// Etag: to.Ptr("00000836-0000-0100-0000-65fdd8bc0000"),
// ID: to.Ptr("/subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVm/providers/Microsoft.Insights/dataCollectionRuleAssociations/configurationAccessEndpoint"),
// Properties: &armmonitor.DataCollectionRuleAssociationProxyOnlyResourceProperties{
// DataCollectionEndpointID: to.Ptr("/subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.Insights/dataCollectionEndpoints/myCollectionEndpoint"),
// },
// SystemData: &armmonitor.SystemData{
// CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-03-22T19:15:08.2155156Z"); return t}()),
// CreatedBy: to.Ptr("user1"),
// CreatedByType: to.Ptr(armmonitor.CreatedByTypeUser),
// LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-03-22T19:15:08.2155156Z"); return t}()),
// LastModifiedBy: to.Ptr("user1"),
// 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.
Lists associations for the specified resource.
- resourceURI - The fully qualified Azure Resource manager identifier of the resource.
- options - DataCollectionRuleAssociationsClientListByResourceOptions contains the optional parameters for the DataCollectionRuleAssociationsClient.NewListByResourcePager method.
Example ¶
Generated from example definition: 2024-03-11/DataCollectionRuleAssociationsListByResource.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("<subscriptionID>", 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 = armmonitor.DataCollectionRuleAssociationsClientListByResourceResponse{
// DataCollectionRuleAssociationProxyOnlyResourceListResult: armmonitor.DataCollectionRuleAssociationProxyOnlyResourceListResult{
// Value: []*armmonitor.DataCollectionRuleAssociationProxyOnlyResource{
// {
// Name: to.Ptr("myAssociation"),
// Type: to.Ptr("Microsoft.Insights/dataCollectionRuleAssociations"),
// Etag: to.Ptr("00000836-0000-0100-0000-65fdd8bc0000"),
// 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"),
// },
// SystemData: &armmonitor.SystemData{
// CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-03-22T19:15:08.2155156Z"); return t}()),
// CreatedBy: to.Ptr("user1"),
// CreatedByType: to.Ptr(armmonitor.CreatedByTypeUser),
// LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-03-22T19:15:08.2155156Z"); return t}()),
// LastModifiedBy: to.Ptr("user1"),
// LastModifiedByType: to.Ptr(armmonitor.CreatedByTypeUser),
// },
// },
// {
// Name: to.Ptr("configurationAccessEndpoint"),
// Type: to.Ptr("Microsoft.Insights/dataCollectionRuleAssociations"),
// Etag: to.Ptr("00000836-0000-0100-0000-65fdd8bc0000"),
// ID: to.Ptr("/subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVm/providers/Microsoft.Insights/dataCollectionRuleAssociations/configurationAccessEndpoint"),
// Properties: &armmonitor.DataCollectionRuleAssociationProxyOnlyResourceProperties{
// DataCollectionEndpointID: to.Ptr("/subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.Insights/dataCollectionEndpoints/myCollectionEndpoint"),
// },
// SystemData: &armmonitor.SystemData{
// CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-03-22T19:15:08.2155156Z"); return t}()),
// CreatedBy: to.Ptr("user1"),
// CreatedByType: to.Ptr(armmonitor.CreatedByTypeUser),
// LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-03-22T19:15:08.2155156Z"); return t}()),
// LastModifiedBy: to.Ptr("user1"),
// 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.
Lists associations for the specified data collection rule.
- 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: 2024-03-11/DataCollectionRuleAssociationsListByRule.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("703362b3-f278-4e4b-9179-c76eaf41ffc2", 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 = armmonitor.DataCollectionRuleAssociationsClientListByRuleResponse{
// DataCollectionRuleAssociationProxyOnlyResourceListResult: armmonitor.DataCollectionRuleAssociationProxyOnlyResourceListResult{
// Value: []*armmonitor.DataCollectionRuleAssociationProxyOnlyResource{
// {
// Name: to.Ptr("myAssociation"),
// Type: to.Ptr("Microsoft.Insights/dataCollectionRuleAssociations"),
// 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"),
// },
// },
// },
// },
// }
}
}
Output:
type DataCollectionRuleAssociationsClientCreateOptions ¶ added in v0.4.0
type DataCollectionRuleAssociationsClientCreateOptions struct {
}
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 {
// The response of a DataCollectionRuleAssociationProxyOnlyResource list operation.
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 {
// The response of a DataCollectionRuleAssociationProxyOnlyResource list operation.
DataCollectionRuleAssociationProxyOnlyResourceListResult
}
DataCollectionRuleAssociationsClientListByResourceResponse contains the response from method DataCollectionRuleAssociationsClient.NewListByResourcePager.
type DataCollectionRuleAssociationsClientListByRuleOptions ¶ added in v0.4.0
type DataCollectionRuleAssociationsClientListByRuleOptions struct {
// (Optional) The continuation token for paginated responses
SkipToken *string
// (Optional) The max number of items to return per page
Top *int32
}
DataCollectionRuleAssociationsClientListByRuleOptions contains the optional parameters for the DataCollectionRuleAssociationsClient.NewListByRulePager method.
type DataCollectionRuleAssociationsClientListByRuleResponse ¶ added in v0.4.0
type DataCollectionRuleAssociationsClientListByRuleResponse struct {
// The response of a DataCollectionRuleAssociationProxyOnlyResource list operation.
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 ETW providers data source configurations.
EtwProviders []*EtwProviderDataSource
// 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 Otel Logs data source configurations.
OtelLogs []*OtelLogsDataSource
// The list of OTel metrics data source configurations.
OtelMetrics []*OtelMetricsDataSource
// The list of Otel traces data source configurations.
OtelTraces []*OtelTracesDataSource
// The list of performance counter data source configurations.
PerformanceCounters []*PerfCounterDataSource
// The list of Open Telemetry performance counter data source configurations.
PerformanceCountersOTel []*PerformanceCountersOTelDataSource
// 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 {
// List of Azure Data Explorer destinations.
AzureDataExplorer []*AdxDestination
// 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 Microsoft Fabric destinations.
MicrosoftFabric []*MicrosoftFabricDestination
// 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 DataCollectionRuleDirectDataSources ¶ added in v0.12.0
type DataCollectionRuleDirectDataSources struct {
// The list of OTel logs data source configurations.
OtelLogs []*OtelLogsDirectDataSource
// The list of OTel metrics data source configurations.
OtelMetrics []*OtelMetricsDirectDataSource
// The list of OTel traces data source configurations.
OtelTraces []*OtelTracesDirectDataSource
}
DataCollectionRuleDirectDataSources - The specification of direct data sources. This property is optional and can be omitted.
func (DataCollectionRuleDirectDataSources) MarshalJSON ¶ added in v0.12.0
func (d DataCollectionRuleDirectDataSources) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DataCollectionRuleDirectDataSources.
func (*DataCollectionRuleDirectDataSources) UnmarshalJSON ¶ added in v0.12.0
func (d *DataCollectionRuleDirectDataSources) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DataCollectionRuleDirectDataSources.
type DataCollectionRuleEndpoints ¶ added in v0.12.0
type DataCollectionRuleEndpoints struct {
// READ-ONLY; The ingestion endpoint for logs
LogsIngestion *string
// READ-ONLY; The ingestion endpoint for metrics
MetricsIngestion *string
}
DataCollectionRuleEndpoints - Defines the ingestion endpoints to send data to via this rule.
func (DataCollectionRuleEndpoints) MarshalJSON ¶ added in v0.12.0
func (d DataCollectionRuleEndpoints) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DataCollectionRuleEndpoints.
func (*DataCollectionRuleEndpoints) UnmarshalJSON ¶ added in v0.12.0
func (d *DataCollectionRuleEndpoints) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DataCollectionRuleEndpoints.
type DataCollectionRuleIngestionQuotas ¶ added in v0.12.0
type DataCollectionRuleIngestionQuotas struct {
Logs *IngestionQuotasLogs
}
DataCollectionRuleIngestionQuotas - The specification for ingestion limits
func (DataCollectionRuleIngestionQuotas) MarshalJSON ¶ added in v0.12.0
func (d DataCollectionRuleIngestionQuotas) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DataCollectionRuleIngestionQuotas.
func (*DataCollectionRuleIngestionQuotas) UnmarshalJSON ¶ added in v0.12.0
func (d *DataCollectionRuleIngestionQuotas) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DataCollectionRuleIngestionQuotas.
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; Immutable Id of azure offering managing this resource on-behalf-of customer.
ProvisionedByImmutableID *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 DataCollectionRuleReferences ¶ added in v0.12.0
type DataCollectionRuleReferences struct {
// Application Insights references to be used on OTel metrics/logs enrichment
ApplicationInsights []*ApplicationInsights
// All the enrichment data sources referenced in data flows
EnrichmentData *ReferencesSpecEnrichmentData
}
DataCollectionRuleReferences - Defines all the references that may be used in other sections of the DCR
func (DataCollectionRuleReferences) MarshalJSON ¶ added in v0.12.0
func (d DataCollectionRuleReferences) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DataCollectionRuleReferences.
func (*DataCollectionRuleReferences) UnmarshalJSON ¶ added in v0.12.0
func (d *DataCollectionRuleReferences) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DataCollectionRuleReferences.
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
Properties *DataCollectionRuleResourceProperties
// The SKU of the resource.
SKU *DataCollectionRuleResourceSKU
// 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
}
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; The type of managed identity assigned to this resource.
Type *ManagedServiceIdentityType
// The identities assigned to this resource by the user.
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; The DataCollectionRuleResource items on this page
Value []*DataCollectionRuleResource
// The link to the next page of items
NextLink *string
}
DataCollectionRuleResourceListResult - The response of a DataCollectionRuleResource list operation.
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 {
// Agent settings used to modify agent behavior on a given host
AgentSettings *DataCollectionRuleAgentSettings
// 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
// The specification of direct data sources.
// This property is optional and can be omitted.
DirectDataSources *DataCollectionRuleDirectDataSources
// Defines all the references that may be used in other sections of the DCR
References *DataCollectionRuleReferences
// Declaration of custom streams used in this rule.
StreamDeclarations map[string]*StreamDeclaration
// READ-ONLY; Defines the ingestion endpoints to send data to via this rule.
Endpoints *DataCollectionRuleEndpoints
// READ-ONLY; The immutable ID of this data collection rule. This property is READ-ONLY.
ImmutableID *string
// READ-ONLY; The specification for ingestion limits
IngestionQuotas *DataCollectionRuleIngestionQuotas
// READ-ONLY; Metadata about the resource
Metadata *DataCollectionRuleMetadata
// READ-ONLY; The resource provisioning state.
ProvisioningState *KnownDataCollectionRuleProvisioningState
}
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 DataCollectionRuleResourceSKU ¶ added in v0.12.0
type DataCollectionRuleResourceSKU struct {
// REQUIRED; The name of the SKU. Ex - P3. It is typically a letter+number code
Name *string
// If the SKU supports scale out/in then the capacity integer should be included. If scale out/in is not possible for the
// resource this may be omitted.
Capacity *int32
// If the service has different generations of hardware, for the same SKU, then that can be captured here.
Family *string
// The SKU size. When the name field is the combination of tier and some other value, this would be the standalone code.
Size *string
// This field is required to be implemented by the Resource Provider if the service has more than one tier, but is not required
// on a PUT.
Tier *SKUTier
}
DataCollectionRuleResourceSKU - The SKU of the resource.
func (DataCollectionRuleResourceSKU) MarshalJSON ¶ added in v0.12.0
func (d DataCollectionRuleResourceSKU) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DataCollectionRuleResourceSKU.
func (*DataCollectionRuleResourceSKU) UnmarshalJSON ¶ added in v0.12.0
func (d *DataCollectionRuleResourceSKU) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DataCollectionRuleResourceSKU.
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.
Generated from API version 2024-03-11
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. The value must be an UUID.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - Contains optional client configuration. Pass nil to accept the default values.
func (*DataCollectionRulesClient) Create ¶
func (client *DataCollectionRulesClient) Create(ctx context.Context, resourceGroupName string, dataCollectionRuleName string, body DataCollectionRuleResource, options *DataCollectionRulesClientCreateOptions) (DataCollectionRulesClientCreateResponse, error)
Create - Creates or updates a data collection rule.
Creates or updates a data collection rule. If the operation fails it returns an *azcore.ResponseError type.
- 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.
- body - The payload
- options - DataCollectionRulesClientCreateOptions contains the optional parameters for the DataCollectionRulesClient.Create method.
Example (CreateOrUpdateAnAgentSettingsConfiguration) ¶
Generated from example definition: 2024-03-11/DataCollectionRulesCreateAgentSettings.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("703362b3-f278-4e4b-9179-c76eaf41ffc2", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewDataCollectionRulesClient().Create(ctx, "myResourceGroup", "myCollectionRule", armmonitor.DataCollectionRuleResource{
Kind: to.Ptr(armmonitor.KnownDataCollectionRuleResourceKind("AgentSettings")),
Location: to.Ptr("eastus"),
Properties: &armmonitor.DataCollectionRuleResourceProperties{
Description: to.Ptr("An agent settings configuration"),
AgentSettings: &armmonitor.DataCollectionRuleAgentSettings{
Logs: []*armmonitor.AgentSetting{
{
Name: to.Ptr(armmonitor.KnownAgentSettingNameMaxDiskQuotaInMB),
Value: to.Ptr("5000"),
},
{
Name: to.Ptr(armmonitor.KnownAgentSettingNameUseTimeReceivedForForwardedEvents),
Value: to.Ptr("1"),
},
{
Name: to.Ptr(armmonitor.KnownAgentSettingNameTags),
Value: to.Ptr("Azure, Monitoring"),
},
},
},
},
}, 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 = armmonitor.DataCollectionRulesClientCreateResponse{
// 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"),
// Kind: to.Ptr(armmonitor.KnownDataCollectionRuleResourceKind("AgentSettings")),
// Location: to.Ptr("eastus"),
// Properties: &armmonitor.DataCollectionRuleResourceProperties{
// Description: to.Ptr("An agent settings configuration"),
// AgentSettings: &armmonitor.DataCollectionRuleAgentSettings{
// Logs: []*armmonitor.AgentSetting{
// {
// Name: to.Ptr(armmonitor.KnownAgentSettingNameMaxDiskQuotaInMB),
// Value: to.Ptr("5000"),
// },
// {
// Name: to.Ptr(armmonitor.KnownAgentSettingNameUseTimeReceivedForForwardedEvents),
// Value: to.Ptr("1"),
// },
// {
// Name: to.Ptr(armmonitor.KnownAgentSettingNameTags),
// Value: to.Ptr("Azure, Monitoring"),
// },
// },
// },
// ImmutableID: to.Ptr("dcr-76ce901eee3a400b9945b1e263a70000"),
// ProvisioningState: to.Ptr(armmonitor.KnownDataCollectionRuleProvisioningStateSucceeded),
// },
// SystemData: &armmonitor.SystemData{
// CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-03-26T05:41:40.7885407Z"); return t}()),
// CreatedBy: to.Ptr("user1"),
// CreatedByType: to.Ptr(armmonitor.CreatedByTypeUser),
// LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-03-26T05:41:40.7885407Z"); return t}()),
// LastModifiedBy: to.Ptr("user1"),
// LastModifiedByType: to.Ptr(armmonitor.CreatedByTypeUser),
// },
// },
// }
}
Output:
Example (CreateOrUpdateDataCollectionRule) ¶
Generated from example definition: 2024-03-11/DataCollectionRulesCreate.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("703362b3-f278-4e4b-9179-c76eaf41ffc2", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewDataCollectionRulesClient().Create(ctx, "myResourceGroup", "myCollectionRule", 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"),
},
},
},
},
}, 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 = armmonitor.DataCollectionRulesClientCreateResponse{
// 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.SystemData{
// CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-01T12:34:56.1234567Z"); 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.1234567Z"); return t}()),
// LastModifiedBy: to.Ptr("user2"),
// LastModifiedByType: to.Ptr(armmonitor.CreatedByTypeUser),
// },
// Tags: map[string]*string{
// "tag1": to.Ptr("A"),
// "tag2": to.Ptr("B"),
// },
// },
// }
}
Output:
Example (CreateOrUpdateDataCollectionRuleWithEmbeddedIngestionEndpoints) ¶
Generated from example definition: 2024-03-11/DataCollectionRulesCreateEmbeddedDCE.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("703362b3-f278-4e4b-9179-c76eaf41ffc2", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewDataCollectionRulesClient().Create(ctx, "myResourceGroup", "myCollectionRule", armmonitor.DataCollectionRuleResource{
Kind: to.Ptr(armmonitor.KnownDataCollectionRuleResourceKind(" Direct")),
Location: to.Ptr("eastus"),
Properties: &armmonitor.DataCollectionRuleResourceProperties{
Description: to.Ptr("A Direct Ingestion Rule with builtin ingestion fqdns"),
DataFlows: []*armmonitor.DataFlow{
{
Destinations: []*string{
to.Ptr("myworkspace"),
},
OutputStream: to.Ptr("Custom-LOGS1_CL"),
Streams: []*armmonitor.KnownDataFlowStreams{
to.Ptr(armmonitor.KnownDataFlowStreams("Custom-LOGS1_CL")),
},
TransformKql: to.Ptr("source | extend jsonContext = parse_json(AdditionalContext) | project TimeGenerated = Time, Computer, AdditionalContext = jsonContext, CounterName=tostring(jsonContext.CounterName), CounterValue=toreal(jsonContext.CounterValue)"),
},
},
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"),
},
},
},
StreamDeclarations: map[string]*armmonitor.StreamDeclaration{
"Custom-LOGS1_CL": {
Columns: []*armmonitor.ColumnDefinition{
{
Name: to.Ptr("Time"),
Type: to.Ptr(armmonitor.KnownColumnDefinitionTypeDatetime),
},
{
Name: to.Ptr("Computer"),
Type: to.Ptr(armmonitor.KnownColumnDefinitionTypeString),
},
{
Name: to.Ptr("AdditionalContext"),
Type: to.Ptr(armmonitor.KnownColumnDefinitionTypeString),
},
{
Name: to.Ptr("CounterName"),
Type: to.Ptr(armmonitor.KnownColumnDefinitionTypeString),
},
{
Name: to.Ptr("CounterValue"),
Type: to.Ptr(armmonitor.KnownColumnDefinitionTypeReal),
},
},
},
},
},
}, 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 = armmonitor.DataCollectionRulesClientCreateResponse{
// 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"),
// Kind: to.Ptr(armmonitor.KnownDataCollectionRuleResourceKind("Direct")),
// Location: to.Ptr("eastus"),
// Properties: &armmonitor.DataCollectionRuleResourceProperties{
// Description: to.Ptr("A Direct Ingestion Rule with builtin ingestion fqdns"),
// DataFlows: []*armmonitor.DataFlow{
// {
// Destinations: []*string{
// to.Ptr("myworkspace"),
// },
// OutputStream: to.Ptr("Custom-LOGS1_CL"),
// Streams: []*armmonitor.KnownDataFlowStreams{
// to.Ptr(armmonitor.KnownDataFlowStreams("Custom-LOGS1_CL")),
// },
// TransformKql: to.Ptr("source | extend jsonContext = parse_json(AdditionalContext) | project TimeGenerated = Time, Computer, AdditionalContext = jsonContext, CounterName=tostring(jsonContext.CounterName), CounterValue=toreal(jsonContext.CounterValue)"),
// },
// },
// 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"),
// },
// },
// },
// Endpoints: &armmonitor.DataCollectionRuleEndpoints{
// LogsIngestion: to.Ptr("https://mycollectionrule-8ykm-eastus2euap.logs.z1.canary.ingest.monitor.azure.com"),
// MetricsIngestion: to.Ptr("https://mycollectionrule-jcvc-eastus2euap.metrics.z1.canary.ingest.monitor.azure.com"),
// },
// ImmutableID: to.Ptr("dcr-d2a09c11a66243009af059a655750000"),
// ProvisioningState: to.Ptr(armmonitor.KnownDataCollectionRuleProvisioningStateSucceeded),
// StreamDeclarations: map[string]*armmonitor.StreamDeclaration{
// "Custom-LOGS1_CL": &armmonitor.StreamDeclaration{
// Columns: []*armmonitor.ColumnDefinition{
// {
// Name: to.Ptr("Time"),
// Type: to.Ptr(armmonitor.KnownColumnDefinitionTypeDatetime),
// },
// {
// Name: to.Ptr("Computer"),
// Type: to.Ptr(armmonitor.KnownColumnDefinitionTypeString),
// },
// {
// Name: to.Ptr("AdditionalContext"),
// Type: to.Ptr(armmonitor.KnownColumnDefinitionTypeString),
// },
// {
// Name: to.Ptr("CounterName"),
// Type: to.Ptr(armmonitor.KnownColumnDefinitionTypeString),
// },
// {
// Name: to.Ptr("CounterValue"),
// Type: to.Ptr(armmonitor.KnownColumnDefinitionTypeReal),
// },
// },
// },
// },
// },
// SystemData: &armmonitor.SystemData{
// CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-30T17:50:40.5383301Z"); return t}()),
// CreatedBy: to.Ptr("user1"),
// CreatedByType: to.Ptr(armmonitor.CreatedByTypeUser),
// LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-30T17:50:40.5383301Z"); return t}()),
// LastModifiedBy: to.Ptr("user1"),
// LastModifiedByType: to.Ptr(armmonitor.CreatedByTypeUser),
// },
// },
// }
}
Output:
Example (CreateOrUpdateDataCollectionRuleWithEnrichment) ¶
Generated from example definition: 2024-03-11/DataCollectionRulesCreateEnrichment.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("703362b3-f278-4e4b-9179-c76eaf41ffc2", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewDataCollectionRulesClient().Create(ctx, "myResourceGroup", "myCollectionRule", armmonitor.DataCollectionRuleResource{
Location: to.Ptr("eastus"),
Properties: &armmonitor.DataCollectionRuleResourceProperties{
Description: to.Ptr("A rule showcasing ingestion time enrichment"),
DataCollectionEndpointID: to.Ptr("/subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.Insights/dataCollectionEndpoints/myDataCollectionEndpoint"),
DataFlows: []*armmonitor.DataFlow{
{
Destinations: []*string{
to.Ptr("centralWorkspace"),
},
OutputStream: to.Ptr("Custom-LOGS1_CL"),
Streams: []*armmonitor.KnownDataFlowStreams{
to.Ptr(armmonitor.KnownDataFlowStreams("Custom-TabularDataABC")),
},
TransformKql: to.Ptr("source | extend LookupData = lookup_string_am('mytextdatastore', Message) | project TimeGenerated, Message, AdditionalContext = LookupData.Message"),
},
},
DataSources: &armmonitor.DataCollectionRuleDataSources{
LogFiles: []*armmonitor.LogFilesDataSource{
{
Name: to.Ptr("myTabularLogDataSource"),
Format: to.Ptr(armmonitor.KnownLogFilesDataSourceFormatText),
FilePatterns: []*string{
to.Ptr("C:\\JavaLogs\\*\\*.log"),
},
Settings: &armmonitor.LogFilesDataSourceSettings{
Text: &armmonitor.LogFileSettingsText{
RecordStartTimestampFormat: to.Ptr(armmonitor.KnownLogFileTextSettingsRecordStartTimestampFormatISO8601),
},
},
Streams: []*string{
to.Ptr("Custom-TabularDataABC"),
},
},
},
},
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"),
},
},
},
References: &armmonitor.DataCollectionRuleReferences{
EnrichmentData: &armmonitor.ReferencesSpecEnrichmentData{
StorageBlobs: []*armmonitor.StorageBlob{
{
Name: to.Ptr("mytextdatastore"),
BlobURL: to.Ptr("https://myenrichmentstorage.blob.core.windows.net/enrichment"),
LookupType: to.Ptr(armmonitor.KnownStorageBlobLookupTypeString),
ResourceID: to.Ptr("/subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourcegroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/myenrichmentstorage"),
},
},
},
},
StreamDeclarations: map[string]*armmonitor.StreamDeclaration{
"Custom-TabularDataABC": {
Columns: []*armmonitor.ColumnDefinition{
{
Name: to.Ptr("TimeGenerated"),
Type: to.Ptr(armmonitor.KnownColumnDefinitionTypeDatetime),
},
{
Name: to.Ptr("Message"),
Type: to.Ptr(armmonitor.KnownColumnDefinitionTypeString),
},
{
Name: to.Ptr("AdditionalContext"),
Type: to.Ptr(armmonitor.KnownColumnDefinitionTypeString),
},
},
},
},
},
}, 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 = armmonitor.DataCollectionRulesClientCreateResponse{
// 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{
// Description: to.Ptr("A rule showcasing ingestion time enrichment"),
// DataCollectionEndpointID: to.Ptr("/subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.Insights/dataCollectionEndpoints/myDataCollectionEndpoint"),
// DataFlows: []*armmonitor.DataFlow{
// {
// Destinations: []*string{
// to.Ptr("centralWorkspace"),
// },
// OutputStream: to.Ptr("Custom-LOGS1_CL"),
// Streams: []*armmonitor.KnownDataFlowStreams{
// to.Ptr(armmonitor.KnownDataFlowStreams("Custom-TabularDataABC")),
// },
// TransformKql: to.Ptr("source | extend LookupData = lookup_string_am('mytextdatastore', Message) | project TimeGenerated, Message, AdditionalContext = LookupData.Message"),
// },
// },
// DataSources: &armmonitor.DataCollectionRuleDataSources{
// LogFiles: []*armmonitor.LogFilesDataSource{
// {
// Name: to.Ptr("myTabularLogDataSource"),
// Format: to.Ptr(armmonitor.KnownLogFilesDataSourceFormatText),
// FilePatterns: []*string{
// to.Ptr("C:\\JavaLogs\\*\\*.log"),
// },
// Settings: &armmonitor.LogFilesDataSourceSettings{
// Text: &armmonitor.LogFileSettingsText{
// RecordStartTimestampFormat: to.Ptr(armmonitor.KnownLogFileTextSettingsRecordStartTimestampFormatISO8601),
// },
// },
// Streams: []*string{
// to.Ptr("Custom-TabularDataABC"),
// },
// },
// },
// },
// 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-ad96300ff0734d08a6a7195eb2be0000"),
// ProvisioningState: to.Ptr(armmonitor.KnownDataCollectionRuleProvisioningStateSucceeded),
// References: &armmonitor.DataCollectionRuleReferences{
// EnrichmentData: &armmonitor.ReferencesSpecEnrichmentData{
// StorageBlobs: []*armmonitor.StorageBlob{
// {
// Name: to.Ptr("mytextdatastore"),
// BlobURL: to.Ptr("https://myenrichmentstorage.blob.core.windows.net/enrichment"),
// LookupType: to.Ptr(armmonitor.KnownStorageBlobLookupTypeString),
// ResourceID: to.Ptr("/subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourcegroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/myenrichmentstorage"),
// },
// },
// },
// },
// StreamDeclarations: map[string]*armmonitor.StreamDeclaration{
// "Custom-TabularDataABC": &armmonitor.StreamDeclaration{
// Columns: []*armmonitor.ColumnDefinition{
// {
// Name: to.Ptr("TimeGenerated"),
// Type: to.Ptr(armmonitor.KnownColumnDefinitionTypeDatetime),
// },
// {
// Name: to.Ptr("Message"),
// Type: to.Ptr(armmonitor.KnownColumnDefinitionTypeString),
// },
// {
// Name: to.Ptr("AdditionalContext"),
// Type: to.Ptr(armmonitor.KnownColumnDefinitionTypeString),
// },
// },
// },
// },
// },
// SystemData: &armmonitor.SystemData{
// CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-30T17:50:40.5383301Z"); return t}()),
// CreatedBy: to.Ptr("user1"),
// CreatedByType: to.Ptr(armmonitor.CreatedByTypeUser),
// LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-30T17:50:40.5383301Z"); return t}()),
// LastModifiedBy: to.Ptr("user1"),
// LastModifiedByType: to.Ptr(armmonitor.CreatedByTypeUser),
// },
// },
// }
}
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.
Deletes a data collection rule. If the operation fails it returns an *azcore.ResponseError type.
- 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: 2024-03-11/DataCollectionRulesDelete.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("703362b3-f278-4e4b-9179-c76eaf41ffc2", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewDataCollectionRulesClient().Delete(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 = armmonitor.DataCollectionRulesClientDeleteResponse{
// }
}
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.
Returns the specified data collection rule. If the operation fails it returns an *azcore.ResponseError type.
- 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: 2024-03-11/DataCollectionRulesGet.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("703362b3-f278-4e4b-9179-c76eaf41ffc2", 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 = armmonitor.DataCollectionRulesClientGetResponse{
// 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.SystemData{
// CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-01T12:34:56.1234567Z"); 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.1234567Z"); 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.
Lists all data collection rules in the specified resource group.
- 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: 2024-03-11/DataCollectionRulesListByResourceGroup.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("703362b3-f278-4e4b-9179-c76eaf41ffc2", 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 = armmonitor.DataCollectionRulesClientListByResourceGroupResponse{
// 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.SystemData{
// CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-01T12:34:56.1234567Z"); 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.1234567Z"); 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.SystemData{
// CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-01T12:34:56.1234567Z"); 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.1234567Z"); 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.
Lists all data collection rules in the specified subscription.
- options - DataCollectionRulesClientListBySubscriptionOptions contains the optional parameters for the DataCollectionRulesClient.NewListBySubscriptionPager method.
Example ¶
Generated from example definition: 2024-03-11/DataCollectionRulesListBySubscription.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("703362b3-f278-4e4b-9179-c76eaf41ffc2", 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 = armmonitor.DataCollectionRulesClientListBySubscriptionResponse{
// 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.SystemData{
// CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-01T12:34:56.1234567Z"); 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.1234567Z"); 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.SystemData{
// CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-01T12:34:56.1234567Z"); 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.1234567Z"); 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, body ResourceForUpdate, options *DataCollectionRulesClientUpdateOptions) (DataCollectionRulesClientUpdateResponse, error)
Update - Updates part of a data collection rule.
Updates part of a data collection rule. If the operation fails it returns an *azcore.ResponseError type.
- 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.
- body - The payload
- options - DataCollectionRulesClientUpdateOptions contains the optional parameters for the DataCollectionRulesClient.Update method.
Example ¶
Generated from example definition: 2024-03-11/DataCollectionRulesUpdate.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("703362b3-f278-4e4b-9179-c76eaf41ffc2", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewDataCollectionRulesClient().Update(ctx, "myResourceGroup", "myCollectionRule", armmonitor.ResourceForUpdate{
Tags: map[string]*string{
"tag1": to.Ptr("A"),
"tag2": to.Ptr("B"),
"tag3": to.Ptr("C"),
},
}, 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 = armmonitor.DataCollectionRulesClientUpdateResponse{
// 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.SystemData{
// CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-01T12:34:56.1234567Z"); 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.1234567Z"); 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 {
}
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 {
// If set to 'true' then all associations of this data collection rule will also be deleted
DeleteAssociations *bool
}
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 {
// The response of a DataCollectionRuleResource list operation.
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 {
// The response of a DataCollectionRuleResource list operation.
DataCollectionRuleResourceListResult
}
DataCollectionRulesClientListBySubscriptionResponse contains the response from method DataCollectionRulesClient.NewListBySubscriptionPager.
type DataCollectionRulesClientUpdateOptions ¶ added in v0.4.0
type DataCollectionRulesClientUpdateOptions struct {
}
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 DataFlow ¶
type DataFlow struct {
// The builtIn transform to transform stream data
BuiltInTransform *string
// Flag to enable overflow column in LA destinations
CaptureOverflow *bool
// 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 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 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 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 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 - Exclude DimensionOperatorExclude DimensionOperator = "Exclude" // DimensionOperatorInclude - Include 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. Previously undocumented values might be returned
AlertSensitivity *DynamicThresholdSensitivity
// CONSTANT; Specifies the type of threshold criteria. Previously undocumented values might be returned
// Field has constant value CriterionTypeDynamicThresholdCriterion, any specified value is ignored.
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. Previously undocumented values might be
// returned
Operator *DynamicThresholdOperator
// REQUIRED; The criteria time aggregation types. Previously undocumented values might be returned
TimeAggregation *AggregationTypeEnum
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 DynamicPromQLCriteria ¶ added in v0.12.0
type DynamicPromQLCriteria struct {
// REQUIRED; The extent of deviation required to trigger an alert. This will affect how tight the threshold is to the metric
// series pattern. Previously undocumented values might be returned
AlertSensitivity *DynamicThresholdSensitivity
// CONSTANT; Specifies the type of threshold criteria. Previously undocumented values might be returned
// Field has constant value CriterionTypeDynamicThresholdCriterion, any specified value is ignored.
CriterionType *CriterionType
// REQUIRED; Name of the criteria.
Name *string
// REQUIRED; The operator used to compare the metric value against the threshold. Previously undocumented values might be
// returned
Operator *DynamicThresholdOperator
// REQUIRED; The query used to evaluate the alert rule
Query *string
// 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
}
DynamicPromQLCriteria - The criterion for dynamic prom query.
func (*DynamicPromQLCriteria) GetMultiPromQLCriteria ¶ added in v0.12.0
func (d *DynamicPromQLCriteria) GetMultiPromQLCriteria() *MultiPromQLCriteria
GetMultiPromQLCriteria implements the MultiPromQLCriteriaClassification interface for type DynamicPromQLCriteria.
func (DynamicPromQLCriteria) MarshalJSON ¶ added in v0.12.0
func (d DynamicPromQLCriteria) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DynamicPromQLCriteria.
func (*DynamicPromQLCriteria) UnmarshalJSON ¶ added in v0.12.0
func (d *DynamicPromQLCriteria) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DynamicPromQLCriteria.
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. Previously undocumented values might be returned
const ( // DynamicThresholdOperatorGreaterOrLessThan - GreaterOrLessThan DynamicThresholdOperatorGreaterOrLessThan DynamicThresholdOperator = "GreaterOrLessThan" // DynamicThresholdOperatorGreaterThan - GreaterThan DynamicThresholdOperatorGreaterThan DynamicThresholdOperator = "GreaterThan" // DynamicThresholdOperatorLessThan - LessThan 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. Previously undocumented values might be returned
const ( // DynamicThresholdSensitivityHigh - High DynamicThresholdSensitivityHigh DynamicThresholdSensitivity = "High" // DynamicThresholdSensitivityLow - Low DynamicThresholdSensitivityLow DynamicThresholdSensitivity = "Low" // DynamicThresholdSensitivityMedium - Medium 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 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 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 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 EtwProviderDataSource ¶ added in v0.12.0
type EtwProviderDataSource struct {
// REQUIRED; The provider GUID or class name for event source
Provider *string
// REQUIRED; Provider type specification: By Manifest GUID or by Event Source name
ProviderType *KnownEtwProviderType
// REQUIRED; List of streams that this data source will be sent to
Streams []*string
// Events Ids to collect
EventIDs []*string
// Event's membership in a set of event categories
Keyword *string
// Minimal level of detail to be logged
LogLevel *KnownEtwProviderDataSourceLogLevel
// 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
}
EtwProviderDataSource - Enables an ETW provider logs to be collected by this data collection rule.
func (EtwProviderDataSource) MarshalJSON ¶ added in v0.12.0
func (e EtwProviderDataSource) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type EtwProviderDataSource.
func (*EtwProviderDataSource) UnmarshalJSON ¶ added in v0.12.0
func (e *EtwProviderDataSource) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type EtwProviderDataSource.
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.
Generated from API version 2015-04-01
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 - Contains optional client configuration. 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.<br>The current list includes the following: Administrative, Security, ServiceHealth, Alert, Recommendation, Policy.
- options - EventCategoriesClientListOptions contains the optional parameters for the EventCategoriesClient.NewListPager method.
Example ¶
Generated from example definition: 2015-04-01/GetEventCategories.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("<subscriptionID>", 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 = armmonitor.EventCategoriesClientListResponse{
// 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
// The link to the next page of items
NextLink *string
}
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 <Key, Value> pairs (usually a Dictionary<String, String>) 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; The EventData items on this page
Value []*EventData
// The link to the next page of items
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 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 principal id of the managed identity. The value can be "None", "SystemAssigned"
ManagedIdentity *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 - Critical EventLevelCritical EventLevel = "Critical" // EventLevelError - Error EventLevelError EventLevel = "Error" // EventLevelInformational - Informational EventLevelInformational EventLevel = "Informational" // EventLevelVerbose - Verbose EventLevelVerbose EventLevel = "Verbose" // EventLevelWarning - Warning 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 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 - None IdentityTypeNone IdentityType = "None" // IdentityTypeSystemAssigned - SystemAssigned IdentityTypeSystemAssigned IdentityType = "SystemAssigned" // IdentityTypeUserAssigned - UserAssigned 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
// The KQL query to transform the data source. This is a deprecated property and will be removed in future versions.
TransformKql *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 URL to get the next set of results.
NextLink *string
// 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 IncidentManagementService ¶ added in v0.12.0
type IncidentManagementService string
IncidentManagementService - The incident management service type
const ( // IncidentManagementServiceIcm - Icm IncidentManagementServiceIcm IncidentManagementService = "Icm" )
func PossibleIncidentManagementServiceValues ¶ added in v0.12.0
func PossibleIncidentManagementServiceValues() []IncidentManagementService
PossibleIncidentManagementServiceValues returns the possible values for the IncidentManagementService const type.
type IncidentReceiver ¶ added in v0.12.0
type IncidentReceiver struct {
// REQUIRED; The incident service connection
Connection *IncidentServiceConnection
// REQUIRED; The incident management service type
IncidentManagementService *IncidentManagementService
// REQUIRED; Field mappings for the incident service
Mappings map[string]*string
// REQUIRED; The name of the Incident receiver. Names must be unique across all receivers within an action group.
Name *string
}
IncidentReceiver - An Incident receiver.
func (IncidentReceiver) MarshalJSON ¶ added in v0.12.0
func (i IncidentReceiver) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type IncidentReceiver.
func (*IncidentReceiver) UnmarshalJSON ¶ added in v0.12.0
func (i *IncidentReceiver) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type IncidentReceiver.
type IncidentServiceConnection ¶ added in v0.12.0
type IncidentServiceConnection struct {
// REQUIRED; GUID value representing the connection ID for the incident management service.
ID *string
// REQUIRED; The name of the connection.
Name *string
}
IncidentServiceConnection - The connection info for Incident Receiver.
func (IncidentServiceConnection) MarshalJSON ¶ added in v0.12.0
func (i IncidentServiceConnection) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type IncidentServiceConnection.
func (*IncidentServiceConnection) UnmarshalJSON ¶ added in v0.12.0
func (i *IncidentServiceConnection) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type IncidentServiceConnection.
type IngestionQuotasLogs ¶ added in v0.12.0
func (IngestionQuotasLogs) MarshalJSON ¶ added in v0.12.0
func (i IngestionQuotasLogs) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type IngestionQuotasLogs.
func (*IngestionQuotasLogs) UnmarshalJSON ¶ added in v0.12.0
func (i *IngestionQuotasLogs) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type IngestionQuotasLogs.
type IssueType ¶ added in v0.12.0
type IssueType string
IssueType - Type of issue
const ( // IssueTypeConfigurationPropagationFailure - An error occurred while applying the network security perimeter (NSP) configuration. IssueTypeConfigurationPropagationFailure IssueType = "ConfigurationPropagationFailure" // IssueTypeMissingIdentityConfiguration - An managed identity hasn't been associated with the resource. The resource will // still be able to validate inbound traffic from the network security perimeter (NSP) or matching inbound access rules, but // it won't be able to perform outbound access as a member of the NSP. IssueTypeMissingIdentityConfiguration IssueType = "MissingIdentityConfiguration" // IssueTypeMissingPerimeterConfiguration - A network connectivity issue is happening on the resource which could be addressed // either by adding new resources to the network security perimeter (NSP) or by modifying access rules. IssueTypeMissingPerimeterConfiguration IssueType = "MissingPerimeterConfiguration" // IssueTypeUnknown - Unknown issue type IssueTypeUnknown IssueType = "Unknown" )
func PossibleIssueTypeValues ¶ added in v0.12.0
func PossibleIssueTypeValues() []IssueType
PossibleIssueTypeValues returns the possible values for the IssueType const type.
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 KnownAgentSettingName ¶ added in v0.12.0
type KnownAgentSettingName string
KnownAgentSettingName - The name of the setting. Must be part of the list of supported settings
const ( // KnownAgentSettingNameMaxDiskQuotaInMB - MaxDiskQuotaInMB KnownAgentSettingNameMaxDiskQuotaInMB KnownAgentSettingName = "MaxDiskQuotaInMB" // KnownAgentSettingNameTags - Tags KnownAgentSettingNameTags KnownAgentSettingName = "Tags" // KnownAgentSettingNameUseTimeReceivedForForwardedEvents - UseTimeReceivedForForwardedEvents KnownAgentSettingNameUseTimeReceivedForForwardedEvents KnownAgentSettingName = "UseTimeReceivedForForwardedEvents" )
func PossibleKnownAgentSettingNameValues ¶ added in v0.12.0
func PossibleKnownAgentSettingNameValues() []KnownAgentSettingName
PossibleKnownAgentSettingNameValues returns the possible values for the KnownAgentSettingName const type.
type KnownColumnDefinitionType ¶ added in v0.5.0
type KnownColumnDefinitionType string
KnownColumnDefinitionType - The type of the column data.
const ( // KnownColumnDefinitionTypeBoolean - boolean KnownColumnDefinitionTypeBoolean KnownColumnDefinitionType = "boolean" // KnownColumnDefinitionTypeDatetime - datetime KnownColumnDefinitionTypeDatetime KnownColumnDefinitionType = "datetime" // KnownColumnDefinitionTypeDynamic - dynamic KnownColumnDefinitionTypeDynamic KnownColumnDefinitionType = "dynamic" // KnownColumnDefinitionTypeInt - int KnownColumnDefinitionTypeInt KnownColumnDefinitionType = "int" // KnownColumnDefinitionTypeLong - long KnownColumnDefinitionTypeLong KnownColumnDefinitionType = "long" // KnownColumnDefinitionTypeReal - real KnownColumnDefinitionTypeReal KnownColumnDefinitionType = "real" // KnownColumnDefinitionTypeString - string 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 - Canceled KnownDataCollectionEndpointProvisioningStateCanceled KnownDataCollectionEndpointProvisioningState = "Canceled" // KnownDataCollectionEndpointProvisioningStateCreating - Creating KnownDataCollectionEndpointProvisioningStateCreating KnownDataCollectionEndpointProvisioningState = "Creating" // KnownDataCollectionEndpointProvisioningStateDeleting - Deleting KnownDataCollectionEndpointProvisioningStateDeleting KnownDataCollectionEndpointProvisioningState = "Deleting" // KnownDataCollectionEndpointProvisioningStateFailed - Failed KnownDataCollectionEndpointProvisioningStateFailed KnownDataCollectionEndpointProvisioningState = "Failed" // KnownDataCollectionEndpointProvisioningStateSucceeded - Succeeded KnownDataCollectionEndpointProvisioningStateSucceeded KnownDataCollectionEndpointProvisioningState = "Succeeded" // KnownDataCollectionEndpointProvisioningStateUpdating - Updating 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 - Linux KnownDataCollectionEndpointResourceKindLinux KnownDataCollectionEndpointResourceKind = "Linux" // KnownDataCollectionEndpointResourceKindWindows - Windows 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 - Canceled KnownDataCollectionRuleAssociationProvisioningStateCanceled KnownDataCollectionRuleAssociationProvisioningState = "Canceled" // KnownDataCollectionRuleAssociationProvisioningStateCreating - Creating KnownDataCollectionRuleAssociationProvisioningStateCreating KnownDataCollectionRuleAssociationProvisioningState = "Creating" // KnownDataCollectionRuleAssociationProvisioningStateDeleting - Deleting KnownDataCollectionRuleAssociationProvisioningStateDeleting KnownDataCollectionRuleAssociationProvisioningState = "Deleting" // KnownDataCollectionRuleAssociationProvisioningStateFailed - Failed KnownDataCollectionRuleAssociationProvisioningStateFailed KnownDataCollectionRuleAssociationProvisioningState = "Failed" // KnownDataCollectionRuleAssociationProvisioningStateSucceeded - Succeeded KnownDataCollectionRuleAssociationProvisioningStateSucceeded KnownDataCollectionRuleAssociationProvisioningState = "Succeeded" // KnownDataCollectionRuleAssociationProvisioningStateUpdating - Updating 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 - Canceled KnownDataCollectionRuleProvisioningStateCanceled KnownDataCollectionRuleProvisioningState = "Canceled" // KnownDataCollectionRuleProvisioningStateCreating - Creating KnownDataCollectionRuleProvisioningStateCreating KnownDataCollectionRuleProvisioningState = "Creating" // KnownDataCollectionRuleProvisioningStateDeleting - Deleting KnownDataCollectionRuleProvisioningStateDeleting KnownDataCollectionRuleProvisioningState = "Deleting" // KnownDataCollectionRuleProvisioningStateFailed - Failed KnownDataCollectionRuleProvisioningStateFailed KnownDataCollectionRuleProvisioningState = "Failed" // KnownDataCollectionRuleProvisioningStateSucceeded - Succeeded KnownDataCollectionRuleProvisioningStateSucceeded KnownDataCollectionRuleProvisioningState = "Succeeded" // KnownDataCollectionRuleProvisioningStateUpdating - Updating 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 - Linux KnownDataCollectionRuleResourceKindLinux KnownDataCollectionRuleResourceKind = "Linux" // KnownDataCollectionRuleResourceKindWindows - Windows 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 - Microsoft-Event KnownDataFlowStreamsMicrosoftEvent KnownDataFlowStreams = "Microsoft-Event" // KnownDataFlowStreamsMicrosoftInsightsMetrics - Microsoft-InsightsMetrics KnownDataFlowStreamsMicrosoftInsightsMetrics KnownDataFlowStreams = "Microsoft-InsightsMetrics" // KnownDataFlowStreamsMicrosoftPerf - Microsoft-Perf KnownDataFlowStreamsMicrosoftPerf KnownDataFlowStreams = "Microsoft-Perf" // KnownDataFlowStreamsMicrosoftSyslog - Microsoft-Syslog KnownDataFlowStreamsMicrosoftSyslog KnownDataFlowStreams = "Microsoft-Syslog" // KnownDataFlowStreamsMicrosoftWindowsEvent - Microsoft-WindowsEvent KnownDataFlowStreamsMicrosoftWindowsEvent KnownDataFlowStreams = "Microsoft-WindowsEvent" )
func PossibleKnownDataFlowStreamsValues ¶
func PossibleKnownDataFlowStreamsValues() []KnownDataFlowStreams
PossibleKnownDataFlowStreamsValues returns the possible values for the KnownDataFlowStreams const type.
type KnownEtwProviderDataSourceLogLevel ¶ added in v0.12.0
type KnownEtwProviderDataSourceLogLevel string
KnownEtwProviderDataSourceLogLevel - Minimal level of detail to be logged
const ( // KnownEtwProviderDataSourceLogLevelCritical - Critical KnownEtwProviderDataSourceLogLevelCritical KnownEtwProviderDataSourceLogLevel = "Critical" // KnownEtwProviderDataSourceLogLevelError - Error KnownEtwProviderDataSourceLogLevelError KnownEtwProviderDataSourceLogLevel = "Error" // KnownEtwProviderDataSourceLogLevelInformational - Informational KnownEtwProviderDataSourceLogLevelInformational KnownEtwProviderDataSourceLogLevel = "Informational" // KnownEtwProviderDataSourceLogLevelVerbose - Verbose KnownEtwProviderDataSourceLogLevelVerbose KnownEtwProviderDataSourceLogLevel = "Verbose" // KnownEtwProviderDataSourceLogLevelWarning - Warning KnownEtwProviderDataSourceLogLevelWarning KnownEtwProviderDataSourceLogLevel = "Warning" )
func PossibleKnownEtwProviderDataSourceLogLevelValues ¶ added in v0.12.0
func PossibleKnownEtwProviderDataSourceLogLevelValues() []KnownEtwProviderDataSourceLogLevel
PossibleKnownEtwProviderDataSourceLogLevelValues returns the possible values for the KnownEtwProviderDataSourceLogLevel const type.
type KnownEtwProviderType ¶ added in v0.12.0
type KnownEtwProviderType string
KnownEtwProviderType - Provider type specification: By Manifest GUID or by Event Source name
const ( // KnownEtwProviderTypeEventSource - EventSource KnownEtwProviderTypeEventSource KnownEtwProviderType = "EventSource" // KnownEtwProviderTypeManifest - Manifest KnownEtwProviderTypeManifest KnownEtwProviderType = "Manifest" )
func PossibleKnownEtwProviderTypeValues ¶ added in v0.12.0
func PossibleKnownEtwProviderTypeValues() []KnownEtwProviderType
PossibleKnownEtwProviderTypeValues returns the possible values for the KnownEtwProviderType const type.
type KnownExtensionDataSourceStreams ¶
type KnownExtensionDataSourceStreams string
const ( // KnownExtensionDataSourceStreamsMicrosoftEvent - Microsoft-Event KnownExtensionDataSourceStreamsMicrosoftEvent KnownExtensionDataSourceStreams = "Microsoft-Event" // KnownExtensionDataSourceStreamsMicrosoftInsightsMetrics - Microsoft-InsightsMetrics KnownExtensionDataSourceStreamsMicrosoftInsightsMetrics KnownExtensionDataSourceStreams = "Microsoft-InsightsMetrics" // KnownExtensionDataSourceStreamsMicrosoftPerf - Microsoft-Perf KnownExtensionDataSourceStreamsMicrosoftPerf KnownExtensionDataSourceStreams = "Microsoft-Perf" // KnownExtensionDataSourceStreamsMicrosoftSyslog - Microsoft-Syslog KnownExtensionDataSourceStreamsMicrosoftSyslog KnownExtensionDataSourceStreams = "Microsoft-Syslog" // KnownExtensionDataSourceStreamsMicrosoftWindowsEvent - Microsoft-WindowsEvent 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 - Canceled KnownLocationSpecProvisioningStatusCanceled KnownLocationSpecProvisioningStatus = "Canceled" // KnownLocationSpecProvisioningStatusCreating - Creating KnownLocationSpecProvisioningStatusCreating KnownLocationSpecProvisioningStatus = "Creating" // KnownLocationSpecProvisioningStatusDeleting - Deleting KnownLocationSpecProvisioningStatusDeleting KnownLocationSpecProvisioningStatus = "Deleting" // KnownLocationSpecProvisioningStatusFailed - Failed KnownLocationSpecProvisioningStatusFailed KnownLocationSpecProvisioningStatus = "Failed" // KnownLocationSpecProvisioningStatusSucceeded - Succeeded KnownLocationSpecProvisioningStatusSucceeded KnownLocationSpecProvisioningStatus = "Succeeded" // KnownLocationSpecProvisioningStatusUpdating - Updating 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 - dd/MMM/yyyy:HH:mm:ss zzz KnownLogFileTextSettingsRecordStartTimestampFormatDdMMMYyyyHHMmSsZzz KnownLogFileTextSettingsRecordStartTimestampFormat = "dd/MMM/yyyy:HH:mm:ss zzz" // KnownLogFileTextSettingsRecordStartTimestampFormatDdMMyyHHMmSs - ddMMyy HH:mm:ss KnownLogFileTextSettingsRecordStartTimestampFormatDdMMyyHHMmSs KnownLogFileTextSettingsRecordStartTimestampFormat = "ddMMyy HH:mm:ss" // KnownLogFileTextSettingsRecordStartTimestampFormatISO8601 - ISO 8601 KnownLogFileTextSettingsRecordStartTimestampFormatISO8601 KnownLogFileTextSettingsRecordStartTimestampFormat = "ISO 8601" // KnownLogFileTextSettingsRecordStartTimestampFormatMDYYYYHHMMSSAMPM - M/D/YYYY HH:MM:SS AM/PM KnownLogFileTextSettingsRecordStartTimestampFormatMDYYYYHHMMSSAMPM KnownLogFileTextSettingsRecordStartTimestampFormat = "M/D/YYYY HH:MM:SS AM/PM" // KnownLogFileTextSettingsRecordStartTimestampFormatMMMDHhMmSs - MMM d hh:mm:ss KnownLogFileTextSettingsRecordStartTimestampFormatMMMDHhMmSs KnownLogFileTextSettingsRecordStartTimestampFormat = "MMM d hh:mm:ss" // KnownLogFileTextSettingsRecordStartTimestampFormatMonDDYYYYHHMMSS - Mon DD, YYYY HH:MM:SS KnownLogFileTextSettingsRecordStartTimestampFormatMonDDYYYYHHMMSS KnownLogFileTextSettingsRecordStartTimestampFormat = "Mon DD, YYYY HH:MM:SS" // KnownLogFileTextSettingsRecordStartTimestampFormatYYYYMMDDHHMMSS - YYYY-MM-DD HH:MM:SS KnownLogFileTextSettingsRecordStartTimestampFormatYYYYMMDDHHMMSS KnownLogFileTextSettingsRecordStartTimestampFormat = "YYYY-MM-DD HH:MM:SS" // KnownLogFileTextSettingsRecordStartTimestampFormatYyMMddHHMmSs - yyMMdd HH:mm:ss KnownLogFileTextSettingsRecordStartTimestampFormatYyMMddHHMmSs KnownLogFileTextSettingsRecordStartTimestampFormat = "yyMMdd HH:mm:ss" // KnownLogFileTextSettingsRecordStartTimestampFormatYyyyMMDdTHHMmSsK - yyyy-MM-ddTHH:mm:ssK 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 ( // KnownLogFilesDataSourceFormatJSON - json KnownLogFilesDataSourceFormatJSON KnownLogFilesDataSourceFormat = "json" // KnownLogFilesDataSourceFormatText - text KnownLogFilesDataSourceFormatText KnownLogFilesDataSourceFormat = "text" )
func PossibleKnownLogFilesDataSourceFormatValues ¶ added in v0.5.0
func PossibleKnownLogFilesDataSourceFormatValues() []KnownLogFilesDataSourceFormat
PossibleKnownLogFilesDataSourceFormatValues returns the possible values for the KnownLogFilesDataSourceFormat const type.
type KnownOtelLogsDataSourceStreams ¶ added in v0.12.0
type KnownOtelLogsDataSourceStreams string
const ( // KnownOtelLogsDataSourceStreamsMicrosoftOTelLogs - Microsoft-OTel-Logs KnownOtelLogsDataSourceStreamsMicrosoftOTelLogs KnownOtelLogsDataSourceStreams = "Microsoft-OTel-Logs" )
func PossibleKnownOtelLogsDataSourceStreamsValues ¶ added in v0.12.0
func PossibleKnownOtelLogsDataSourceStreamsValues() []KnownOtelLogsDataSourceStreams
PossibleKnownOtelLogsDataSourceStreamsValues returns the possible values for the KnownOtelLogsDataSourceStreams const type.
type KnownOtelLogsDirectDataSourceStreams ¶ added in v0.12.0
type KnownOtelLogsDirectDataSourceStreams string
const ( // KnownOtelLogsDirectDataSourceStreamsMicrosoftOTelLogs - Microsoft-OTel-Logs KnownOtelLogsDirectDataSourceStreamsMicrosoftOTelLogs KnownOtelLogsDirectDataSourceStreams = "Microsoft-OTel-Logs" )
func PossibleKnownOtelLogsDirectDataSourceStreamsValues ¶ added in v0.12.0
func PossibleKnownOtelLogsDirectDataSourceStreamsValues() []KnownOtelLogsDirectDataSourceStreams
PossibleKnownOtelLogsDirectDataSourceStreamsValues returns the possible values for the KnownOtelLogsDirectDataSourceStreams const type.
type KnownOtelTracesDataSourceStreams ¶ added in v0.12.0
type KnownOtelTracesDataSourceStreams string
const ( // KnownOtelTracesDataSourceStreamsMicrosoftOTelTracesEvents - Microsoft-OTel-Traces-Events KnownOtelTracesDataSourceStreamsMicrosoftOTelTracesEvents KnownOtelTracesDataSourceStreams = "Microsoft-OTel-Traces-Events" // KnownOtelTracesDataSourceStreamsMicrosoftOTelTracesResources - Microsoft-OTel-Traces-Resources KnownOtelTracesDataSourceStreamsMicrosoftOTelTracesResources KnownOtelTracesDataSourceStreams = "Microsoft-OTel-Traces-Resources" // KnownOtelTracesDataSourceStreamsMicrosoftOTelTracesSpans - Microsoft-OTel-Traces-Spans KnownOtelTracesDataSourceStreamsMicrosoftOTelTracesSpans KnownOtelTracesDataSourceStreams = "Microsoft-OTel-Traces-Spans" )
func PossibleKnownOtelTracesDataSourceStreamsValues ¶ added in v0.12.0
func PossibleKnownOtelTracesDataSourceStreamsValues() []KnownOtelTracesDataSourceStreams
PossibleKnownOtelTracesDataSourceStreamsValues returns the possible values for the KnownOtelTracesDataSourceStreams const type.
type KnownOtelTracesDirectDataSourceStreams ¶ added in v0.12.0
type KnownOtelTracesDirectDataSourceStreams string
const ( // KnownOtelTracesDirectDataSourceStreamsMicrosoftOTelTracesEvents - Microsoft-OTel-Traces-Events KnownOtelTracesDirectDataSourceStreamsMicrosoftOTelTracesEvents KnownOtelTracesDirectDataSourceStreams = "Microsoft-OTel-Traces-Events" // KnownOtelTracesDirectDataSourceStreamsMicrosoftOTelTracesResources - Microsoft-OTel-Traces-Resources KnownOtelTracesDirectDataSourceStreamsMicrosoftOTelTracesResources KnownOtelTracesDirectDataSourceStreams = "Microsoft-OTel-Traces-Resources" // KnownOtelTracesDirectDataSourceStreamsMicrosoftOTelTracesSpans - Microsoft-OTel-Traces-Spans KnownOtelTracesDirectDataSourceStreamsMicrosoftOTelTracesSpans KnownOtelTracesDirectDataSourceStreams = "Microsoft-OTel-Traces-Spans" )
func PossibleKnownOtelTracesDirectDataSourceStreamsValues ¶ added in v0.12.0
func PossibleKnownOtelTracesDirectDataSourceStreamsValues() []KnownOtelTracesDirectDataSourceStreams
PossibleKnownOtelTracesDirectDataSourceStreamsValues returns the possible values for the KnownOtelTracesDirectDataSourceStreams const type.
type KnownPerfCounterDataSourceStreams ¶
type KnownPerfCounterDataSourceStreams string
const ( // KnownPerfCounterDataSourceStreamsMicrosoftInsightsMetrics - Microsoft-InsightsMetrics KnownPerfCounterDataSourceStreamsMicrosoftInsightsMetrics KnownPerfCounterDataSourceStreams = "Microsoft-InsightsMetrics" // KnownPerfCounterDataSourceStreamsMicrosoftPerf - Microsoft-Perf KnownPerfCounterDataSourceStreamsMicrosoftPerf KnownPerfCounterDataSourceStreams = "Microsoft-Perf" )
func PossibleKnownPerfCounterDataSourceStreamsValues ¶
func PossibleKnownPerfCounterDataSourceStreamsValues() []KnownPerfCounterDataSourceStreams
PossibleKnownPerfCounterDataSourceStreamsValues returns the possible values for the KnownPerfCounterDataSourceStreams const type.
type KnownPerformanceCountersOTelDataSourceStreams ¶ added in v0.12.0
type KnownPerformanceCountersOTelDataSourceStreams string
const ( // KnownPerformanceCountersOTelDataSourceStreamsMicrosoftOtelPerfMetrics - Microsoft-OtelPerfMetrics KnownPerformanceCountersOTelDataSourceStreamsMicrosoftOtelPerfMetrics KnownPerformanceCountersOTelDataSourceStreams = "Microsoft-OtelPerfMetrics" )
func PossibleKnownPerformanceCountersOTelDataSourceStreamsValues ¶ added in v0.12.0
func PossibleKnownPerformanceCountersOTelDataSourceStreamsValues() []KnownPerformanceCountersOTelDataSourceStreams
PossibleKnownPerformanceCountersOTelDataSourceStreamsValues returns the possible values for the KnownPerformanceCountersOTelDataSourceStreams const type.
type KnownPrometheusForwarderDataSourceStreams ¶ added in v0.9.0
type KnownPrometheusForwarderDataSourceStreams string
const ( // KnownPrometheusForwarderDataSourceStreamsMicrosoftPrometheusMetrics - Microsoft-PrometheusMetrics 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 - Disabled KnownPublicNetworkAccessOptionsDisabled KnownPublicNetworkAccessOptions = "Disabled" // KnownPublicNetworkAccessOptionsEnabled - Enabled KnownPublicNetworkAccessOptionsEnabled KnownPublicNetworkAccessOptions = "Enabled" // KnownPublicNetworkAccessOptionsSecuredByPerimeter - SecuredByPerimeter KnownPublicNetworkAccessOptionsSecuredByPerimeter KnownPublicNetworkAccessOptions = "SecuredByPerimeter" )
func PossibleKnownPublicNetworkAccessOptionsValues ¶
func PossibleKnownPublicNetworkAccessOptionsValues() []KnownPublicNetworkAccessOptions
PossibleKnownPublicNetworkAccessOptionsValues returns the possible values for the KnownPublicNetworkAccessOptions const type.
type KnownStorageBlobLookupType ¶ added in v0.12.0
type KnownStorageBlobLookupType string
KnownStorageBlobLookupType - The type of lookup to perform on the blob
const ( // KnownStorageBlobLookupTypeCidr - Cidr KnownStorageBlobLookupTypeCidr KnownStorageBlobLookupType = "Cidr" // KnownStorageBlobLookupTypeString - String KnownStorageBlobLookupTypeString KnownStorageBlobLookupType = "String" )
func PossibleKnownStorageBlobLookupTypeValues ¶ added in v0.12.0
func PossibleKnownStorageBlobLookupTypeValues() []KnownStorageBlobLookupType
PossibleKnownStorageBlobLookupTypeValues returns the possible values for the KnownStorageBlobLookupType const type.
type KnownSyslogDataSourceFacilityNames ¶
type KnownSyslogDataSourceFacilityNames string
const ( // KnownSyslogDataSourceFacilityNamesAlert - alert KnownSyslogDataSourceFacilityNamesAlert KnownSyslogDataSourceFacilityNames = "alert" // KnownSyslogDataSourceFacilityNamesAsterisk - * KnownSyslogDataSourceFacilityNamesAsterisk KnownSyslogDataSourceFacilityNames = "*" // KnownSyslogDataSourceFacilityNamesAudit - audit KnownSyslogDataSourceFacilityNamesAudit KnownSyslogDataSourceFacilityNames = "audit" // KnownSyslogDataSourceFacilityNamesAuth - auth KnownSyslogDataSourceFacilityNamesAuth KnownSyslogDataSourceFacilityNames = "auth" // KnownSyslogDataSourceFacilityNamesAuthpriv - authpriv KnownSyslogDataSourceFacilityNamesAuthpriv KnownSyslogDataSourceFacilityNames = "authpriv" // KnownSyslogDataSourceFacilityNamesClock - clock KnownSyslogDataSourceFacilityNamesClock KnownSyslogDataSourceFacilityNames = "clock" // KnownSyslogDataSourceFacilityNamesCron - cron KnownSyslogDataSourceFacilityNamesCron KnownSyslogDataSourceFacilityNames = "cron" // KnownSyslogDataSourceFacilityNamesDaemon - daemon KnownSyslogDataSourceFacilityNamesDaemon KnownSyslogDataSourceFacilityNames = "daemon" // KnownSyslogDataSourceFacilityNamesFtp - ftp KnownSyslogDataSourceFacilityNamesFtp KnownSyslogDataSourceFacilityNames = "ftp" // KnownSyslogDataSourceFacilityNamesKern - kern KnownSyslogDataSourceFacilityNamesKern KnownSyslogDataSourceFacilityNames = "kern" // KnownSyslogDataSourceFacilityNamesLocal0 - local0 KnownSyslogDataSourceFacilityNamesLocal0 KnownSyslogDataSourceFacilityNames = "local0" // KnownSyslogDataSourceFacilityNamesLocal1 - local1 KnownSyslogDataSourceFacilityNamesLocal1 KnownSyslogDataSourceFacilityNames = "local1" // KnownSyslogDataSourceFacilityNamesLocal2 - local2 KnownSyslogDataSourceFacilityNamesLocal2 KnownSyslogDataSourceFacilityNames = "local2" // KnownSyslogDataSourceFacilityNamesLocal3 - local3 KnownSyslogDataSourceFacilityNamesLocal3 KnownSyslogDataSourceFacilityNames = "local3" // KnownSyslogDataSourceFacilityNamesLocal4 - local4 KnownSyslogDataSourceFacilityNamesLocal4 KnownSyslogDataSourceFacilityNames = "local4" // KnownSyslogDataSourceFacilityNamesLocal5 - local5 KnownSyslogDataSourceFacilityNamesLocal5 KnownSyslogDataSourceFacilityNames = "local5" // KnownSyslogDataSourceFacilityNamesLocal6 - local6 KnownSyslogDataSourceFacilityNamesLocal6 KnownSyslogDataSourceFacilityNames = "local6" // KnownSyslogDataSourceFacilityNamesLocal7 - local7 KnownSyslogDataSourceFacilityNamesLocal7 KnownSyslogDataSourceFacilityNames = "local7" // KnownSyslogDataSourceFacilityNamesLpr - lpr KnownSyslogDataSourceFacilityNamesLpr KnownSyslogDataSourceFacilityNames = "lpr" // KnownSyslogDataSourceFacilityNamesMail - mail KnownSyslogDataSourceFacilityNamesMail KnownSyslogDataSourceFacilityNames = "mail" // KnownSyslogDataSourceFacilityNamesMark - mark KnownSyslogDataSourceFacilityNamesMark KnownSyslogDataSourceFacilityNames = "mark" // KnownSyslogDataSourceFacilityNamesNews - news KnownSyslogDataSourceFacilityNamesNews KnownSyslogDataSourceFacilityNames = "news" // KnownSyslogDataSourceFacilityNamesNopri - nopri KnownSyslogDataSourceFacilityNamesNopri KnownSyslogDataSourceFacilityNames = "nopri" // KnownSyslogDataSourceFacilityNamesNtp - ntp KnownSyslogDataSourceFacilityNamesNtp KnownSyslogDataSourceFacilityNames = "ntp" // KnownSyslogDataSourceFacilityNamesSyslog - syslog KnownSyslogDataSourceFacilityNamesSyslog KnownSyslogDataSourceFacilityNames = "syslog" // KnownSyslogDataSourceFacilityNamesUser - user KnownSyslogDataSourceFacilityNamesUser KnownSyslogDataSourceFacilityNames = "user" // KnownSyslogDataSourceFacilityNamesUucp - uucp 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 - Alert KnownSyslogDataSourceLogLevelsAlert KnownSyslogDataSourceLogLevels = "Alert" // KnownSyslogDataSourceLogLevelsAsterisk - * KnownSyslogDataSourceLogLevelsAsterisk KnownSyslogDataSourceLogLevels = "*" // KnownSyslogDataSourceLogLevelsCritical - Critical KnownSyslogDataSourceLogLevelsCritical KnownSyslogDataSourceLogLevels = "Critical" // KnownSyslogDataSourceLogLevelsDebug - Debug KnownSyslogDataSourceLogLevelsDebug KnownSyslogDataSourceLogLevels = "Debug" // KnownSyslogDataSourceLogLevelsEmergency - Emergency KnownSyslogDataSourceLogLevelsEmergency KnownSyslogDataSourceLogLevels = "Emergency" // KnownSyslogDataSourceLogLevelsError - Error KnownSyslogDataSourceLogLevelsError KnownSyslogDataSourceLogLevels = "Error" // KnownSyslogDataSourceLogLevelsInfo - Info KnownSyslogDataSourceLogLevelsInfo KnownSyslogDataSourceLogLevels = "Info" // KnownSyslogDataSourceLogLevelsNotice - Notice KnownSyslogDataSourceLogLevelsNotice KnownSyslogDataSourceLogLevels = "Notice" // KnownSyslogDataSourceLogLevelsWarning - Warning 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 - Microsoft-Syslog 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 - Microsoft-Event KnownWindowsEventLogDataSourceStreamsMicrosoftEvent KnownWindowsEventLogDataSourceStreams = "Microsoft-Event" // KnownWindowsEventLogDataSourceStreamsMicrosoftWindowsEvent - Microsoft-WindowsEvent KnownWindowsEventLogDataSourceStreamsMicrosoftWindowsEvent KnownWindowsEventLogDataSourceStreams = "Microsoft-WindowsEvent" )
func PossibleKnownWindowsEventLogDataSourceStreamsValues ¶
func PossibleKnownWindowsEventLogDataSourceStreamsValues() []KnownWindowsEventLogDataSourceStreams
PossibleKnownWindowsEventLogDataSourceStreamsValues returns the possible values for the KnownWindowsEventLogDataSourceStreams const type.
type KnownWindowsFirewallLogsDataSourceProfileFilter ¶ added in v0.12.0
type KnownWindowsFirewallLogsDataSourceProfileFilter string
const ( // KnownWindowsFirewallLogsDataSourceProfileFilterDomain - Domain KnownWindowsFirewallLogsDataSourceProfileFilterDomain KnownWindowsFirewallLogsDataSourceProfileFilter = "Domain" // KnownWindowsFirewallLogsDataSourceProfileFilterPrivate - Private KnownWindowsFirewallLogsDataSourceProfileFilterPrivate KnownWindowsFirewallLogsDataSourceProfileFilter = "Private" // KnownWindowsFirewallLogsDataSourceProfileFilterPublic - Public KnownWindowsFirewallLogsDataSourceProfileFilterPublic KnownWindowsFirewallLogsDataSourceProfileFilter = "Public" )
func PossibleKnownWindowsFirewallLogsDataSourceProfileFilterValues ¶ added in v0.12.0
func PossibleKnownWindowsFirewallLogsDataSourceProfileFilterValues() []KnownWindowsFirewallLogsDataSourceProfileFilter
PossibleKnownWindowsFirewallLogsDataSourceProfileFilterValues returns the possible values for the KnownWindowsFirewallLogsDataSourceProfileFilter 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 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 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 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
// The KQL query to transform the data source. This is a deprecated property and will be removed in future versions.
TransformKql *string
}
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
// the URL to get the next set of results.
NextLink *string
}
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; The geo-location where the resource lives
Location *string
// REQUIRED; The log profile properties of the resource.
Properties *LogProfileProperties
// 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
}
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.
Generated from API version 2016-03-01
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. The value must be an UUID.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - Contains optional client configuration. 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.
- 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: 2016-03-01/createOrUpdateLogProfile.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("df602c9c-7aa0-407d-a6fb-eb20c8bd1192", 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(""),
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{},
}, 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 = armmonitor.LogProfilesClientCreateOrUpdateResponse{
// 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.
- logProfileName - The name of the log profile.
- options - LogProfilesClientDeleteOptions contains the optional parameters for the LogProfilesClient.Delete method.
Example ¶
Generated from example definition: 2016-03-01/deleteLogProfile.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("b67f7fec-69fc-4974-9099-a26bd6ffeda3", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewLogProfilesClient().Delete(ctx, "Rac46PostSwapRG", 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 = armmonitor.LogProfilesClientDeleteResponse{
// }
}
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.
- logProfileName - The name of the log profile.
- options - LogProfilesClientGetOptions contains the optional parameters for the LogProfilesClient.Get method.
Example ¶
Generated from example definition: 2016-03-01/getLogProfile.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("df602c9c-7aa0-407d-a6fb-eb20c8bd1192", 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 = armmonitor.LogProfilesClientGetResponse{
// 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.
- options - LogProfilesClientListOptions contains the optional parameters for the LogProfilesClient.NewListPager method.
Example ¶
Generated from example definition: 2016-03-01/listLogProfile.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("df602c9c-7aa0-407d-a6fb-eb20c8bd1192", 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 = armmonitor.LogProfilesClientListResponse{
// 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.
- 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: 2016-03-01/patchLogProfile.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("df602c9c-7aa0-407d-a6fb-eb20c8bd1192", 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 = armmonitor.LogProfilesClientUpdateResponse{
// 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"),
// },
// Tags: map[string]*string{
// "key1": to.Ptr("value1"),
// },
// },
// }
}
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
// 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
// The principal id of the managed identity. The value can be "None", "SystemAssigned"
ManagedIdentity *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 ManagedServiceIdentity ¶ added in v0.9.0
type ManagedServiceIdentity struct {
// REQUIRED; The type of managed identity assigned to this resource.
Type *ManagedServiceIdentityType
// The identities assigned to this resource by the user.
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 - No managed identity. ManagedServiceIdentityTypeNone ManagedServiceIdentityType = "None" // ManagedServiceIdentityTypeSystemAssigned - System assigned managed identity. ManagedServiceIdentityTypeSystemAssigned ManagedServiceIdentityType = "SystemAssigned" // ManagedServiceIdentityTypeSystemAssignedUserAssigned - System and user assigned managed identity. ManagedServiceIdentityTypeSystemAssignedUserAssigned ManagedServiceIdentityType = "SystemAssigned,UserAssigned" // ManagedServiceIdentityTypeUserAssigned - User assigned managed identity. ManagedServiceIdentityTypeUserAssigned ManagedServiceIdentityType = "UserAssigned" )
func PossibleManagedServiceIdentityTypeValues ¶ added in v0.9.0
func PossibleManagedServiceIdentityTypeValues() []ManagedServiceIdentityType
PossibleManagedServiceIdentityTypeValues returns the possible values for the ManagedServiceIdentityType const type.
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 *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
}
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 - Average MetricAggregationTypeAverage MetricAggregationType = "Average" // MetricAggregationTypeCount - Count MetricAggregationTypeCount MetricAggregationType = "Count" // MetricAggregationTypeMaximum - Maximum MetricAggregationTypeMaximum MetricAggregationType = "Maximum" // MetricAggregationTypeMinimum - Minimum MetricAggregationTypeMinimum MetricAggregationType = "Minimum" // MetricAggregationTypeNone - None MetricAggregationTypeNone MetricAggregationType = "None" // MetricAggregationTypeTotal - Total 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. Previously undocumented values might be returned
ODataType *Odatatype
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, - *PromQLCriteria, *WebtestLocationAvailabilityCriteria
type MetricAlertMultipleResourceMultipleMetricCriteria ¶
type MetricAlertMultipleResourceMultipleMetricCriteria struct {
// CONSTANT; Specifies the type of the alert criteria. Previously undocumented values might be returned
// Field has constant value OdatatypeMicrosoftAzureMonitorMultipleResourceMultipleMetricCriteria, any specified value is ignored.
ODataType *Odatatype
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. You cannot change the scope of a metric rule based
// on logs.
Scopes []*string
// REQUIRED; Alert severity {0, 1, 2, 3, 4}
Severity *int32
// The properties of an action properties.
ActionProperties map[string]*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 properties of an alert payload.
CustomProperties map[string]*string
// The description of the metric alert that will be included in the alert email.
Description *string
// The configuration for how the alert is resolved. Applicable for PromQLCriteria.
ResolveConfiguration *ResolveConfiguration
// 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
// 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
}
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 properties of an action properties.
ActionProperties map[string]*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
// Defines the specific alert criteria information.
Criteria MetricAlertCriteriaClassification
// The properties of an alert payload.
CustomProperties map[string]*string
// 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 configuration for how the alert is resolved. Applicable for PromQLCriteria.
ResolveConfiguration *ResolveConfiguration
// 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; The geo-location where the resource lives
Location *string
// REQUIRED; The alert rule properties of the resource.
Properties *MetricAlertProperties
// The identity of the resource.
Identity *Identity
// 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
}
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 URL to get the next set of results.
NextLink *string
// 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 identity of the resource.
Identity *Identity
// 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 {
// CONSTANT; Specifies the type of the alert criteria. Previously undocumented values might be returned
// Field has constant value OdatatypeMicrosoftAzureMonitorSingleResourceMultipleMetricCriteria, any specified value is ignored.
ODataType *Odatatype
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.
Generated from API version 2024-03-01-preview
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. The value must be an UUID.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - Contains optional client configuration. 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.
- 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: 2024-03-01-preview/createOrUpdateDynamicMetricAlertMultipleResource.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("00000000-0000-0000-0000-000000000000", 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"),
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{
AllOf: []armmonitor.MultiMetricCriteriaClassification{
&armmonitor.DynamicMetricCriteria{
Name: to.Ptr("High_CPU_80"),
AlertSensitivity: to.Ptr(armmonitor.DynamicThresholdSensitivityMedium),
CriterionType: to.Ptr(armmonitor.CriterionTypeDynamicThresholdCriterion),
Dimensions: []*armmonitor.MetricDimension{},
FailingPeriods: &armmonitor.DynamicThresholdFailingPeriods{
MinFailingPeriodsToAlert: to.Ptr[float32](4),
NumberOfEvaluationPeriods: to.Ptr[float32](4),
},
MetricName: to.Ptr("Percentage CPU"),
MetricNamespace: to.Ptr("microsoft.compute/virtualmachines"),
Operator: to.Ptr(armmonitor.DynamicThresholdOperatorGreaterOrLessThan),
TimeAggregation: to.Ptr(armmonitor.AggregationTypeEnumAverage),
},
},
ODataType: to.Ptr(armmonitor.OdatatypeMicrosoftAzureMonitorMultipleResourceMultipleMetricCriteria),
},
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"),
},
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 = armmonitor.MetricAlertsClientCreateOrUpdateResponse{
// 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"),
// 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{
// AllOf: []armmonitor.MultiMetricCriteriaClassification{
// &armmonitor.DynamicMetricCriteria{
// Name: to.Ptr("High_CPU_80"),
// AlertSensitivity: to.Ptr(armmonitor.DynamicThresholdSensitivityMedium),
// CriterionType: to.Ptr(armmonitor.CriterionTypeDynamicThresholdCriterion),
// Dimensions: []*armmonitor.MetricDimension{
// },
// FailingPeriods: &armmonitor.DynamicThresholdFailingPeriods{
// MinFailingPeriodsToAlert: to.Ptr[float32](4),
// NumberOfEvaluationPeriods: to.Ptr[float32](4),
// },
// MetricName: to.Ptr("Percentage CPU"),
// MetricNamespace: to.Ptr("microsoft.compute/virtualmachines"),
// Operator: to.Ptr(armmonitor.DynamicThresholdOperatorGreaterOrLessThan),
// TimeAggregation: to.Ptr(armmonitor.AggregationTypeEnumAverage),
// },
// },
// ODataType: to.Ptr(armmonitor.OdatatypeMicrosoftAzureMonitorMultipleResourceMultipleMetricCriteria),
// },
// 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"),
// },
// Tags: map[string]*string{
// "hidden-link:/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/leoalerttest": to.Ptr("Resource"),
// },
// },
// }
}
Output:
Example (CreateOrUpdateADynamicAlertRuleForSingleResource) ¶
Generated from example definition: 2024-03-01-preview/createOrUpdateDynamicMetricAlertSingleResource.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
"time"
)
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("00000000-0000-0000-0000-000000000000", 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"),
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{
AllOf: []armmonitor.MultiMetricCriteriaClassification{
&armmonitor.DynamicMetricCriteria{
Name: to.Ptr("High_CPU_80"),
AlertSensitivity: to.Ptr(armmonitor.DynamicThresholdSensitivityMedium),
CriterionType: to.Ptr(armmonitor.CriterionTypeDynamicThresholdCriterion),
Dimensions: []*armmonitor.MetricDimension{},
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 }()),
MetricName: to.Ptr("Percentage CPU"),
MetricNamespace: to.Ptr("microsoft.compute/virtualmachines"),
Operator: to.Ptr(armmonitor.DynamicThresholdOperatorGreaterOrLessThan),
TimeAggregation: to.Ptr(armmonitor.AggregationTypeEnumAverage),
},
},
ODataType: to.Ptr(armmonitor.OdatatypeMicrosoftAzureMonitorMultipleResourceMultipleMetricCriteria),
},
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"),
},
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 = armmonitor.MetricAlertsClientCreateOrUpdateResponse{
// 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"),
// 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{
// AllOf: []armmonitor.MultiMetricCriteriaClassification{
// &armmonitor.DynamicMetricCriteria{
// Name: to.Ptr("High_CPU_80"),
// AlertSensitivity: to.Ptr(armmonitor.DynamicThresholdSensitivityMedium),
// CriterionType: to.Ptr(armmonitor.CriterionTypeDynamicThresholdCriterion),
// Dimensions: []*armmonitor.MetricDimension{
// },
// 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}()),
// MetricName: to.Ptr("Percentage CPU"),
// MetricNamespace: to.Ptr("microsoft.compute/virtualmachines"),
// Operator: to.Ptr(armmonitor.DynamicThresholdOperatorGreaterOrLessThan),
// TimeAggregation: to.Ptr(armmonitor.AggregationTypeEnumAverage),
// },
// },
// ODataType: to.Ptr(armmonitor.OdatatypeMicrosoftAzureMonitorMultipleResourceMultipleMetricCriteria),
// },
// 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"),
// },
// Tags: map[string]*string{
// "hidden-link:/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/leoalerttest": to.Ptr("Resource"),
// },
// },
// }
}
Output:
Example (CreateOrUpdateAQueryBasedAlertRule) ¶
Generated from example definition: 2024-03-01-preview/createOrUpdateMetricAlertQuery.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewMetricAlertsClient().CreateOrUpdate(ctx, "gigtest", "chiricutin", armmonitor.MetricAlertResource{
Identity: &armmonitor.Identity{
Type: to.Ptr(armmonitor.IdentityTypeUserAssigned),
UserAssignedIdentities: map[string]*armmonitor.UserIdentityProperties{
"/subscriptions/2f1a501a-6e1d-4f37-a445-462d7f8a563d/resourceGroups/AdisTest/providers/Microsoft.ManagedIdentity/userAssignedIdentities/msi-test-euap": {},
},
},
Location: to.Ptr("eastus"),
Properties: &armmonitor.MetricAlertProperties{
Description: to.Ptr("This is the description of the rule1"),
ActionProperties: map[string]*string{
"Email.Sujbect": to.Ptr("my custom email subject"),
},
Actions: []*armmonitor.MetricAlertAction{
{
ActionGroupID: to.Ptr("/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2"),
},
},
Criteria: &armmonitor.PromQLCriteria{
AllOf: []armmonitor.MultiPromQLCriteriaClassification{
&armmonitor.StaticPromQLCriteria{
Name: to.Ptr("Metric1"),
CriterionType: to.Ptr(armmonitor.CriterionTypeStaticThresholdCriterion),
Query: to.Ptr("avg({\"system.cpu.utilization\"}) > 90"),
},
},
FailingPeriods: &armmonitor.QueryFailingPeriods{
For: to.Ptr("PT5M"),
},
ODataType: to.Ptr(armmonitor.OdatatypeMicrosoftAzureMonitorPromQLCriteria),
},
CustomProperties: map[string]*string{
"key11": to.Ptr("value11"),
"key12": to.Ptr("value12"),
},
Enabled: to.Ptr(true),
EvaluationFrequency: to.Ptr("PT1M"),
ResolveConfiguration: &armmonitor.ResolveConfiguration{
AutoResolved: to.Ptr(true),
TimeToResolve: to.Ptr("PT10M"),
},
Scopes: []*string{
to.Ptr("/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/microsoft.monitor/accounts/gigwadme"),
},
Severity: to.Ptr[int32](3),
},
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 = armmonitor.MetricAlertsClientCreateOrUpdateResponse{
// 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"),
// Identity: &armmonitor.Identity{
// Type: to.Ptr(armmonitor.IdentityTypeUserAssigned),
// TenantID: to.Ptr("72f988bf-86f1-41af-91ab-2d7cd011db47"),
// UserAssignedIdentities: map[string]*armmonitor.UserIdentityProperties{
// "/subscriptions/2f1a501a-6e1d-4f37-a445-462d7f8a563d/resourceGroups/AdisTest/providers/Microsoft.ManagedIdentity/userAssignedIdentities/msi-test-euap": &armmonitor.UserIdentityProperties{
// ClientID: to.Ptr("778f4d04-3c60-4622-a839-5cf05866c983"),
// PrincipalID: to.Ptr("669dd76d-cde8-4dc3-b882-1de566b0c628"),
// },
// },
// },
// Location: to.Ptr("eastus"),
// Properties: &armmonitor.MetricAlertProperties{
// Description: to.Ptr("This is the description of the rule1"),
// ActionProperties: map[string]*string{
// "Email.Sujbect": to.Ptr("my custom email subject"),
// },
// Actions: []*armmonitor.MetricAlertAction{
// {
// ActionGroupID: to.Ptr("/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2"),
// },
// },
// Criteria: &armmonitor.PromQLCriteria{
// AllOf: []armmonitor.MultiPromQLCriteriaClassification{
// &armmonitor.StaticPromQLCriteria{
// Name: to.Ptr("Metric1"),
// CriterionType: to.Ptr(armmonitor.CriterionTypeStaticThresholdCriterion),
// Query: to.Ptr("avg({\"system.cpu.utilization\"}) > 90"),
// },
// },
// FailingPeriods: &armmonitor.QueryFailingPeriods{
// For: to.Ptr("PT2M"),
// },
// ODataType: to.Ptr(armmonitor.OdatatypeMicrosoftAzureMonitorPromQLCriteria),
// },
// CustomProperties: map[string]*string{
// "key11": to.Ptr("value11"),
// "key12": to.Ptr("value12"),
// },
// Enabled: to.Ptr(true),
// EvaluationFrequency: to.Ptr("PT1M"),
// ResolveConfiguration: &armmonitor.ResolveConfiguration{
// AutoResolved: to.Ptr(true),
// TimeToResolve: to.Ptr("PT10M"),
// },
// Scopes: []*string{
// to.Ptr("/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/microsoft.monitor/accounts/gigwadme"),
// },
// Severity: to.Ptr[int32](3),
// },
// Tags: map[string]*string{
// "hidden-link:/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/leoalerttest": to.Ptr("Resource"),
// },
// },
// }
}
Output:
Example (CreateOrUpdateAQueryBasedAlertRuleWithDynamicThreshold) ¶
Generated from example definition: 2024-03-01-preview/createOrUpdateMetricAlertQueryDT.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
"time"
)
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("14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewMetricAlertsClient().CreateOrUpdate(ctx, "gigtest", "chiricutin", armmonitor.MetricAlertResource{
Identity: &armmonitor.Identity{
Type: to.Ptr(armmonitor.IdentityTypeUserAssigned),
UserAssignedIdentities: map[string]*armmonitor.UserIdentityProperties{
"/subscriptions/2f1a501a-6e1d-4f37-a445-462d7f8a563d/resourceGroups/AdisTest/providers/Microsoft.ManagedIdentity/userAssignedIdentities/msi-test-euap": {},
},
},
Location: to.Ptr("eastus"),
Properties: &armmonitor.MetricAlertProperties{
Description: to.Ptr("This is the description of the rule1"),
ActionProperties: map[string]*string{
"Email.Sujbect": to.Ptr("my custom email subject"),
},
Actions: []*armmonitor.MetricAlertAction{
{
ActionGroupID: to.Ptr("/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2"),
},
},
Criteria: &armmonitor.PromQLCriteria{
AllOf: []armmonitor.MultiPromQLCriteriaClassification{
&armmonitor.DynamicPromQLCriteria{
Name: to.Ptr("Metric1"),
AlertSensitivity: to.Ptr(armmonitor.DynamicThresholdSensitivityMedium),
CriterionType: to.Ptr(armmonitor.CriterionTypeDynamicThresholdCriterion),
IgnoreDataBefore: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-04-04T21:00:00.000Z"); return t }()),
Operator: to.Ptr(armmonitor.DynamicThresholdOperatorLessThan),
Query: to.Ptr("avg({\"system.cpu.utilization\"})"),
},
},
FailingPeriods: &armmonitor.QueryFailingPeriods{
For: to.Ptr("PT5M"),
},
ODataType: to.Ptr(armmonitor.OdatatypeMicrosoftAzureMonitorPromQLCriteria),
},
CustomProperties: map[string]*string{
"key11": to.Ptr("value11"),
"key12": to.Ptr("value12"),
},
Enabled: to.Ptr(true),
EvaluationFrequency: to.Ptr("PT1M"),
ResolveConfiguration: &armmonitor.ResolveConfiguration{
AutoResolved: to.Ptr(true),
TimeToResolve: to.Ptr("PT10M"),
},
Scopes: []*string{
to.Ptr("/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/microsoft.monitor/accounts/gigwadme"),
},
Severity: to.Ptr[int32](3),
},
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 = armmonitor.MetricAlertsClientCreateOrUpdateResponse{
// 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"),
// Identity: &armmonitor.Identity{
// Type: to.Ptr(armmonitor.IdentityTypeUserAssigned),
// TenantID: to.Ptr("72f988bf-86f1-41af-91ab-2d7cd011db47"),
// UserAssignedIdentities: map[string]*armmonitor.UserIdentityProperties{
// "/subscriptions/2f1a501a-6e1d-4f37-a445-462d7f8a563d/resourceGroups/AdisTest/providers/Microsoft.ManagedIdentity/userAssignedIdentities/msi-test-euap": &armmonitor.UserIdentityProperties{
// ClientID: to.Ptr("778f4d04-3c60-4622-a839-5cf05866c983"),
// PrincipalID: to.Ptr("669dd76d-cde8-4dc3-b882-1de566b0c628"),
// },
// },
// },
// Location: to.Ptr("eastus"),
// Properties: &armmonitor.MetricAlertProperties{
// Description: to.Ptr("This is the description of the rule1"),
// ActionProperties: map[string]*string{
// "Email.Sujbect": to.Ptr("my custom email subject"),
// },
// Actions: []*armmonitor.MetricAlertAction{
// {
// ActionGroupID: to.Ptr("/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2"),
// },
// },
// Criteria: &armmonitor.PromQLCriteria{
// AllOf: []armmonitor.MultiPromQLCriteriaClassification{
// &armmonitor.DynamicPromQLCriteria{
// Name: to.Ptr("Metric1"),
// AlertSensitivity: to.Ptr(armmonitor.DynamicThresholdSensitivityMedium),
// CriterionType: to.Ptr(armmonitor.CriterionTypeDynamicThresholdCriterion),
// IgnoreDataBefore: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-04-04T21:00:00.000Z"); return t}()),
// Operator: to.Ptr(armmonitor.DynamicThresholdOperatorLessThan),
// Query: to.Ptr("avg({\"system.cpu.utilization\"})"),
// },
// },
// FailingPeriods: &armmonitor.QueryFailingPeriods{
// For: to.Ptr("PT2M"),
// },
// ODataType: to.Ptr(armmonitor.OdatatypeMicrosoftAzureMonitorPromQLCriteria),
// },
// CustomProperties: map[string]*string{
// "key11": to.Ptr("value11"),
// "key12": to.Ptr("value12"),
// },
// Enabled: to.Ptr(true),
// EvaluationFrequency: to.Ptr("PT1M"),
// ResolveConfiguration: &armmonitor.ResolveConfiguration{
// AutoResolved: to.Ptr(true),
// TimeToResolve: to.Ptr("PT10M"),
// },
// Scopes: []*string{
// to.Ptr("/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/microsoft.monitor/accounts/gigwadme"),
// },
// Severity: to.Ptr[int32](3),
// },
// Tags: map[string]*string{
// "hidden-link:/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/leoalerttest": to.Ptr("Resource"),
// },
// },
// }
}
Output:
Example (CreateOrUpdateAResourceCentricQueryBasedAlertRule) ¶
Generated from example definition: 2024-03-01-preview/createOrUpdateMetricAlertQueryResourceCentric.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewMetricAlertsClient().CreateOrUpdate(ctx, "gigtest", "chiricutin", armmonitor.MetricAlertResource{
Identity: &armmonitor.Identity{
Type: to.Ptr(armmonitor.IdentityTypeUserAssigned),
UserAssignedIdentities: map[string]*armmonitor.UserIdentityProperties{
"/subscriptions/2f1a501a-6e1d-4f37-a445-462d7f8a563d/resourceGroups/AdisTest/providers/Microsoft.ManagedIdentity/userAssignedIdentities/msi-test-euap": {},
},
},
Location: to.Ptr("eastus"),
Properties: &armmonitor.MetricAlertProperties{
Description: to.Ptr("This is the description of the rule1"),
ActionProperties: map[string]*string{
"Email.Sujbect": to.Ptr("my custom email subject"),
},
Actions: []*armmonitor.MetricAlertAction{
{
ActionGroupID: to.Ptr("/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2"),
},
},
Criteria: &armmonitor.PromQLCriteria{
AllOf: []armmonitor.MultiPromQLCriteriaClassification{
&armmonitor.StaticPromQLCriteria{
Name: to.Ptr("Metric1"),
CriterionType: to.Ptr(armmonitor.CriterionTypeStaticThresholdCriterion),
Query: to.Ptr("avg({\"system.cpu.utilization\"}) > 90"),
},
},
FailingPeriods: &armmonitor.QueryFailingPeriods{
For: to.Ptr("PT5M"),
},
ODataType: to.Ptr(armmonitor.OdatatypeMicrosoftAzureMonitorPromQLCriteria),
},
CustomProperties: map[string]*string{
"key11": to.Ptr("value11"),
"key12": to.Ptr("value12"),
},
Enabled: to.Ptr(true),
EvaluationFrequency: to.Ptr("PT1M"),
ResolveConfiguration: &armmonitor.ResolveConfiguration{
AutoResolved: to.Ptr(true),
TimeToResolve: to.Ptr("PT10M"),
},
Scopes: []*string{
to.Ptr("/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/microsoft.compute/virtualMachines/myVmName"),
},
Severity: to.Ptr[int32](3),
},
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 = armmonitor.MetricAlertsClientCreateOrUpdateResponse{
// 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"),
// Identity: &armmonitor.Identity{
// Type: to.Ptr(armmonitor.IdentityTypeUserAssigned),
// TenantID: to.Ptr("72f988bf-86f1-41af-91ab-2d7cd011db47"),
// UserAssignedIdentities: map[string]*armmonitor.UserIdentityProperties{
// "/subscriptions/2f1a501a-6e1d-4f37-a445-462d7f8a563d/resourceGroups/AdisTest/providers/Microsoft.ManagedIdentity/userAssignedIdentities/msi-test-euap": &armmonitor.UserIdentityProperties{
// ClientID: to.Ptr("778f4d04-3c60-4622-a839-5cf05866c983"),
// PrincipalID: to.Ptr("669dd76d-cde8-4dc3-b882-1de566b0c628"),
// },
// },
// },
// Location: to.Ptr("eastus"),
// Properties: &armmonitor.MetricAlertProperties{
// Description: to.Ptr("This is the description of the rule1"),
// ActionProperties: map[string]*string{
// "Email.Sujbect": to.Ptr("my custom email subject"),
// },
// Actions: []*armmonitor.MetricAlertAction{
// {
// ActionGroupID: to.Ptr("/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2"),
// },
// },
// Criteria: &armmonitor.PromQLCriteria{
// AllOf: []armmonitor.MultiPromQLCriteriaClassification{
// &armmonitor.StaticPromQLCriteria{
// Name: to.Ptr("Metric1"),
// CriterionType: to.Ptr(armmonitor.CriterionTypeStaticThresholdCriterion),
// Query: to.Ptr("avg({\"system.cpu.utilization\"}) > 90"),
// },
// },
// FailingPeriods: &armmonitor.QueryFailingPeriods{
// For: to.Ptr("PT2M"),
// },
// ODataType: to.Ptr(armmonitor.OdatatypeMicrosoftAzureMonitorPromQLCriteria),
// },
// CustomProperties: map[string]*string{
// "key11": to.Ptr("value11"),
// "key12": to.Ptr("value12"),
// },
// Enabled: to.Ptr(true),
// EvaluationFrequency: to.Ptr("PT1M"),
// ResolveConfiguration: &armmonitor.ResolveConfiguration{
// AutoResolved: to.Ptr(true),
// TimeToResolve: to.Ptr("PT10M"),
// },
// Scopes: []*string{
// to.Ptr("/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/microsoft.compute/virtualMachines/myVmName"),
// },
// Severity: to.Ptr[int32](3),
// },
// Tags: map[string]*string{
// "hidden-link:/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/leoalerttest": to.Ptr("Resource"),
// },
// },
// }
}
Output:
Example (CreateOrUpdateAResourceCentricQueryBasedAlertRuleForMultipleResources) ¶
Generated from example definition: 2024-03-01-preview/createOrUpdateMetricAlertQueryMultiResource.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewMetricAlertsClient().CreateOrUpdate(ctx, "gigtest", "chiricutin", armmonitor.MetricAlertResource{
Identity: &armmonitor.Identity{
Type: to.Ptr(armmonitor.IdentityTypeUserAssigned),
UserAssignedIdentities: map[string]*armmonitor.UserIdentityProperties{
"/subscriptions/2f1a501a-6e1d-4f37-a445-462d7f8a563d/resourceGroups/AdisTest/providers/Microsoft.ManagedIdentity/userAssignedIdentities/msi-test-euap": {},
},
},
Location: to.Ptr("eastus"),
Properties: &armmonitor.MetricAlertProperties{
Description: to.Ptr("This is the description of the rule1"),
ActionProperties: map[string]*string{
"Email.Sujbect": to.Ptr("my custom email subject"),
},
Actions: []*armmonitor.MetricAlertAction{
{
ActionGroupID: to.Ptr("/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2"),
},
},
Criteria: &armmonitor.PromQLCriteria{
AllOf: []armmonitor.MultiPromQLCriteriaClassification{
&armmonitor.StaticPromQLCriteria{
Name: to.Ptr("Metric1"),
CriterionType: to.Ptr(armmonitor.CriterionTypeStaticThresholdCriterion),
Query: to.Ptr("avg({\"system.cpu.utilization\"}) by (\"microsoft.resourceid\") > 90"),
},
},
FailingPeriods: &armmonitor.QueryFailingPeriods{
For: to.Ptr("PT5M"),
},
ODataType: to.Ptr(armmonitor.OdatatypeMicrosoftAzureMonitorPromQLCriteria),
},
CustomProperties: map[string]*string{
"key11": to.Ptr("value11"),
"key12": to.Ptr("value12"),
},
Enabled: to.Ptr(true),
EvaluationFrequency: to.Ptr("PT1M"),
ResolveConfiguration: &armmonitor.ResolveConfiguration{
AutoResolved: to.Ptr(true),
TimeToResolve: to.Ptr("PT10M"),
},
Scopes: []*string{
to.Ptr("/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"),
},
Severity: to.Ptr[int32](3),
},
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 = armmonitor.MetricAlertsClientCreateOrUpdateResponse{
// 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"),
// Identity: &armmonitor.Identity{
// Type: to.Ptr(armmonitor.IdentityTypeUserAssigned),
// TenantID: to.Ptr("72f988bf-86f1-41af-91ab-2d7cd011db47"),
// UserAssignedIdentities: map[string]*armmonitor.UserIdentityProperties{
// "/subscriptions/2f1a501a-6e1d-4f37-a445-462d7f8a563d/resourceGroups/AdisTest/providers/Microsoft.ManagedIdentity/userAssignedIdentities/msi-test-euap": &armmonitor.UserIdentityProperties{
// ClientID: to.Ptr("778f4d04-3c60-4622-a839-5cf05866c983"),
// PrincipalID: to.Ptr("669dd76d-cde8-4dc3-b882-1de566b0c628"),
// },
// },
// },
// Location: to.Ptr("eastus"),
// Properties: &armmonitor.MetricAlertProperties{
// Description: to.Ptr("This is the description of the rule1"),
// ActionProperties: map[string]*string{
// "Email.Sujbect": to.Ptr("my custom email subject"),
// },
// Actions: []*armmonitor.MetricAlertAction{
// {
// ActionGroupID: to.Ptr("/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2"),
// },
// },
// Criteria: &armmonitor.PromQLCriteria{
// AllOf: []armmonitor.MultiPromQLCriteriaClassification{
// &armmonitor.StaticPromQLCriteria{
// Name: to.Ptr("Metric1"),
// CriterionType: to.Ptr(armmonitor.CriterionTypeStaticThresholdCriterion),
// Query: to.Ptr("avg({\"system.cpu.utilization\"}) by (\"microsoft.resourceid\") > 90"),
// },
// },
// FailingPeriods: &armmonitor.QueryFailingPeriods{
// For: to.Ptr("PT2M"),
// },
// ODataType: to.Ptr(armmonitor.OdatatypeMicrosoftAzureMonitorPromQLCriteria),
// },
// CustomProperties: map[string]*string{
// "key11": to.Ptr("value11"),
// "key12": to.Ptr("value12"),
// },
// Enabled: to.Ptr(true),
// EvaluationFrequency: to.Ptr("PT1M"),
// ResolveConfiguration: &armmonitor.ResolveConfiguration{
// AutoResolved: to.Ptr(true),
// TimeToResolve: to.Ptr("PT10M"),
// },
// Scopes: []*string{
// to.Ptr("/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"),
// },
// Severity: to.Ptr[int32](3),
// },
// Tags: map[string]*string{
// "hidden-link:/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/leoalerttest": to.Ptr("Resource"),
// },
// },
// }
}
Output:
Example (CreateOrUpdateAWebTestAlertRule) ¶
Generated from example definition: 2024-03-01-preview/createOrUpdateWebTestMetricAlert.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("12345678-1234-1234-1234-123456789101", 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"),
Properties: &armmonitor.MetricAlertProperties{
Description: to.Ptr("Automatically created alert rule for availability test \"component-example\" a"),
Actions: []*armmonitor.MetricAlertAction{},
Criteria: &armmonitor.WebtestLocationAvailabilityCriteria{
ComponentID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/components/webtest-name-example"),
FailedLocationCount: to.Ptr[float32](2),
ODataType: to.Ptr(armmonitor.OdatatypeMicrosoftAzureMonitorWebtestLocationAvailabilityCriteria),
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"),
},
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"),
},
}, 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 = armmonitor.MetricAlertsClientCreateOrUpdateResponse{
// 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"),
// Properties: &armmonitor.MetricAlertProperties{
// Description: to.Ptr("Automatically created alert rule for availability test \"webtest-name-example\" a"),
// Actions: []*armmonitor.MetricAlertAction{
// },
// Criteria: &armmonitor.WebtestLocationAvailabilityCriteria{
// ComponentID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/components/component-example"),
// FailedLocationCount: to.Ptr[float32](2),
// ODataType: to.Ptr(armmonitor.OdatatypeMicrosoftAzureMonitorWebtestLocationAvailabilityCriteria),
// 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"),
// },
// 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"),
// },
// },
// }
}
Output:
Example (CreateOrUpdateAnAlertRuleForMultipleResource) ¶
Generated from example definition: 2024-03-01-preview/createOrUpdateMetricAlertMultipleResource.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7", 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"),
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{
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"),
Operator: to.Ptr(armmonitor.OperatorGreaterThan),
Threshold: to.Ptr[float64](80.5),
TimeAggregation: to.Ptr(armmonitor.AggregationTypeEnumAverage),
},
},
ODataType: to.Ptr(armmonitor.OdatatypeMicrosoftAzureMonitorMultipleResourceMultipleMetricCriteria),
},
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"),
},
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 = armmonitor.MetricAlertsClientCreateOrUpdateResponse{
// 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"),
// 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{
// 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"),
// Operator: to.Ptr(armmonitor.OperatorGreaterThan),
// Threshold: to.Ptr[float64](80.5),
// TimeAggregation: to.Ptr(armmonitor.AggregationTypeEnumAverage),
// },
// },
// ODataType: to.Ptr(armmonitor.OdatatypeMicrosoftAzureMonitorMultipleResourceMultipleMetricCriteria),
// },
// 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"),
// },
// Tags: map[string]*string{
// "hidden-link:/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/leoalerttest": to.Ptr("Resource"),
// },
// },
// }
}
Output:
Example (CreateOrUpdateAnAlertRuleForSingleResource) ¶
Generated from example definition: 2024-03-01-preview/createOrUpdateMetricAlertSingleResource.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7", 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"),
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{
AllOf: []*armmonitor.MetricCriteria{
{
Name: to.Ptr("High_CPU_80"),
CriterionType: to.Ptr(armmonitor.CriterionTypeStaticThresholdCriterion),
Dimensions: []*armmonitor.MetricDimension{},
MetricName: to.Ptr("\\Processor(_Total)\\% Processor Time"),
Operator: to.Ptr(armmonitor.OperatorGreaterThan),
Threshold: to.Ptr[float64](80.5),
TimeAggregation: to.Ptr(armmonitor.AggregationTypeEnumAverage),
},
},
ODataType: to.Ptr(armmonitor.OdatatypeMicrosoftAzureMonitorSingleResourceMultipleMetricCriteria),
},
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 = armmonitor.MetricAlertsClientCreateOrUpdateResponse{
// 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"),
// 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{
// AllOf: []*armmonitor.MetricCriteria{
// {
// Name: to.Ptr("High_CPU_80"),
// CriterionType: to.Ptr(armmonitor.CriterionTypeStaticThresholdCriterion),
// Dimensions: []*armmonitor.MetricDimension{
// },
// MetricName: to.Ptr("\\Processor(_Total)\\% Processor Time"),
// Operator: to.Ptr(armmonitor.OperatorGreaterThan),
// Threshold: to.Ptr[float64](80.5),
// TimeAggregation: to.Ptr(armmonitor.AggregationTypeEnumAverage),
// },
// },
// ODataType: to.Ptr(armmonitor.OdatatypeMicrosoftAzureMonitorSingleResourceMultipleMetricCriteria),
// },
// 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{
// "hidden-link:/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/leoalerttest": to.Ptr("Resource"),
// },
// },
// }
}
Output:
Example (CreateOrUpdateAnAlertRuleOnResourceGroupS) ¶
Generated from example definition: 2024-03-01-preview/createOrUpdateMetricAlertResourceGroup.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7", 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"),
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{
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"),
Operator: to.Ptr(armmonitor.OperatorGreaterThan),
Threshold: to.Ptr[float64](80.5),
TimeAggregation: to.Ptr(armmonitor.AggregationTypeEnumAverage),
},
},
ODataType: to.Ptr(armmonitor.OdatatypeMicrosoftAzureMonitorMultipleResourceMultipleMetricCriteria),
},
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"),
},
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 = armmonitor.MetricAlertsClientCreateOrUpdateResponse{
// 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"),
// 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{
// 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"),
// Operator: to.Ptr(armmonitor.OperatorGreaterThan),
// Threshold: to.Ptr[float64](80.5),
// TimeAggregation: to.Ptr(armmonitor.AggregationTypeEnumAverage),
// },
// },
// ODataType: to.Ptr(armmonitor.OdatatypeMicrosoftAzureMonitorMultipleResourceMultipleMetricCriteria),
// },
// 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"),
// },
// Tags: map[string]*string{
// "hidden-link:/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/leoalerttest": to.Ptr("Resource"),
// },
// },
// }
}
Output:
Example (CreateOrUpdateAnAlertRuleOnSubscription) ¶
Generated from example definition: 2024-03-01-preview/createOrUpdateMetricAlertSubscription.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7", 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"),
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{
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"),
Operator: to.Ptr(armmonitor.OperatorGreaterThan),
Threshold: to.Ptr[float64](80.5),
TimeAggregation: to.Ptr(armmonitor.AggregationTypeEnumAverage),
},
},
ODataType: to.Ptr(armmonitor.OdatatypeMicrosoftAzureMonitorMultipleResourceMultipleMetricCriteria),
},
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"),
},
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 = armmonitor.MetricAlertsClientCreateOrUpdateResponse{
// 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"),
// 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{
// 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"),
// Operator: to.Ptr(armmonitor.OperatorGreaterThan),
// Threshold: to.Ptr[float64](80.5),
// TimeAggregation: to.Ptr(armmonitor.AggregationTypeEnumAverage),
// },
// },
// ODataType: to.Ptr(armmonitor.OdatatypeMicrosoftAzureMonitorMultipleResourceMultipleMetricCriteria),
// },
// 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"),
// },
// Tags: map[string]*string{
// "hidden-link:/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/leoalerttest": to.Ptr("Resource"),
// },
// },
// }
}
Output:
Example (CreateOrUpdateAnAlertRulesWithDimensions) ¶
Generated from example definition: 2024-03-01-preview/createOrUpdateMetricAlertWithDimensions.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7", 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"),
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{
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"),
Operator: to.Ptr(armmonitor.OperatorGreaterThan),
Threshold: to.Ptr[float64](55),
TimeAggregation: to.Ptr(armmonitor.AggregationTypeEnumAverage),
},
},
ODataType: to.Ptr(armmonitor.OdatatypeMicrosoftAzureMonitorMultipleResourceMultipleMetricCriteria),
},
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"),
},
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 = armmonitor.MetricAlertsClientCreateOrUpdateResponse{
// 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"),
// 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{
// 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"),
// Operator: to.Ptr(armmonitor.OperatorGreaterThan),
// Threshold: to.Ptr[float64](55),
// TimeAggregation: to.Ptr(armmonitor.AggregationTypeEnumAverage),
// },
// },
// ODataType: to.Ptr(armmonitor.OdatatypeMicrosoftAzureMonitorMultipleResourceMultipleMetricCriteria),
// },
// 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"),
// },
// Tags: map[string]*string{
// "hidden-link:/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/leoalerttest": to.Ptr("Resource"),
// },
// },
// }
}
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.
- 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: 2024-03-01-preview/deleteMetricAlert.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewMetricAlertsClient().Delete(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 = armmonitor.MetricAlertsClientDeleteResponse{
// }
}
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.
- 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: 2024-03-01-preview/getDynamicMetricAlertMultipleResource.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("00000000-0000-0000-0000-000000000000", 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 = armmonitor.MetricAlertsClientGetResponse{
// 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"),
// 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{
// AllOf: []armmonitor.MultiMetricCriteriaClassification{
// &armmonitor.DynamicMetricCriteria{
// Name: to.Ptr("High_CPU_80"),
// AlertSensitivity: to.Ptr(armmonitor.DynamicThresholdSensitivityMedium),
// CriterionType: to.Ptr(armmonitor.CriterionTypeDynamicThresholdCriterion),
// Dimensions: []*armmonitor.MetricDimension{
// },
// FailingPeriods: &armmonitor.DynamicThresholdFailingPeriods{
// MinFailingPeriodsToAlert: to.Ptr[float32](4),
// NumberOfEvaluationPeriods: to.Ptr[float32](4),
// },
// MetricName: to.Ptr("Percentage CPU"),
// MetricNamespace: to.Ptr("microsoft.compute/virtualmachines"),
// Operator: to.Ptr(armmonitor.DynamicThresholdOperatorGreaterOrLessThan),
// TimeAggregation: to.Ptr(armmonitor.AggregationTypeEnumAverage),
// },
// },
// ODataType: to.Ptr(armmonitor.OdatatypeMicrosoftAzureMonitorMultipleResourceMultipleMetricCriteria),
// },
// 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"),
// },
// Tags: map[string]*string{
// "hidden-link:/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/leoalerttest": to.Ptr("Resource"),
// },
// },
// }
}
Output:
Example (GetADynamicAlertRuleForSingleResource) ¶
Generated from example definition: 2024-03-01-preview/getDynamicMetricAlertSingleResource.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("00000000-0000-0000-0000-000000000000", 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 = armmonitor.MetricAlertsClientGetResponse{
// 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"),
// 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{
// AllOf: []armmonitor.MultiMetricCriteriaClassification{
// &armmonitor.DynamicMetricCriteria{
// Name: to.Ptr("High_CPU_80"),
// AlertSensitivity: to.Ptr(armmonitor.DynamicThresholdSensitivityMedium),
// CriterionType: to.Ptr(armmonitor.CriterionTypeDynamicThresholdCriterion),
// Dimensions: []*armmonitor.MetricDimension{
// },
// FailingPeriods: &armmonitor.DynamicThresholdFailingPeriods{
// MinFailingPeriodsToAlert: to.Ptr[float32](4),
// NumberOfEvaluationPeriods: to.Ptr[float32](4),
// },
// MetricName: to.Ptr("Percentage CPU"),
// MetricNamespace: to.Ptr("microsoft.compute/virtualmachines"),
// Operator: to.Ptr(armmonitor.DynamicThresholdOperatorGreaterOrLessThan),
// TimeAggregation: to.Ptr(armmonitor.AggregationTypeEnumAverage),
// },
// },
// ODataType: to.Ptr(armmonitor.OdatatypeMicrosoftAzureMonitorMultipleResourceMultipleMetricCriteria),
// },
// 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"),
// },
// Tags: map[string]*string{
// "hidden-link:/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/leoalerttest": to.Ptr("Resource"),
// },
// },
// }
}
Output:
Example (GetAQueryBasedAlertRule) ¶
Generated from example definition: 2024-03-01-preview/getMetricAlertQuery.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7", 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 = armmonitor.MetricAlertsClientGetResponse{
// 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"),
// Identity: &armmonitor.Identity{
// Type: to.Ptr(armmonitor.IdentityTypeUserAssigned),
// TenantID: to.Ptr("72f988bf-86f1-41af-91ab-2d7cd011db47"),
// UserAssignedIdentities: map[string]*armmonitor.UserIdentityProperties{
// "/subscriptions/2f1a501a-6e1d-4f37-a445-462d7f8a563d/resourceGroups/AdisTest/providers/Microsoft.ManagedIdentity/userAssignedIdentities/msi-test-euap": &armmonitor.UserIdentityProperties{
// ClientID: to.Ptr("778f4d04-3c60-4622-a839-5cf05866c983"),
// PrincipalID: to.Ptr("669dd76d-cde8-4dc3-b882-1de566b0c628"),
// },
// },
// },
// Location: to.Ptr("eastus"),
// 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.PromQLCriteria{
// AllOf: []armmonitor.MultiPromQLCriteriaClassification{
// &armmonitor.StaticPromQLCriteria{
// Name: to.Ptr("Metric1"),
// CriterionType: to.Ptr(armmonitor.CriterionTypeStaticThresholdCriterion),
// Query: to.Ptr("floor(minute(vector(time())) / 10 ) % 2 == 1"),
// },
// },
// ODataType: to.Ptr(armmonitor.OdatatypeMicrosoftAzureMonitorPromQLCriteria),
// },
// Enabled: to.Ptr(true),
// EvaluationFrequency: to.Ptr("PT1M"),
// ResolveConfiguration: &armmonitor.ResolveConfiguration{
// AutoResolved: to.Ptr(true),
// TimeToResolve: to.Ptr("PT10M"),
// },
// Scopes: []*string{
// to.Ptr("/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/microsoft.monitor/accounts/gigwadme"),
// },
// Severity: to.Ptr[int32](3),
// },
// Tags: map[string]*string{
// "hidden-link:/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/leoalerttest": to.Ptr("Resource"),
// },
// },
// }
}
Output:
Example (GetAWebTestAlertRule) ¶
Generated from example definition: 2024-03-01-preview/getWebTestMetricAlert.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("12345678-1234-1234-1234-123456789101", 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 = armmonitor.MetricAlertsClientGetResponse{
// 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"),
// Properties: &armmonitor.MetricAlertProperties{
// Description: to.Ptr("Automatically created alert rule for availability test \"webtest-name-example\""),
// Actions: []*armmonitor.MetricAlertAction{
// },
// Criteria: &armmonitor.WebtestLocationAvailabilityCriteria{
// ComponentID: to.Ptr("/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/components/component-example"),
// FailedLocationCount: to.Ptr[float32](2),
// ODataType: to.Ptr(armmonitor.OdatatypeMicrosoftAzureMonitorWebtestLocationAvailabilityCriteria),
// 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"),
// },
// 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"),
// },
// },
// }
}
Output:
Example (GetAnAlertRuleForMultipleResources) ¶
Generated from example definition: 2024-03-01-preview/getMetricAlertMultipleResource.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7", 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 = armmonitor.MetricAlertsClientGetResponse{
// 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"),
// 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{
// 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"),
// Operator: to.Ptr(armmonitor.OperatorGreaterThan),
// Threshold: to.Ptr[float64](80.5),
// TimeAggregation: to.Ptr(armmonitor.AggregationTypeEnumAverage),
// },
// },
// ODataType: to.Ptr(armmonitor.OdatatypeMicrosoftAzureMonitorMultipleResourceMultipleMetricCriteria),
// },
// 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"),
// },
// Tags: map[string]*string{
// "hidden-link:/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/leoalerttest": to.Ptr("Resource"),
// },
// },
// }
}
Output:
Example (GetAnAlertRuleForSingleResource) ¶
Generated from example definition: 2024-03-01-preview/getMetricAlertSingleResource.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7", 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 = armmonitor.MetricAlertsClientGetResponse{
// 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"),
// 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{
// AllOf: []*armmonitor.MetricCriteria{
// {
// Name: to.Ptr("High_CPU_80"),
// CriterionType: to.Ptr(armmonitor.CriterionTypeStaticThresholdCriterion),
// Dimensions: []*armmonitor.MetricDimension{
// },
// MetricName: to.Ptr("\\Processor(_Total)\\% Processor Time"),
// Operator: to.Ptr(armmonitor.OperatorGreaterThan),
// Threshold: to.Ptr[float64](80.5),
// TimeAggregation: to.Ptr(armmonitor.AggregationTypeEnumAverage),
// },
// },
// ODataType: to.Ptr(armmonitor.OdatatypeMicrosoftAzureMonitorSingleResourceMultipleMetricCriteria),
// },
// 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{
// "hidden-link:/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/leoalerttest": to.Ptr("Resource"),
// },
// },
// }
}
Output:
Example (GetAnAlertRuleOnResourceGroupS) ¶
Generated from example definition: 2024-03-01-preview/getMetricAlertResourceGroup.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7", 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 = armmonitor.MetricAlertsClientGetResponse{
// 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"),
// 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{
// 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"),
// Operator: to.Ptr(armmonitor.OperatorGreaterThan),
// Threshold: to.Ptr[float64](80.5),
// TimeAggregation: to.Ptr(armmonitor.AggregationTypeEnumAverage),
// },
// },
// ODataType: to.Ptr(armmonitor.OdatatypeMicrosoftAzureMonitorMultipleResourceMultipleMetricCriteria),
// },
// 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"),
// },
// Tags: map[string]*string{
// "hidden-link:/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/leoalerttest": to.Ptr("Resource"),
// },
// },
// }
}
Output:
Example (GetAnAlertRuleOnSubscription) ¶
Generated from example definition: 2024-03-01-preview/getMetricAlertSubscription.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7", 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 = armmonitor.MetricAlertsClientGetResponse{
// 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"),
// 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{
// 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"),
// Operator: to.Ptr(armmonitor.OperatorGreaterThan),
// Threshold: to.Ptr[float64](80.5),
// TimeAggregation: to.Ptr(armmonitor.AggregationTypeEnumAverage),
// },
// },
// ODataType: to.Ptr(armmonitor.OdatatypeMicrosoftAzureMonitorMultipleResourceMultipleMetricCriteria),
// },
// 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"),
// },
// Tags: map[string]*string{
// "hidden-link:/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/leoalerttest": to.Ptr("Resource"),
// },
// },
// }
}
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.
- resourceGroupName - The name of the resource group. The name is case insensitive.
- options - MetricAlertsClientListByResourceGroupOptions contains the optional parameters for the MetricAlertsClient.NewListByResourceGroupPager method.
Example ¶
Generated from example definition: 2024-03-01-preview/listByResourceGroupMetricAlert.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewMetricAlertsClient().NewListByResourceGroupPager("gigtest", 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 = armmonitor.MetricAlertsClientListByResourceGroupResponse{
// 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"),
// 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{
// 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"),
// Operator: to.Ptr(armmonitor.OperatorGreaterThan),
// Threshold: to.Ptr[float64](80.5),
// TimeAggregation: to.Ptr(armmonitor.AggregationTypeEnumAverage),
// },
// },
// ODataType: to.Ptr(armmonitor.OdatatypeMicrosoftAzureMonitorSingleResourceMultipleMetricCriteria),
// },
// 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{
// "hidden-link:/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/leoalerttest": to.Ptr("Resource"),
// },
// },
// {
// 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"),
// 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{
// 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"),
// Operator: to.Ptr(armmonitor.OperatorGreaterThan),
// Threshold: to.Ptr[float64](50.5),
// TimeAggregation: to.Ptr(armmonitor.AggregationTypeEnumAverage),
// },
// },
// ODataType: to.Ptr(armmonitor.OdatatypeMicrosoftAzureMonitorSingleResourceMultipleMetricCriteria),
// },
// 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"),
// },
// Tags: map[string]*string{
// "hidden-link:/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/leoalerttest": to.Ptr("Resource"),
// },
// },
// },
// },
// }
}
}
Output:
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.
- options - MetricAlertsClientListBySubscriptionOptions contains the optional parameters for the MetricAlertsClient.NewListBySubscriptionPager method.
Example ¶
Generated from example definition: 2024-03-01-preview/listMetricAlert.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7", 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 = armmonitor.MetricAlertsClientListBySubscriptionResponse{
// 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"),
// 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{
// 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"),
// Operator: to.Ptr(armmonitor.OperatorGreaterThan),
// Threshold: to.Ptr[float64](80.5),
// TimeAggregation: to.Ptr(armmonitor.AggregationTypeEnumAverage),
// },
// },
// ODataType: to.Ptr(armmonitor.OdatatypeMicrosoftAzureMonitorSingleResourceMultipleMetricCriteria),
// },
// 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{
// "hidden-link:/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/leoalerttest": to.Ptr("Resource"),
// },
// },
// {
// 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"),
// 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{
// 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"),
// Operator: to.Ptr(armmonitor.OperatorGreaterThan),
// Threshold: to.Ptr[float64](50.5),
// TimeAggregation: to.Ptr(armmonitor.AggregationTypeEnumAverage),
// },
// },
// ODataType: to.Ptr(armmonitor.OdatatypeMicrosoftAzureMonitorSingleResourceMultipleMetricCriteria),
// },
// 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"),
// },
// Tags: map[string]*string{
// "hidden-link:/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/leoalerttest": to.Ptr("Resource"),
// },
// },
// },
// },
// }
}
}
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.
- 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: 2024-03-01-preview/UpdateMetricAlert.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7", 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{
AllOf: []*armmonitor.MetricCriteria{
{
Name: to.Ptr("High_CPU_80"),
CriterionType: to.Ptr(armmonitor.CriterionTypeStaticThresholdCriterion),
Dimensions: []*armmonitor.MetricDimension{},
MetricName: to.Ptr("\\Processor(_Total)\\% Processor Time"),
Operator: to.Ptr(armmonitor.OperatorGreaterThan),
Threshold: to.Ptr[float64](80.5),
TimeAggregation: to.Ptr(armmonitor.AggregationTypeEnumAverage),
},
},
ODataType: to.Ptr(armmonitor.OdatatypeMicrosoftAzureMonitorSingleResourceMultipleMetricCriteria),
},
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 = armmonitor.MetricAlertsClientUpdateResponse{
// 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"),
// 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{
// AllOf: []*armmonitor.MetricCriteria{
// {
// Name: to.Ptr("High_CPU_80"),
// CriterionType: to.Ptr(armmonitor.CriterionTypeStaticThresholdCriterion),
// Dimensions: []*armmonitor.MetricDimension{
// },
// MetricName: to.Ptr("\\Processor(_Total)\\% Processor Time"),
// Operator: to.Ptr(armmonitor.OperatorGreaterThan),
// Threshold: to.Ptr[float64](80.5),
// TimeAggregation: to.Ptr(armmonitor.AggregationTypeEnumAverage),
// },
// },
// ODataType: to.Ptr(armmonitor.OdatatypeMicrosoftAzureMonitorSingleResourceMultipleMetricCriteria),
// },
// 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{
// "hidden-link:/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/Rac46PostSwapRG/providers/Microsoft.Web/sites/leoalerttest": to.Ptr("Resource"),
// },
// },
// }
}
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.
Generated from API version 2024-03-01-preview
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. The value must be an UUID.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - Contains optional client configuration. 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.
- 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: 2024-03-01-preview/getMetricAlertStatus.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7", 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 = armmonitor.MetricAlertsStatusClientListResponse{
// 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.6293237Z"); 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.
- 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: 2024-03-01-preview/getMetricAlertStatusByName.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("009f6022-67ec-423e-9aa7-691182870588", 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 = armmonitor.MetricAlertsStatusClientListByNameResponse{
// 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.6293237Z"); 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 a supported 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 URL to get the next set of results.
NextLink *string
// 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 - Availability MetricClassAvailability MetricClass = "Availability" // MetricClassErrors - Errors MetricClassErrors MetricClass = "Errors" // MetricClassLatency - Latency MetricClassLatency MetricClass = "Latency" // MetricClassSaturation - Saturation MetricClassSaturation MetricClass = "Saturation" // MetricClassTransactions - Transactions MetricClassTransactions MetricClass = "Transactions" )
func PossibleMetricClassValues ¶
func PossibleMetricClassValues() []MetricClass
PossibleMetricClassValues returns the possible values for the MetricClass const type.
type MetricCriteria ¶
type MetricCriteria struct {
// CONSTANT; Specifies the type of threshold criteria. Previously undocumented values might be returned
// Field has constant value CriterionTypeStaticThresholdCriterion, any specified value is ignored.
CriterionType *CriterionType
// REQUIRED; Name of the metric.
MetricName *string
// REQUIRED; Name of the criteria.
Name *string
// REQUIRED; The criteria operator. Previously undocumented values might be returned
Operator *Operator
// REQUIRED; The criteria threshold value that activates the alert.
Threshold *float64
// REQUIRED; The criteria time aggregation types. Previously undocumented values might be returned
TimeAggregation *AggregationTypeEnum
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
// The link to the next page of items
NextLink *string
}
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.
Generated from API version 2024-02-01
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. The value must be an UUID.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - Contains optional client configuration. 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.
- 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: 2024-02-01/GetMultiResourceMetricDefinitions.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("92d2a2d8-b514-432d-8cc9-a5f9272630d5", 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 = armmonitor.MetricDefinitionsClientListAtSubscriptionScopeResponse{
// 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.
- resourceURI - The fully qualified Azure Resource manager identifier of the resource.
- options - MetricDefinitionsClientListOptions contains the optional parameters for the MetricDefinitionsClient.NewListPager method.
Example (GetApplicationInsightsMetricDefinitionsWithoutFilter) ¶
Generated from example definition: 2024-02-01/GetMetricDefinitionsApplicationInsights.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("<subscriptionID>", 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 = armmonitor.MetricDefinitionsClientListResponse{
// 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: 2024-02-01/GetMetricDefinitions.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("<subscriptionID>", 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 = armmonitor.MetricDefinitionsClientListResponse{
// 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: 2024-02-01/GetMetricDefinitionsMetricClass.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("<subscriptionID>", 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 = armmonitor.MetricDefinitionsClientListResponse{
// 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
// The link to the next page of items
NextLink *string
}
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.
Generated from API version 2024-02-01
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 - Contains optional client configuration. 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.
- resourceURI - The identifier of the resource.
- options - MetricNamespacesClientListOptions contains the optional parameters for the MetricNamespacesClient.NewListPager method.
Example ¶
Generated from example definition: 2024-02-01/GetMetricNamespaces.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("<subscriptionID>", 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 = armmonitor.MetricNamespacesClientListResponse{
// 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 - Data MetricResultTypeData MetricResultType = "Data" // MetricResultTypeMetadata - Metadata 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 timegrain is enabled.
Enabled *bool
// REQUIRED; the timegrain of the metric in ISO8601 format.
TimeGrain *string
// the retention policy for this timegrain.
RetentionPolicy *RetentionPolicy
}
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 - Average MetricStatisticTypeAverage MetricStatisticType = "Average" // MetricStatisticTypeCount - Count MetricStatisticTypeCount MetricStatisticType = "Count" // MetricStatisticTypeMax - Max MetricStatisticTypeMax MetricStatisticType = "Max" // MetricStatisticTypeMin - Min MetricStatisticTypeMin MetricStatisticType = "Min" // MetricStatisticTypeSum - Sum 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 - Rate unit of binary digits per second. MetricUnitBitsPerSecond MetricUnit = "BitsPerSecond" // MetricUnitByteSeconds - Unit of data transfer or storage. It is the size of the data in bytes multiplied by the time it // takes to transfer or store the data in seconds. MetricUnitByteSeconds MetricUnit = "ByteSeconds" // MetricUnitBytes - Unit of memory in bytes. MetricUnitBytes MetricUnit = "Bytes" // MetricUnitBytesPerSecond - Rate unit of memory in bytes per second. MetricUnitBytesPerSecond MetricUnit = "BytesPerSecond" // MetricUnitCores - Unit of processing power. MetricUnitCores MetricUnit = "Cores" // MetricUnitCount - Unit of raw quantity. MetricUnitCount MetricUnit = "Count" // MetricUnitCountPerSecond - Rate unit of raw quantity per second. MetricUnitCountPerSecond MetricUnit = "CountPerSecond" // MetricUnitMilliCores - Unit of processing power in 1/1000th of a CPU core. MetricUnitMilliCores MetricUnit = "MilliCores" // MetricUnitMilliSeconds - Unit of time in 1/1000th of a second. MetricUnitMilliSeconds MetricUnit = "MilliSeconds" // MetricUnitNanoCores - Unit of processing power in one billionth of a CPU core. MetricUnitNanoCores MetricUnit = "NanoCores" // MetricUnitPercent - Percentage unit. MetricUnitPercent MetricUnit = "Percent" // MetricUnitSeconds - Unit of time in seconds. MetricUnitSeconds MetricUnit = "Seconds" // MetricUnitUnspecified - No specified unit. 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 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.
Generated from API version 2024-02-01
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. The value must be an UUID.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - Contains optional client configuration. 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**. This API used the [default ARM throttling limits](https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/request-limits-and-throttling). If the operation fails it returns an *azcore.ResponseError type.
- resourceURI - The fully qualified Azure Resource manager identifier of the resource.
- options - MetricsClientListOptions contains the optional parameters for the MetricsClient.List method.
Example (GetMetricForData) ¶
Generated from example definition: 2024-02-01/GetMetric.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("<subscriptionID>", 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{
Filter: to.Ptr("Tier eq '*'"),
AutoAdjustTimegrain: to.Ptr(true),
ValidateDimensions: to.Ptr(false),
Aggregation: to.Ptr("average,minimum,maximum"),
Interval: to.Ptr("PT6H"),
Metricnames: to.Ptr("BlobCount,BlobCapacity"),
Metricnamespace: to.Ptr("Microsoft.Storage/storageAccounts/blobServices"),
Orderby: to.Ptr("average asc"),
Timespan: to.Ptr("2021-04-20T09:00:00.000Z/2021-04-20T14:00:00.000Z"),
Top: to.Ptr[int32](5)})
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 = armmonitor.MetricsClientListResponse{
// 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:00Z"); 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:00Z"); 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:00Z"); 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:00Z"); 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:00Z"); 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:00Z"); 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:00Z"); 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:00Z"); 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:00Z"); 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:00Z"); 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:00Z"); 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:00Z"); 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:00Z"); 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:00Z"); 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:00Z"); 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:00Z"); 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:00Z"); 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:00Z"); 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:00Z"); 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:00Z"); 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:00Z"); 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:00Z"); 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:00Z"); 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:00Z"); 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:00Z"); return t}()),
// },
// },
// Metadatavalues: []*armmonitor.MetadataValue{
// {
// Name: &armmonitor.LocalizableString{
// LocalizedValue: to.Ptr("tier"),
// Value: to.Ptr("tier"),
// },
// Value: to.Ptr("Untiered"),
// },
// },
// },
// },
// Unit: to.Ptr(armmonitor.MetricUnitCount),
// },
// {
// 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:00Z"); 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:00Z"); 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:00Z"); 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:00Z"); 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:00Z"); 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:00Z"); 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:00Z"); 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:00Z"); 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:00Z"); 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:00Z"); 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:00Z"); 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:00Z"); 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:00Z"); 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:00Z"); 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:00Z"); 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:00Z"); 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:00Z"); 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:00Z"); 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:00Z"); 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:00Z"); 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:00Z"); 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:00Z"); 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:00Z"); 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:00Z"); 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:00Z"); return t}()),
// },
// },
// Metadatavalues: []*armmonitor.MetadataValue{
// {
// Name: &armmonitor.LocalizableString{
// LocalizedValue: to.Ptr("tier"),
// Value: to.Ptr("tier"),
// },
// Value: to.Ptr("Cool"),
// },
// },
// },
// },
// Unit: to.Ptr(armmonitor.MetricUnitBytes),
// },
// },
// },
// }
}
Output:
Example (GetMetricForMetadata) ¶
Generated from example definition: 2024-02-01/GetMetricMetadata.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("<subscriptionID>", 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{
Filter: to.Ptr("Tier eq '*'"),
Metricnamespace: to.Ptr("Microsoft.Storage/storageAccounts/blobServices"),
Timespan: to.Ptr("2017-04-14T02:20:00Z/2017-04-14T04:20:00Z")})
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 = armmonitor.MetricsClientListResponse{
// 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.MetricUnitCount),
// },
// },
// },
// }
}
Output:
Example (GetMetricWithError) ¶
Generated from example definition: 2024-02-01/GetMetricError.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("<subscriptionID>", 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{
AutoAdjustTimegrain: to.Ptr(true),
ValidateDimensions: to.Ptr(false),
Aggregation: to.Ptr("average"),
Interval: to.Ptr("FULL"),
Metricnames: to.Ptr("MongoRequestsCount,MongoRequests"),
Metricnamespace: to.Ptr("microsoft.documentdb/databaseaccounts"),
Timespan: to.Ptr("2021-06-07T21:51:00Z/2021-06-08T01:51:00Z")})
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 = armmonitor.MetricsClientListResponse{
// 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.MetricUnitCountPerSecond),
// },
// {
// 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:00Z"); return t}()),
// },
// },
// Metadatavalues: []*armmonitor.MetadataValue{
// },
// },
// },
// Unit: to.Ptr(armmonitor.MetricUnitCount),
// },
// },
// },
// }
}
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**. This API used the [default ARM throttling limits](https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/request-limits-and-throttling). If the operation fails it returns an *azcore.ResponseError type.
- 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: 2024-02-01/GetMultiResourceMetric.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("92d2a2d8-b514-432d-8cc9-a5f9272630d5", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewMetricsClient().ListAtSubscriptionScope(ctx, "westus2", &armmonitor.MetricsClientListAtSubscriptionScopeOptions{
Filter: to.Ptr("LUN eq '0' and Microsoft.ResourceId eq '*'"),
AutoAdjustTimegrain: to.Ptr(true),
ValidateDimensions: to.Ptr(false),
Aggregation: to.Ptr("count"),
Interval: to.Ptr("PT6H"),
Metricnames: to.Ptr("Data Disk Max Burst IOPS"),
Metricnamespace: to.Ptr("microsoft.compute/virtualmachines"),
Orderby: to.Ptr("count desc"),
Timespan: to.Ptr("2021-06-08T19:00:00Z/2021-06-12T01:00:00Z"),
Top: to.Ptr[int32](10)})
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 = armmonitor.MetricsClientListAtSubscriptionScopeResponse{
// Response: armmonitor.Response{
// 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.Metric{
// {
// 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:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-09T01:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-09T07:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-09T13:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-09T19:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-10T01:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-10T07:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](413),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-10T13:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-10T19:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-11T01:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-11T07:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-11T13:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-11T19:00:00Z"); 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:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](133),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-09T01:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-09T07:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-09T13:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-09T19:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-10T01:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-10T07:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-10T13:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-10T19:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-11T01:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-11T07:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-11T13:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-11T19:00:00Z"); 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:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-09T01:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-09T07:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-09T13:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-09T19:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-10T01:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-10T07:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-10T13:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-10T19:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](78),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-11T01:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-11T07:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-11T13:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-11T19:00:00Z"); 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:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-09T01:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-09T07:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-09T13:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-09T19:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-10T01:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-10T07:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-10T13:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-10T19:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-11T01:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-11T07:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-11T13:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-11T19:00:00Z"); 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:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-09T01:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-09T07:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-09T13:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-09T19:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-10T01:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-10T07:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-10T13:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-10T19:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-11T01:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-11T07:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-11T13:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-11T19:00:00Z"); 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: 2024-02-01/GetMultiResourceMetricMetadata.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("92d2a2d8-b514-432d-8cc9-a5f9272630d5", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewMetricsClient().ListAtSubscriptionScope(ctx, "westus2", &armmonitor.MetricsClientListAtSubscriptionScopeOptions{
Filter: to.Ptr("LUN eq '0'"),
Metricnames: to.Ptr("Data Disk Max Burst IOPS"),
Metricnamespace: to.Ptr("microsoft.compute/virtualmachines"),
Timespan: to.Ptr("2021-06-10T02:23:16.129Z/2021-06-12T02:23:16.129Z")})
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 = armmonitor.MetricsClientListAtSubscriptionScopeResponse{
// Response: armmonitor.Response{
// 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.Metric{
// {
// 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. This API used the [default ARM throttling limits](https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/request-limits-and-throttling). If the operation fails it returns an *azcore.ResponseError type.
- region - The region where the metrics you want reside.
- options - MetricsClientListAtSubscriptionScopePostOptions contains the optional parameters for the MetricsClient.ListAtSubscriptionScopePost method.
Example (PostRequestForSubscriptionLevelMetricData) ¶
Generated from example definition: 2024-02-01/PostMultiResourceMetric.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("92d2a2d8-b514-432d-8cc9-a5f9272630d5", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewMetricsClient().ListAtSubscriptionScopePost(ctx, "westus2", &armmonitor.MetricsClientListAtSubscriptionScopePostOptions{
Filter: to.Ptr("LUN eq '0' and Microsoft.ResourceId eq '*'"),
AutoAdjustTimegrain: to.Ptr(true),
ValidateDimensions: to.Ptr(false),
Aggregation: to.Ptr("count"),
Interval: to.Ptr("PT6H"),
Metricnames: to.Ptr("Data Disk Max Burst IOPS"),
Metricnamespace: to.Ptr("microsoft.compute/virtualmachines"),
Orderby: to.Ptr("count desc"),
Timespan: to.Ptr("2021-06-08T19:00:00Z/2021-06-12T01:00:00Z"),
Top: to.Ptr[int32](10)})
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 = armmonitor.MetricsClientListAtSubscriptionScopePostResponse{
// Response: armmonitor.Response{
// 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.Metric{
// {
// 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:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-09T01:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-09T07:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-09T13:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-09T19:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-10T01:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-10T07:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](413),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-10T13:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-10T19:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-11T01:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-11T07:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-11T13:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-11T19:00:00Z"); 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:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](133),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-09T01:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-09T07:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-09T13:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-09T19:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-10T01:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-10T07:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-10T13:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-10T19:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-11T01:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-11T07:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-11T13:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-11T19:00:00Z"); 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:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-09T01:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-09T07:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-09T13:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-09T19:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-10T01:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-10T07:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-10T13:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-10T19:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](78),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-11T01:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-11T07:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-11T13:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-11T19:00:00Z"); 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:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-09T01:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-09T07:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-09T13:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-09T19:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-10T01:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-10T07:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-10T13:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-10T19:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-11T01:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-11T07:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-11T13:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-11T19:00:00Z"); 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:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-09T01:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-09T07:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-09T13:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-09T19:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-10T01:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-10T07:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-10T13:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-10T19:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-11T01:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-11T07:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-11T13:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-11T19:00:00Z"); 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 (PostRequestForSubscriptionLevelMetricDataUsingBodyParams) ¶
Generated from example definition: 2024-02-01/PostMultiResourceMetricBody.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("92d2a2d8-b514-432d-8cc9-a5f9272630d5", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewMetricsClient().ListAtSubscriptionScopePost(ctx, "westus2", &armmonitor.MetricsClientListAtSubscriptionScopePostOptions{
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("2021-06-08T19:00:00Z/2021-06-12T01:00:00Z"),
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 = armmonitor.MetricsClientListAtSubscriptionScopePostResponse{
// Response: armmonitor.Response{
// 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.Metric{
// {
// 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:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-09T01:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-09T07:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-09T13:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-09T19:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-10T01:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-10T07:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](413),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-10T13:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-10T19:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-11T01:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-11T07:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-11T13:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-11T19:00:00Z"); 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:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](133),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-09T01:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-09T07:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-09T13:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-09T19:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-10T01:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-10T07:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-10T13:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-10T19:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-11T01:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-11T07:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-11T13:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-11T19:00:00Z"); 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:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-09T01:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-09T07:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-09T13:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-09T19:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-10T01:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-10T07:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-10T13:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-10T19:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](78),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-11T01:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-11T07:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-11T13:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-11T19:00:00Z"); 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:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-09T01:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-09T07:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-09T13:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-09T19:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-10T01:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-10T07:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-10T13:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-10T19:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-11T01:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-11T07:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-11T13:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-11T19:00:00Z"); 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:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-09T01:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-09T07:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-09T13:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-09T19:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-10T01:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-10T07:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-10T13:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-10T19:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-11T01:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-11T07:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-11T13:00:00Z"); return t}()),
// },
// {
// Count: to.Ptr[float64](72),
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-11T19:00:00Z"); 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 (PostRequestForSubscriptionLevelMetricMetadata) ¶
Generated from example definition: 2024-02-01/PostMultiResourceMetricMetadata.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("92d2a2d8-b514-432d-8cc9-a5f9272630d5", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewMetricsClient().ListAtSubscriptionScopePost(ctx, "westus2", &armmonitor.MetricsClientListAtSubscriptionScopePostOptions{
Filter: to.Ptr("LUN eq '0'"),
Metricnames: to.Ptr("Data Disk Max Burst IOPS"),
Metricnamespace: to.Ptr("microsoft.compute/virtualmachines"),
Timespan: to.Ptr("2021-06-10T02:23:16.129Z/2021-06-12T02:23:16.129Z")})
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 = armmonitor.MetricsClientListAtSubscriptionScopePostResponse{
// Response: armmonitor.Response{
// 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.Metric{
// {
// 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:
type MetricsClientListAtSubscriptionScopeOptions ¶ added in v0.9.0
type MetricsClientListAtSubscriptionScopeOptions struct {
// The list of aggregation types (comma separated) to retrieve.
// *Examples: average, minimum, maximum*
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.<br>Example:<br>Metric contains metadata A, B and C.<br>-
// Return all time series of C where A = a1 and B = b1 or b2<br>**$filter=A eq ‘a1’ and B eq ‘b1’ or B eq ‘b2’ and C eq ‘*’**<br>-
// Invalid variant:<br>**$filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘*’ or B = ‘b2’**<br>This is invalid because the logical
// or operator cannot separate two different metadata names.<br>- Return all time series where A = a1, B = b1 and C = c1:<br>**$filter=A
// eq ‘a1’ and B eq ‘b1’ and C eq ‘c1’**<br>- Return all time series where A = a1<br>**$filter=A eq ‘a1’ and B eq ‘*’ and
// C eq ‘*’**.
Filter *string
// The interval (i.e. timegrain) of the query in ISO 8601 duration format. Defaults to PT1M. Special case for 'FULL' value
// that returns single datapoint for entire time span requested.
// *Examples: PT15M, PT1H, P1D, FULL*
Interval *string
// The names of the metrics (comma separated) to retrieve. Limit 20 metrics.
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 'startDateTime_ISO/endDateTime_ISO'.
Timespan *string
// The maximum number of records to retrieve per resource ID in the request.
// 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.
// *Examples: average, minimum, maximum*
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 request body
Body *SubscriptionScopeMetricsRequestBodyParameters
// The **$filter** is used to reduce the set of metric data returned.<br>Example:<br>Metric contains metadata A, B and C.<br>-
// Return all time series of C where A = a1 and B = b1 or b2<br>**$filter=A eq ‘a1’ and B eq ‘b1’ or B eq ‘b2’ and C eq ‘*’**<br>-
// Invalid variant:<br>**$filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘*’ or B = ‘b2’**<br>This is invalid because the logical
// or operator cannot separate two different metadata names.<br>- Return all time series where A = a1, B = b1 and C = c1:<br>**$filter=A
// eq ‘a1’ and B eq ‘b1’ and C eq ‘c1’**<br>- Return all time series where A = a1<br>**$filter=A eq ‘a1’ and B eq ‘*’ and
// C eq ‘*’**.
Filter *string
// The interval (i.e. timegrain) of the query in ISO 8601 duration format. Defaults to PT1M. Special case for 'FULL' value
// that returns single datapoint for entire time span requested.
// *Examples: PT15M, PT1H, P1D, FULL*
Interval *string
// The names of the metrics (comma separated) to retrieve. Limit 20 metrics.
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 'startDateTime_ISO/endDateTime_ISO'.
Timespan *string
// The maximum number of records to retrieve per resource ID in the request.
// 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 metrics query.
Response
}
MetricsClientListAtSubscriptionScopePostResponse contains the response from method MetricsClient.ListAtSubscriptionScopePost.
type MetricsClientListAtSubscriptionScopeResponse ¶ added in v0.9.0
type MetricsClientListAtSubscriptionScopeResponse struct {
// The response to a metrics query.
Response
}
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.
// *Examples: average, minimum, maximum*
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.<br>Example:<br>Metric contains metadata A, B and C.<br>-
// Return all time series of C where A = a1 and B = b1 or b2<br>**$filter=A eq ‘a1’ and B eq ‘b1’ or B eq ‘b2’ and C eq ‘*’**<br>-
// Invalid variant:<br>**$filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘*’ or B = ‘b2’**<br>This is invalid because the logical
// or operator cannot separate two different metadata names.<br>- Return all time series where A = a1, B = b1 and C = c1:<br>**$filter=A
// eq ‘a1’ and B eq ‘b1’ and C eq ‘c1’**<br>- Return all time series where A = a1<br>**$filter=A eq ‘a1’ and B eq ‘*’ and
// C eq ‘*’**.
Filter *string
// The interval (i.e. timegrain) of the query in ISO 8601 duration format. Defaults to PT1M. Special case for 'FULL' value
// that returns single datapoint for entire time span requested.
// *Examples: PT15M, PT1H, P1D, FULL*
Interval *string
// The names of the metrics (comma separated) to retrieve. Limit 20 metrics.
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
// 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 'startDateTime_ISO/endDateTime_ISO'.
Timespan *string
// The maximum number of records to retrieve per resource ID in the request.
// 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 MicrosoftFabricDestination ¶ added in v0.12.0
type MicrosoftFabricDestination struct {
// The artifact id of the Microsoft Fabric resource.
ArtifactID *string
// The name of the database to which data will be ingested.
DatabaseName *string
// The ingestion uri of the Microsoft Fabric resource.
IngestionURI *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 tenant id of the Microsoft Fabric resource.
TenantID *string
}
MicrosoftFabricDestination - Microsoft Fabric destination (non-Azure).
func (MicrosoftFabricDestination) MarshalJSON ¶ added in v0.12.0
func (m MicrosoftFabricDestination) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type MicrosoftFabricDestination.
func (*MicrosoftFabricDestination) UnmarshalJSON ¶ added in v0.12.0
func (m *MicrosoftFabricDestination) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type MicrosoftFabricDestination.
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. Previously undocumented values might be returned
CriterionType *CriterionType
// REQUIRED; Name of the metric.
MetricName *string
// REQUIRED; Name of the criteria.
Name *string
// REQUIRED; The criteria time aggregation types. Previously undocumented values might be returned
TimeAggregation *AggregationTypeEnum
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 MultiPromQLCriteria ¶ added in v0.12.0
type MultiPromQLCriteria struct {
// REQUIRED; Specifies the type of threshold criteria. Previously undocumented values might be returned
CriterionType *CriterionType
// REQUIRED; Name of the criteria.
Name *string
// REQUIRED; The query used to evaluate the alert rule
Query *string
}
MultiPromQLCriteria - The types of conditions for a multi query metric alert.
func (*MultiPromQLCriteria) GetMultiPromQLCriteria ¶ added in v0.12.0
func (m *MultiPromQLCriteria) GetMultiPromQLCriteria() *MultiPromQLCriteria
GetMultiPromQLCriteria implements the MultiPromQLCriteriaClassification interface for type MultiPromQLCriteria.
func (MultiPromQLCriteria) MarshalJSON ¶ added in v0.12.0
func (m MultiPromQLCriteria) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type MultiPromQLCriteria.
func (*MultiPromQLCriteria) UnmarshalJSON ¶ added in v0.12.0
func (m *MultiPromQLCriteria) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type MultiPromQLCriteria.
type MultiPromQLCriteriaClassification ¶ added in v0.12.0
type MultiPromQLCriteriaClassification interface {
// GetMultiPromQLCriteria returns the MultiPromQLCriteria content of the underlying type.
GetMultiPromQLCriteria() *MultiPromQLCriteria
}
MultiPromQLCriteriaClassification provides polymorphic access to related types. Call the interface's GetMultiPromQLCriteria() method to access the common type. Use a type switch to determine the concrete type. The possible types are: - *DynamicPromQLCriteria, *MultiPromQLCriteria, *StaticPromQLCriteria
type NamespaceClassification ¶
type NamespaceClassification string
NamespaceClassification - Kind of namespace
const ( // NamespaceClassificationCustom - Custom NamespaceClassificationCustom NamespaceClassification = "Custom" // NamespaceClassificationPlatform - Platform NamespaceClassificationPlatform NamespaceClassification = "Platform" // NamespaceClassificationQos - Qos NamespaceClassificationQos NamespaceClassification = "Qos" )
func PossibleNamespaceClassificationValues ¶
func PossibleNamespaceClassificationValues() []NamespaceClassification
PossibleNamespaceClassificationValues returns the possible values for the NamespaceClassification const type.
type NetworkSecurityPerimeter ¶ added in v0.12.0
type NetworkSecurityPerimeter struct {
// Fully qualified Azure resource ID of the NSP resource
ID *string
// Location of the network security perimeter
Location *string
// Universal unique ID (UUID) of the network security perimeter
PerimeterGUID *string
}
NetworkSecurityPerimeter - Information about a network security perimeter (NSP)
func (NetworkSecurityPerimeter) MarshalJSON ¶ added in v0.12.0
func (n NetworkSecurityPerimeter) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type NetworkSecurityPerimeter.
func (*NetworkSecurityPerimeter) UnmarshalJSON ¶ added in v0.12.0
func (n *NetworkSecurityPerimeter) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type NetworkSecurityPerimeter.
type NetworkSecurityPerimeterConfiguration ¶ added in v0.12.0
type NetworkSecurityPerimeterConfiguration struct {
Properties *NetworkSecurityPerimeterConfigurationProperties
// 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
}
NetworkSecurityPerimeterConfiguration - Network security perimeter (NSP) configuration resource
func (NetworkSecurityPerimeterConfiguration) MarshalJSON ¶ added in v0.12.0
func (n NetworkSecurityPerimeterConfiguration) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type NetworkSecurityPerimeterConfiguration.
func (*NetworkSecurityPerimeterConfiguration) UnmarshalJSON ¶ added in v0.12.0
func (n *NetworkSecurityPerimeterConfiguration) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type NetworkSecurityPerimeterConfiguration.
type NetworkSecurityPerimeterConfigurationListResult ¶ added in v0.12.0
type NetworkSecurityPerimeterConfigurationListResult struct {
// The link used to get the next page of results.
NextLink *string
// Array of network security perimeter results.
Value []*NetworkSecurityPerimeterConfiguration
}
NetworkSecurityPerimeterConfigurationListResult - Result of a list NSP (network security perimeter) configurations request.
func (NetworkSecurityPerimeterConfigurationListResult) MarshalJSON ¶ added in v0.12.0
func (n NetworkSecurityPerimeterConfigurationListResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type NetworkSecurityPerimeterConfigurationListResult.
func (*NetworkSecurityPerimeterConfigurationListResult) UnmarshalJSON ¶ added in v0.12.0
func (n *NetworkSecurityPerimeterConfigurationListResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type NetworkSecurityPerimeterConfigurationListResult.
type NetworkSecurityPerimeterConfigurationProperties ¶ added in v0.12.0
type NetworkSecurityPerimeterConfigurationProperties struct {
NetworkSecurityPerimeter *NetworkSecurityPerimeter
Profile *NetworkSecurityProfile
ResourceAssociation *ResourceAssociation
// READ-ONLY; List of provisioning issues, if any
ProvisioningIssues []*ProvisioningIssue
// READ-ONLY
ProvisioningState *NetworkSecurityPerimeterConfigurationProvisioningState
}
NetworkSecurityPerimeterConfigurationProperties - Network security configuration properties.
func (NetworkSecurityPerimeterConfigurationProperties) MarshalJSON ¶ added in v0.12.0
func (n NetworkSecurityPerimeterConfigurationProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type NetworkSecurityPerimeterConfigurationProperties.
func (*NetworkSecurityPerimeterConfigurationProperties) UnmarshalJSON ¶ added in v0.12.0
func (n *NetworkSecurityPerimeterConfigurationProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type NetworkSecurityPerimeterConfigurationProperties.
type NetworkSecurityPerimeterConfigurationProvisioningState ¶ added in v0.12.0
type NetworkSecurityPerimeterConfigurationProvisioningState string
NetworkSecurityPerimeterConfigurationProvisioningState - Provisioning state of a network security perimeter configuration that is being created or updated.
const ( NetworkSecurityPerimeterConfigurationProvisioningStateAccepted NetworkSecurityPerimeterConfigurationProvisioningState = "Accepted" NetworkSecurityPerimeterConfigurationProvisioningStateCanceled NetworkSecurityPerimeterConfigurationProvisioningState = "Canceled" NetworkSecurityPerimeterConfigurationProvisioningStateCreating NetworkSecurityPerimeterConfigurationProvisioningState = "Creating" NetworkSecurityPerimeterConfigurationProvisioningStateDeleting NetworkSecurityPerimeterConfigurationProvisioningState = "Deleting" NetworkSecurityPerimeterConfigurationProvisioningStateFailed NetworkSecurityPerimeterConfigurationProvisioningState = "Failed" NetworkSecurityPerimeterConfigurationProvisioningStateSucceeded NetworkSecurityPerimeterConfigurationProvisioningState = "Succeeded" NetworkSecurityPerimeterConfigurationProvisioningStateUpdating NetworkSecurityPerimeterConfigurationProvisioningState = "Updating" )
func PossibleNetworkSecurityPerimeterConfigurationProvisioningStateValues ¶ added in v0.12.0
func PossibleNetworkSecurityPerimeterConfigurationProvisioningStateValues() []NetworkSecurityPerimeterConfigurationProvisioningState
PossibleNetworkSecurityPerimeterConfigurationProvisioningStateValues returns the possible values for the NetworkSecurityPerimeterConfigurationProvisioningState const type.
type NetworkSecurityProfile ¶ added in v0.12.0
type NetworkSecurityProfile struct {
// List of Access Rules
AccessRules []*AccessRule
// Current access rules version
AccessRulesVersion *int32
// Current diagnostic settings version
DiagnosticSettingsVersion *int32
// List of log categories that are enabled
EnabledLogCategories []*string
// Name of the profile
Name *string
}
NetworkSecurityProfile - Network security perimeter configuration profile
func (NetworkSecurityProfile) MarshalJSON ¶ added in v0.12.0
func (n NetworkSecurityProfile) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type NetworkSecurityProfile.
func (*NetworkSecurityProfile) UnmarshalJSON ¶ added in v0.12.0
func (n *NetworkSecurityProfile) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type NetworkSecurityProfile.
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 incident receivers that are part of this action group.
IncidentReceivers []*IncidentReceiver
// 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. Previously undocumented values might be returned
const ( // OdatatypeMicrosoftAzureMonitorMultipleResourceMultipleMetricCriteria - Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria OdatatypeMicrosoftAzureMonitorMultipleResourceMultipleMetricCriteria Odatatype = "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria" // OdatatypeMicrosoftAzureMonitorPromQLCriteria - Microsoft.Azure.Monitor.PromQLCriteria OdatatypeMicrosoftAzureMonitorPromQLCriteria Odatatype = "Microsoft.Azure.Monitor.PromQLCriteria" // OdatatypeMicrosoftAzureMonitorSingleResourceMultipleMetricCriteria - Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria OdatatypeMicrosoftAzureMonitorSingleResourceMultipleMetricCriteria Odatatype = "Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria" // OdatatypeMicrosoftAzureMonitorWebtestLocationAvailabilityCriteria - Microsoft.Azure.Monitor.WebtestLocationAvailabilityCriteria OdatatypeMicrosoftAzureMonitorWebtestLocationAvailabilityCriteria Odatatype = "Microsoft.Azure.Monitor.WebtestLocationAvailabilityCriteria" )
func PossibleOdatatypeValues ¶
func PossibleOdatatypeValues() []Odatatype
PossibleOdatatypeValues returns the possible values for the Odatatype const type.
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 Operator ¶
type Operator string
Operator - The criteria operator. Previously undocumented values might be returned
const ( // OperatorEquals - Equals OperatorEquals Operator = "Equals" // OperatorGreaterThan - GreaterThan OperatorGreaterThan Operator = "GreaterThan" // OperatorGreaterThanOrEqual - GreaterThanOrEqual OperatorGreaterThanOrEqual Operator = "GreaterThanOrEqual" // OperatorLessThan - LessThan OperatorLessThan Operator = "LessThan" // OperatorLessThanOrEqual - LessThanOrEqual OperatorLessThanOrEqual Operator = "LessThanOrEqual" )
func PossibleOperatorValues ¶
func PossibleOperatorValues() []Operator
PossibleOperatorValues returns the possible values for the Operator const type.
type OtelLogsDataSource ¶ added in v0.12.0
type OtelLogsDataSource struct {
// REQUIRED; List of streams that this data source will be sent to.
Streams []*KnownOtelLogsDataSourceStreams
// Specifies the reference alias to enrich the telemetry signal with.
EnrichWithReference *string
// Specifies the list of resource attributes that need to be added as labels/dimensions to the telemetry data for further
// enrichment.
EnrichWithResourceAttributes []*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
// Specifies whether to replace the default resourceId in the log record with the resourceId of the referenced resource being
// used for enrichment.
ReplaceResourceIDWithReference *bool
// Specifies the routing policy based on OTLP payload resource attributes to route subset of the payload according to matching
// resource attribute.
ResourceAttributeRouting *OtelLogsDataSourceResourceAttributeRouting
}
OtelLogsDataSource - Enables Otel logs to be collected by this data collection rule.
func (OtelLogsDataSource) MarshalJSON ¶ added in v0.12.0
func (o OtelLogsDataSource) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type OtelLogsDataSource.
func (*OtelLogsDataSource) UnmarshalJSON ¶ added in v0.12.0
func (o *OtelLogsDataSource) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type OtelLogsDataSource.
type OtelLogsDataSourceResourceAttributeRouting ¶ added in v0.12.0
type OtelLogsDataSourceResourceAttributeRouting struct {
// The name of the resource attribute to match.
AttributeName *string
// The value of the resource attribute to match.
AttributeValue *string
}
OtelLogsDataSourceResourceAttributeRouting - Specifies the routing policy based on OTLP payload resource attributes to route subset of the payload according to matching resource attribute.
func (OtelLogsDataSourceResourceAttributeRouting) MarshalJSON ¶ added in v0.12.0
func (o OtelLogsDataSourceResourceAttributeRouting) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type OtelLogsDataSourceResourceAttributeRouting.
func (*OtelLogsDataSourceResourceAttributeRouting) UnmarshalJSON ¶ added in v0.12.0
func (o *OtelLogsDataSourceResourceAttributeRouting) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type OtelLogsDataSourceResourceAttributeRouting.
type OtelLogsDirectDataSource ¶ added in v0.12.0
type OtelLogsDirectDataSource struct {
// REQUIRED; List of streams that this data source will be sent to.
Streams []*KnownOtelLogsDirectDataSourceStreams
// Specifies the reference to enrich the telemetry signal with.
EnrichWithReference *string
// Specifies the list of resource attributes that need to be added as labels/dimensions to the telemetry data for further
// enrichment.
EnrichWithResourceAttributes []*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
// Specifies whether to replace the default resourceId in the log record with the resourceId of the referenced resource being
// used for enrichment.
ReplaceResourceIDWithReference *bool
}
func (OtelLogsDirectDataSource) MarshalJSON ¶ added in v0.12.0
func (o OtelLogsDirectDataSource) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type OtelLogsDirectDataSource.
func (*OtelLogsDirectDataSource) UnmarshalJSON ¶ added in v0.12.0
func (o *OtelLogsDirectDataSource) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type OtelLogsDirectDataSource.
type OtelMetricsDataSource ¶ added in v0.12.0
type OtelMetricsDataSource struct {
// REQUIRED; List of streams that this data source will be sent to.
Streams []*string
// Specifies the reference to enrich the telemetry signal with.
EnrichWithReference *string
// Specifies the list of resource attributes that need to be added as labels/dimensions to the telemetry data for further
// enrichment.
EnrichWithResourceAttributes []*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
// Specifies the routing policy based on OTLP payload resource attributes to route subset of the payload according to matching
// resource attribute.
ResourceAttributeRouting *OtelMetricsDataSourceResourceAttributeRouting
}
OtelMetricsDataSource - Definition of OTel metrics configuration.
func (OtelMetricsDataSource) MarshalJSON ¶ added in v0.12.0
func (o OtelMetricsDataSource) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type OtelMetricsDataSource.
func (*OtelMetricsDataSource) UnmarshalJSON ¶ added in v0.12.0
func (o *OtelMetricsDataSource) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type OtelMetricsDataSource.
type OtelMetricsDataSourceResourceAttributeRouting ¶ added in v0.12.0
type OtelMetricsDataSourceResourceAttributeRouting struct {
// The name of the resource attribute to match.
AttributeName *string
// The value of the resource attribute to match.
AttributeValue *string
}
OtelMetricsDataSourceResourceAttributeRouting - Specifies the routing policy based on OTLP payload resource attributes to route subset of the payload according to matching resource attribute.
func (OtelMetricsDataSourceResourceAttributeRouting) MarshalJSON ¶ added in v0.12.0
func (o OtelMetricsDataSourceResourceAttributeRouting) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type OtelMetricsDataSourceResourceAttributeRouting.
func (*OtelMetricsDataSourceResourceAttributeRouting) UnmarshalJSON ¶ added in v0.12.0
func (o *OtelMetricsDataSourceResourceAttributeRouting) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type OtelMetricsDataSourceResourceAttributeRouting.
type OtelMetricsDirectDataSource ¶ added in v0.12.0
type OtelMetricsDirectDataSource struct {
// REQUIRED; List of streams that this data source will be sent to.
Streams []*string
// Specifies the reference to enrich the telemetry signal with.
EnrichWithReference *string
// Specifies the list of resource attributes that need to be added as labels/dimensions to the telemetry data for further
// enrichment.
EnrichWithResourceAttributes []*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
}
OtelMetricsDirectDataSource - Definition of OTel metrics configuration.
func (OtelMetricsDirectDataSource) MarshalJSON ¶ added in v0.12.0
func (o OtelMetricsDirectDataSource) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type OtelMetricsDirectDataSource.
func (*OtelMetricsDirectDataSource) UnmarshalJSON ¶ added in v0.12.0
func (o *OtelMetricsDirectDataSource) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type OtelMetricsDirectDataSource.
type OtelTracesDataSource ¶ added in v0.12.0
type OtelTracesDataSource struct {
// REQUIRED; 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 []*KnownOtelTracesDataSourceStreams
// Specifies the reference to enrich the telemetry signal with.
EnrichWithReference *string
// Specifies the list of resource attributes that need to be added as labels/dimensions to the telemetry data for further
// enrichment.
EnrichWithResourceAttributes []*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
// Specifies whether to replace the default resourceId in the log record with the resourceId of the referenced resource being
// used for enrichment.
ReplaceResourceIDWithReference *bool
// Specifies the routing policy based on OTLP payload resource attributes to route subset of the payload according to matching
// resource attribute.
ResourceAttributeRouting *OtelTracesDataSourceResourceAttributeRouting
}
OtelTracesDataSource - Enables Otel Traces to be collected by this data collection rule.
func (OtelTracesDataSource) MarshalJSON ¶ added in v0.12.0
func (o OtelTracesDataSource) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type OtelTracesDataSource.
func (*OtelTracesDataSource) UnmarshalJSON ¶ added in v0.12.0
func (o *OtelTracesDataSource) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type OtelTracesDataSource.
type OtelTracesDataSourceResourceAttributeRouting ¶ added in v0.12.0
type OtelTracesDataSourceResourceAttributeRouting struct {
// The name of the resource attribute to match.
AttributeName *string
// The value of the resource attribute to match.
AttributeValue *string
}
OtelTracesDataSourceResourceAttributeRouting - Specifies the routing policy based on OTLP payload resource attributes to route subset of the payload according to matching resource attribute.
func (OtelTracesDataSourceResourceAttributeRouting) MarshalJSON ¶ added in v0.12.0
func (o OtelTracesDataSourceResourceAttributeRouting) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type OtelTracesDataSourceResourceAttributeRouting.
func (*OtelTracesDataSourceResourceAttributeRouting) UnmarshalJSON ¶ added in v0.12.0
func (o *OtelTracesDataSourceResourceAttributeRouting) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type OtelTracesDataSourceResourceAttributeRouting.
type OtelTracesDirectDataSource ¶ added in v0.12.0
type OtelTracesDirectDataSource struct {
// REQUIRED; 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 []*KnownOtelTracesDirectDataSourceStreams
// Specifies the reference to enrich the telemetry signal with.
EnrichWithReference *string
// Specifies the list of resource attributes that need to be added as labels/dimensions to the telemetry data for further
// enrichment.
EnrichWithResourceAttributes []*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
// Specifies whether to replace the default resourceId in the log record with the resourceId of the referenced resource being
// used for enrichment.
ReplaceResourceIDWithReference *bool
}
OtelTracesDirectDataSource - Enables Otel Traces to be collected by this data collection rule.
func (OtelTracesDirectDataSource) MarshalJSON ¶ added in v0.12.0
func (o OtelTracesDirectDataSource) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type OtelTracesDirectDataSource.
func (*OtelTracesDirectDataSource) UnmarshalJSON ¶ added in v0.12.0
func (o *OtelTracesDirectDataSource) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type OtelTracesDirectDataSource.
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
// The KQL query to transform the data source. This is a deprecated property and will be removed in future versions.
TransformKql *string
}
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 PerformanceCountersOTelDataSource ¶ added in v0.12.0
type PerformanceCountersOTelDataSource struct {
// A list of specifier names of the performance counters you want to collect.
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 []*KnownPerformanceCountersOTelDataSourceStreams
}
PerformanceCountersOTelDataSource - Definition of which Open Telemetry 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 (PerformanceCountersOTelDataSource) MarshalJSON ¶ added in v0.12.0
func (p PerformanceCountersOTelDataSource) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type PerformanceCountersOTelDataSource.
func (*PerformanceCountersOTelDataSource) UnmarshalJSON ¶ added in v0.12.0
func (p *PerformanceCountersOTelDataSource) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type PerformanceCountersOTelDataSource.
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 - Disabled PredictiveAutoscalePolicyScaleModeDisabled PredictiveAutoscalePolicyScaleMode = "Disabled" // PredictiveAutoscalePolicyScaleModeEnabled - Enabled PredictiveAutoscalePolicyScaleModeEnabled PredictiveAutoscalePolicyScaleMode = "Enabled" // PredictiveAutoscalePolicyScaleModeForecastOnly - ForecastOnly 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.
Generated from API version 2022-10-01
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. The value must be an UUID.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - Contains optional client configuration. 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.
- 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 'startDateTime_ISO/endDateTime_ISO'.
- 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: 2022-10-01/GetPredictiveMetric.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("00000000-0000-0000-0000-000000000000", 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 = armmonitor.PredictiveMetricClientGetResponse{
// PredictiveResponse: armmonitor.PredictiveResponse{
// Data: []*armmonitor.PredictiveValue{
// {
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-10-14T22:00:00Z"); return t}()),
// Value: to.Ptr[float64](123),
// },
// {
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-10-14T22:02:00Z"); return t}()),
// Value: to.Ptr[float64](120),
// },
// {
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-10-14T22:02:00Z"); return t}()),
// Value: to.Ptr[float64](88),
// },
// {
// TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-10-14T22:03:00Z"); 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 resource identifier of the 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; 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
}
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 private endpoint resource.
PrivateEndpoint *PrivateEndpoint
// READ-ONLY; The provisioning state of the private endpoint connection resource.
ProvisioningState *PrivateEndpointConnectionProvisioningState
}
PrivateEndpointConnectionProperties - Properties of the private endpoint connection.
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 - Connection is being created PrivateEndpointConnectionProvisioningStateCreating PrivateEndpointConnectionProvisioningState = "Creating" // PrivateEndpointConnectionProvisioningStateDeleting - Connection is being deleted PrivateEndpointConnectionProvisioningStateDeleting PrivateEndpointConnectionProvisioningState = "Deleting" // PrivateEndpointConnectionProvisioningStateFailed - Connection provisioning has failed PrivateEndpointConnectionProvisioningStateFailed PrivateEndpointConnectionProvisioningState = "Failed" // PrivateEndpointConnectionProvisioningStateSucceeded - Connection has been provisioned 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.
Generated from API version 2023-06-01-preview
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. The value must be an UUID.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - Contains optional client configuration. 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.
- 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 associated with the Azure resource.
- options - PrivateEndpointConnectionsClientBeginCreateOrUpdateOptions contains the optional parameters for the PrivateEndpointConnectionsClient.BeginCreateOrUpdate method.
Example ¶
Generated from example definition: 2023-06-01-preview/PrivateEndpointConnectionUpdate.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("00000000-1111-2222-3333-444444444444", 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 poll 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 = armmonitor.PrivateEndpointConnectionsClientCreateOrUpdateResponse{
// 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.
- 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 associated with the Azure resource.
- options - PrivateEndpointConnectionsClientBeginDeleteOptions contains the optional parameters for the PrivateEndpointConnectionsClient.BeginDelete method.
Example ¶
Generated from example definition: 2023-06-01-preview/PrivateEndpointConnectionDelete.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("00000000-1111-2222-3333-444444444444", 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)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to poll 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 = armmonitor.PrivateEndpointConnectionsClientDeleteResponse{
// }
}
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.
- 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 associated with the Azure resource.
- options - PrivateEndpointConnectionsClientGetOptions contains the optional parameters for the PrivateEndpointConnectionsClient.Get method.
Example ¶
Generated from example definition: 2023-06-01-preview/PrivateEndpointConnectionGet.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("00000000-1111-2222-3333-444444444444", 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 = armmonitor.PrivateEndpointConnectionsClientGetResponse{
// 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.
- 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: 2023-06-01-preview/PrivateEndpointConnectionList.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("00000000-1111-2222-3333-444444444444", 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 = armmonitor.PrivateEndpointConnectionsClientListByPrivateLinkScopeResponse{
// 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 long-running operation 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 long-running operation 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 - Connection approved PrivateEndpointServiceConnectionStatusApproved PrivateEndpointServiceConnectionStatus = "Approved" // PrivateEndpointServiceConnectionStatusPending - Connection waiting for approval or rejection PrivateEndpointServiceConnectionStatusPending PrivateEndpointServiceConnectionStatus = "Pending" // PrivateEndpointServiceConnectionStatusRejected - Connection Rejected 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; 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
}
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 {
// REQUIRED; The PrivateLinkResource items on this page
Value []*PrivateLinkResource
// The link to the next page of items
NextLink *string
}
PrivateLinkResourceListResult - The response of a PrivateLinkResource list operation.
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.
Generated from API version 2023-06-01-preview
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. The value must be an UUID.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - Contains optional client configuration. 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.
- 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 associated with the Azure resource.
- options - PrivateLinkResourcesClientGetOptions contains the optional parameters for the PrivateLinkResourcesClient.Get method.
Example ¶
Generated from example definition: 2023-06-01-preview/PrivateLinkScopePrivateLinkResourceGet.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("00000000-1111-2222-3333-444444444444", 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 = armmonitor.PrivateLinkResourcesClientGetResponse{
// 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.
- 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: 2023-06-01-preview/PrivateLinkScopePrivateLinkResourceListGet.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("00000000-1111-2222-3333-444444444444", 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 = armmonitor.PrivateLinkResourcesClientListByPrivateLinkScopeResponse{
// 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 {
// The response of a PrivateLinkResource list operation.
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.
Generated from API version 2023-06-01-preview
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. The value must be an UUID.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - Contains optional client configuration. Pass nil to accept the default values.
func (*PrivateLinkScopeOperationStatusClient) Get ¶
func (client *PrivateLinkScopeOperationStatusClient) Get(ctx context.Context, resourceGroupName string, asyncOperationID 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.
- resourceGroupName - The name of the resource group. The name is case insensitive.
- asyncOperationID - The operation Id.
- options - PrivateLinkScopeOperationStatusClientGetOptions contains the optional parameters for the PrivateLinkScopeOperationStatusClient.Get method.
Example ¶
Generated from example definition: 2023-06-01-preview/privateLinkScopeOperationStatuses.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("613192d7-503f-477a-9cfe-4efc3ee2bd60", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewPrivateLinkScopeOperationStatusClient().Get(ctx, "MyResourceGroup", "713192d7-503f-477a-9cfe-4efc3ee2bd11", 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 = armmonitor.PrivateLinkScopeOperationStatusClientGetResponse{
// 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 PrivateLinkScopeProvisioningState ¶ added in v0.12.0
type PrivateLinkScopeProvisioningState string
PrivateLinkScopeProvisioningState - 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.
const ( // PrivateLinkScopeProvisioningStateCanceled - Canceled PrivateLinkScopeProvisioningStateCanceled PrivateLinkScopeProvisioningState = "Canceled" // PrivateLinkScopeProvisioningStateDeleting - Deleting PrivateLinkScopeProvisioningStateDeleting PrivateLinkScopeProvisioningState = "Deleting" // PrivateLinkScopeProvisioningStateFailed - Failed PrivateLinkScopeProvisioningStateFailed PrivateLinkScopeProvisioningState = "Failed" // PrivateLinkScopeProvisioningStateSucceeded - Succeeded PrivateLinkScopeProvisioningStateSucceeded PrivateLinkScopeProvisioningState = "Succeeded" )
func PossiblePrivateLinkScopeProvisioningStateValues ¶ added in v0.12.0
func PossiblePrivateLinkScopeProvisioningStateValues() []PrivateLinkScopeProvisioningState
PossiblePrivateLinkScopeProvisioningStateValues returns the possible values for the PrivateLinkScopeProvisioningState const type.
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.
Generated from API version 2023-06-01-preview
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. The value must be an UUID.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - Contains optional client configuration. 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 - Add an Azure monitor scoped resource in the private link scope. If the operation fails it returns an *azcore.ResponseError type.
- 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 (UpdateAScopedPlatformMetricsSubscriptionInAPrivateLinkScope) ¶
Generated from example definition: 2023-06-01-preview/PrivateLinkScopedResourceUpdatePlatformMetrics.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("00000000-1111-2222-3333-444444444444", 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{
Kind: to.Ptr(armmonitor.ScopedResourceKind("PlatformMetrics")),
LinkedResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444"),
SubscriptionLocation: to.Ptr("eastus"),
},
}, 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 poll 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 = armmonitor.PrivateLinkScopedResourcesClientCreateOrUpdateResponse{
// 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{
// Kind: to.Ptr(armmonitor.ScopedResourceKind("PlatformMetrics")),
// LinkedResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444"),
// ProvisioningState: to.Ptr(armmonitor.ScopedResourceProvisioningStateSucceeded),
// SubscriptionLocation: to.Ptr("eastus"),
// },
// SystemData: &armmonitor.SystemData{
// CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-16T12:59:57.051056Z"); 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.051056Z"); return t}()),
// LastModifiedBy: to.Ptr("bobby@contoso.com"),
// LastModifiedByType: to.Ptr(armmonitor.CreatedByTypeUser),
// },
// },
// }
}
Output:
Example (UpdateAScopedResourceInAPrivateLinkScope) ¶
Generated from example definition: 2023-06-01-preview/PrivateLinkScopedResourceUpdate.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("00000000-1111-2222-3333-444444444444", 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{
Kind: to.Ptr(armmonitor.ScopedResourceKindResource),
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 poll 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 = armmonitor.PrivateLinkScopedResourcesClientCreateOrUpdateResponse{
// 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{
// Kind: to.Ptr(armmonitor.ScopedResourceKindResource),
// LinkedResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/MyResourceGroup/providers/Microsoft.Insights/components/my-component"),
// ProvisioningState: to.Ptr(armmonitor.ScopedResourceProvisioningStateSucceeded),
// },
// SystemData: &armmonitor.SystemData{
// CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-16T12:59:57.051056Z"); 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.051056Z"); 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 an Azure monitor scoped resource with a given name. If the operation fails it returns an *azcore.ResponseError type.
- 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: 2023-06-01-preview/PrivateLinkScopedResourceDelete.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("00000000-1111-2222-3333-444444444444", 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)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to poll 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 = armmonitor.PrivateLinkScopedResourcesClientDeleteResponse{
// }
}
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.
- 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: 2023-06-01-preview/PrivateLinkScopedResourceGet.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("00000000-1111-2222-3333-444444444444", 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 = armmonitor.PrivateLinkScopedResourcesClientGetResponse{
// 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{
// Kind: to.Ptr(armmonitor.ScopedResourceKindResource),
// LinkedResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/MyResourceGroup/providers/Microsoft.Insights/components/my-component"),
// ProvisioningState: to.Ptr(armmonitor.ScopedResourceProvisioningStateSucceeded),
// },
// SystemData: &armmonitor.SystemData{
// CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-16T12:59:57.051056Z"); 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.051056Z"); 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 scoped resources on a private link scope.
- 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 (GetsListOfScopedResourcesInAPrivateLinkScope) ¶
Generated from example definition: 2023-06-01-preview/PrivateLinkScopedResourceList.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("00000000-1111-2222-3333-444444444444", 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 = armmonitor.PrivateLinkScopedResourcesClientListByPrivateLinkScopeResponse{
// ScopedResourceListResult: armmonitor.ScopedResourceListResult{
// Value: []*armmonitor.ScopedResource{
// {
// Name: to.Ptr("scoped-resource-name-one"),
// 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-one"),
// Properties: &armmonitor.ScopedResourceProperties{
// Kind: to.Ptr(armmonitor.ScopedResourceKindResource),
// LinkedResourceID: to.Ptr("/subscriptions/00000000-0000-2222-3333-444444444444/resourceGroups/MyComponentResourceGroup/providers/Microsoft.Insights/components/my-component"),
// ProvisioningState: to.Ptr(armmonitor.ScopedResourceProvisioningStateSucceeded),
// },
// SystemData: &armmonitor.SystemData{
// CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-16T12:59:57.051056Z"); 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.051056Z"); return t}()),
// LastModifiedBy: to.Ptr("bobby@contoso.com"),
// LastModifiedByType: to.Ptr(armmonitor.CreatedByTypeUser),
// },
// },
// {
// Name: to.Ptr("scoped-resource-name-two"),
// 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-two"),
// Properties: &armmonitor.ScopedResourceProperties{
// Kind: to.Ptr(armmonitor.ScopedResourceKind("PlatformMetrics")),
// LinkedResourceID: to.Ptr("/subscriptions/00000000-3333-2222-5555-444444444444"),
// ProvisioningState: to.Ptr(armmonitor.ScopedResourceProvisioningStateProvisioning),
// SubscriptionLocation: to.Ptr("westus"),
// },
// SystemData: &armmonitor.SystemData{
// CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-16T12:59:57.051056Z"); 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.051056Z"); return t}()),
// LastModifiedBy: to.Ptr("bobby@contoso.com"),
// LastModifiedByType: to.Ptr(armmonitor.CreatedByTypeUser),
// },
// },
// {
// Name: to.Ptr("scoped-resource-name-three"),
// 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-three"),
// Properties: &armmonitor.ScopedResourceProperties{
// Kind: to.Ptr(armmonitor.ScopedResourceKind("PlatformMetrics")),
// LinkedResourceID: to.Ptr("/subscriptions/00000000-3333-2222-5555-444444444444"),
// ProvisioningState: to.Ptr(armmonitor.ScopedResourceProvisioningStateSucceeded),
// SubscriptionLocation: to.Ptr("eastus"),
// },
// SystemData: &armmonitor.SystemData{
// CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-16T12:59:57.051056Z"); 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.051056Z"); return t}()),
// LastModifiedBy: to.Ptr("bobby@contoso.com"),
// LastModifiedByType: to.Ptr(armmonitor.CreatedByTypeUser),
// },
// },
// },
// },
// }
}
}
Output:
Example (GetsListOfScopedResourcesInAPrivateLinkScopeFilteredByKind) ¶
Generated from example definition: 2023-06-01-preview/PrivateLinkScopedResourceListKindFilter.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("00000000-1111-2222-3333-444444444444", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewPrivateLinkScopedResourcesClient().NewListByPrivateLinkScopePager("MyResourceGroup", "MyPrivateLinkScope", &armmonitor.PrivateLinkScopedResourcesClientListByPrivateLinkScopeOptions{
Kind: to.Ptr("Resource")})
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 = armmonitor.PrivateLinkScopedResourcesClientListByPrivateLinkScopeResponse{
// ScopedResourceListResult: armmonitor.ScopedResourceListResult{
// Value: []*armmonitor.ScopedResource{
// {
// Name: to.Ptr("scoped-resource-name-one"),
// 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-one"),
// Properties: &armmonitor.ScopedResourceProperties{
// Kind: to.Ptr(armmonitor.ScopedResourceKindResource),
// LinkedResourceID: to.Ptr("/subscriptions/00000000-0000-2222-3333-444444444444/resourceGroups/MyComponentResourceGroup/providers/Microsoft.Insights/components/my-component"),
// ProvisioningState: to.Ptr(armmonitor.ScopedResourceProvisioningStateSucceeded),
// },
// SystemData: &armmonitor.SystemData{
// CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-16T12:59:57.051056Z"); 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.051056Z"); return t}()),
// LastModifiedBy: to.Ptr("bobby@contoso.com"),
// LastModifiedByType: to.Ptr(armmonitor.CreatedByTypeUser),
// },
// },
// {
// Name: to.Ptr("scoped-resource-name-two"),
// 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-two"),
// Properties: &armmonitor.ScopedResourceProperties{
// Kind: to.Ptr(armmonitor.ScopedResourceKindResource),
// LinkedResourceID: to.Ptr("/subscriptions/00000000-3333-2222-5555-444444444444/resourceGroups/MyWorkspaceResourceGroup/providers/Microsoft.OperationalInsights/workspaces/my-workspace"),
// ProvisioningState: to.Ptr(armmonitor.ScopedResourceProvisioningStateProvisioning),
// },
// SystemData: &armmonitor.SystemData{
// CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-16T12:59:57.051056Z"); 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.051056Z"); 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 long-running operation 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 long-running operation 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 {
// The kind of the private link resource. Not specifying a kind will return scoped resources of all kinds.
Kind *string
}
PrivateLinkScopedResourcesClientListByPrivateLinkScopeOptions contains the optional parameters for the PrivateLinkScopedResourcesClient.NewListByPrivateLinkScopePager method.
type PrivateLinkScopedResourcesClientListByPrivateLinkScopeResponse ¶ added in v0.4.0
type PrivateLinkScopedResourcesClientListByPrivateLinkScopeResponse struct {
// The response of a ScopedResource list operation.
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.
Generated from API version 2023-06-01-preview
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. The value must be an UUID.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - Contains optional client configuration. 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.
- 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: 2023-06-01-preview/PrivateLinkScopesDelete.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("86dc51d3-92ed-4d7e-947a-775ea79b4919", 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 poll 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.
- 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: 2023-06-01-preview/PrivateLinkScopesCreate.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("86dc51d3-92ed-4d7e-947a-775ea79b4919", 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 = armmonitor.PrivateLinkScopesClientCreateOrUpdateResponse{
// 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"),
// Properties: &armmonitor.AzureMonitorPrivateLinkScopeProperties{
// AccessModeSettings: &armmonitor.AccessModeSettings{
// Exclusions: []*armmonitor.AccessModeSettingsExclusion{
// },
// IngestionAccessMode: to.Ptr(armmonitor.AccessModeOpen),
// QueryAccessMode: to.Ptr(armmonitor.AccessModeOpen),
// },
// ProvisioningState: to.Ptr(armmonitor.PrivateLinkScopeProvisioningStateSucceeded),
// },
// SystemData: &armmonitor.SystemData{
// CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-16T12:59:57.051056Z"); 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.051056Z"); return t}()),
// LastModifiedBy: to.Ptr("bobby@contoso.com"),
// LastModifiedByType: to.Ptr(armmonitor.CreatedByTypeUser),
// },
// Tags: map[string]*string{
// },
// },
// }
}
Output:
Example (PrivateLinkScopeUpdate) ¶
Generated from example definition: 2023-06-01-preview/PrivateLinkScopesUpdate.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("86dc51d3-92ed-4d7e-947a-775ea79b4919", 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),
},
},
Tags: map[string]*string{
"Tag1": 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 = armmonitor.PrivateLinkScopesClientCreateOrUpdateResponse{
// 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"),
// Properties: &armmonitor.AzureMonitorPrivateLinkScopeProperties{
// AccessModeSettings: &armmonitor.AccessModeSettings{
// Exclusions: []*armmonitor.AccessModeSettingsExclusion{
// },
// IngestionAccessMode: to.Ptr(armmonitor.AccessModeOpen),
// QueryAccessMode: to.Ptr(armmonitor.AccessModeOpen),
// },
// ProvisioningState: to.Ptr(armmonitor.PrivateLinkScopeProvisioningStateSucceeded),
// },
// SystemData: &armmonitor.SystemData{
// CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-16T12:59:57.051056Z"); 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.051056Z"); return t}()),
// LastModifiedBy: to.Ptr("bobby@contoso.com"),
// LastModifiedByType: to.Ptr(armmonitor.CreatedByTypeUser),
// },
// Tags: map[string]*string{
// "Tag1": to.Ptr("Value1"),
// },
// },
// }
}
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.
- 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: 2023-06-01-preview/PrivateLinkScopesGet.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("86dc51d3-92ed-4d7e-947a-775ea79b4919", 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 = armmonitor.PrivateLinkScopesClientGetResponse{
// 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"),
// Properties: &armmonitor.AzureMonitorPrivateLinkScopeProperties{
// AccessModeSettings: &armmonitor.AccessModeSettings{
// Exclusions: []*armmonitor.AccessModeSettingsExclusion{
// },
// IngestionAccessMode: to.Ptr(armmonitor.AccessModeOpen),
// QueryAccessMode: to.Ptr(armmonitor.AccessModeOpen),
// },
// ProvisioningState: to.Ptr(armmonitor.PrivateLinkScopeProvisioningStateSucceeded),
// },
// SystemData: &armmonitor.SystemData{
// CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-16T12:59:57.051056Z"); 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.051056Z"); return t}()),
// LastModifiedBy: to.Ptr("bobby@contoso.com"),
// LastModifiedByType: to.Ptr(armmonitor.CreatedByTypeUser),
// },
// Tags: map[string]*string{
// },
// },
// }
}
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.
- 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: 2023-06-01-preview/PrivateLinkScopesListByResourceGroup.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("86dc51d3-92ed-4d7e-947a-775ea79b4919", 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 = armmonitor.PrivateLinkScopesClientListByResourceGroupResponse{
// 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"),
// Properties: &armmonitor.AzureMonitorPrivateLinkScopeProperties{
// AccessModeSettings: &armmonitor.AccessModeSettings{
// Exclusions: []*armmonitor.AccessModeSettingsExclusion{
// },
// IngestionAccessMode: to.Ptr(armmonitor.AccessModeOpen),
// QueryAccessMode: to.Ptr(armmonitor.AccessModeOpen),
// },
// ProvisioningState: to.Ptr(armmonitor.PrivateLinkScopeProvisioningStateSucceeded),
// },
// SystemData: &armmonitor.SystemData{
// CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-16T12:59:57.051056Z"); 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.051056Z"); return t}()),
// LastModifiedBy: to.Ptr("bobby@contoso.com"),
// LastModifiedByType: to.Ptr(armmonitor.CreatedByTypeUser),
// },
// Tags: map[string]*string{
// },
// },
// {
// 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"),
// Properties: &armmonitor.AzureMonitorPrivateLinkScopeProperties{
// AccessModeSettings: &armmonitor.AccessModeSettings{
// Exclusions: []*armmonitor.AccessModeSettingsExclusion{
// },
// IngestionAccessMode: to.Ptr(armmonitor.AccessModeOpen),
// QueryAccessMode: to.Ptr(armmonitor.AccessModeOpen),
// },
// ProvisioningState: to.Ptr(armmonitor.PrivateLinkScopeProvisioningStateSucceeded),
// },
// SystemData: &armmonitor.SystemData{
// CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-16T12:59:57.051056Z"); 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.051056Z"); return t}()),
// LastModifiedBy: to.Ptr("bobby@contoso.com"),
// LastModifiedByType: to.Ptr(armmonitor.CreatedByTypeUser),
// },
// Tags: map[string]*string{
// },
// },
// },
// },
// }
}
}
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.
- options - PrivateLinkScopesClientListOptions contains the optional parameters for the PrivateLinkScopesClient.NewListPager method.
Example ¶
Generated from example definition: 2023-06-01-preview/PrivateLinkScopesList.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("86dc51d3-92ed-4d7e-947a-775ea79b4919", 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 = armmonitor.PrivateLinkScopesClientListResponse{
// 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"),
// Properties: &armmonitor.AzureMonitorPrivateLinkScopeProperties{
// AccessModeSettings: &armmonitor.AccessModeSettings{
// Exclusions: []*armmonitor.AccessModeSettingsExclusion{
// },
// IngestionAccessMode: to.Ptr(armmonitor.AccessModeOpen),
// QueryAccessMode: to.Ptr(armmonitor.AccessModeOpen),
// },
// ProvisioningState: to.Ptr(armmonitor.PrivateLinkScopeProvisioningStateSucceeded),
// },
// SystemData: &armmonitor.SystemData{
// CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-16T12:59:57.051056Z"); 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.051056Z"); return t}()),
// LastModifiedBy: to.Ptr("bobby@contoso.com"),
// LastModifiedByType: to.Ptr(armmonitor.CreatedByTypeUser),
// },
// Tags: map[string]*string{
// },
// },
// {
// 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"),
// Properties: &armmonitor.AzureMonitorPrivateLinkScopeProperties{
// AccessModeSettings: &armmonitor.AccessModeSettings{
// Exclusions: []*armmonitor.AccessModeSettingsExclusion{
// },
// IngestionAccessMode: to.Ptr(armmonitor.AccessModeOpen),
// QueryAccessMode: to.Ptr(armmonitor.AccessModeOpen),
// },
// ProvisioningState: to.Ptr(armmonitor.PrivateLinkScopeProvisioningStateSucceeded),
// },
// SystemData: &armmonitor.SystemData{
// CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-16T12:59:57.051056Z"); 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.051056Z"); return t}()),
// LastModifiedBy: to.Ptr("bobby@contoso.com"),
// LastModifiedByType: to.Ptr(armmonitor.CreatedByTypeUser),
// },
// Tags: map[string]*string{
// },
// },
// },
// },
// }
}
}
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.
- 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: 2023-06-01-preview/PrivateLinkScopesUpdateTagsOnly.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("subid", 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 = armmonitor.PrivateLinkScopesClientUpdateTagsResponse{
// 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"),
// Properties: &armmonitor.AzureMonitorPrivateLinkScopeProperties{
// AccessModeSettings: &armmonitor.AccessModeSettings{
// Exclusions: []*armmonitor.AccessModeSettingsExclusion{
// },
// IngestionAccessMode: to.Ptr(armmonitor.AccessModeOpen),
// QueryAccessMode: to.Ptr(armmonitor.AccessModeOpen),
// },
// ProvisioningState: to.Ptr(armmonitor.PrivateLinkScopeProvisioningStateSucceeded),
// },
// SystemData: &armmonitor.SystemData{
// CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-16T12:59:57.051056Z"); 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.051056Z"); return t}()),
// LastModifiedBy: to.Ptr("bobby@contoso.com"),
// LastModifiedByType: to.Ptr(armmonitor.CreatedByTypeUser),
// },
// Tags: map[string]*string{
// "Tag1": to.Ptr("Value1"),
// "Tag2": to.Ptr("Value2"),
// },
// },
// }
}
Output:
type PrivateLinkScopesClientBeginDeleteOptions ¶ added in v0.4.0
type PrivateLinkScopesClientBeginDeleteOptions struct {
// Resumes the long-running operation 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 {
// The response of a AzureMonitorPrivateLinkScope list operation.
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 {
// The response of a AzureMonitorPrivateLinkScope list operation.
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 PromQLCriteria ¶ added in v0.12.0
type PromQLCriteria struct {
// CONSTANT; Specifies the type of the alert criteria. Previously undocumented values might be returned
// Field has constant value OdatatypeMicrosoftAzureMonitorPromQLCriteria, any specified value is ignored.
ODataType *Odatatype
AdditionalProperties map[string]any
// The list of promQL criteria. Alert will be raised when all conditions are met.
AllOf []MultiPromQLCriteriaClassification
// Configuration for failing periods in query-based alerts.
FailingPeriods *QueryFailingPeriods
}
PromQLCriteria - Specifies the PromQL criteria for the metric alert resource.
func (*PromQLCriteria) GetMetricAlertCriteria ¶ added in v0.12.0
func (p *PromQLCriteria) GetMetricAlertCriteria() *MetricAlertCriteria
GetMetricAlertCriteria implements the MetricAlertCriteriaClassification interface for type PromQLCriteria.
func (PromQLCriteria) MarshalJSON ¶ added in v0.12.0
func (p PromQLCriteria) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type PromQLCriteria.
func (*PromQLCriteria) UnmarshalJSON ¶ added in v0.12.0
func (p *PromQLCriteria) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type PromQLCriteria.
type PrometheusForwarderDataSource ¶ added in v0.9.0
type PrometheusForwarderDataSource struct {
// Custom VM Scrape Config that defines scrape jobs
CustomVMScrapeConfig []any
// The list of label inclusion filters in the form of label "name-value" pairs.
// Currently only one label is supported: 'microsoft_metrics_include_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 ProvisioningIssue ¶ added in v0.12.0
type ProvisioningIssue struct {
// READ-ONLY; Name of the issue
Name *string
// READ-ONLY
Properties *ProvisioningIssueProperties
}
ProvisioningIssue - Describes a provisioning issue for a network security perimeter configuration
func (ProvisioningIssue) MarshalJSON ¶ added in v0.12.0
func (p ProvisioningIssue) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ProvisioningIssue.
func (*ProvisioningIssue) UnmarshalJSON ¶ added in v0.12.0
func (p *ProvisioningIssue) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ProvisioningIssue.
type ProvisioningIssueProperties ¶ added in v0.12.0
type ProvisioningIssueProperties struct {
// READ-ONLY; Description of the issue
Description *string
// READ-ONLY; Type of issue
IssueType *IssueType
// READ-ONLY; Severity of the issue.
Severity *Severity
// READ-ONLY; Access rules that can be added to the network security profile (NSP) to remediate the issue.
SuggestedAccessRules []*AccessRule
// READ-ONLY; Fully qualified resource IDs of suggested resources that can be associated to the network security perimeter
// (NSP) to remediate the issue.
SuggestedResourceIDs []*string
}
ProvisioningIssueProperties - Details of a provisioning issue for a network security perimeter (NSP) configuration. Resource providers should generate separate provisioning issue elements for each separate issue detected, and include a meaningful and distinctive description, as well as any appropriate suggestedResourceIds and suggestedAccessRules
func (ProvisioningIssueProperties) MarshalJSON ¶ added in v0.12.0
func (p ProvisioningIssueProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ProvisioningIssueProperties.
func (*ProvisioningIssueProperties) UnmarshalJSON ¶ added in v0.12.0
func (p *ProvisioningIssueProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ProvisioningIssueProperties.
type QueryFailingPeriods ¶ added in v0.12.0
type QueryFailingPeriods struct {
// REQUIRED; The amount of time (in ISO 8601 duration format) alert must be active before firing.
For *string
}
QueryFailingPeriods - Configuration for failing periods in query-based alerts.
func (QueryFailingPeriods) MarshalJSON ¶ added in v0.12.0
func (q QueryFailingPeriods) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type QueryFailingPeriods.
func (*QueryFailingPeriods) UnmarshalJSON ¶ added in v0.12.0
func (q *QueryFailingPeriods) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type QueryFailingPeriods.
type ReceiverStatus ¶
type ReceiverStatus string
ReceiverStatus - Indicates the status of the receiver. Receivers that are not Enabled will not receive any communications.
const ( // ReceiverStatusDisabled - Disabled ReceiverStatusDisabled ReceiverStatus = "Disabled" // ReceiverStatusEnabled - Enabled ReceiverStatusEnabled ReceiverStatus = "Enabled" // ReceiverStatusNotSpecified - NotSpecified 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 - Day RecurrenceFrequencyDay RecurrenceFrequency = "Day" // RecurrenceFrequencyHour - Hour RecurrenceFrequencyHour RecurrenceFrequency = "Hour" // RecurrenceFrequencyMinute - Minute RecurrenceFrequencyMinute RecurrenceFrequency = "Minute" // RecurrenceFrequencyMonth - Month RecurrenceFrequencyMonth RecurrenceFrequency = "Month" // RecurrenceFrequencyNone - None RecurrenceFrequencyNone RecurrenceFrequency = "None" // RecurrenceFrequencySecond - Second RecurrenceFrequencySecond RecurrenceFrequency = "Second" // RecurrenceFrequencyWeek - Week RecurrenceFrequencyWeek RecurrenceFrequency = "Week" // RecurrenceFrequencyYear - Year 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 ReferencesSpecEnrichmentData ¶ added in v0.12.0
type ReferencesSpecEnrichmentData struct {
// All the storage blobs used as enrichment data sources
StorageBlobs []*StorageBlob
}
ReferencesSpecEnrichmentData - All the enrichment data sources referenced in data flows
func (ReferencesSpecEnrichmentData) MarshalJSON ¶ added in v0.12.0
func (r ReferencesSpecEnrichmentData) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ReferencesSpecEnrichmentData.
func (*ReferencesSpecEnrichmentData) UnmarshalJSON ¶ added in v0.12.0
func (r *ReferencesSpecEnrichmentData) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ReferencesSpecEnrichmentData.
type ResolveConfiguration ¶ added in v0.12.0
type ResolveConfiguration struct {
// REQUIRED; Indicates whether the alert should be auto resolved
AutoResolved *bool
// The time (in ISO 8601 duration format) after which the alert should be auto resolved
TimeToResolve *string
}
func (ResolveConfiguration) MarshalJSON ¶ added in v0.12.0
func (r ResolveConfiguration) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ResolveConfiguration.
func (*ResolveConfiguration) UnmarshalJSON ¶ added in v0.12.0
func (r *ResolveConfiguration) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ResolveConfiguration.
type ResourceAssociation ¶ added in v0.12.0
type ResourceAssociation struct {
AccessMode *ResourceAssociationAccessMode
// Name of the resource association
Name *string
}
ResourceAssociation - Information about resource association
func (ResourceAssociation) MarshalJSON ¶ added in v0.12.0
func (r ResourceAssociation) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ResourceAssociation.
func (*ResourceAssociation) UnmarshalJSON ¶ added in v0.12.0
func (r *ResourceAssociation) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ResourceAssociation.
type ResourceAssociationAccessMode ¶ added in v0.12.0
type ResourceAssociationAccessMode string
ResourceAssociationAccessMode - Access mode of the resource association
const ( // ResourceAssociationAccessModeAudit - Audit access mode - traffic to the resource that fails access checks is logged but // not blocked ResourceAssociationAccessModeAudit ResourceAssociationAccessMode = "Audit" // ResourceAssociationAccessModeEnforced - Enforced access mode - traffic to the resource that failed access checks is blocked ResourceAssociationAccessModeEnforced ResourceAssociationAccessMode = "Enforced" // ResourceAssociationAccessModeLearning - Learning access mode - traffic to the resource is enabled for analysis but not // blocked ResourceAssociationAccessModeLearning ResourceAssociationAccessMode = "Learning" )
func PossibleResourceAssociationAccessModeValues ¶ added in v0.12.0
func PossibleResourceAssociationAccessModeValues() []ResourceAssociationAccessMode
PossibleResourceAssociationAccessModeValues returns the possible values for the ResourceAssociationAccessMode const type.
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; The type of managed identity assigned to this resource.
Type *ManagedServiceIdentityType
// The identities assigned to this resource by the user.
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 ISO 8601 duration format with a special case for 'FULL'
// value that returns single datapoint for entire time span requested (*Examples: PT15M, PT1H, P1D, FULL*).
// This may be adjusted and different from what was originally requested if AutoAdjustTimegrain=true is specified. 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 ResultType ¶
type ResultType string
const ( // ResultTypeData - Data ResultTypeData ResultType = "Data" // ResultTypeMetadata - Metadata 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 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 SKUTier ¶ added in v0.12.0
type SKUTier string
SKUTier - This field is required to be implemented by the Resource Provider if the service has more than one tier, but is not required on a PUT.
const ( // SKUTierBasic - The Basic service tier. SKUTierBasic SKUTier = "Basic" // SKUTierFree - The Free service tier. SKUTierFree SKUTier = "Free" // SKUTierPremium - The Premium service tier. SKUTierPremium SKUTier = "Premium" // SKUTierStandard - The Standard service tier. SKUTierStandard SKUTier = "Standard" )
func PossibleSKUTierValues ¶ added in v0.12.0
func PossibleSKUTierValues() []SKUTier
PossibleSKUTierValues returns the possible values for the SKUTier const type.
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 - Decrease ScaleDirectionDecrease ScaleDirection = "Decrease" // ScaleDirectionIncrease - Increase ScaleDirectionIncrease ScaleDirection = "Increase" // ScaleDirectionNone - None 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 - Equals ScaleRuleMetricDimensionOperationTypeEquals ScaleRuleMetricDimensionOperationType = "Equals" // ScaleRuleMetricDimensionOperationTypeNotEquals - NotEquals 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.
const ( // ScaleTypeChangeCount - ChangeCount ScaleTypeChangeCount ScaleType = "ChangeCount" // ScaleTypeExactCount - ExactCount ScaleTypeExactCount ScaleType = "ExactCount" // ScaleTypePercentChangeCount - PercentChangeCount ScaleTypePercentChangeCount ScaleType = "PercentChangeCount" // ScaleTypeServiceAllowedNextValue - ServiceAllowedNextValue ScaleTypeServiceAllowedNextValue ScaleType = "ServiceAllowedNextValue" )
func PossibleScaleTypeValues ¶
func PossibleScaleTypeValues() []ScaleType
PossibleScaleTypeValues returns the possible values for the ScaleType const type.
type ScheduledQueryRuleClient ¶ added in v0.12.0
type ScheduledQueryRuleClient struct {
// contains filtered or unexported fields
}
ScheduledQueryRuleClient contains the methods for the ScheduledQueryRule group. Don't use this type directly, use NewScheduledQueryRuleClient() instead.
Generated from API version 2021-10-01
func NewScheduledQueryRuleClient ¶ added in v0.12.0
func NewScheduledQueryRuleClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ScheduledQueryRuleClient, error)
NewScheduledQueryRuleClient creates a new instance of ScheduledQueryRuleClient with the specified values.
- subscriptionID - The ID of the target subscription. The value must be an UUID.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - Contains optional client configuration. Pass nil to accept the default values.
func (*ScheduledQueryRuleClient) BeginReconcileNSP ¶ added in v0.12.0
func (client *ScheduledQueryRuleClient) BeginReconcileNSP(ctx context.Context, resourceGroupName string, ruleName string, networkSecurityPerimeterConfigurationName string, options *ScheduledQueryRuleClientBeginReconcileNSPOptions) (*runtime.Poller[ScheduledQueryRuleClientReconcileNSPResponse], error)
BeginReconcileNSP - Reconcile network security perimeter configuration for ScheduledQueryRule resource. If the operation fails it returns an *azcore.ResponseError type.
- resourceGroupName - The name of the resource group. The name is case insensitive.
- ruleName - The name of the rule.
- networkSecurityPerimeterConfigurationName - The name for a network security perimeter configuration
- options - ScheduledQueryRuleClientBeginReconcileNSPOptions contains the optional parameters for the ScheduledQueryRuleClient.BeginReconcileNSP method.
Example ¶
Generated from example definition: 2021-10-01/NSPForScheduledQueryRule_Reconcile.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("00000000-1111-2222-3333-444444444444", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewScheduledQueryRuleClient().BeginReconcileNSP(ctx, "exampleRG", "someRule", "somePerimeterConfiguration", 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 poll the result: %v", err)
}
}
Output:
func (*ScheduledQueryRuleClient) GetNSP ¶ added in v0.12.0
func (client *ScheduledQueryRuleClient) GetNSP(ctx context.Context, resourceGroupName string, ruleName string, networkSecurityPerimeterConfigurationName string, options *ScheduledQueryRuleClientGetNSPOptions) (ScheduledQueryRuleClientGetNSPResponse, error)
GetNSP - Gets a network security perimeter configuration. If the operation fails it returns an *azcore.ResponseError type.
- resourceGroupName - The name of the resource group. The name is case insensitive.
- ruleName - The name of the rule.
- networkSecurityPerimeterConfigurationName - The name for a network security perimeter configuration
- options - ScheduledQueryRuleClientGetNSPOptions contains the optional parameters for the ScheduledQueryRuleClient.GetNSP method.
Example ¶
Generated from example definition: 2021-10-01/NSPForScheduledQueryRule_Get.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("00000000-1111-2222-3333-444444444444", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewScheduledQueryRuleClient().GetNSP(ctx, "exampleRG", "someRule", "somePerimeterConfiguration", 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 = armmonitor.ScheduledQueryRuleClientGetNSPResponse{
// NetworkSecurityPerimeterConfiguration: armmonitor.NetworkSecurityPerimeterConfiguration{
// Name: to.Ptr("somePerimeterConfiguration"),
// Type: to.Ptr("Microsoft.Insights/scheduledQueryRules/networkSecurityPerimeterConfigurations"),
// ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/exampleRG/providers/Microsoft.Insights/scheduledQueryRules/someRule/networkSecurityPerimeterConfigurations/somePerimeterConfiguration"),
// Properties: &armmonitor.NetworkSecurityPerimeterConfigurationProperties{
// NetworkSecurityPerimeter: &armmonitor.NetworkSecurityPerimeter{
// ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/networkRG/providers/Microsoft.Network/networkSecurityPerimeters/perimeter1"),
// Location: to.Ptr("japaneast"),
// },
// Profile: &armmonitor.NetworkSecurityProfile{
// Name: to.Ptr("profile1"),
// AccessRules: []*armmonitor.AccessRule{
// {
// Name: to.Ptr("rule1"),
// Properties: &armmonitor.AccessRuleProperties{
// AddressPrefixes: []*string{
// to.Ptr("148.0.0.0/8"),
// to.Ptr("152.4.6.0/24"),
// },
// Direction: to.Ptr(armmonitor.AccessRuleDirectionInbound),
// },
// },
// },
// AccessRulesVersion: to.Ptr[int32](0),
// },
// ProvisioningState: to.Ptr(armmonitor.NetworkSecurityPerimeterConfigurationProvisioningStateAccepted),
// ResourceAssociation: &armmonitor.ResourceAssociation{
// Name: to.Ptr("assoc1"),
// AccessMode: to.Ptr(armmonitor.ResourceAssociationAccessModeEnforced),
// },
// },
// },
// }
}
Output:
func (*ScheduledQueryRuleClient) NewListNSPPager ¶ added in v0.12.0
func (client *ScheduledQueryRuleClient) NewListNSPPager(resourceGroupName string, ruleName string, options *ScheduledQueryRuleClientListNSPOptions) *runtime.Pager[ScheduledQueryRuleClientListNSPResponse]
NewListNSPPager - Gets a list of NSP configurations for specified scheduled query rule.
- resourceGroupName - The name of the resource group. The name is case insensitive.
- ruleName - The name of the rule.
- options - ScheduledQueryRuleClientListNSPOptions contains the optional parameters for the ScheduledQueryRuleClient.NewListNSPPager method.
Example ¶
Generated from example definition: 2021-10-01/NSPForScheduledQueryRule_List.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("00000000-1111-2222-3333-444444444444", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewScheduledQueryRuleClient().NewListNSPPager("exampleRG", "someRule", 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 = armmonitor.ScheduledQueryRuleClientListNSPResponse{
// NetworkSecurityPerimeterConfigurationListResult: armmonitor.NetworkSecurityPerimeterConfigurationListResult{
// Value: []*armmonitor.NetworkSecurityPerimeterConfiguration{
// {
// Name: to.Ptr("somePerimeterConfiguration"),
// Type: to.Ptr("Microsoft.Insights/scheduledQueryRules/networkSecurityPerimeterConfigurations"),
// ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/exampleRG/providers/Microsoft.Insights/scheduledQueryRules/someRule/networkSecurityPerimeterConfigurations/somePerimeterConfiguration"),
// Properties: &armmonitor.NetworkSecurityPerimeterConfigurationProperties{
// NetworkSecurityPerimeter: &armmonitor.NetworkSecurityPerimeter{
// ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/networkRG/providers/Microsoft.Network/networkSecurityPerimeters/perimeter1"),
// Location: to.Ptr("japaneast"),
// },
// Profile: &armmonitor.NetworkSecurityProfile{
// Name: to.Ptr("profile1"),
// AccessRules: []*armmonitor.AccessRule{
// {
// Name: to.Ptr("rule1"),
// Properties: &armmonitor.AccessRuleProperties{
// AddressPrefixes: []*string{
// to.Ptr("148.0.0.0/8"),
// to.Ptr("152.4.6.0/24"),
// },
// Direction: to.Ptr(armmonitor.AccessRuleDirectionInbound),
// },
// },
// },
// AccessRulesVersion: to.Ptr[int32](0),
// },
// ProvisioningState: to.Ptr(armmonitor.NetworkSecurityPerimeterConfigurationProvisioningStateAccepted),
// ResourceAssociation: &armmonitor.ResourceAssociation{
// Name: to.Ptr("assoc1"),
// AccessMode: to.Ptr(armmonitor.ResourceAssociationAccessModeEnforced),
// },
// },
// },
// },
// },
// }
}
}
Output:
type ScheduledQueryRuleClientBeginReconcileNSPOptions ¶ added in v0.12.0
type ScheduledQueryRuleClientBeginReconcileNSPOptions struct {
// Resumes the long-running operation from the provided token.
ResumeToken string
}
ScheduledQueryRuleClientBeginReconcileNSPOptions contains the optional parameters for the ScheduledQueryRuleClient.BeginReconcileNSP method.
type ScheduledQueryRuleClientGetNSPOptions ¶ added in v0.12.0
type ScheduledQueryRuleClientGetNSPOptions struct {
}
ScheduledQueryRuleClientGetNSPOptions contains the optional parameters for the ScheduledQueryRuleClient.GetNSP method.
type ScheduledQueryRuleClientGetNSPResponse ¶ added in v0.12.0
type ScheduledQueryRuleClientGetNSPResponse struct {
// Network security perimeter (NSP) configuration resource
NetworkSecurityPerimeterConfiguration
}
ScheduledQueryRuleClientGetNSPResponse contains the response from method ScheduledQueryRuleClient.GetNSP.
type ScheduledQueryRuleClientListNSPOptions ¶ added in v0.12.0
type ScheduledQueryRuleClientListNSPOptions struct {
}
ScheduledQueryRuleClientListNSPOptions contains the optional parameters for the ScheduledQueryRuleClient.NewListNSPPager method.
type ScheduledQueryRuleClientListNSPResponse ¶ added in v0.12.0
type ScheduledQueryRuleClientListNSPResponse struct {
// Result of a list NSP (network security perimeter) configurations request.
NetworkSecurityPerimeterConfigurationListResult
}
ScheduledQueryRuleClientListNSPResponse contains the response from method ScheduledQueryRuleClient.NewListNSPPager.
type ScheduledQueryRuleClientReconcileNSPResponse ¶ added in v0.12.0
type ScheduledQueryRuleClientReconcileNSPResponse struct {
}
ScheduledQueryRuleClientReconcileNSPResponse contains the response from method ScheduledQueryRuleClient.BeginReconcileNSP.
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 kinds LogAlert and SimpleLogAlert.
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
// Defines the configuration for resolving fired alerts. Relevant only for rules of kinds LogAlert and SimpleLogAlert.
ResolveConfiguration *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; 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
}
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 {
// REQUIRED; The ScheduledQueryRuleResource items on this page
Value []*ScheduledQueryRuleResource
// The link to the next page of items
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.
Generated from API version 2025-01-01-preview
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. The value must be an UUID.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - Contains optional client configuration. 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.
- 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: 2025-01-01-preview/createOrUpdateScheduledQueryRule.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("dd4bfc94-a096-412b-9c43-4bd13e35afbc", 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"),
},
ActionProperties: map[string]*string{
"Icm.Title": to.Ptr("Custom title in ICM"),
"Icm.TsgId": to.Ptr("https://tsg.url"),
},
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"),
ResolveConfiguration: &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.AlertSeverityFour),
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 = armmonitor.ScheduledQueryRulesClientCreateOrUpdateResponse{
// 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"),
// },
// ActionProperties: map[string]*string{
// "Icm.Title": to.Ptr("Custom title in ICM"),
// "Icm.TsgId": to.Ptr("https://tsg.url"),
// },
// 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"),
// ResolveConfiguration: &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.AlertSeverityFour),
// SkipQueryValidation: to.Ptr(true),
// WindowSize: to.Ptr("PT10M"),
// },
// Tags: map[string]*string{
// },
// },
// }
}
Output:
Example (CreateOrUpdateAScheduledQueryRuleOnResourceGroupS) ¶
Generated from example definition: 2025-01-01-preview/createOrUpdateScheduledQueryRuleResourceGroup.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("dd4bfc94-a096-412b-9c43-4bd13e35afbc", 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"),
},
ActionProperties: map[string]*string{
"Icm.Title": to.Ptr("Custom title in ICM"),
"Icm.TsgId": to.Ptr("https://tsg.url"),
},
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"),
ResolveConfiguration: &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.AlertSeverityFour),
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 = armmonitor.ScheduledQueryRulesClientCreateOrUpdateResponse{
// 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"),
// },
// ActionProperties: map[string]*string{
// "Icm.Title": to.Ptr("Custom title in ICM"),
// "Icm.TsgId": to.Ptr("https://tsg.url"),
// },
// 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"),
// ResolveConfiguration: &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.AlertSeverityFour),
// 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: 2025-01-01-preview/createOrUpdateScheduledQueryRuleSubscription.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("dd4bfc94-a096-412b-9c43-4bd13e35afbc", 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"),
},
ActionProperties: map[string]*string{
"Icm.Title": to.Ptr("Custom title in ICM"),
"Icm.TsgId": to.Ptr("https://tsg.url"),
},
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"),
ResolveConfiguration: &armmonitor.RuleResolveConfiguration{
AutoResolved: to.Ptr(true),
TimeToResolve: to.Ptr("PT10M"),
},
Scopes: []*string{
to.Ptr("/subscriptions/aaf177ed-1330-a9f2-80ea-fd3d7783b147"),
},
Severity: to.Ptr(armmonitor.AlertSeverityFour),
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 = armmonitor.ScheduledQueryRulesClientCreateOrUpdateResponse{
// 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"),
// },
// ActionProperties: map[string]*string{
// "Icm.Title": to.Ptr("Custom title in ICM"),
// "Icm.TsgId": to.Ptr("https://tsg.url"),
// },
// 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"),
// ResolveConfiguration: &armmonitor.RuleResolveConfiguration{
// AutoResolved: to.Ptr(true),
// TimeToResolve: to.Ptr("PT10M"),
// },
// Scopes: []*string{
// to.Ptr("/subscriptions/aaf177ed-1330-a9f2-80ea-fd3d7783b147"),
// },
// Severity: to.Ptr( armmonitor.AlertSeverityFour),
// SkipQueryValidation: to.Ptr(true),
// TargetResourceTypes: []*string{
// to.Ptr("Microsoft.Compute/virtualMachines"),
// },
// WindowSize: to.Ptr("PT10M"),
// },
// Tags: map[string]*string{
// },
// },
// }
}
Output:
Example (CreateOrUpdateASimpleLogAlertScheduledQueryRuleOnSubscription) ¶
Generated from example definition: 2025-01-01-preview/createOrUpdateSimpleLogAlertScheduledQueryRule.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("dd4bfc94-a096-412b-9c43-4bd13e35afbc", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewScheduledQueryRulesClient().CreateOrUpdate(ctx, "QueryResourceGroupName", "perf", armmonitor.ScheduledQueryRuleResource{
Kind: to.Ptr(armmonitor.KindSimpleLogAlert),
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"),
},
ActionProperties: map[string]*string{
"Icm.Title": to.Ptr("Custom title in ICM"),
"Icm.TsgId": to.Ptr("https://tsg.url"),
},
CustomProperties: map[string]*string{
"key11": to.Ptr("value11"),
"key12": to.Ptr("value12"),
},
},
AutoMitigate: to.Ptr(false),
CheckWorkspaceAlertsStorageConfigured: to.Ptr(true),
Criteria: &armmonitor.ScheduledQueryRuleCriteria{
AllOf: []*armmonitor.Condition{
{
Query: to.Ptr("Perf | where ObjectName == \"Processor\""),
},
},
},
Enabled: to.Ptr(true),
Scopes: []*string{
to.Ptr("/subscriptions/aaf177ed-1330-a9f2-80ea-fd3d7783b147/resourceGroups/scopeResourceGroup1/providers/Microsoft.Compute/virtualMachines/vm1"),
},
Severity: to.Ptr(armmonitor.AlertSeverityFour),
SkipQueryValidation: 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 = armmonitor.ScheduledQueryRulesClientCreateOrUpdateResponse{
// 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"),
// Kind: to.Ptr(armmonitor.KindSimpleLogAlert),
// 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"),
// },
// ActionProperties: map[string]*string{
// "Icm.Title": to.Ptr("Custom title in ICM"),
// "Icm.TsgId": to.Ptr("https://tsg.url"),
// },
// CustomProperties: map[string]*string{
// "key11": to.Ptr("value11"),
// "key12": to.Ptr("value12"),
// },
// },
// AutoMitigate: to.Ptr(false),
// CheckWorkspaceAlertsStorageConfigured: to.Ptr(true),
// Criteria: &armmonitor.ScheduledQueryRuleCriteria{
// AllOf: []*armmonitor.Condition{
// {
// Query: to.Ptr("Perf | where ObjectName == \"Processor\""),
// },
// },
// },
// Enabled: to.Ptr(true),
// IsWorkspaceAlertsStorageConfigured: to.Ptr(true),
// Scopes: []*string{
// to.Ptr("/subscriptions/aaf177ed-1330-a9f2-80ea-fd3d7783b147/resourceGroups/scopeResourceGroup1/providers/Microsoft.Compute/virtualMachines/vm1"),
// },
// Severity: to.Ptr( armmonitor.AlertSeverityFour),
// SkipQueryValidation: to.Ptr(true),
// },
// Tags: map[string]*string{
// },
// },
// }
}
Output:
Example (CreateOrUpdateDynamicThresholdScheduledQueryRuleOnSubscription) ¶
Generated from example definition: 2025-01-01-preview/createOrUpdateDynamicThresholdScheduledQueryRule.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
"time"
)
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("dd4bfc94-a096-412b-9c43-4bd13e35afbc", 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"),
},
ActionProperties: map[string]*string{
"Icm.Title": to.Ptr("Custom title in ICM"),
"Icm.TsgId": to.Ptr("https://tsg.url"),
},
CustomProperties: map[string]*string{
"key11": to.Ptr("value11"),
"key12": to.Ptr("value12"),
},
},
CheckWorkspaceAlertsStorageConfigured: to.Ptr(true),
Criteria: &armmonitor.ScheduledQueryRuleCriteria{
AllOf: []*armmonitor.Condition{
{
AlertSensitivity: to.Ptr("Medium"),
CriterionType: to.Ptr(armmonitor.CriterionTypeDynamicThresholdCriterion),
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("*"),
},
},
},
IgnoreDataBefore: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-06-01T21:00:00.000Z"); return t }()),
MetricMeasureColumn: to.Ptr("% Processor Time"),
Operator: to.Ptr(armmonitor.ConditionOperatorGreaterOrLessThan),
Query: to.Ptr("Perf | where ObjectName == \"Processor\""),
ResourceIDColumn: to.Ptr("resourceId"),
TimeAggregation: to.Ptr(armmonitor.TimeAggregationAverage),
},
},
},
Enabled: to.Ptr(true),
EvaluationFrequency: to.Ptr("PT5M"),
MuteActionsDuration: to.Ptr("PT30M"),
Scopes: []*string{
to.Ptr("/subscriptions/aaf177ed-1330-a9f2-80ea-fd3d7783b147/resourceGroups/scopeResourceGroup1/providers/Microsoft.Compute/virtualMachines/vm1"),
},
Severity: to.Ptr(armmonitor.AlertSeverityFour),
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 = armmonitor.ScheduledQueryRulesClientCreateOrUpdateResponse{
// 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"),
// },
// ActionProperties: map[string]*string{
// "Icm.Title": to.Ptr("Custom title in ICM"),
// "Icm.TsgId": to.Ptr("https://tsg.url"),
// },
// CustomProperties: map[string]*string{
// "key11": to.Ptr("value11"),
// "key12": to.Ptr("value12"),
// },
// },
// CheckWorkspaceAlertsStorageConfigured: to.Ptr(true),
// Criteria: &armmonitor.ScheduledQueryRuleCriteria{
// AllOf: []*armmonitor.Condition{
// {
// AlertSensitivity: to.Ptr("Medium"),
// CriterionType: to.Ptr(armmonitor.CriterionTypeDynamicThresholdCriterion),
// 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("*"),
// },
// },
// },
// IgnoreDataBefore: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-06-01T21:00:00.000Z"); return t}()),
// MetricMeasureColumn: to.Ptr("% Processor Time"),
// Operator: to.Ptr(armmonitor.ConditionOperatorGreaterOrLessThan),
// Query: to.Ptr("Perf | where ObjectName == \"Processor\""),
// ResourceIDColumn: to.Ptr("resourceId"),
// TimeAggregation: to.Ptr(armmonitor.TimeAggregationAverage),
// },
// },
// },
// Enabled: to.Ptr(true),
// EvaluationFrequency: to.Ptr("PT5M"),
// IsWorkspaceAlertsStorageConfigured: to.Ptr(true),
// MuteActionsDuration: to.Ptr("PT30M"),
// Scopes: []*string{
// to.Ptr("/subscriptions/aaf177ed-1330-a9f2-80ea-fd3d7783b147/resourceGroups/scopeResourceGroup1/providers/Microsoft.Compute/virtualMachines/vm1"),
// },
// Severity: to.Ptr( armmonitor.AlertSeverityFour),
// SkipQueryValidation: to.Ptr(true),
// 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.
- 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: 2025-01-01-preview/deleteScheduledQueryRule.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("dd4bfc94-a096-412b-9c43-4bd13e35afbc", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewScheduledQueryRulesClient().Delete(ctx, "QueryResourceGroupName", "heartbeat", 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 = armmonitor.ScheduledQueryRulesClientDeleteResponse{
// }
}
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.
- 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: 2025-01-01-preview/getScheduledQueryRule.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("dd4bfc94-a096-412b-9c43-4bd13e35afbc", 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 = armmonitor.ScheduledQueryRulesClientGetResponse{
// 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"),
// },
// ActionProperties: map[string]*string{
// "Icm.Title": to.Ptr("Custom title in ICM"),
// "Icm.TsgId": to.Ptr("https://tsg.url"),
// },
// 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"),
// ResolveConfiguration: &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.AlertSeverityFour),
// 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.
- 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: 2025-01-01-preview/listScheduledQueryRulesByResourceGroup.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("dd4bfc94-a096-412b-9c43-4bd13e35afbc", 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 = armmonitor.ScheduledQueryRulesClientListByResourceGroupResponse{
// 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"),
// },
// ActionProperties: map[string]*string{
// "Icm.Title": to.Ptr("Custom title in ICM"),
// "Icm.TsgId": to.Ptr("https://tsg.url"),
// },
// 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"),
// ResolveConfiguration: &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.AlertSeverityFour),
// 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"),
// },
// ActionProperties: map[string]*string{
// "Icm.Title": to.Ptr("Custom title in ICM"),
// "Icm.TsgId": to.Ptr("https://tsg.url"),
// },
// 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"),
// ResolveConfiguration: &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.AlertSeverityFour),
// 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.
- options - ScheduledQueryRulesClientListBySubscriptionOptions contains the optional parameters for the ScheduledQueryRulesClient.NewListBySubscriptionPager method.
Example ¶
Generated from example definition: 2025-01-01-preview/listScheduledQueryRulesBySubscription.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("dd4bfc94-a096-412b-9c43-4bd13e35afbc", 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 = armmonitor.ScheduledQueryRulesClientListBySubscriptionResponse{
// 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"),
// },
// ActionProperties: map[string]*string{
// "Icm.Title": to.Ptr("Custom title in ICM"),
// "Icm.TsgId": to.Ptr("https://tsg.url"),
// },
// 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"),
// ResolveConfiguration: &armmonitor.RuleResolveConfiguration{
// AutoResolved: to.Ptr(true),
// TimeToResolve: to.Ptr("PT10M"),
// },
// Scopes: []*string{
// to.Ptr("/subscriptions/aaf177ed-1330-a9f2-80ea-fd3d7783b147"),
// },
// Severity: to.Ptr( armmonitor.AlertSeverityFour),
// 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"),
// },
// ActionProperties: map[string]*string{
// "Icm.Title": to.Ptr("Custom title in ICM"),
// "Icm.TsgId": to.Ptr("https://tsg.url"),
// },
// 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"),
// ResolveConfiguration: &armmonitor.RuleResolveConfiguration{
// AutoResolved: to.Ptr(true),
// TimeToResolve: to.Ptr("PT10M"),
// },
// Scopes: []*string{
// to.Ptr("/subscriptions/aaf177ed-1330-a9f2-80ea-fd3d7783b147"),
// },
// Severity: to.Ptr( armmonitor.AlertSeverityFour),
// 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.
- 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: 2025-01-01-preview/patchScheduledQueryRule.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("dd4bfc94-a096-412b-9c43-4bd13e35afbc", 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 = armmonitor.ScheduledQueryRulesClientUpdateResponse{
// 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"),
// },
// ActionProperties: map[string]*string{
// "Icm.Title": to.Ptr("Custom title in ICM"),
// "Icm.TsgId": to.Ptr("https://tsg.url"),
// },
// 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"),
// ResolveConfiguration: &armmonitor.RuleResolveConfiguration{
// AutoResolved: to.Ptr(true),
// TimeToResolve: to.Ptr("PT10M"),
// },
// Scopes: []*string{
// to.Ptr("/subscriptions/aaf177ed-1330-a9f2-80ea-fd3d7783b147"),
// },
// Severity: to.Ptr( armmonitor.AlertSeverityFour),
// 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; 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
}
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 ScopedResourceKind ¶ added in v0.12.0
type ScopedResourceKind string
ScopedResourceKind - The kind of scoped Azure monitor resource.
const ( // ScopedResourceKindMetrics - Metrics ScopedResourceKindMetrics ScopedResourceKind = "Metrics" // ScopedResourceKindResource - Resource ScopedResourceKindResource ScopedResourceKind = "Resource" )
func PossibleScopedResourceKindValues ¶ added in v0.12.0
func PossibleScopedResourceKindValues() []ScopedResourceKind
PossibleScopedResourceKindValues returns the possible values for the ScopedResourceKind const type.
type ScopedResourceListResult ¶
type ScopedResourceListResult struct {
// REQUIRED; The ScopedResource items on this page
Value []*ScopedResource
// The link to the next page of items
NextLink *string
}
ScopedResourceListResult - The response of a ScopedResource list operation.
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 kind of scoped Azure monitor resource.
Kind *ScopedResourceKind
// The resource id of the scoped Azure monitor resource.
LinkedResourceID *string
// The location of a scoped subscription. Only needs to be specified for metric dataplane subscriptions.
SubscriptionLocation *string
// READ-ONLY; State of the Azure monitor resource.
ProvisioningState *ScopedResourceProvisioningState
}
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 ScopedResourceProvisioningState ¶ added in v0.12.0
type ScopedResourceProvisioningState string
ScopedResourceProvisioningState - State of the Azure monitor resource.
const ( // ScopedResourceProvisioningStateCanceled - Canceled ScopedResourceProvisioningStateCanceled ScopedResourceProvisioningState = "Canceled" // ScopedResourceProvisioningStateFailed - Failed ScopedResourceProvisioningStateFailed ScopedResourceProvisioningState = "Failed" // ScopedResourceProvisioningStateProvisioning - Provisioning ScopedResourceProvisioningStateProvisioning ScopedResourceProvisioningState = "Provisioning" // ScopedResourceProvisioningStateSucceeded - Succeeded ScopedResourceProvisioningStateSucceeded ScopedResourceProvisioningState = "Succeeded" )
func PossibleScopedResourceProvisioningStateValues ¶ added in v0.12.0
func PossibleScopedResourceProvisioningStateValues() []ScopedResourceProvisioningState
PossibleScopedResourceProvisioningStateValues returns the possible values for the ScopedResourceProvisioningState const type.
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 ServiceDiagnosticSettings ¶ added in v0.12.0
type ServiceDiagnosticSettings struct {
// The resource Id for the event hub namespace authorization rule.
EventHubAuthorizationRuleID *string
// the list of logs settings.
Logs []*LogSettings
// the list of metric settings.
Metrics []*MetricSettings
// The service bus rule ID of the service bus namespace in which you would like to have Event Hubs created for streaming Diagnostic
// Logs. 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 Diagnostic Logs.
StorageAccountID *string
// The workspace ID (resource ID of a Log Analytics workspace) for a 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
}
ServiceDiagnosticSettings - The diagnostic settings for service.
func (ServiceDiagnosticSettings) MarshalJSON ¶ added in v0.12.0
func (s ServiceDiagnosticSettings) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ServiceDiagnosticSettings.
func (*ServiceDiagnosticSettings) UnmarshalJSON ¶ added in v0.12.0
func (s *ServiceDiagnosticSettings) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ServiceDiagnosticSettings.
type ServiceDiagnosticSettingsClient ¶ added in v0.12.0
type ServiceDiagnosticSettingsClient struct {
// contains filtered or unexported fields
}
ServiceDiagnosticSettingsClient contains the methods for the ServiceDiagnosticSettings group. Don't use this type directly, use NewServiceDiagnosticSettingsClient() instead.
Generated from API version 2016-09-01
func NewServiceDiagnosticSettingsClient ¶ added in v0.12.0
func NewServiceDiagnosticSettingsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*ServiceDiagnosticSettingsClient, error)
NewServiceDiagnosticSettingsClient creates a new instance of ServiceDiagnosticSettingsClient with the specified values.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - Contains optional client configuration. Pass nil to accept the default values.
func (*ServiceDiagnosticSettingsClient) CreateOrUpdate ¶ added in v0.12.0
func (client *ServiceDiagnosticSettingsClient) CreateOrUpdate(ctx context.Context, resourceURI string, parameters ServiceDiagnosticSettingsResource, options *ServiceDiagnosticSettingsClientCreateOrUpdateOptions) (ServiceDiagnosticSettingsClientCreateOrUpdateResponse, error)
CreateOrUpdate - Create or update new diagnostic settings for the specified resource. **WARNING**: This method will be deprecated in future releases. If the operation fails it returns an *azcore.ResponseError type.
- resourceURI - The fully qualified Azure Resource manager identifier of the resource.
- parameters - Parameters supplied to the operation.
- options - ServiceDiagnosticSettingsClientCreateOrUpdateOptions contains the optional parameters for the ServiceDiagnosticSettingsClient.CreateOrUpdate method.
Example ¶
Generated from example definition: 2016-09-01/createOrUpdateServiceDiagnosticSetting.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("<subscriptionID>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewServiceDiagnosticSettingsClient().CreateOrUpdate(ctx, "subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourcegroups/viruela1/providers/microsoft.logic/workflows/viruela6", armmonitor.ServiceDiagnosticSettingsResource{
Location: to.Ptr(""),
Properties: &armmonitor.ServiceDiagnosticSettings{
EventHubAuthorizationRuleID: to.Ptr("/subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourceGroups/montest/providers/microsoft.eventhub/namespaces/mynamespace/eventhubs/myeventhub/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),
},
},
},
Metrics: []*armmonitor.MetricSettings{
{
Enabled: to.Ptr(true),
RetentionPolicy: &armmonitor.RetentionPolicy{
Days: to.Ptr[int32](0),
Enabled: to.Ptr(false),
},
TimeGrain: to.Ptr("PT1M"),
},
},
ServiceBusRuleID: to.Ptr("/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/andy1101/providers/Microsoft.EventHub/namespaces/andy1101/authorizationrules/RootManageSharedAccessKey"),
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 = armmonitor.ServiceDiagnosticSettingsClientCreateOrUpdateResponse{
// ServiceDiagnosticSettingsResource: armmonitor.ServiceDiagnosticSettingsResource{
// Name: to.Ptr("service"),
// Type: to.Ptr(""),
// ID: to.Ptr("/subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourcegroups/viruela1/providers/microsoft.logic/workflows/viruela6/diagnosticSettings/service"),
// Location: to.Ptr(""),
// Properties: &armmonitor.ServiceDiagnosticSettings{
// EventHubAuthorizationRuleID: to.Ptr("/subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourceGroups/montest/providers/microsoft.eventhub/namespaces/mynamespace/eventhubs/myeventhub/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),
// },
// },
// },
// Metrics: []*armmonitor.MetricSettings{
// {
// Enabled: to.Ptr(true),
// RetentionPolicy: &armmonitor.RetentionPolicy{
// Days: to.Ptr[int32](0),
// Enabled: to.Ptr(false),
// },
// TimeGrain: to.Ptr("PT1M"),
// },
// },
// ServiceBusRuleID: to.Ptr("/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/andy1101/providers/Microsoft.EventHub/namespaces/andy1101/authorizationrules/RootManageSharedAccessKey"),
// StorageAccountID: to.Ptr("/subscriptions/df602c9c-7aa0-407d-a6fb-eb20c8bd1192/resourceGroups/apptest/providers/Microsoft.Storage/storageAccounts/appteststorage1"),
// WorkspaceID: to.Ptr(""),
// },
// },
// }
}
Output:
func (*ServiceDiagnosticSettingsClient) Get ¶ added in v0.12.0
func (client *ServiceDiagnosticSettingsClient) Get(ctx context.Context, resourceURI string, options *ServiceDiagnosticSettingsClientGetOptions) (ServiceDiagnosticSettingsClientGetResponse, error)
Get - Gets the active diagnostic settings for the specified resource. **WARNING**: This method will be deprecated in future releases. If the operation fails it returns an *azcore.ResponseError type.
- resourceURI - The fully qualified Azure Resource manager identifier of the resource.
- options - ServiceDiagnosticSettingsClientGetOptions contains the optional parameters for the ServiceDiagnosticSettingsClient.Get method.
Example ¶
Generated from example definition: 2016-09-01/getServiceDiagnosticSetting.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("<subscriptionID>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewServiceDiagnosticSettingsClient().Get(ctx, "subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourcegroups/viruela1/providers/microsoft.logic/workflows/viruela6", 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 = armmonitor.ServiceDiagnosticSettingsClientGetResponse{
// ServiceDiagnosticSettingsResource: armmonitor.ServiceDiagnosticSettingsResource{
// Name: to.Ptr("service"),
// Type: to.Ptr(""),
// ID: to.Ptr("/subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourcegroups/viruela1/providers/microsoft.logic/workflows/viruela6/diagnosticSettings/service"),
// Location: to.Ptr(""),
// Properties: &armmonitor.ServiceDiagnosticSettings{
// EventHubAuthorizationRuleID: to.Ptr("/subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourceGroups/montest/providers/microsoft.eventhub/namespaces/mynamespace/eventhubs/myeventhub/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),
// },
// },
// },
// Metrics: []*armmonitor.MetricSettings{
// {
// Enabled: to.Ptr(true),
// RetentionPolicy: &armmonitor.RetentionPolicy{
// Days: to.Ptr[int32](0),
// Enabled: to.Ptr(false),
// },
// TimeGrain: to.Ptr("PT1M"),
// },
// },
// ServiceBusRuleID: to.Ptr("/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/andy1101/providers/Microsoft.EventHub/namespaces/andy1101/authorizationrules/RootManageSharedAccessKey"),
// StorageAccountID: to.Ptr("/subscriptions/df602c9c-7aa0-407d-a6fb-eb20c8bd1192/resourceGroups/apptest/providers/Microsoft.Storage/storageAccounts/appteststorage1"),
// WorkspaceID: to.Ptr(""),
// },
// },
// }
}
Output:
func (*ServiceDiagnosticSettingsClient) Update ¶ added in v0.12.0
func (client *ServiceDiagnosticSettingsClient) Update(ctx context.Context, resourceURI string, serviceDiagnosticSettingsResource ServiceDiagnosticSettingsResourcePatch, options *ServiceDiagnosticSettingsClientUpdateOptions) (ServiceDiagnosticSettingsClientUpdateResponse, error)
Update - Updates an existing ServiceDiagnosticSettingsResource. To update other fields use the CreateOrUpdate method. **WARNING**: This method will be deprecated in future releases. If the operation fails it returns an *azcore.ResponseError type.
- resourceURI - The fully qualified Azure Resource manager identifier of the resource.
- serviceDiagnosticSettingsResource - Parameters supplied to the operation.
- options - ServiceDiagnosticSettingsClientUpdateOptions contains the optional parameters for the ServiceDiagnosticSettingsClient.Update method.
Example ¶
Generated from example definition: 2016-09-01/updateServiceDiagnosticSetting.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("<subscriptionID>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewServiceDiagnosticSettingsClient().Update(ctx, "subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourcegroups/viruela1/providers/microsoft.logic/workflows/viruela6", armmonitor.ServiceDiagnosticSettingsResourcePatch{
Properties: &armmonitor.ServiceDiagnosticSettings{
EventHubAuthorizationRuleID: to.Ptr("/subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourceGroups/montest/providers/microsoft.eventhub/namespaces/mynamespace/eventhubs/myeventhub/authorizationrules/myrule"),
Logs: []*armmonitor.LogSettings{
{
Category: to.Ptr("WorkflowRuntime"),
Enabled: to.Ptr(true),
RetentionPolicy: &armmonitor.RetentionPolicy{
Days: to.Ptr[int32](5),
Enabled: to.Ptr(false),
},
},
},
Metrics: []*armmonitor.MetricSettings{
{
Enabled: to.Ptr(true),
RetentionPolicy: &armmonitor.RetentionPolicy{
Days: to.Ptr[int32](3),
Enabled: to.Ptr(false),
},
TimeGrain: to.Ptr("PT1M"),
},
},
ServiceBusRuleID: to.Ptr("/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/andy1101/providers/Microsoft.EventHub/namespaces/andy1101/authorizationrules/RootManageSharedAccessKey"),
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 = armmonitor.ServiceDiagnosticSettingsClientUpdateResponse{
// ServiceDiagnosticSettingsResource: armmonitor.ServiceDiagnosticSettingsResource{
// Name: to.Ptr("service"),
// Type: to.Ptr(""),
// ID: to.Ptr("/subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourcegroups/viruela1/providers/microsoft.logic/workflows/viruela6/diagnosticSettings/service"),
// Location: to.Ptr(""),
// Properties: &armmonitor.ServiceDiagnosticSettings{
// EventHubAuthorizationRuleID: to.Ptr("/subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourceGroups/montest/providers/microsoft.eventhub/namespaces/mynamespace/eventhubs/myeventhub/authorizationrules/myrule"),
// Logs: []*armmonitor.LogSettings{
// {
// Category: to.Ptr("WorkflowRuntime"),
// Enabled: to.Ptr(true),
// RetentionPolicy: &armmonitor.RetentionPolicy{
// Days: to.Ptr[int32](5),
// Enabled: to.Ptr(false),
// },
// },
// },
// Metrics: []*armmonitor.MetricSettings{
// {
// Enabled: to.Ptr(true),
// RetentionPolicy: &armmonitor.RetentionPolicy{
// Days: to.Ptr[int32](3),
// Enabled: to.Ptr(false),
// },
// TimeGrain: to.Ptr("PT1M"),
// },
// },
// ServiceBusRuleID: to.Ptr("/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/andy1101/providers/Microsoft.EventHub/namespaces/andy1101/authorizationrules/RootManageSharedAccessKey"),
// StorageAccountID: to.Ptr("/subscriptions/df602c9c-7aa0-407d-a6fb-eb20c8bd1192/resourceGroups/apptest/providers/Microsoft.Storage/storageAccounts/appteststorage1"),
// WorkspaceID: to.Ptr(""),
// },
// },
// }
}
Output:
type ServiceDiagnosticSettingsClientCreateOrUpdateOptions ¶ added in v0.12.0
type ServiceDiagnosticSettingsClientCreateOrUpdateOptions struct {
}
ServiceDiagnosticSettingsClientCreateOrUpdateOptions contains the optional parameters for the ServiceDiagnosticSettingsClient.CreateOrUpdate method.
type ServiceDiagnosticSettingsClientCreateOrUpdateResponse ¶ added in v0.12.0
type ServiceDiagnosticSettingsClientCreateOrUpdateResponse struct {
// Description of a service diagnostic setting
ServiceDiagnosticSettingsResource
}
ServiceDiagnosticSettingsClientCreateOrUpdateResponse contains the response from method ServiceDiagnosticSettingsClient.CreateOrUpdate.
type ServiceDiagnosticSettingsClientGetOptions ¶ added in v0.12.0
type ServiceDiagnosticSettingsClientGetOptions struct {
}
ServiceDiagnosticSettingsClientGetOptions contains the optional parameters for the ServiceDiagnosticSettingsClient.Get method.
type ServiceDiagnosticSettingsClientGetResponse ¶ added in v0.12.0
type ServiceDiagnosticSettingsClientGetResponse struct {
// Description of a service diagnostic setting
ServiceDiagnosticSettingsResource
}
ServiceDiagnosticSettingsClientGetResponse contains the response from method ServiceDiagnosticSettingsClient.Get.
type ServiceDiagnosticSettingsClientUpdateOptions ¶ added in v0.12.0
type ServiceDiagnosticSettingsClientUpdateOptions struct {
}
ServiceDiagnosticSettingsClientUpdateOptions contains the optional parameters for the ServiceDiagnosticSettingsClient.Update method.
type ServiceDiagnosticSettingsClientUpdateResponse ¶ added in v0.12.0
type ServiceDiagnosticSettingsClientUpdateResponse struct {
// Description of a service diagnostic setting
ServiceDiagnosticSettingsResource
}
ServiceDiagnosticSettingsClientUpdateResponse contains the response from method ServiceDiagnosticSettingsClient.Update.
type ServiceDiagnosticSettingsResource ¶ added in v0.12.0
type ServiceDiagnosticSettingsResource struct {
// REQUIRED; Resource location
Location *string
// The service diagnostics settings of the resource.
Properties *ServiceDiagnosticSettings
// 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
}
ServiceDiagnosticSettingsResource - Description of a service diagnostic setting
func (ServiceDiagnosticSettingsResource) MarshalJSON ¶ added in v0.12.0
func (s ServiceDiagnosticSettingsResource) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ServiceDiagnosticSettingsResource.
func (*ServiceDiagnosticSettingsResource) UnmarshalJSON ¶ added in v0.12.0
func (s *ServiceDiagnosticSettingsResource) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ServiceDiagnosticSettingsResource.
type ServiceDiagnosticSettingsResourcePatch ¶ added in v0.12.0
type ServiceDiagnosticSettingsResourcePatch struct {
// The service diagnostics settings for an update operation.
Properties *ServiceDiagnosticSettings
// Resource tags
Tags map[string]*string
}
ServiceDiagnosticSettingsResourcePatch - Service diagnostic setting resource for patch operations
func (ServiceDiagnosticSettingsResourcePatch) MarshalJSON ¶ added in v0.12.0
func (s ServiceDiagnosticSettingsResourcePatch) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ServiceDiagnosticSettingsResourcePatch.
func (*ServiceDiagnosticSettingsResourcePatch) UnmarshalJSON ¶ added in v0.12.0
func (s *ServiceDiagnosticSettingsResourcePatch) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ServiceDiagnosticSettingsResourcePatch.
type Severity ¶ added in v0.12.0
type Severity string
Severity - Severity of the issue.
func PossibleSeverityValues ¶ added in v0.12.0
func PossibleSeverityValues() []Severity
PossibleSeverityValues returns the possible values for the Severity const type.
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 StaticPromQLCriteria ¶ added in v0.12.0
type StaticPromQLCriteria struct {
// CONSTANT; Specifies the type of threshold criteria. Previously undocumented values might be returned
// Field has constant value CriterionTypeStaticThresholdCriterion, any specified value is ignored.
CriterionType *CriterionType
// REQUIRED; Name of the criteria.
Name *string
// REQUIRED; The query used to evaluate the alert rule
Query *string
}
StaticPromQLCriteria - The criterion for static prom query.
func (*StaticPromQLCriteria) GetMultiPromQLCriteria ¶ added in v0.12.0
func (s *StaticPromQLCriteria) GetMultiPromQLCriteria() *MultiPromQLCriteria
GetMultiPromQLCriteria implements the MultiPromQLCriteriaClassification interface for type StaticPromQLCriteria.
func (StaticPromQLCriteria) MarshalJSON ¶ added in v0.12.0
func (s StaticPromQLCriteria) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type StaticPromQLCriteria.
func (*StaticPromQLCriteria) UnmarshalJSON ¶ added in v0.12.0
func (s *StaticPromQLCriteria) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type StaticPromQLCriteria.
type StorageBlob ¶ added in v0.12.0
type StorageBlob struct {
// Url of the storage blob
BlobURL *string
// The type of lookup to perform on the blob
LookupType *KnownStorageBlobLookupType
// The name of the enrichment data source used as an alias when referencing this data source in data flows
Name *string
// Resource Id of the storage account that hosts the blob
ResourceID *string
}
func (StorageBlob) MarshalJSON ¶ added in v0.12.0
func (s StorageBlob) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type StorageBlob.
func (*StorageBlob) UnmarshalJSON ¶ added in v0.12.0
func (s *StorageBlob) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type StorageBlob.
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 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
// The link to the next page of items
NextLink *string
}
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 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.<br>Example:<br>Metric contains metadata A, B and C.<br>-
// Return all time series of C where A = a1 and B = b1 or b2<br>**$filter=A eq ‘a1’ and B eq ‘b1’ or B eq ‘b2’ and C eq ‘*’**<br>-
// Invalid variant:<br>**$filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘*’ or B = ‘b2’**<br>This is invalid because the logical
// or operator cannot separate two different metadata names.<br>- Return all time series where A = a1, B = b1 and C = c1:<br>**$filter=A
// eq ‘a1’ and B eq ‘b1’ and C eq ‘c1’**<br>- Return all time series where A = a1<br>**$filter=A eq ‘a1’ and B eq ‘*’ and
// C eq ‘*’**.
Filter *string
// The interval (i.e. timegrain) of the query in ISO 8601 duration format. Defaults to PT1M. Special case for 'FULL' value
// that returns single datapoint for entire time span requested.
// *Examples: PT15M, PT1H, P1D, FULL*
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 'startDateTime_ISO/endDateTime_ISO'.
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
}
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
// The KQL query to transform the data source. This is a deprecated property and will be removed in future versions.
TransformKql *string
}
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 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.
Generated from API version 2015-04-01
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 - Contains optional client configuration. 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.<br>Everything that is applicable to the API to get the Activity Logs for the subscription is applicable to this API (the parameters, $filter, etc.).<br>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.
- options - TenantActivityLogsClientListOptions contains the optional parameters for the TenantActivityLogsClient.NewListPager method.
Example (GetTenantActivityLogsWithFilter) ¶
Generated from example definition: 2015-04-01/GetTenantActivityLogsFiltered.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("<subscriptionID>", 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'")})
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 = armmonitor.TenantActivityLogsClientListResponse{
// EventDataCollection: armmonitor.EventDataCollection{
// NextLink: to.Ptr("https://management.azure.com/subscriptions/089bd33f-d4ec-47fe-8ba5-0753aa5c5b33/providers/microsoft.insights/eventtypes/management/values?$skiptoken=opaqueSkipToken"),
// 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.9792776Z"); 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.9936304Z"); return t}()),
// SubscriptionID: to.Ptr("089bd33f-d4ec-47fe-8ba5-0753aa5c5b33"),
// },
// },
// },
// }
}
}
Output:
Example (GetTenantActivityLogsWithFilterAndSelect) ¶
Generated from example definition: 2015-04-01/GetTenantActivityLogsFilteredAndSelected.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("<subscriptionID>", 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 = armmonitor.TenantActivityLogsClientListResponse{
// EventDataCollection: armmonitor.EventDataCollection{
// NextLink: to.Ptr("https://management.azure.com/subscriptions/089bd33f-d4ec-47fe-8ba5-0753aa5c5b33/providers/microsoft.insights/eventtypes/management/values?$skiptoken=opaqueSkipToken"),
// 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.9792776Z"); 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.9936304Z"); return t}()),
// },
// },
// },
// }
}
}
Output:
Example (GetTenantActivityLogsWithSelect) ¶
Generated from example definition: 2015-04-01/GetTenantActivityLogsSelected.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("<subscriptionID>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewTenantActivityLogsClient().NewListPager(&armmonitor.TenantActivityLogsClientListOptions{
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 = armmonitor.TenantActivityLogsClientListResponse{
// EventDataCollection: armmonitor.EventDataCollection{
// NextLink: to.Ptr("https://management.azure.com/subscriptions/089bd33f-d4ec-47fe-8ba5-0753aa5c5b33/providers/microsoft.insights/eventtypes/management/values?$skiptoken=opaqueSkipToken"),
// 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.9792776Z"); 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.9936304Z"); return t}()),
// },
// },
// },
// }
}
}
Output:
Example (GetTenantActivityLogsWithoutFilterOrSelect) ¶
Generated from example definition: 2015-04-01/GetTenantActivityLogsNoParams.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("<subscriptionID>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewTenantActivityLogsClient().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 = armmonitor.TenantActivityLogsClientListResponse{
// EventDataCollection: armmonitor.EventDataCollection{
// NextLink: to.Ptr("https://management.azure.com/subscriptions/089bd33f-d4ec-47fe-8ba5-0753aa5c5b33/providers/microsoft.insights/eventtypes/management/values?$skiptoken=opaqueSkipToken"),
// 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.9792776Z"); 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.9936304Z"); 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. <br>The **$filter** is very restricted and allows only the following patterns.<br>-
// List events for a resource group: $filter=eventTimestamp ge '<Start Time>' and eventTimestamp le '<End Time>' and eventChannels
// eq 'Admin, Operation' and resourceGroupName eq '<ResourceGroupName>'.<br>- List events for resource: $filter=eventTimestamp
// ge '<Start Time>' and eventTimestamp le '<End Time>' and eventChannels eq 'Admin, Operation' and resourceUri eq '<ResourceURI>'.<br>-
// List events for a subscription: $filter=eventTimestamp ge '<Start Time>' and eventTimestamp le '<End Time>' and eventChannels
// eq 'Admin, Operation'.<br>- List events for a resource provider: $filter=eventTimestamp ge '<Start Time>' and eventTimestamp
// le '<End Time>' and eventChannels eq 'Admin, Operation' and resourceProvider eq '<ResourceProviderName>'.<br>- 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 '<CorrelationID>'.<br>**NOTE**:
// No other syntax is allowed.
Filter *string
// Used to fetch events with only the given properties.<br>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 TimeAggregation ¶ added in v0.8.0
type TimeAggregation string
TimeAggregation - Aggregation type. Relevant and required only for rules of the kind LogAlert.
const ( // TimeAggregationAverage - Average TimeAggregationAverage TimeAggregation = "Average" // TimeAggregationCount - Count TimeAggregationCount TimeAggregation = "Count" // TimeAggregationMaximum - Maximum TimeAggregationMaximum TimeAggregation = "Maximum" // TimeAggregationMinimum - Minimum TimeAggregationMinimum TimeAggregation = "Minimum" // TimeAggregationTotal - Total TimeAggregationTotal TimeAggregation = "Total" )
func PossibleTimeAggregationValues ¶ added in v0.8.0
func PossibleTimeAggregationValues() []TimeAggregation
PossibleTimeAggregationValues returns the possible values for the TimeAggregation 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 - Average TimeAggregationTypeAverage TimeAggregationType = "Average" // TimeAggregationTypeCount - Count TimeAggregationTypeCount TimeAggregationType = "Count" // TimeAggregationTypeLast - Last TimeAggregationTypeLast TimeAggregationType = "Last" // TimeAggregationTypeMaximum - Maximum TimeAggregationTypeMaximum TimeAggregationType = "Maximum" // TimeAggregationTypeMinimum - Minimum TimeAggregationTypeMinimum TimeAggregationType = "Minimum" // TimeAggregationTypeTotal - Total 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 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 resource identity.
ClientID *string
// READ-ONLY; The principal ID of resource identity.
PrincipalID *string
}
UserIdentityProperties - Properties of the user assigned identity.
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 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 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
// The principal id of the managed identity. The value can be "None", "SystemAssigned"
ManagedIdentity *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 WebtestLocationAvailabilityCriteria ¶
type WebtestLocationAvailabilityCriteria struct {
// REQUIRED; The Application Insights resource Id.
ComponentID *string
// REQUIRED; The number of failed locations.
FailedLocationCount *float32
// CONSTANT; Specifies the type of the alert criteria. Previously undocumented values might be returned
// Field has constant value OdatatypeMicrosoftAzureMonitorWebtestLocationAvailabilityCriteria, any specified value is ignored.
ODataType *Odatatype
// REQUIRED; The Application Insights web test Id.
WebTestID *string
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
// The KQL query to transform the data source. This is a deprecated property and will be removed in future versions.
TransformKql *string
// 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
// Firewall logs profile filter
ProfileFilter []*KnownWindowsFirewallLogsDataSourceProfileFilter
}
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.
Source Files
¶
- actiongroups_client.go
- activitylogalerts_client.go
- activitylogs_client.go
- alertruleincidents_client.go
- autoscalesettings_client.go
- baselines_client.go
- client_factory.go
- constants.go
- datacollectionendpoints_client.go
- datacollectionruleassociations_client.go
- datacollectionrules_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
- options.go
- polymorphic_helpers.go
- predictivemetric_client.go
- privateendpointconnections_client.go
- privatelinkresources_client.go
- privatelinkscopedresources_client.go
- privatelinkscopeoperationstatus_client.go
- privatelinkscopes_client.go
- responses.go
- scheduledqueryrule_client.go
- scheduledqueryrules_client.go
- servicediagnosticsettings_client.go
- tenantactivitylogs_client.go
- version.go