すべてのプロダクト
Search
ドキュメントセンター

Application Real-Time Monitoring Service:CreateOrUpdateNotificationPolicy

最終更新日:Apr 10, 2026

通知ポリシーを作成または変更します。

今すぐお試しください

この API を OpenAPI Explorer でお試しください。手作業による署名は必要ありません。呼び出しに成功すると、入力したパラメーターに基づき、資格情報が組み込まれた SDK コードが自動的に生成されます。このコードをダウンロードしてローカルで使用できます。

テスト

RAM 認証

この操作の認証情報はありません。問題が発生した場合は、アカウントマネージャーにご連絡ください。

リクエストパラメーター

パラメーター

必須 / 任意

説明

Id

integer

任意

通知ポリシーの ID。

  • このパラメーターを指定しない場合、新しい通知ポリシーが作成されます。

  • このパラメーターを指定すると、指定された通知ポリシーが変更されます。

1234

Name

string

必須

通知ポリシーの名前。

notificationpolicy_test

MatchingRules

string

任意

マッチングルール。フォーマット:

[
 {
 "matchingConditions": [
 { 
 "value": "test",    // マッチング条件の値。 
 "key": "alertname",     // マッチング条件のキー。 
 "operator": "eq"   // マッチング条件の論理演算子。eq (等しい)、neq (等しくない)、in (含む)、nin (含まない)、re (正規表現一致)、nre (正規表現不一致) があります。   
 }
 ]
 } 
 ]

[ { "matchingConditions": [ { "value": "test", "key": "alertname", "operator": "eq" } ] } ]

SendRecoverMessage

boolean

任意

アラートに関連するすべてのイベントが復元済みの状態に変わったときに、アラートのステータスを自動的に解決済みに変更するかどうかを指定します。ARMS は、アラートのステータスが解決済みに変更されると、連絡先に通知します。

  • true:システムは通知を送信します。

  • false:システムは通知を送信しません。

true

GroupRule

string

任意

アラートイベントグループオブジェクトの配列。

  • groupingFields フィールドを指定しない場合、すべてのアラートは alertname に基づいて連絡先に送信されます。

  • groupingFields フィールドを指定すると、同じフィールドを持つアラートが 1 つの通知で連絡先に送信されます。

サンプル文:

{ 
"groupWait":5,    // グルーピングの待機時間。 
"groupInterval":30,     // グルーピングの時間間隔。 
"groupingFields":["alertname"]       // アラートイベントをグループ化するために使用されるフィールド。 
}

{ "groupWait":5, "groupInterval":30, "groupingFields":["alertname"] }

NotifyRule

string

必須

通知ルールオブジェクトの配列。フォーマット:

{ 
 "notifyStartTime":"00:00",      // 通知ウィンドウの開始時刻。 
 "notifyEndTime":"23:59",       // 通知ウィンドウの終了時刻。 
 "notifyChannels":["dingTalk", "email", "sms", "tts", "webhook"],       // 通知方法。有効な値:dingTalk、email、sms、tts、webhook。 
 "notifyObjects":[{       // 通知オブジェクトの配列。 
 "notifyObjectType":"CONTACT",       // 通知オブジェクトのタイプ。有効な値:CONTACT (連絡先)、CONTACT_GROUP (連絡先グループ)、ARMS_CONTACT (ARMS 連絡先)、ARMS_CONTACT_GROUP (ARMS 連絡先グループ)、DING_ROBOT_GROUP (DingTalk、Lark、WeCom、または IM ロボット)、CONTACT_SCHEDULE (スケジュールで定義された勤務中のユーザー)。 
 "notifyObjectId":123,       // 通知オブジェクトの ID。 
 "notifyObjectName":"test"       // 通知オブジェクトの名前。 
 }]

{ "notifyStartTime": "00:00", "notifyEndTime": "23:59", "notifyChannels": [ "dingTalk", "email", "sms", "tts", "webhook" ], "notifyObjects": [ { "notifyObjectType": "CONTACT", "notifyObjectId": 123, "notifyObjectName": "test", "notifyChannels": [ "email", "sms", "tts" ], } ] }

NotifyTemplate

string

任意

通知テンプレート。デフォルトの通知テンプレートは、表の下に記載されています。

{ "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}}" }

EscalationPolicyId

integer

任意

エスカレーションポリシーの ID。

123

Repeat

boolean

任意

長時間未解決のアラートに対して通知を再送するかどうかを指定します。デフォルト値:true。有効な値:

  • true:このパラメーターを true に設定した場合、RepeatInterval を設定する必要があります。

  • false:このパラメーターを false に設定した場合、EscalationPolicyId を設定する必要があります。

true

RepeatInterval

integer

任意

長時間未解決のアラートに対して通知を再送する時間間隔。単位:秒。

600

IntegrationId

integer

任意

アラートがプッシュされるチケットシステムの統合 ID。

34

RegionId

string

任意

リージョン ID。

cn-hangzhou

DirectedMode

boolean

任意

シンプルモードを有効にするかどうかを指定します。

false

State

string

任意

通知ポリシーを有効にするかどうかを指定します。有効な値:enable と disable。

enable

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 }} <a href="{{.generatorURL}}" >リンク</a> {{ 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 }} <a href="{{.generatorURL}}" >リンク</a> {{ 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 }}",

// 電話によるアラート通知
"tsContent":"アラート名: {{ .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 }}",

// IM (インスタントメッセージ) ロボットによって送信されるアラート通知
"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}}"

}

レスポンスフィールド

フィールド

説明

object

応答のスキーマ

RequestId

string

リクエスト ID。

A5EC8221-08F2-4C95-9AF1-49FD998C****

