Skip to main content

on_call_user_notification_rules

Creates, updates, deletes, gets or lists an on_call_user_notification_rules resource.

Overview

Nameon_call_user_notification_rules
TypeResource
Iddatadog.service_management.on_call_user_notification_rules

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringUnique identifier for the rule
attributesobjectAttributes for an on-call notification rule.
relationshipsobjectRelationship object for creating a notification rule
typestringIndicates 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:

NameAccessible byRequired ParamsOptional ParamsDescription
get_user_notification_ruleselectuser_id, rule_idincludeGet a notification rule for a user. The authenticated user must be the target user or have the on_call_admin permission
list_user_notification_rulesselectuser_idincludeList the notification rules for a user. The authenticated user must be the target user or have the on_call_admin permission
create_user_notification_ruleinsertuser_id, dataCreate 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_rulereplaceuser_id, rule_id, dataincludeUpdate a notification rule for a user. The authenticated user must be the target user or have the on_call_admin permission
delete_user_notification_ruledeleteuser_id, rule_idDelete 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.

NameDatatypeDescription
rule_idstringThe rule ID
sitestringThe 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_idstringThe user ID
includestringComma-separated list of included relationships to be returned. Allowed values: channel.

SELECT examples

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 }}'
;

INSERT examples

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
;

REPLACE examples

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 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
;