Webhook アラート連絡先を作成または変更します。
今すぐお試しください
テスト
RAM 認証
リクエストパラメーター
|
パラメーター |
型 |
必須 / 任意 |
説明 |
例 |
| WebhookId |
integer |
任意 |
Webhook アラート連絡先の ID です。
|
123 |
| WebhookName |
string |
必須 |
Webhook アラート連絡先の名前です。 |
Webhook告警 |
| Method |
string |
必須 |
HTTP リクエストメソッドです。
|
Post |
| Url |
string |
必須 |
HTTP リクエストメソッドの URL です。 |
https://oapi.dingtalk.com/robot/send?access_token=e1a049121****** |
| BizHeaders |
string |
任意 |
HTTP リクエストヘッダーです。 |
[{"Content-Type":"application/json;charset=utf-8"}] |
| BizParams |
string |
任意 |
HTTP リクエストのパラメーターです。 |
[{"content":"mike"}] |
| Body |
string |
任意 |
アラートがトリガーされたときに送信される通知テンプレートです。このパラメーターは、Method パラメーターが Post に設定されている場合に必須です。 |
{ "告警名称":"{{ .commonLabels.alertname }}{{if .commonLabels.clustername }}", "集群名称":"{{ .commonLabels.clustername }} {{ end }}{{if eq "app" .commonLabels._aliyun_arms_involvedObject_kind }}", "应用名称":"{{ .commonLabels._aliyun_arms_involvedObject_name }} {{ end }}", "通知策略":"{{ .dispatchRuleName }}", "告警时间":"{{ .startTime }}", "告警内容":"{{ for .alerts }} {{ .annotations.message }} {{ end }}" } |
| RecoverBody |
string |
任意 |
アラートが解消されたときに送信される通知テンプレートです。このパラメーターは、Method パラメーターが Post に設定されている場合に必須です。 |
{ "告警名称":"{{ .commonLabels.alertname }}{{if .commonLabels.clustername }}", "集群名称":"{{ .commonLabels.clustername }} {{ end }}{{if eq "app" .commonLabels._aliyun_arms_involvedObject_kind }}", "应用名称":"{{ .commonLabels._aliyun_arms_involvedObject_name }} {{ end }}", "通知策略":"{{ .dispatchRuleName }}", "恢复时间":"{{ .endTime }}", "告警内容":"{{ for .alerts }} {{ .annotations.message }} {{ end }}" } |
レスポンスフィールド
|
フィールド |
型 |
説明 |
例 |
|
object |
応答のスキーマ |
||
| RequestId |
string |
リクエスト ID です。 |
16AF921B-8187-489F-9913-43C808B4**** |
| WebhookContact |
object |
返された Webhook アラート連絡先です。 |
|
| WebhookId |
number |
Webhook アラート連絡先の ID です。 |
123 |
| WebhookName |
string |
Webhook アラート連絡先の名前です。 |
Webhook告警 |
| Webhook |
object |
Webhook アラート連絡先の情報です。 |
|
| Method |
string |
HTTP リクエストメソッドです。
|
Post |
| Url |
string |
リクエストメソッドの URL です。 |
https://oapi.dingtalk.com/robot/send?access_token=e1a049121****** |
| BizHeaders |
string |
HTTP リクエストヘッダーです。 |
[{"Content-Type":"application/json;charset=utf-8"}] |
| BizParams |
string |
HTTP リクエストのパラメーターです。 |
[{"content":"mike"}] |
| Body |
string |
アラート通知テンプレートです。 |
{ "告警名称":"{{ .commonLabels.alertname }}{{if .commonLabels.clustername }}", "集群名称":"{{ .commonLabels.clustername }} {{ end }}{{if eq "app" .commonLabels._aliyun_arms_involvedObject_kind }}", "应用名称":"{{ .commonLabels._aliyun_arms_involvedObject_name }} {{ end }}", "通知策略":"{{ .dispatchRuleName }}", "告警时间":"{{ .startTime }}", "告警内容":"{{ for .alerts }} {{ .annotations.message }} {{ end }}" } |
| RecoverBody |
string |
アラート解消の通知テンプレートです。 |
{ "告警名称":"{{ .commonLabels.alertname }}{{if .commonLabels.clustername }}", "集群名称":"{{ .commonLabels.clustername }} {{ end }}{{if eq "app" .commonLabels._aliyun_arms_involvedObject_kind }}", "应用名称":"{{ .commonLabels._aliyun_arms_involvedObject_name }} {{ end }}", "通知策略":"{{ .dispatchRuleName }}", "恢复时间":"{{ .endTime }}", "告警内容":"{{ for .alerts }} {{ .annotations.message }} {{ end }}" } |
例
成功レスポンス
JSONJSON
{
"RequestId": "16AF921B-8187-489F-9913-43C808B4****",
"WebhookContact": {
"WebhookId": 123,
"WebhookName": "Webhook告警",
"Webhook": {
"Method": "Post",
"Url": "https://oapi.dingtalk.com/robot/send?access_token=e1a049121******",
"BizHeaders": "[{\"Content-Type\":\"application/json;charset=utf-8\"}]",
"BizParams": "[{\"content\":\"mike\"}]",
"Body": "{ \"告警名称\":\"{{ .commonLabels.alertname }}{{if .commonLabels.clustername }}\", \"集群名称\":\"{{ .commonLabels.clustername }} {{ end }}{{if eq \"app\" .commonLabels._aliyun_arms_involvedObject_kind }}\", \"应用名称\":\"{{ .commonLabels._aliyun_arms_involvedObject_name }} {{ end }}\", \"通知策略\":\"{{ .dispatchRuleName }}\", \"告警时间\":\"{{ .startTime }}\", \"告警内容\":\"{{ for .alerts }} {{ .annotations.message }} {{ end }}\" }",
"RecoverBody": "{ \"告警名称\":\"{{ .commonLabels.alertname }}{{if .commonLabels.clustername }}\", \"集群名称\":\"{{ .commonLabels.clustername }} {{ end }}{{if eq \"app\" .commonLabels._aliyun_arms_involvedObject_kind }}\", \"应用名称\":\"{{ .commonLabels._aliyun_arms_involvedObject_name }} {{ end }}\", \"通知策略\":\"{{ .dispatchRuleName }}\", \"恢复时间\":\"{{ .endTime }}\", \"告警内容\":\"{{ for .alerts }} {{ .annotations.message }} {{ end }}\" }"
}
}
}
エラーコード
完全なリストについては、「エラーコード」をご参照ください。
変更履歴
完全なリストについては、「変更履歴」をご参照ください。