All Products
Search
Document Center

Application Real-Time Monitoring Service:ListNotificationPolicies

Last Updated:Jun 12, 2026

Mengkueri informasi kebijakan notifikasi berdasarkan kondisi yang ditentukan.

Coba sekarang

Coba API ini di OpenAPI Explorer tanpa perlu penandatanganan manual. Panggilan yang berhasil akan secara otomatis menghasilkan contoh kode SDK sesuai dengan parameter Anda. Unduh kode tersebut dengan kredensial bawaan yang aman untuk penggunaan lokal.

Test

RAM authorization

Tidak ada otorisasi untuk operasi ini. Jika Anda mengalami masalah saat menjalankan operasi ini, hubungi dukungan teknis.

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.

  • true: Mengkueri.

  • false: Tidak mengkueri.

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: equal to

  • neq: not equal to

  • in: contains

  • nin: does not contain

  • re: regular expression match

  • nre: regular expression mismatch

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 (default): The system sends a notification.

  • false: The system does not send a notification.

true

GroupRule

object

The grouping rule for alert events.

GroupingFields

array

An array of alert event group objects.

  • If you do not specify the groupingFields field, all alerts will be sent to contacts based on alertname.

  • If you specify the groupingFields field, alerts with the same field will be sent to contacts in one notification.

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: DingTalk

  • email: email

  • sms: text message

  • tts: phone call

  • webhook: webhook

[ "dingTalk", "email", "sms", "tts","webhook" ]

NotifyObjects

array<object>

The notification objects.

object

NotifyObjectType

string

The type of the notification object. Valid values:

  • CONTACT: an individual contact

  • CONTACT_GROUP: a contact group

  • DING_ROBOT: an instant messaging (IM) chatbot

  • CONTACT_SCHEDULE: a person on duty based on an established schedule

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: email

  • sms: text message

  • tts: phone call

[ "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 (default): The system resends notifications for a long-lasting unresolved alert at a specified time interval.

  • false: The system resends notifications for a long-lasting unresolved alert based on an escalation policy.

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.