MetricAlertResource Class
The metric alert resource.
Variables are only populated by the server, and will be ignored when sending a request.
All required parameters must be populated in order to send to server.
Constructor
MetricAlertResource(*, location: str, severity: int, enabled: bool, scopes: List[str], evaluation_frequency: timedelta, window_size: timedelta, criteria: _models.MetricAlertCriteria, tags: Dict[str, str] | None = None, description: str | None = None, target_resource_type: str | None = None, target_resource_region: str | None = None, auto_mitigate: bool | None = None, actions: List[_models.MetricAlertAction] | None = None, **kwargs: Any)
Keyword-Only Parameters
| Name | Description |
|---|---|
|
location
|
Resource location. Required. |
|
tags
|
Resource tags. Default value: None
|
|
description
|
the description of the metric alert that will be included in the alert email. Default value: None
|
|
severity
|
Alert severity {0, 1, 2, 3, 4}. Required. |
|
enabled
|
the flag that indicates whether the metric alert is enabled. Required. |
|
scopes
|
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. Required. |
|
evaluation_frequency
|
how often the metric alert is evaluated represented in ISO 8601 duration format. Required. |
|
window_size
|
the period of time (in ISO 8601 duration format) that is used to monitor alert activity based on the threshold. Required. |
|
target_resource_type
|
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. Default value: None
|
|
target_resource_region
|
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. Default value: None
|
|
criteria
|
defines the specific alert criteria information. Required. |
|
auto_mitigate
|
the flag that indicates whether the alert should be auto resolved or not. The default is true. Default value: None
|
|
actions
|
the array of actions that are performed when the alert rule becomes active, and when an alert condition is resolved. Default value: None
|
Variables
| Name | Description |
|---|---|
|
id
|
Azure resource Id. |
|
name
|
Azure resource name. |
|
type
|
Azure resource type. |
|
location
|
Resource location. Required. |
|
tags
|
Resource tags. |
|
description
|
the description of the metric alert that will be included in the alert email. |
|
severity
|
Alert severity {0, 1, 2, 3, 4}. Required. |
|
enabled
|
the flag that indicates whether the metric alert is enabled. Required. |
|
scopes
|
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. Required. |
|
evaluation_frequency
|
how often the metric alert is evaluated represented in ISO 8601 duration format. Required. |
|
window_size
|
the period of time (in ISO 8601 duration format) that is used to monitor alert activity based on the threshold. Required. |
|
target_resource_type
|
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. |
|
target_resource_region
|
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. |
|
criteria
|
defines the specific alert criteria information. Required. |
|
auto_mitigate
|
the flag that indicates whether the alert should be auto resolved or not. The default is true. |
|
actions
|
the array of actions that are performed when the alert rule becomes active, and when an alert condition is resolved. |
|
last_updated_time
|
Last time the rule was updated in ISO8601 format. |
|
is_migrated
|
the value indicating whether this alert rule is migrated. |