You need to enable JavaScript to run this app.
文档中心
云监控

云监控

复制全文
下载 pdf
告警模板
ApplyObjectGroupsByAlertTemplate
复制全文
下载 pdf
ApplyObjectGroupsByAlertTemplate
绑定对象分组和通知策略至告警模版。​
使用限制​
  • 每个告警模版最多允许绑定 100 个对象分组。​
  • 每个对象分组最多绑定 20 个告警模版。​
请求说明​
  • 请求方式:POST​
  • 请求地址:https://cloudmonitor.cn-beijing.volcengineapi.com?Action=ApplyObjectGroupsByAlertTemplate&Version=2018-01-01​
调试​
API Explorer
您可以通过 API Explorer 在线发起调用,无需关注签名生成过程,快速获取调用结果。
​
请求参数​
​
参数​
类型​
是否必选​
示例值​
描述​
Action​
String​
是​
ApplyObjectGroupsByAlertTemplate​
接口名称。当前 API 的名称为 ApplyObjectGroupsByAlertTemplate。​
Version​
String​
是​
2018-01-01​
接口版本。当前 API 的版本为 2018-01-01。​
AlertTemplateId​
String​
是​
1354766247190******​
告警模版 ID。​
ApplyObjects​
Array of AlertNotification​
是​
-​
绑定的对象分组。​
ProjectName​
String​
是​
default​
生成告警策略所属项目。​
​
AlertNotification​
​
参数​
类型​
是否必选​
示例值​
描述​
NotificationId​
String​
否​
189898***00​
通知策略 ID。​
可以调用 ListNotifications 接口,获取通知策略 ID。​
注意​
该参数的优先级比AlertMethods更高,因此,当使用该参数指定告警通知策略 ID 时,其他告警通知的配置(AlertMethods、ContactGroupIds、WebhookIds,EffectStartAt、EffectEndAt等)将失效。​
AlertMethods​
Array of String​
否​
Phone​
告警通知方式,取值:​
  • Email:使用邮箱接收告警通知。​
  • Phone:使用电话接收告警通知。​
  • SMS:使用短信接收告警通知。​
  • Webhook:使用 Webhook 接收告警通知。​
Webhook​
String​
否​
https://qyapi.weixin.qq.com/xxxx​
当AlertMethods配置为Webhook时,指定告警回调 Webhook 地址。​
WebhookIds​
Array of String​
否​
["18913208***4528"]​
当AlertMethods配置为Webhook时,指定告警 Webhook 回调 ID。​
可以调用 ListWebhooks 接口,获取 Webhook 回调 ID。​
注意​
WebhookIds和Webhook参数仅能配置一个,不能同时配置。​
ContactGroupIds​
Array of String​
否​
145080093687100****​
当AlertMethods配置为Email、Phone或SMS时,指定告警联系组 ID。​
可以调用 ListContactGroups接口,获取联系组 ID。​
ObjectGroupId​
String​
是​
1764547228734******​
对象分组 ID。​
EffectStartAt​
String​
是​
00:00​
告警策略生效的开始时间,格式为HH:MM,例如:00:00。​
EffectEndAt​
String​
是​
23:59​
告警策略生效的截止时间,格式为HH:MM,例如:23:59。​
说明​
EffectEndAt时间必须晚于EffectStartAt时间。​
NotifyTemplates​
否​
-​
通知模版配置。​
​
NotifyTemplateBasic​
​
参数​
类型​
是否必选​
示例值​
描述​
Channel​
String​
否​
email​
通知渠道,取值:​
  • email:邮箱​
  • sms:短信​
  • phone:电话​
  • lark:飞书​
  • dingtalk:钉钉​
  • wecom:企业微信​
  • slack:Slack​
  • api:回调地址​
NotifyTemplateId​
String​
否​
189828***00​
通知模版 ID。​
注意​
每种通知渠道仅支持配置 1 个通知模版 ID。​
​
请求示例​
​
POST https://cloudmonitor.cn-beijing.volcengineapi.com?Action=ApplyObjectGroupsByAlertTemplate&Version=2018-01-01​
Content-Type: application/json​
{​
"AlertTemplateId": "1354766247190******",​
"ApplyObjects": [​
{​
"ObjectGroupId": "1764547228734******",​
"Webhook": "https://qyapi.weixin.qq.com/xxxx",​
"WebhookIds": [​
"18913208***4528"​
],​
"AlertMethods": [​
"Phone"​
],​
"ContactGroupIds": [​
"145080093687100****"​
],​
"NotifyTemplates": [​
{​
"Channel": "email",​
"NotifyTemplateId": "189828***00"​
}​
]​
"EffectStartAt": "00:00",​
"EffectEndAt": "23:59"​
}​
],​
"ProjectName": "default"​
}​
​
返回参数​
​
参数​
类型​
示例值​
描述​
Data​
Array of String​
["1354766247190******"]​
生成的告警策略 ID。​
​
返回示例​
​
{​
"ResponseMetadata": {​
"Action": "ApplyObjectGroupsByAlertTemplate",​
"Region": "cn-beijing",​
"Service": "cloudmonitor",​
"Version": "2018-01-01",​
"RequestId": "20230604110420****100232280022D31"​
},​
"Result": {​
"Data": [​
"1354766247190******"​
]​
}​
}​
​
错误码​
本接口无特有的错误码。更多信息请参见 错误码。​
最近更新时间:2026.08.11 20:28:02
这个页面对您有帮助吗?
有用
有用
无用
无用