metric_alerts
Creates, updates, deletes, gets or lists a metric_alerts
resource.
Overview
Name | metric_alerts |
Type | Resource |
Id | azure.monitor.metric_alerts |
Fields
- vw_metric_alerts
- metric_alerts
Name | Datatype | Description |
---|---|---|
id | text | Azure resource Id |
name | text | Azure resource name |
description | text | field from the properties object |
actions | text | field from the properties object |
auto_mitigate | text | field from the properties object |
criteria | text | field from the properties object |
enabled | text | field from the properties object |
evaluation_frequency | text | field from the properties object |
is_migrated | text | field from the properties object |
last_updated_time | text | field from the properties object |
location | text | Resource location |
resourceGroupName | text | field from the properties object |
ruleName | text | field from the properties object |
scopes | text | field from the properties object |
severity | text | field from the properties object |
subscriptionId | text | field from the properties object |
system_data | text | field from the properties object |
tags | text | Gets or sets a list of key value pairs that describe the resource. These tags can be used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key no greater in length than 128 characters and a value no greater in length than 256 characters. |
target_resource_region | text | field from the properties object |
target_resource_type | text | field from the properties object |
type | text | Azure resource type |
window_size | text | field from the properties object |
Name | Datatype | Description |
---|---|---|
id | string | Azure resource Id |
name | string | Azure resource name |
location | string | Resource location |
properties | object | An alert rule. |
systemData | object | Metadata pertaining to creation and last modification of the resource. |
tags | object | Gets or sets a list of key value pairs that describe the resource. These tags can be used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key no greater in length than 128 characters and a value no greater in length than 256 characters. |
type | string | Azure resource type |
Methods
Name | Accessible by | Required Params | Description |
---|---|---|---|
get | SELECT | resourceGroupName, ruleName, subscriptionId | Retrieve an alert rule definition. |
list_by_resource_group | SELECT | resourceGroupName, subscriptionId | Retrieve alert rule definitions in a resource group. |
list_by_subscription | SELECT | subscriptionId | Retrieve alert rule definitions in a subscription. |
create_or_update | INSERT | resourceGroupName, ruleName, subscriptionId, data__properties | Create or update an metric alert definition. |
delete | DELETE | resourceGroupName, ruleName, subscriptionId | Delete an alert rule definition. |
update | UPDATE | resourceGroupName, ruleName, subscriptionId | Update an metric alert definition. |
SELECT
examples
Retrieve alert rule definitions in a subscription.
- vw_metric_alerts
- metric_alerts
SELECT
id,
name,
description,
actions,
auto_mitigate,
criteria,
enabled,
evaluation_frequency,
is_migrated,
last_updated_time,
location,
resourceGroupName,
ruleName,
scopes,
severity,
subscriptionId,
system_data,
tags,
target_resource_region,
target_resource_type,
type,
window_size
FROM azure.monitor.vw_metric_alerts
WHERE subscriptionId = '{{ subscriptionId }}';
SELECT
id,
name,
location,
properties,
systemData,
tags,
type
FROM azure.monitor.metric_alerts
WHERE subscriptionId = '{{ subscriptionId }}';
INSERT
example
Use the following StackQL query and manifest file to create a new metric_alerts
resource.
- All Properties
- Manifest
/*+ create */
INSERT INTO azure.monitor.metric_alerts (
resourceGroupName,
ruleName,
subscriptionId,
data__properties,
location,
tags,
properties
)
SELECT
'{{ resourceGroupName }}',
'{{ ruleName }}',
'{{ subscriptionId }}',
'{{ data__properties }}',
'{{ location }}',
'{{ tags }}',
'{{ properties }}'
;
- name: your_resource_model_name
props:
- name: id
value: string
- name: name
value: string
- name: type
value: string
- name: location
value: string
- name: tags
value: object
- name: systemData
value:
- name: createdBy
value: string
- name: createdByType
value: string
- name: createdAt
value: string
- name: lastModifiedBy
value: string
- name: lastModifiedByType
value: string
- name: lastModifiedAt
value: string
- name: properties
value:
- name: description
value: string
- name: severity
value: integer
- name: enabled
value: boolean
- name: scopes
value:
- string
- name: evaluationFrequency
value: string
- name: windowSize
value: string
- name: targetResourceType
value: string
- name: targetResourceRegion
value: string
- name: criteria
value:
- name: odata.type
value: string
- name: autoMitigate
value: boolean
- name: actions
value:
- - name: actionGroupId
value: string
- name: webHookProperties
value: object
- name: lastUpdatedTime
value: string
- name: isMigrated
value: boolean
UPDATE
example
Updates a metric_alerts
resource.
/*+ update */
UPDATE azure.monitor.metric_alerts
SET
tags = '{{ tags }}',
properties = '{{ properties }}'
WHERE
resourceGroupName = '{{ resourceGroupName }}'
AND ruleName = '{{ ruleName }}'
AND subscriptionId = '{{ subscriptionId }}';
DELETE
example
Deletes the specified metric_alerts
resource.
/*+ delete */
DELETE FROM azure.monitor.metric_alerts
WHERE resourceGroupName = '{{ resourceGroupName }}'
AND ruleName = '{{ ruleName }}'
AND subscriptionId = '{{ subscriptionId }}';