notification_rules
Creates, updates, deletes, gets or lists a notification_rules resource.
Overview
| Name | notification_rules |
| Type | Resource |
| Id | datadog.monitoring.notification_rules |
Fields
The following fields are returned by SELECT queries:
- get_monitor_notification_rule
- get_monitor_notification_rules
| Name | Datatype | Description |
|---|---|---|
id | string | The ID of the monitor notification rule. (example: 00000000-0000-1234-0000-000000000000) |
attributes | object | Attributes of the monitor notification rule. |
relationships | object | All relationships associated with monitor notification rule. |
type | string | Monitor notification rule resource type. (default: monitor-notification-rule, example: monitor-notification-rule) |
| Name | Datatype | Description |
|---|---|---|
id | string | The ID of the monitor notification rule. (example: 00000000-0000-1234-0000-000000000000) |
attributes | object | Attributes of the monitor notification rule. |
relationships | object | All relationships associated with monitor notification rule. |
type | string | Monitor notification rule resource type. (default: monitor-notification-rule, example: monitor-notification-rule) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_monitor_notification_rule | select | rule_id, region | include | Returns a monitor notification rule by rule_id. |
get_monitor_notification_rules | select | region | page, per_page, sort, filters, include | Returns a list of all monitor notification rules. |
create_monitor_notification_rule | insert | region, data__data | Creates a monitor notification rule. | |
update_monitor_notification_rule | update | rule_id, region, data__data | Updates a monitor notification rule by rule_id. | |
delete_monitor_notification_rule | delete | rule_id, region | Deletes a monitor notification rule by rule_id. |
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 |
|---|---|---|
region | string | (default: datadoghq.com) |
rule_id | string | ID of the monitor notification rule to delete. |
filters | string | JSON-encoded filter object. Supported keys: * text: Free-text query matched against rule name, tags, and recipients. * tags: Array of strings. Return rules that have any of these tags. * recipients: Array of strings. Return rules that have any of these recipients. (example: {"text":"error","tags":["env:prod","team:my-team"],"recipients":["slack-monitor-app","email@example.com"]}) |
include | string | Comma-separated list of resource paths for related resources to include in the response. Supported resource path is created_by. |
page | integer (int32) | The page to start paginating from. If page is not specified, the argument defaults to the first page. |
per_page | integer (int32) | The number of rules to return per page. If per_page is not specified, the argument defaults to 100. |
sort | string | String for sort order, composed of field and sort order separated by a colon, for example name:asc. Supported sort directions: asc, desc. Supported fields: name, created_at. |
SELECT examples
- get_monitor_notification_rule
- get_monitor_notification_rules
Returns a monitor notification rule by rule_id.
SELECT
id,
attributes,
relationships,
type
FROM datadog.monitoring.notification_rules
WHERE rule_id = '{{ rule_id }}' -- required
AND region = '{{ region }}' -- required
AND include = '{{ include }}'
;
Returns a list of all monitor notification rules.
SELECT
id,
attributes,
relationships,
type
FROM datadog.monitoring.notification_rules
WHERE region = '{{ region }}' -- required
AND page = '{{ page }}'
AND per_page = '{{ per_page }}'
AND sort = '{{ sort }}'
AND filters = '{{ filters }}'
AND include = '{{ include }}'
;
INSERT examples
- create_monitor_notification_rule
- Manifest
Creates a monitor notification rule.
INSERT INTO datadog.monitoring.notification_rules (
data__data,
region
)
SELECT
'{{ data }}' /* required */,
'{{ region }}'
RETURNING
data,
included
;
# Description fields are for documentation purposes
- name: notification_rules
props:
- name: region
value: string
description: Required parameter for the notification_rules resource.
- name: data
value: object
description: |
Object to create a monitor notification rule.
UPDATE examples
- update_monitor_notification_rule
Updates a monitor notification rule by rule_id.
UPDATE datadog.monitoring.notification_rules
SET
data__data = '{{ data }}'
WHERE
rule_id = '{{ rule_id }}' --required
AND region = '{{ region }}' --required
AND data__data = '{{ data }}' --required
RETURNING
data,
included;
DELETE examples
- delete_monitor_notification_rule
Deletes a monitor notification rule by rule_id.
DELETE FROM datadog.monitoring.notification_rules
WHERE rule_id = '{{ rule_id }}' --required
AND region = '{{ region }}' --required
;