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. (monitor-notification-rule) (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. (monitor-notification-rule) (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 | include | Returns a monitor notification rule by rule_id. |
get_monitor_notification_rules | select | page, per_page, sort, filters, include | Returns a list of all monitor notification rules. | |
create_monitor_notification_rule | insert | data | Creates a monitor notification rule. | |
update_monitor_notification_rule | update | rule_id, data | Updates a monitor notification rule by rule_id. | |
delete_monitor_notification_rule | delete | rule_id | 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 |
|---|---|---|
rule_id | string | ID of the monitor notification rule to delete. |
site | string | The Datadog site (region) for your organization, for example datadoghq.com, us3.datadoghq.com, us5.datadoghq.com, ap1.datadoghq.com, ap2.datadoghq.com, datadoghq.eu, ddog-gov.com. Resolved from the DD_SITE environment variable when set. Optional: defaults to datadoghq.com, or the value of the DD_SITE environment variable when set; a WHERE value overrides both. |
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 include = '{{ include }}'
;
Returns a list of all monitor notification rules.
SELECT
id,
attributes,
relationships,
type
FROM datadog.monitoring.notification_rules
WHERE 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
)
SELECT
'{{ data }}' /* required */
RETURNING
data,
included
;
# Description fields are for documentation purposes
- name: notification_rules
props:
- name: data
description: |
Object to create a monitor notification rule.
value:
attributes:
bundle_config:
duration: {{ duration }}
conditional_recipients:
conditions:
- recipients: "{{ recipients }}"
scope: "{{ scope }}"
fallback_recipients:
- "{{ fallback_recipients }}"
filter:
tags:
- "{{ tags }}"
scope: "{{ scope }}"
name: "{{ name }}"
recipients:
- "{{ recipients }}"
type: "{{ type }}"
UPDATE examples
- update_monitor_notification_rule
Updates a monitor notification rule by rule_id.
UPDATE datadog.monitoring.notification_rules
SET
data = '{{ data }}'
WHERE
rule_id = '{{ rule_id }}' --required
AND 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
;