ScheduledQueryRuleResource Class

The scheduled query rule 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

ScheduledQueryRuleResource(*, location: str, identity: _models.Identity | None = None, tags: Dict[str, str] | None = None, kind: str | _models.Kind | None = None, description: str | None = None, display_name: str | None = None, severity: int | _models.AlertSeverity | None = None, enabled: bool | None = None, scopes: List[str] | None = None, evaluation_frequency: timedelta | None = None, window_size: timedelta | None = None, override_query_time_range: timedelta | None = None, target_resource_types: List[str] | None = None, criteria: _models.ScheduledQueryRuleCriteria | None = None, mute_actions_duration: timedelta | None = None, actions: _models.Actions | None = None, check_workspace_alerts_storage_configured: bool | None = None, skip_query_validation: bool | None = None, auto_mitigate: bool | None = None, resolve_configuration: _models.RuleResolveConfiguration | None = None, **kwargs: Any)

Keyword-Only Parameters

Name Description
identity

The identity of the resource.

Default value: None
tags

Resource tags.

Default value: None
location
str

The geo-location where the resource lives. Required.

kind
str or Kind

Indicates the type of scheduled query rule. The default is LogAlert. Known values are: "LogAlert" and "LogToMetric".

Default value: None
description
str

The description of the scheduled query rule.

Default value: None
display_name
str

The display name of the alert rule.

Default value: None
severity

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. Known values are: 0, 1, 2, 3, and 4.

Default value: None
enabled

The flag which indicates whether this scheduled query rule is enabled. Value should be true or false.

Default value: None
scopes

The list of resource id's that this scheduled query rule is scoped to.

Default value: None
evaluation_frequency

How often the scheduled query rule is evaluated represented in ISO 8601 duration format. Relevant and required only for rules of the kind LogAlert.

Default value: None
window_size

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.

Default value: None
override_query_time_range

If specified then overrides the query time range (default is WindowSize*NumberOfEvaluationPeriods). Relevant only for rules of the kind LogAlert.

Default value: None
target_resource_types

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.

Default value: None
criteria

The rule criteria that defines the conditions of the scheduled query rule.

Default value: None
mute_actions_duration

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.

Default value: None
actions

Actions to invoke when the alert fires.

Default value: None
check_workspace_alerts_storage_configured

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.

Default value: None
skip_query_validation

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.

Default value: None
auto_mitigate

The flag that indicates whether the alert should be automatically resolved or not. The default is true. Relevant only for rules of the kind LogAlert.

Default value: None
resolve_configuration

Defines the configuration for resolving fired alerts. Relevant only for rules of the kind LogAlert.

Default value: None

Variables

Name Description
id
str

Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.

name
str

The name of the resource.

type
str

The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts".

identity

The identity of the resource.

tags

Resource tags.

location
str

The geo-location where the resource lives. Required.

kind
str or Kind

Indicates the type of scheduled query rule. The default is LogAlert. Known values are: "LogAlert" and "LogToMetric".

etag
str

The etag field is not required. If it is provided in the response body, it must also be provided as a header per the normal etag convention. Entity tags are used for comparing two or more entities from the same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields.

system_data

SystemData of ScheduledQueryRule.

created_with_api_version
str

The api-version used when creating this alert rule.

is_legacy_log_analytics_rule

True if alert rule is legacy Log Analytic rule.

description
str

The description of the scheduled query rule.

display_name
str

The display name of the alert rule.

severity

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. Known values are: 0, 1, 2, 3, and 4.

enabled

The flag which indicates whether this scheduled query rule is enabled. Value should be true or false.

scopes

The list of resource id's that this scheduled query rule is scoped to.

evaluation_frequency

How often the scheduled query rule is evaluated represented in ISO 8601 duration format. Relevant and required only for rules of the kind LogAlert.

window_size

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.

override_query_time_range

If specified then overrides the query time range (default is WindowSize*NumberOfEvaluationPeriods). Relevant only for rules of the kind LogAlert.

target_resource_types

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.

criteria

The rule criteria that defines the conditions of the scheduled query rule.

mute_actions_duration

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.

actions

Actions to invoke when the alert fires.

is_workspace_alerts_storage_configured

The flag which indicates whether this scheduled query rule has been configured to be stored in the customer's storage. The default is false.

check_workspace_alerts_storage_configured

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.

skip_query_validation

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.

auto_mitigate

The flag that indicates whether the alert should be automatically resolved or not. The default is true. Relevant only for rules of the kind LogAlert.

resolve_configuration

Defines the configuration for resolving fired alerts. Relevant only for rules of the kind LogAlert.