slack_channels
Creates, updates, deletes, gets or lists a slack_channels resource.
Overview
| Name | slack_channels |
| Type | Resource |
| Id | datadog.integrations.slack_channels |
Fields
The following fields are returned by SELECT queries:
- get_slack_integration_channel
- get_slack_integration_channels
| Name | Datatype | Description |
|---|---|---|
name | string | Your channel name. (example: #general) |
display | object | Configuration options for what is shown in an alert event message. |
| Name | Datatype | Description |
|---|---|---|
name | string | Your channel name. (example: #general) |
display | object | Configuration options for what is shown in an alert event message. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_slack_integration_channel | select | account_name, channel_name | Get a channel configured for your Datadog-Slack integration. | |
get_slack_integration_channels | select | account_name | Get a list of all channels configured for your Datadog-Slack integration. | |
create_slack_integration_channel | insert | account_name | Add a channel to your Datadog-Slack integration. | |
update_slack_integration_channel | update | account_name, channel_name | Update a channel used in your Datadog-Slack integration. | |
remove_slack_integration_channel | delete | account_name, channel_name | Remove 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.
| Name | Datatype | Description |
|---|---|---|
account_name | string | Your Slack account name. |
channel_name | string | The name of the Slack channel being operated on. |
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. |
SELECT examples
- get_slack_integration_channel
- get_slack_integration_channels
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
;
Get a list of all channels configured for your Datadog-Slack integration.
SELECT
name,
display
FROM datadog.integrations.slack_channels
WHERE account_name = '{{ account_name }}' -- required
;
INSERT examples
- create_slack_integration_channel
- Manifest
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
;
# Description fields are for documentation purposes
- name: slack_channels
props:
- name: account_name
value: "{{ account_name }}"
description: Required parameter for the slack_channels resource.
- name: display
description: |
Configuration options for what is shown in an alert event message.
value:
message: {{ message }}
mute_buttons: {{ mute_buttons }}
notified: {{ notified }}
snapshot: {{ snapshot }}
tags: {{ tags }}
- name: name
value: "{{ name }}"
description: |
Your channel name.
UPDATE examples
- update_slack_integration_channel
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_slack_integration_channel
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
;