Datadog-Slack インテグレーションを Datadog API を介して直接構成します。
PUT https://api.datadoghq.eu/api/v1/integration/slackhttps://api.datadoghq.com/api/v1/integration/slack
既存の Datadog-Slack インテグレーションにチャンネルを追加します。
このメソッドを使用すると、現在の構成を Datadog オーガニゼーションに送信された 新しい構成に置き換えて、インテグレーション構成が更新されます。
既存の Datadog-Slack インテグレーションのリクエスト本文を更新します。
フィールド
種類
説明
channels
[object]
An array of slack channel configurations.
account [required]
string
Account to which the channel belongs to.
channel_name [required]
string
Your channel name.
transfer_all_user_comments
boolean
To be notified for every comment on a graph, set it to true
.
If set to False
use the @slack-channel_name
syntax for comments
to be posted to slack.
{
"channels": [
{
"account": "jane.doe",
"channel_name": "#general",
"transfer_all_user_comments": false
}
]
}
OK
Bad Request
Error response object.
{
"errors": [
"Bad Request"
]
}
Authentication error
Error response object.
{
"errors": [
"Bad Request"
]
}
# Curl command
curl -X PUT "https://api.datadoghq.eu"https://api.datadoghq.com/api/v1/integration/slack" \
-H "Content-Type: application/json" \
-H "DD-API-KEY: ${DD_CLIENT_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_CLIENT_APP_KEY}" \
-d @- << EOF
{
"channels": [
{
"account": "jane.doe",
"channel_name": "#general"
}
]
}
EOF
POST https://api.datadoghq.eu/api/v1/integration/slackhttps://api.datadoghq.com/api/v1/integration/slack
Datadog-Slack インテグレーションを作成します。作成が完了したら、 Slack インテグレーションエンドポイントにチャンネルを追加するに従ってチャンネルを追加してください。
このメソッドを使用すると、Datadog オーガニゼーションの既存のデータに新しい構成を追加する形でインテグレーション構成が更新されます。
Datadog-Slack インテグレーションのリクエスト本文を作成します。
フィールド
種類
説明
service_hooks
[object]
The array of service hook objects.
account [required]
string
Your Slack account name.
url [required]
string
Your Slack service hook URL.
{
"service_hooks": [
{
"account": "joe.doe",
"url": "https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX"
}
]
}
OK
Bad Request
Error response object.
{
"errors": [
"Bad Request"
]
}
Authentication error
Error response object.
{
"errors": [
"Bad Request"
]
}
# Curl command
curl -X POST "https://api.datadoghq.eu"https://api.datadoghq.com/api/v1/integration/slack" \
-H "Content-Type: application/json" \
-H "DD-API-KEY: ${DD_CLIENT_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_CLIENT_APP_KEY}" \
-d @- << EOF
{
"service_hooks": [
{
"account": "joe.doe",
"url": "https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX"
}
]
}
EOF
require 'rubygems'
require 'dogapi'
api_key = '<DATADOG_API_KEY>'
app_key = '<DATADOG_APPLICATION_KEY>'
config= {
"service_hooks": [
{
"account": "Main_Account",
"url": "https://hooks.slack.com/services/1/1/1"
},
{
"account": "doghouse",
"url": "https://hooks.slack.com/services/2/2/2"
}
]
}
dog = Dogapi::Client.new(api_key, app_key)
dog.create_integration('slack', config)
POST https://api.datadoghq.eu/api/v1/integration/slack/configuration/accounts/{team_name}/channelshttps://api.datadoghq.com/api/v1/integration/slack/configuration/accounts/{team_name}/channels
Datadog-Slack インテグレーションにチャンネルを追加します。
名前
種類
説明
team_name [required]
string
Your Slack team name.
作成される Slack チャンネルを説明するペイロード
フィールド
種類
説明
display
object
Configuration options for what is shown in an alert event message.
message
boolean
Show the main body of the alert event.
notified
boolean
Show the list of @-handles in the alert event.
snapshot
boolean
Show the alert event's snapshot image.
tags
boolean
Show the scopes on which the monitor alerted.
name
string
Your channel name.
{
"display": {
"message": false,
"notified": false,
"snapshot": false,
"tags": false
},
"name": "#general"
}
OK
The Slack channel configuration.
フィールド
種類
説明
display
object
Configuration options for what is shown in an alert event message.
message
boolean
Show the main body of the alert event.
notified
boolean
Show the list of @-handles in the alert event.
snapshot
boolean
Show the alert event's snapshot image.
tags
boolean
Show the scopes on which the monitor alerted.
name
string
Your channel name.
{
"display": {
"message": false,
"notified": false,
"snapshot": false,
"tags": false
},
"name": "#general"
}
Bad Request
Error response object.
{
"errors": [
"Bad Request"
]
}
Authentication error
Error response object.
{
"errors": [
"Bad Request"
]
}
Item Not Found
Error response object.
{
"errors": [
"Bad Request"
]
}
# Path parameters
export team_name="CHANGE_ME"
# Curl command
curl -X POST "https://api.datadoghq.eu"https://api.datadoghq.com/api/v1/integration/slack/configuration/accounts/${team_name}/channels" \
-H "Content-Type: application/json" \
-H "DD-API-KEY: ${DD_CLIENT_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_CLIENT_APP_KEY}" \
-d @- << EOF
{}
EOF
DELETE https://api.datadoghq.eu/api/v1/integration/slackhttps://api.datadoghq.com/api/v1/integration/slack
Datadog-Slack インテグレーションを削除します。
OK
Authentication error
Error response object.
{
"errors": [
"Bad Request"
]
}
# Curl command
curl -X DELETE "https://api.datadoghq.eu"https://api.datadoghq.com/api/v1/integration/slack" \
-H "Content-Type: application/json" \
-H "DD-API-KEY: ${DD_CLIENT_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_CLIENT_APP_KEY}"
require 'rubygems'
require 'dogapi'
api_key = '<DATADOG_API_KEY>'
app_key = '<DATADOG_APPLICATION_KEY>'
dog = Dogapi::Client.new(api_key, app_key)
dog.delete_integration('slack')
GET https://api.datadoghq.eu/api/v1/integration/slack/configuration/accounts/{team_name}/channels/{channel_name}https://api.datadoghq.com/api/v1/integration/slack/configuration/accounts/{team_name}/channels/{channel_name}
Datadog-Slack インテグレーションに構成されたチャンネルを取得します。
名前
種類
説明
team_name [required]
string
Your Slack team name.
channel_name [required]
string
The name of the Slack channel being operated on.
OK
The Slack channel configuration.
フィールド
種類
説明
display
object
Configuration options for what is shown in an alert event message.
message
boolean
Show the main body of the alert event.
notified
boolean
Show the list of @-handles in the alert event.
snapshot
boolean
Show the alert event's snapshot image.
tags
boolean
Show the scopes on which the monitor alerted.
name
string
Your channel name.
{
"display": {
"message": false,
"notified": false,
"snapshot": false,
"tags": false
},
"name": "#general"
}
Bad Request
Error response object.
{
"errors": [
"Bad Request"
]
}
Authentication error
Error response object.
{
"errors": [
"Bad Request"
]
}
Item Not Found
Error response object.
{
"errors": [
"Bad Request"
]
}
# Path parameters
export team_name="CHANGE_ME"
export channel_name="CHANGE_ME"
# Curl command
curl -X GET "https://api.datadoghq.eu"https://api.datadoghq.com/api/v1/integration/slack/configuration/accounts/${team_name}/channels/${channel_name}" \
-H "Content-Type: application/json" \
-H "DD-API-KEY: ${DD_CLIENT_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_CLIENT_APP_KEY}"
GET https://api.datadoghq.eu/api/v1/integration/slack/configuration/accounts/{team_name}/channelshttps://api.datadoghq.com/api/v1/integration/slack/configuration/accounts/{team_name}/channels
Datadog-Slack インテグレーションに構成されたすべてのチャンネルのリストを取得します。
名前
種類
説明
team_name [required]
string
Your Slack team name.
OK
A list of configured Slack channels.
フィールド
種類
説明
display
object
Configuration options for what is shown in an alert event message.
message
boolean
Show the main body of the alert event.
notified
boolean
Show the list of @-handles in the alert event.
snapshot
boolean
Show the alert event's snapshot image.
tags
boolean
Show the scopes on which the monitor alerted.
name
string
Your channel name.
{
"display": {
"message": false,
"notified": false,
"snapshot": false,
"tags": false
},
"name": "#general"
}
Bad Request
Error response object.
{
"errors": [
"Bad Request"
]
}
Authentication error
Error response object.
{
"errors": [
"Bad Request"
]
}
Item Not Found
Error response object.
{
"errors": [
"Bad Request"
]
}
# Path parameters
export team_name="CHANGE_ME"
# Curl command
curl -X GET "https://api.datadoghq.eu"https://api.datadoghq.com/api/v1/integration/slack/configuration/accounts/${team_name}/channels" \
-H "Content-Type: application/json" \
-H "DD-API-KEY: ${DD_CLIENT_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_CLIENT_APP_KEY}"
GET https://api.datadoghq.eu/api/v1/integration/slackhttps://api.datadoghq.com/api/v1/integration/slack
Datadog-Slack インテグレーションのすべての情報を取得します。
OK
{}
Bad Request
Error response object.
{
"errors": [
"Bad Request"
]
}
Authentication error
Error response object.
{
"errors": [
"Bad Request"
]
}
Item Not Found
Error response object.
{
"errors": [
"Bad Request"
]
}
# Curl command
curl -X GET "https://api.datadoghq.eu"https://api.datadoghq.com/api/v1/integration/slack" \
-H "Content-Type: application/json" \
-H "DD-API-KEY: ${DD_CLIENT_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_CLIENT_APP_KEY}"
require 'rubygems'
require 'dogapi'
api_key = '<DATADOG_API_KEY>'
app_key = '<DATADOG_APPLICATION_KEY>'
dog = Dogapi::Client.new(api_key, app_key)
dog.get_integration('slack')
DELETE https://api.datadoghq.eu/api/v1/integration/slack/configuration/accounts/{team_name}/channels/{channel_name}https://api.datadoghq.com/api/v1/integration/slack/configuration/accounts/{team_name}/channels/{channel_name}
Datadog-Slack インテグレーションからチャンネルを削除します。
名前
種類
説明
team_name [required]
string
Your Slack team name.
channel_name [required]
string
The name of the Slack channel being operated on.
The channel was removed successfully.
Bad Request
Error response object.
{
"errors": [
"Bad Request"
]
}
Authentication error
Error response object.
{
"errors": [
"Bad Request"
]
}
Item Not Found
Error response object.
{
"errors": [
"Bad Request"
]
}
# Path parameters
export team_name="CHANGE_ME"
export channel_name="CHANGE_ME"
# Curl command
curl -X DELETE "https://api.datadoghq.eu"https://api.datadoghq.com/api/v1/integration/slack/configuration/accounts/${team_name}/channels/${channel_name}" \
-H "Content-Type: application/json" \
-H "DD-API-KEY: ${DD_CLIENT_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_CLIENT_APP_KEY}"
PATCH https://api.datadoghq.eu/api/v1/integration/slack/configuration/accounts/{team_name}/channels/{channel_name}https://api.datadoghq.com/api/v1/integration/slack/configuration/accounts/{team_name}/channels/{channel_name}
Datadog-Slack インテグレーションに使用されるチャンネルを更新します。
名前
種類
説明
team_name [required]
string
Your Slack team name.
channel_name [required]
string
The name of the Slack channel being operated on.
更新されるフィールドと値を説明するペイロード。
フィールド
種類
説明
display
object
Configuration options for what is shown in an alert event message.
message
boolean
Show the main body of the alert event.
notified
boolean
Show the list of @-handles in the alert event.
snapshot
boolean
Show the alert event's snapshot image.
tags
boolean
Show the scopes on which the monitor alerted.
name
string
Your channel name.
{
"display": {
"message": false,
"notified": false,
"snapshot": false,
"tags": false
},
"name": "#general"
}
OK
The Slack channel configuration.
フィールド
種類
説明
display
object
Configuration options for what is shown in an alert event message.
message
boolean
Show the main body of the alert event.
notified
boolean
Show the list of @-handles in the alert event.
snapshot
boolean
Show the alert event's snapshot image.
tags
boolean
Show the scopes on which the monitor alerted.
name
string
Your channel name.
{
"display": {
"message": false,
"notified": false,
"snapshot": false,
"tags": false
},
"name": "#general"
}
Bad Request
Error response object.
{
"errors": [
"Bad Request"
]
}
Authentication error
Error response object.
{
"errors": [
"Bad Request"
]
}
Item Not Found
Error response object.
{
"errors": [
"Bad Request"
]
}
# Path parameters
export team_name="CHANGE_ME"
export channel_name="CHANGE_ME"
# Curl command
curl -X PATCH "https://api.datadoghq.eu"https://api.datadoghq.com/api/v1/integration/slack/configuration/accounts/${team_name}/channels/${channel_name}" \
-H "Content-Type: application/json" \
-H "DD-API-KEY: ${DD_CLIENT_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_CLIENT_APP_KEY}" \
-d @- << EOF
{}
EOF