Skip to main content

on_call_user_notification_channels

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

Overview

Nameon_call_user_notification_channels
TypeResource
Iddatadog.service_management.on_call_user_notification_channels

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringUnique identifier for the channel
attributesobjectAttributes for an on-call notification channel.
typestringIndicates that the resource is of type 'notification_channels'. (notification_channels) (default: notification_channels, example: notification_channels)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_user_notification_channelselectuser_id, channel_idGet a notification channel for a user. The authenticated user must be the target user or have the on_call_admin permission
list_user_notification_channelsselectuser_idList the notification channels for a user. The authenticated user must be the target user or have the on_call_admin permission
create_user_notification_channelinsertuser_id, dataCreate a new notification channel for a user. The authenticated user must be the target user or have the on_call_admin permission
delete_user_notification_channeldeleteuser_id, channel_idDelete a notification channel 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
channel_idstringThe channel 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

SELECT examples

Get a notification channel for a user. The authenticated user must be the target user or have the on_call_admin permission

SELECT
id,
attributes,
type
FROM datadog.service_management.on_call_user_notification_channels
WHERE user_id = '{{ user_id }}' -- required
AND channel_id = '{{ channel_id }}' -- required
;

INSERT examples

Create a new notification channel 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_channels (
data,
user_id
)
SELECT
'{{ data }}' /* required */,
'{{ user_id }}'
RETURNING
data
;

DELETE examples

Delete a notification channel 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_channels
WHERE user_id = '{{ user_id }}' --required
AND channel_id = '{{ channel_id }}' --required
;