on_call_user_notification_rules
Creates, updates, deletes, gets or lists an on_call_user_notification_rules resource.
Overview
| Name | on_call_user_notification_rules |
| Type | Resource |
| Id | datadog.service_management.on_call_user_notification_rules |
Fields
The following fields are returned by SELECT queries:
- get_user_notification_rule
- list_user_notification_rules
| Name | Datatype | Description |
|---|---|---|
id | string | Unique identifier for the rule |
attributes | object | Attributes for an on-call notification rule. |
relationships | object | Relationship object for creating a notification rule |
type | string | Indicates that the resource is of type 'notification_rules'. (notification_rules) (default: notification_rules, example: notification_rules) |
| Name | Datatype | Description |
|---|---|---|
id | string | Unique identifier for the rule |
attributes | object | Attributes for an on-call notification rule. |
relationships | object | Relationship object for creating a notification rule |
type | string | Indicates that the resource is of type 'notification_rules'. (notification_rules) (default: notification_rules, example: notification_rules) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_user_notification_rule | select | user_id, rule_id | include | Get a notification rule for a user. The authenticated user must be the target user or have the on_call_admin permission |
list_user_notification_rules | select | user_id | include | List the notification rules for a user. The authenticated user must be the target user or have the on_call_admin permission |
create_user_notification_rule | insert | user_id, data | Create a new notification rule for a user. The authenticated user must be the target user or have the on_call_admin permission | |
update_user_notification_rule | replace | user_id, rule_id, data | include | Update a notification rule for a user. The authenticated user must be the target user or have the on_call_admin permission |
delete_user_notification_rule | delete | user_id, rule_id | Delete a notification rule for a user. The authenticated user must be the target user or have the on_call_admin permission |
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 | The rule ID |
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. |
user_id | string | The user ID |
include | string | Comma-separated list of included relationships to be returned. Allowed values: channel. |
SELECT examples
- get_user_notification_rule
- list_user_notification_rules
Get a notification rule for a user. The authenticated user must be the target user or have the on_call_admin permission
SELECT
id,
attributes,
relationships,
type
FROM datadog.service_management.on_call_user_notification_rules
WHERE user_id = '{{ user_id }}' -- required
AND rule_id = '{{ rule_id }}' -- required
AND include = '{{ include }}'
;
List the notification rules for a user. The authenticated user must be the target user or have the on_call_admin permission
SELECT
id,
attributes,
relationships,
type
FROM datadog.service_management.on_call_user_notification_rules
WHERE user_id = '{{ user_id }}' -- required
AND include = '{{ include }}'
;
INSERT examples
- create_user_notification_rule
- Manifest
Create a new notification rule for a user. The authenticated user must be the target user or have the on_call_admin permission
INSERT INTO datadog.service_management.on_call_user_notification_rules (
data,
user_id
)
SELECT
'{{ data }}' /* required */,
'{{ user_id }}'
RETURNING
data,
included
;
# Description fields are for documentation purposes
- name: on_call_user_notification_rules
props:
- name: user_id
value: "{{ user_id }}"
description: Required parameter for the on_call_user_notification_rules resource.
- name: data
description: |
Data for creating an on-call notification rule
value:
attributes:
category: "{{ category }}"
channel_settings:
method: "{{ method }}"
type: "{{ type }}"
delay_minutes: {{ delay_minutes }}
relationships:
channel:
data:
id: "{{ id }}"
type: "{{ type }}"
type: "{{ type }}"
REPLACE examples
- update_user_notification_rule
Update a notification rule for a user. The authenticated user must be the target user or have the on_call_admin permission
REPLACE datadog.service_management.on_call_user_notification_rules
SET
data = '{{ data }}'
WHERE
user_id = '{{ user_id }}' --required
AND rule_id = '{{ rule_id }}' --required
AND data = '{{ data }}' --required
AND include = '{{ include}}'
RETURNING
data,
included;
DELETE examples
- delete_user_notification_rule
Delete a notification rule for a user. The authenticated user must be the target user or have the on_call_admin permission
DELETE FROM datadog.service_management.on_call_user_notification_rules
WHERE user_id = '{{ user_id }}' --required
AND rule_id = '{{ rule_id }}' --required
;