Membuat atau memodifikasi kontak peringatan Webhook.
Coba sekarang
Test
RAM authorization
Parameter permintaan
|
Parameter |
Type |
Required |
Description |
Example |
| WebhookId |
integer |
No |
ID kontak peringatan Webhook.
|
123 |
| WebhookName |
string |
Yes |
Nama kontak peringatan Webhook. |
Webhook告警 |
| Method |
string |
Yes |
Metode permintaan HTTP.
|
Post |
| Url |
string |
Yes |
URL dari metode permintaan yang ditentukan oleh Method. |
https://oapi.dingtalk.com/robot/send?access_token=e1a049121****** |
| BizHeaders |
string |
No |
Header permintaan HTTP. |
[{"Content-Type":"application/json;charset=utf-8"}] |
| BizParams |
string |
No |
Parameter permintaan HTTP. |
[{"content":"mike"}] |
| Body |
string |
No |
Templat notifikasi yang dikirim saat peringatan dipicu. Parameter ini wajib diisi jika Method diatur ke Post. Anda dapat menggunakan placeholder |
{ "告警名称":"{{ .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 |
No |
Templat notifikasi yang dikirim saat peringatan diselesaikan. Parameter ini wajib diisi jika Method diatur ke Post. Anda dapat menggunakan placeholder |
{ "告警名称":"{{ .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 }}" } |
Elemen respons
|
Element |
Type |
Description |
Example |
|
object |
Skema Respons |
||
| RequestId |
string |
ID permintaan. |
16AF921B-8187-489F-9913-43C808B4**** |
| WebhookContact |
object |
Objek WebhookContact yang dikembalikan. |
|
| WebhookId |
number |
ID kontak peringatan Webhook. |
123 |
| WebhookName |
string |
Nama kontak peringatan Webhook. |
Webhook告警 |
| Webhook |
object |
Objek Webhook yang dikembalikan. |
|
| Method |
string |
The HTTP request method.
|
Post |
| Url |
string |
The URL of the request method. |
https://oapi.dingtalk.com/robot/send?access_token=e1a049121****** |
| BizHeaders |
string |
The HTTP request headers. |
[{"Content-Type":"application/json;charset=utf-8"}] |
| BizParams |
string |
The parameters in the HTTP request. |
[{"content":"mike"}] |
| Body |
string |
The alert notification template. |
{ "告警名称":"{{ .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 |
The notification template for clearing alerts. |
{ "告警名称":"{{ .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 }}" } |
Contoh
Respons sukses
JSONformat
{
"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 }}\" }"
}
}
}
Kode kesalahan
Lihat Error Codes untuk daftar lengkap.
Catatan rilis
Lihat Release Notes untuk daftar lengkap.