Mengkueri informasi kebijakan notifikasi berdasarkan kondisi yang ditentukan.
Coba sekarang
Test
RAM authorization
Parameter permintaan
|
Parameter |
Type |
Required |
Description |
Example |
| Name |
string |
No |
Nama kebijakan notifikasi. |
notificationpolicy_test |
| Page |
integer |
Yes |
Nomor halaman yang akan dikueri. |
1 |
| Size |
integer |
Yes |
Jumlah entri yang ditampilkan per halaman. |
20 |
| IsDetail |
boolean |
No |
Apakah akan mengkueri detail kebijakan notifikasi.
|
false |
| RegionId |
string |
No |
ID wilayah. Nilai default adalah cn-hangzhou. |
cn-hangzhou |
| Ids |
string |
No |
ID kebijakan notifikasi. |
12345 |
| DirectedMode |
boolean |
No |
Mode minimalis. |
Elemen respons
|
Element |
Type |
Description |
Example |
|
object |
Skema Respons. |
||
| RequestId |
string |
ID permintaan. |
78901766-3806-4E96-8E47-CFEF59E4**** |
| PageBean |
object |
Objek paginasi. |
|
| Total |
integer |
Jumlah total kebijakan notifikasi yang dikembalikan. |
24 |
| Page |
integer |
Nomor halaman yang dikembalikan. |
1 |
| Size |
integer |
Jumlah entri per halaman. |
20 |
| NotificationPolicies |
array<object> |
Informasi kebijakan notifikasi. |
|
|
array<object> |
Objek kebijakan notifikasi. |
||
| Id |
integer |
The ID of the notification policy. |
1234 |
| Name |
string |
The name of the notification policy. |
notificationpolicy_test |
| MatchingRules |
array<object> |
The matching rules for alert events. |
|
|
array<object> |
|||
| MatchingConditions |
array<object> |
The matching conditions. |
|
|
object |
|||
| Key |
string |
The key of the matching condition. |
altertname |
| Value |
string |
The value of the matching condition. |
test |
| Operator |
string |
The logical operator of the matching condition. Valid values:
|
eq |
| SendRecoverMessage |
boolean |
Indicates whether the status of an alert automatically changes to Resolved when all events related to the alert change to the Restored state. The system sends a notification to the alert contacts when the alert status changes to Resolved.
|
true |
| GroupRule |
object |
The grouping rule for alert events. |
|
| GroupingFields |
array |
An array of alert event group objects.
|
|
|
string |
The field that is used for grouping. |
["alertname"] |
|
| GroupWait |
integer |
The waiting time for grouping. Unit: seconds. Default value: 5. |
5 |
| GroupInterval |
integer |
The time interval of grouping. Unit: seconds. Default value: 30. |
30 |
| NotifyRule |
object |
The notification rule. |
|
| NotifyStartTime |
string |
The start time of the notification window. |
00:00 |
| NotifyEndTime |
string |
The end time of the notification window. |
23:59 |
| NotifyChannels |
array |
The notification method. |
|
|
string |
The notification methods. Valid values:
|
[ "dingTalk", "email", "sms", "tts","webhook" ] |
|
| NotifyObjects |
array<object> |
The notification objects. |
|
|
object |
|||
| NotifyObjectType |
string |
The type of the notification object. Valid values:
|
CONTACT |
| NotifyObjectId |
integer |
The ID of the notification object. |
123 |
| NotifyObjectName |
string |
The name of the notification object. |
test |
| NotifyChannels |
array |
The notification methods specified for a contact. |
|
|
string |
The notification methods.
|
[ "email", "sms", "tts" ] |
|
| NotifyTemplate |
object |
The notification template. |
|
| EmailTitle |
string |
The title of the alert notification sent by email. |
{{ .commonLabels.alertname }} |
| EmailContent |
string |
The content of the alert notification sent by email. |
告警名称:{{ .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 }} {{if .generatorURL }} 详情链接 {{ end }} {{ end }} |
| EmailRecoverTitle |
string |
The title of the alert resolution notification sent by email. |
{{ .commonLabels.alertname }} |
| EmailRecoverContent |
string |
The content of the alert resolution notification sent by email. |
告警名称:{{ .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 }} {{if .generatorURL }} 详情链接 {{ end }} {{ end }} |
| SmsContent |
string |
The content of the alert notification sent by text message. |
发生{{ .level }}告警 告警名称:{{ .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 }} |
| SmsRecoverContent |
string |
The content of the alert resolution notification sent by text message. |
告警已经恢复 告警名称:{{ .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 }} |
| TtsContent |
string |
The content of the alert notification sent by phone. |
告警名称:{{ .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 }} |
| TtsRecoverContent |
string |
The content of the alert resolution notification sent by phone. |
告警名称:{{ .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 }} |
| RobotContent |
string |
The content of the alert notification sent by an IM chatbot. |
{{if .commonLabels.clustername }} > 集群名称:{{ .commonLabels.clustername }} {{ end }}{{if eq "app" .commonLabels._aliyun_arms_involvedObject_kind }} > 应用名称:{{ .commonLabels._aliyun_arms_involvedObject_name }} {{ end }}{{ for .alerts }} > {{ .annotations.message }} {{if .generatorURL }} [详情链接]({{.generatorURL}}) {{end}} {{if eq "true" .labels._aliyun_arms_is_denoise_filtered }} (疑似噪音) {{end}} {{end}} |
| Repeat |
boolean |
Indicates whether the system resends notifications for a long-lasting unresolved alert. Valid values:
|
true |
| RepeatInterval |
integer |
The time interval at which a notification is resent for a long-lasting unresolved alert. Unit: seconds. |
600 |
| EscalationPolicyId |
integer |
The ID of the escalation policy. |
123 |
| IntegrationId |
integer |
The integration ID of the ticket system to which alerts are pushed. |
34 |
| DirectedMode |
boolean |
Indicates whether simple mode is enabled. |
|
| State |
string |
Indicates whether the notification policy is enabled. Valid values: enable and disable. |
enable |
Contoh
Respons sukses
JSONformat
{
"RequestId": "78901766-3806-4E96-8E47-CFEF59E4****",
"PageBean": {
"Total": 24,
"Page": 1,
"Size": 20,
"NotificationPolicies": [
{
"Id": 1234,
"Name": "notificationpolicy_test",
"MatchingRules": [
{
"MatchingConditions": [
{
"Key": "altertname",
"Value": "test",
"Operator": "eq"
}
]
}
],
"SendRecoverMessage": true,
"GroupRule": {
"GroupingFields": [
"[\"alertname\"]"
],
"GroupWait": 5,
"GroupInterval": 30
},
"NotifyRule": {
"NotifyStartTime": "00:00",
"NotifyEndTime": "23:59",
"NotifyChannels": [
"[ \"dingTalk\", \"email\", \"sms\", \"tts\",\"webhook\" ]"
],
"NotifyObjects": [
{
"NotifyObjectType": "CONTACT",
"NotifyObjectId": 123,
"NotifyObjectName": "test",
"NotifyChannels": [
"[ \"email\", \"sms\", \"tts\" ]"
]
}
]
},
"NotifyTemplate": {
"EmailTitle": "{{ .commonLabels.alertname }}",
"EmailContent": "告警名称:{{ .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 }} {{if .generatorURL }} 详情链接 {{ end }} {{ end }}",
"EmailRecoverTitle": "{{ .commonLabels.alertname }}",
"EmailRecoverContent": "告警名称:{{ .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 }} {{if .generatorURL }} 详情链接 {{ end }} {{ end }}",
"SmsContent": "发生{{ .level }}告警 告警名称:{{ .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 }}",
"SmsRecoverContent": "告警已经恢复 告警名称:{{ .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 }}",
"TtsContent": "告警名称:{{ .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 }}",
"TtsRecoverContent": "告警名称:{{ .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 }}",
"RobotContent": "{{if .commonLabels.clustername }} > 集群名称:{{ .commonLabels.clustername }} {{ end }}{{if eq \"app\" .commonLabels._aliyun_arms_involvedObject_kind }} > 应用名称:{{ .commonLabels._aliyun_arms_involvedObject_name }} {{ end }}{{ for .alerts }} > {{ .annotations.message }} {{if .generatorURL }} [详情链接]({{.generatorURL}}) {{end}} {{if eq \"true\" .labels._aliyun_arms_is_denoise_filtered }} (疑似噪音) {{end}} {{end}}"
},
"Repeat": true,
"RepeatInterval": 600,
"EscalationPolicyId": 123,
"IntegrationId": 34,
"DirectedMode": true,
"State": "enable"
}
]
}
}
Kode kesalahan
Lihat Error Codes untuk daftar lengkap.
Catatan rilis
Lihat Release Notes untuk daftar lengkap.