指定された条件に基づいて通知ポリシーをクエリします。
今すぐお試しください
テスト
RAM 認証
リクエストパラメーター
|
パラメーター |
型 |
必須 / 任意 |
説明 |
例 |
| Name |
string |
任意 |
通知ポリシーの名前。 |
notificationpolicy_test |
| Page |
integer |
必須 |
返すページ番号。 |
1 |
| Size |
integer |
必須 |
各ページで返すエントリ数。 |
20 |
| IsDetail |
boolean |
任意 |
通知ポリシーの詳細をクエリするかどうかを指定します。 有効な値:
|
false |
| RegionId |
string |
任意 |
リージョン ID。 デフォルト値:cn-hangzhou。 |
cn-hangzhou |
| Ids |
string |
任意 |
通知ポリシーの ID。 |
12345 |
| DirectedMode |
boolean |
任意 |
シンプルモードを有効にするかどうかを指定します。 |
true |
レスポンスフィールド
|
フィールド |
型 |
説明 |
例 |
|
object |
応答のスキーマ |
||
| RequestId |
string |
リクエスト ID。 |
78901766-3806-4E96-8E47-CFEF59E4**** |
| PageBean |
object |
返されたページ。 |
|
| Total |
integer |
返される通知ポリシーの数。 |
24 |
| Page |
integer |
返されたページ番号。 |
1 |
| Size |
integer |
各ページで返されるエントリ数。 |
20 |
| NotificationPolicies |
array<object> |
クエリされた通知ポリシー。 |
|
|
array<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 |
| SendRecoverMessage |
boolean |
アラートに関連するすべてのイベントが復元済みの状態に変わったときに、アラートのステータスが自動的に解決済みに変更されるかどうかを示します。 アラートのステータスが解決済みに変更されると、システムはアラート連絡先に通知を送信します。
|
true |
| GroupRule |
object |
アラートイベントのグループ化ルール。 |
|
| GroupingFields |
array |
アラートイベントグループオブジェクトの配列。
|
|
|
string |
グループ化に使用されるフィールド。 |
["alertname"] |
|
| GroupWait |
integer |
グループ化の待機時間。 単位:秒。 デフォルト値:5。 |
5 |
| GroupInterval |
integer |
グループ化の時間間隔。 単位:秒。 デフォルト値:30。 |
30 |
| NotifyRule |
object |
通知ルール。 |
|
| NotifyStartTime |
string |
通知ウィンドウの開始時刻。 |
00:00 |
| NotifyEndTime |
string |
通知ウィンドウの終了時刻。 |
23:59 |
| NotifyChannels |
array |
通知方法。 |
|
|
string |
通知方法。 有効な値:
|
[ "dingTalk", "email", "sms", "tts","webhook" ] |
|
| NotifyObjects |
array<object> |
通知オブジェクト。 |
|
|
object |
|||
| NotifyObjectType |
string |
通知オブジェクトのタイプ。 有効な値:
|
CONTACT |
| NotifyObjectId |
integer |
通知オブジェクトの ID。 |
123 |
| NotifyObjectName |
string |
通知オブジェクトの名前。 |
test |
| NotifyChannels |
array |
連絡先に指定された通知方法。 |
|
|
string |
通知方法。
|
[ "email", "sms", "tts" ] |
|
| 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}} |
| Repeat |
boolean |
未解決のまま長時間続くアラートに対して、システムが通知を再送するかどうかを示します。 有効な値:
|
true |
| RepeatInterval |
integer |
未解決のまま長時間続くアラートの通知が再送される時間間隔。 単位:秒。 |
600 |
| EscalationPolicyId |
integer |
エスカレーションポリシーの ID。 |
123 |
| IntegrationId |
integer |
アラートがプッシュされるチケットシステムの連携 ID。 |
34 |
| DirectedMode |
boolean |
シンプルモードが有効になっているかどうかを示します。 |
true |
| State |
string |
通知ポリシーが有効になっているかどうかを示します。 有効な値:enable および disable。 |
enable |
例
成功レスポンス
JSONJSON
{
"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"
}
]
}
}
エラーコード
完全なリストについては、「エラーコード」をご参照ください。
変更履歴
完全なリストについては、「変更履歴」をご参照ください。