插件下载了解更多
Alibaba Cloud Developer ToolkitbetaAlibaba Cloud OpenAPI
Alibaba Cloud Developer Toolkit is a collection of extensions that can help access Alibaba Cloud services in Visual Studio Code.
安装插件之前,确保已安装 JetBrains IDE安装插件之前,确保已安装 JetBrains IDE
Alibaba Cloud Developer ToolkitbetaAlibaba Cloud OpenAPI
The Alibaba Cloud Developer Toolkit for JetBrains makes it easier to access Alibaba Cloud services.
流控信息
当前云产品API请求速率暂未透出。
请求参数
字段名称 | 字段详情 |
---|---|
Idinteger<int64> | |
Namestring | 通知策略名称。 示例值:notificationpolicy_test |
MatchingRulesstring | 匹配告警事件规则。格式如下:展开详情 示例值:[ { "matchingConditions": [ { "value": "test", "key": "alertname", "operator": "eq" } ] } ] |
SendRecoverMessageboolean | 当告警下面全部事件都恢复时,告警状态是否自动恢复为已解决。当告警恢复时,系统将会发送通知给处理人。展开详情 示例值:true |
GroupRulestring | 设置事件分组。展开详情 示例值:{ "groupWait":5, "groupInterval":30, "groupingFields":["alertname"] }参考取值来源: DescribeDispatchRule |
NotifyRulestring | 设置通知规则。格式如下:展开详情 示例值:{
"notifyStartTime": "00:00",
"notifyEndTime": "23:59",
"notifyChannels": [
"dingTalk",
"email",
"sms",
"tts",
"webhook"
],
"notifyObjects": [
{
"notifyObjectType": "CONTACT",
"notifyObjectId": 123,
"notifyObjectName": "test",
"notifyChannels": [
"email",
"sms",
"tts"
],
}
]
}
|
NotifyTemplatestring | 通知模板。示例模板请参见表格下方说明。 示例值:{ "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}}" } |
EscalationPolicyIdinteger<int64> | 升级规则 ID。 注意
该字段类型为 Long,在序列化/反序列化的过程中可能导致精度丢失,请注意数值不得大于 9007199254740991。 示例值:123 |
Repeatboolean | 对于长期未解决的告警是否发送重复通知。展开详情 示例值:true |
RepeatIntervalinteger<int64> | 重复通知时间间隔,单位为秒。 注意
该字段类型为 Long,在序列化/反序列化的过程中可能导致精度丢失,请注意数值不得大于 9007199254740991。 示例值:600 |
IntegrationIdinteger<int64> | 告警需要推送到的工单系统,填写工单系统的集成 ID。 注意
该字段类型为 Long,在序列化/反序列化的过程中可能导致精度丢失,请注意数值不得大于 9007199254740991。 示例值:34参考取值来源: UpdateIntegration ListIntegration CreateIntegration |
RegionIdstring | 地域 ID。 示例值:cn-hangzhou |
DirectedModeboolean | 极简模式 示例值:false |
Statestring | 通知策略是否启用,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 }}",
//电话告警通知
"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}}",
//机器人告警恢复通知
"robotRecoverContent":"{{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}}"
}
返回参数
字段名称 | 字段详情 |
---|---|
RequestIdstring | 请求 ID。 示例值:A5EC8221-08F2-4C95-9AF1-49FD998C**** |
NotificationPolicyobject | 通知策略对象。 |