alert_rule_resources
Creates, updates, deletes, gets or lists an alert_rule_resources resource.
Overview
| Name | alert_rule_resources |
| Type | Resource |
| Id | azure.database_watcher.alert_rule_resources |
Fields
The following fields are returned by SELECT queries:
- get
- list_by_parent
| Name | Datatype | Description |
|---|---|---|
id | string | Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long |
name | string | The name of the resource. |
alertRuleResourceId | string | The resource ID of the alert rule resource. Required. |
alertRuleTemplateId | string | The template ID associated with alert rule resource. Required. |
alertRuleTemplateVersion | string | The alert rule template version. Required. |
createdWithProperties | string | The properties with which the alert rule resource was created. Required. Known values are: "CreatedWithActionGroup" and "None". (CreatedWithActionGroup, None) |
creationTime | string (date-time) | The creation time of the alert rule resource. Required. |
provisioningState | string | The provisioning state of the alert rule resource. Known values are: "Succeeded", "Failed", and "Canceled". (Succeeded, Failed, Canceled) |
systemData | object | Azure Resource Manager metadata containing createdBy and modifiedBy information. |
type | string | The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". |
| Name | Datatype | Description |
|---|---|---|
id | string | Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long |
name | string | The name of the resource. |
alertRuleResourceId | string | The resource ID of the alert rule resource. Required. |
alertRuleTemplateId | string | The template ID associated with alert rule resource. Required. |
alertRuleTemplateVersion | string | The alert rule template version. Required. |
createdWithProperties | string | The properties with which the alert rule resource was created. Required. Known values are: "CreatedWithActionGroup" and "None". (CreatedWithActionGroup, None) |
creationTime | string (date-time) | The creation time of the alert rule resource. Required. |
provisioningState | string | The provisioning state of the alert rule resource. Known values are: "Succeeded", "Failed", and "Canceled". (Succeeded, Failed, Canceled) |
systemData | object | Azure Resource Manager metadata containing createdBy and modifiedBy information. |
type | string | The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | resource_group_name, watcher_name, alert_rule_resource_name, subscription_id | Get a AlertRuleResource. | |
list_by_parent | select | resource_group_name, watcher_name, subscription_id | List AlertRuleResource resources by Watcher. | |
create_or_update | insert | resource_group_name, watcher_name, alert_rule_resource_name, subscription_id | Create a AlertRuleResource. | |
create_or_update | replace | resource_group_name, watcher_name, alert_rule_resource_name, subscription_id | Create a AlertRuleResource. | |
delete | delete | resource_group_name, watcher_name, alert_rule_resource_name, subscription_id | Delete a AlertRuleResource. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
alert_rule_resource_name | string | The alert rule proxy resource name. Required. |
resource_group_name | string | The name of the resource group. The name is case insensitive. Required. |
subscription_id | string | |
watcher_name | string | The database watcher name. Required. |
SELECT examples
- get
- list_by_parent
Get a AlertRuleResource.
SELECT
id,
name,
alertRuleResourceId,
alertRuleTemplateId,
alertRuleTemplateVersion,
createdWithProperties,
creationTime,
provisioningState,
systemData,
type
FROM azure.database_watcher.alert_rule_resources
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND watcher_name = '{{ watcher_name }}' -- required
AND alert_rule_resource_name = '{{ alert_rule_resource_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;
List AlertRuleResource resources by Watcher.
SELECT
id,
name,
alertRuleResourceId,
alertRuleTemplateId,
alertRuleTemplateVersion,
createdWithProperties,
creationTime,
provisioningState,
systemData,
type
FROM azure.database_watcher.alert_rule_resources
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND watcher_name = '{{ watcher_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;
INSERT examples
- create_or_update
- Manifest
Create a AlertRuleResource.
INSERT INTO azure.database_watcher.alert_rule_resources (
properties,
resource_group_name,
watcher_name,
alert_rule_resource_name,
subscription_id
)
SELECT
'{{ properties }}',
'{{ resource_group_name }}',
'{{ watcher_name }}',
'{{ alert_rule_resource_name }}',
'{{ subscription_id }}'
RETURNING
id,
name,
properties,
systemData,
type
;
# Description fields are for documentation purposes
- name: alert_rule_resources
props:
- name: resource_group_name
value: "{{ resource_group_name }}"
description: Required parameter for the alert_rule_resources resource.
- name: watcher_name
value: "{{ watcher_name }}"
description: Required parameter for the alert_rule_resources resource.
- name: alert_rule_resource_name
value: "{{ alert_rule_resource_name }}"
description: Required parameter for the alert_rule_resources resource.
- name: subscription_id
value: "{{ subscription_id }}"
description: Required parameter for the alert_rule_resources resource.
- name: properties
description: |
The resource-specific properties for this resource.
value:
alertRuleResourceId: "{{ alertRuleResourceId }}"
createdWithProperties: "{{ createdWithProperties }}"
creationTime: "{{ creationTime }}"
provisioningState: "{{ provisioningState }}"
alertRuleTemplateId: "{{ alertRuleTemplateId }}"
alertRuleTemplateVersion: "{{ alertRuleTemplateVersion }}"
REPLACE examples
- create_or_update
Create a AlertRuleResource.
REPLACE azure.database_watcher.alert_rule_resources
SET
properties = '{{ properties }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND watcher_name = '{{ watcher_name }}' --required
AND alert_rule_resource_name = '{{ alert_rule_resource_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
RETURNING
id,
name,
properties,
systemData,
type;
DELETE examples
- delete
Delete a AlertRuleResource.
DELETE FROM azure.database_watcher.alert_rule_resources
WHERE resource_group_name = '{{ resource_group_name }}' --required
AND watcher_name = '{{ watcher_name }}' --required
AND alert_rule_resource_name = '{{ alert_rule_resource_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
;