Skip to main content

alert_rule_resources

Creates, updates, deletes, gets or lists a alert_rule_resources resource.

Overview

Namealert_rule_resources
TypeResource
Idazure.db_watcher.alert_rule_resources

Fields

NameDatatypeDescription
alertRuleResourceNametextfield from the properties object
alert_rule_resource_idtextfield from the properties object
alert_rule_template_idtextfield from the properties object
alert_rule_template_versiontextfield from the properties object
created_with_propertiestextfield from the properties object
creation_timetextfield from the properties object
provisioning_statetextfield from the properties object
resourceGroupNametextfield from the properties object
subscriptionIdtextfield from the properties object
watcherNametextfield from the properties object

Methods

NameAccessible byRequired ParamsDescription
getSELECTalertRuleResourceName, resourceGroupName, subscriptionId, watcherNameGet a AlertRuleResource
list_by_parentSELECTresourceGroupName, subscriptionId, watcherNameList AlertRuleResource resources by Watcher
create_or_updateINSERTalertRuleResourceName, resourceGroupName, subscriptionId, watcherNameCreate a AlertRuleResource
deleteDELETEalertRuleResourceName, resourceGroupName, subscriptionId, watcherNameDelete a AlertRuleResource

SELECT examples

List AlertRuleResource resources by Watcher

SELECT
alertRuleResourceName,
alert_rule_resource_id,
alert_rule_template_id,
alert_rule_template_version,
created_with_properties,
creation_time,
provisioning_state,
resourceGroupName,
subscriptionId,
watcherName
FROM azure.db_watcher.vw_alert_rule_resources
WHERE resourceGroupName = '{{ resourceGroupName }}'
AND subscriptionId = '{{ subscriptionId }}'
AND watcherName = '{{ watcherName }}';

INSERT example

Use the following StackQL query and manifest file to create a new alert_rule_resources resource.

/*+ create */
INSERT INTO azure.db_watcher.alert_rule_resources (
alertRuleResourceName,
resourceGroupName,
subscriptionId,
watcherName,
properties
)
SELECT
'{{ alertRuleResourceName }}',
'{{ resourceGroupName }}',
'{{ subscriptionId }}',
'{{ watcherName }}',
'{{ properties }}'
;

DELETE example

Deletes the specified alert_rule_resources resource.

/*+ delete */
DELETE FROM azure.db_watcher.alert_rule_resources
WHERE alertRuleResourceName = '{{ alertRuleResourceName }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND subscriptionId = '{{ subscriptionId }}'
AND watcherName = '{{ watcherName }}';