Skip to main content

slack_channels

Creates, updates, deletes, gets or lists a slack_channels resource.

Overview

Nameslack_channels
TypeResource
Iddatadog.integrations.slack_channels

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
namestringYour channel name. (example: #general)
displayobjectConfiguration options for what is shown in an alert event message.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_slack_integration_channelselectaccount_name, channel_nameGet a channel configured for your Datadog-Slack integration.
get_slack_integration_channelsselectaccount_nameGet a list of all channels configured for your Datadog-Slack integration.
create_slack_integration_channelinsertaccount_nameAdd a channel to your Datadog-Slack integration.
update_slack_integration_channelupdateaccount_name, channel_nameUpdate a channel used in your Datadog-Slack integration.
remove_slack_integration_channeldeleteaccount_name, channel_nameRemove a channel from your Datadog-Slack integration.

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
account_namestringYour Slack account name.
channel_namestringThe name of the Slack channel being operated on.
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.

SELECT examples

Get a channel configured for your Datadog-Slack integration.

SELECT
name,
display
FROM datadog.integrations.slack_channels
WHERE account_name = '{{ account_name }}' -- required
AND channel_name = '{{ channel_name }}' -- required
;

INSERT examples

Add a channel to your Datadog-Slack integration.

INSERT INTO datadog.integrations.slack_channels (
display,
name,
account_name
)
SELECT
'{{ display }}',
'{{ name }}',
'{{ account_name }}'
RETURNING
name,
display
;

UPDATE examples

Update a channel used in your Datadog-Slack integration.

UPDATE datadog.integrations.slack_channels
SET
display = '{{ display }}',
name = '{{ name }}'
WHERE
account_name = '{{ account_name }}' --required
AND channel_name = '{{ channel_name }}' --required
RETURNING
name,
display;

DELETE examples

Remove a channel from your Datadog-Slack integration.

DELETE FROM datadog.integrations.slack_channels
WHERE account_name = '{{ account_name }}' --required
AND channel_name = '{{ channel_name }}' --required
;