POST https://api.ap1.datadoghq.com/api/v1/integration/slackhttps://api.ap2.datadoghq.com/api/v1/integration/slackhttps://api.datadoghq.eu/api/v1/integration/slackhttps://api.ddog-gov.com/api/v1/integration/slackhttps://api.us2.ddog-gov.com/api/v1/integration/slackhttps://api.uk1.datadoghq.com/api/v1/integration/slackhttps://api.datadoghq.com/api/v1/integration/slackhttps://api.us3.datadoghq.com/api/v1/integration/slackhttps://api.us5.datadoghq.com/api/v1/integration/slack
概要
Datadog-Slack インテグレーションを作成します。作成が完了したら、
Slack インテグレーションエンドポイントにチャンネルを追加するに従ってチャンネルを追加してください。
このメソッドを使用すると、Datadog オーガニゼーションの既存のデータに新しい構成を追加する形でインテグレーション構成が更新されます。
リクエスト
Body Data (required)
Datadog-Slack インテグレーションのリクエスト本文を作成します。
Expand All
The array of service hook objects.
Your Slack service hook URL.
{
"service_hooks": [
{
"account": "joe.doe",
"url": "https://hooks.slack.com/services/example-workspace/example-channel/example-token"
}
]
}
応答
Bad Request
Error response object.
Expand All
Array of errors returned by the API.
{
"errors": [
"Bad Request"
]
}
Authentication error
Error response object.
Expand All
Array of errors returned by the API.
{
"errors": [
"Bad Request"
]
}
Too many requests
Error response object.
Expand All
Array of errors returned by the API.
{
"errors": [
"Bad Request"
]
}
コード例
## default
#
# Curl command
curl -X POST "https://api.ap1.datadoghq.com"https://api.ap2.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.us2.ddog-gov.com"https://api.uk1.datadoghq.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v1/integration/slack" \
-H "Content-Type: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \
-d @- << EOF
{
"service_hooks": [
{
"account": "Main_Account",
"url": "https://hooks.slack.com/services/1/1/1"
}
]
}
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)
Instructions
First install the library and its dependencies and then save the example to example.rb and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comuk1.datadoghq.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" rb "example.rb"