NotificationPolicy

object

通知ポリシーオブジェクトの配列。

Id

integer

通知ポリシーの ID。

1234

Name

string

通知ポリシーの名前。

notificationpolicy_test

MatchingRules

array<object>

マッチングルール。

array<object>

MatchingConditions

array<object>

マッチング条件。

object

Key

string

マッチング条件のキー。

altertname

Value

string

マッチング条件の値。

test

Operator

string

マッチング条件の論理演算子。有効な値:

  • eq:等しい

  • neq:等しくない

  • in:含む

  • nin:含まない

  • re:正規表現一致

  • nre:正規表現不一致

eq

SendRecoverMessage

boolean

アラートに関連するすべてのイベントが復元済みの状態に変わったときに、アラートのステータスを自動的に解決済みに変更するかどうかを示します。ARMS は、アラートのステータスが解決済みに変更されると、連絡先に通知します。

  • true:システムは通知を送信します。

  • false:システムは通知を送信しません。

true

GroupRule

object

アラートイベントグループオブジェクトの配列。

GroupingFields

array

アラートイベントグループオブジェクトの配列。

  • groupingFields フィールドを指定しない場合、すべてのアラートは alertname に基づいて連絡先に送信されます。

  • groupingFields フィールドを指定すると、同じフィールドを持つアラートが 1 つの通知で連絡先に送信されます。

string

グルーピングに使用されるフィールド。

["alertName","clustname"]

GroupWait

integer

グルーピングの待機時間。単位:秒。デフォルト値:5。

5

GroupInterval

integer

グルーピングの時間間隔。単位:秒。デフォルト値:30。

30

NotifyRule

object

通知ルールオブジェクトの配列。

NotifyStartTime

string

通知ウィンドウの開始時刻。

00:00

NotifyEndTime

string

通知ウィンドウの終了時刻。

23:59

NotifyChannels

array

通知方法。

string

通知方法。有効な値:

  • dingTalk:DingTalk

  • email:メール

  • sms:テキストメッセージ

  • tts:電話

  • webhook:Webhook

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

NotifyObjects

array<object>

通知オブジェクトの配列。

object

通知オブジェクトに関する情報。

NotifyObjectType

string

通知オブジェクトのタイプ。有効な値:

  • CONTACT:連絡先

  • CONTACT_GROUP:連絡先グループ

  • ARMS_CONTACT:ARMS 連絡先

  • ARMS_CONTACT_GROUP:ARMS 連絡先グループ

  • DING_ROBOT_GROUP:DingTalk、Lark、WeCom、または IM ロボット

  • CONTACT_SCHEDULE:スケジュールで定義された勤務中のユーザー

CONTACT

NotifyObjectId

integer

通知オブジェクトの ID。

123

NotifyObjectName

string

通知オブジェクトの名前。

test

NotifyChannels

array

連絡先に指定された通知方法。

string

通知方法。有効な値:

  • email:メール

  • sms:テキストメッセージ

  • tts:電話

sms

NotifyTemplate

object

通知テンプレート。

EmailTitle

string

メールで送信されるアラート通知のタイトル。

{{ .commonLabels.alertname }}

EmailContent

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 }} {{if .generatorURL }} 详情链接 {{ end }} {{ end }}

EmailRecoverTitle

string

メールで送信されるアラート解決通知のタイトル。

{{ .commonLabels.alertname }}

EmailRecoverContent

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 }} {{if .generatorURL }} 详情链接 {{ end }} {{ end }}

SmsContent

string

テキストメッセージで送信されるアラート通知の内容。

发生{{ .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

テキストメッセージで送信されるアラート解決通知の内容。

告警已经恢复 告警名称:{{ .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

電話によるアラート通知の内容。

告警名称:{{ .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

電話によるアラート解決通知の内容。

告警名称:{{ .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

IM ロボットによって送信されるアラート通知の内容。

{{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}}

EscalationPolicyId

integer

エスカレーションポリシーの ID。

123

Repeat

boolean

長時間未解決のアラートに対して通知が再送されるかどうかを示します。デフォルト値:true。有効な値:

  • true:システムは、指定された時間間隔で長時間未解決のアラートの通知を再送します。

  • false:システムは、エスカレーションポリシーに基づいて長時間未解決のアラートの通知を送信します。

true

RepeatInterval

integer

長時間未解決のアラートに対して通知が再送される時間間隔。単位:秒。

600

IntegrationId

integer

アラートがプッシュされるチケットシステムの統合 ID。

34

DirectedMode

boolean

シンプルモードを有効にするかどうかを指定します。

false

State

string

通知ポリシーが有効になっているかどうかを示します。有効な値:enable と disable。

enable

成功レスポンス

JSONJSON

{
  "RequestId": "A5EC8221-08F2-4C95-9AF1-49FD998C****",
  "NotificationPolicy": {
    "Id": 1234,
    "Name": "notificationpolicy_test",
    "MatchingRules": [
      {
        "MatchingConditions": [
          {
            "Key": "altertname",
            "Value": "test",
            "Operator": "eq"
          }
        ]
      }
    ],
    "SendRecoverMessage": true,
    "GroupRule": {
      "GroupingFields": [
        "[\"alertName\",\"clustname\"]"
      ],
      "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": [
            "sms"
          ]
        }
      ]
    },
    "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}}"
    },
    "EscalationPolicyId": 123,
    "Repeat": true,
    "RepeatInterval": 600,
    "IntegrationId": 34,
    "DirectedMode": false,
    "State": "enable"
  }
}

エラーコード

完全なリストについては、「エラーコード」をご参照ください。

変更履歴

完全なリストについては、「変更履歴」をご参照ください。