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

云监控

复制全文
下载 pdf
告警模板
EnablePresetAlertTemplate
复制全文
下载 pdf
EnablePresetAlertTemplate
应用预置告警模版,批量创建告警策略。​
请求说明​
  • 请求方式:POST​
  • 请求地址:https://cloudmonitor.cn-beijing.volcengineapi.com?Action=EnablePresetAlertTemplate&Version=2018-01-01​
调试​
API Explorer
您可以通过 API Explorer 在线发起调用,无需关注签名生成过程,快速获取调用结果。
​
请求参数​
​
参数​
类型​
是否必选​
示例值​
描述​
Action​
String​
是​
EnablePresetAlertTemplate​
接口名称。当前 API 的名称为 EnablePresetAlertTemplate。​
Version​
String​
是​
2018-01-01​
接口版本。当前 API 的版本为 2018-01-01。​
TemplateId​
String​
是​
1354766247190******​
告警模版 ID。​
NotificationId​
String​
否​
189898***00​
通知策略 ID。​
可以调用 ListNotifications 接口,获取通知策略 ID。​
注意​
该参数的优先级比AlertMethods更高,因此,当使用该参数指定告警通知策略 ID 时,其他告警通知的配置(AlertMethods、ContactGroupIds、WebhookIds,EffectStartAt、EffectEndAt等)将失效。​
AlertMethods​
Array of String​
否​
Phone​
告警通知方式,取值:​
  • Email:使用邮箱接收告警通知。​
  • Phone:使用电话接收告警通知。​
  • SMS:使用短信接收告警通知。​
  • Webhook:使用 Webhook 接收告警通知。​
ContactGroupIds​
Array of String​
否​
["145080093687100****"]​
当AlertMethods配置为Email、Phone或SMS时,指定告警联系组 ID。​
可以调用 ListContactGroups接口,获取联系组 ID。​
WebhookIds​
Array of String​
否​
["18913208***4528"]​
当AlertMethods配置为Webhook时,指定告警 Webhook 回调 ID。​
可以调用 ListWebhooks接口,获取 Webhook 回调 ID。​
Webhook​
String​
否​
http://alert.volc.com/callback​
当AlertMethods配置为Webhook时,配置告警 Webhook 回调地址。​
注意​
WebhookIds和Webhook参数仅能配置一个,不能同时配置。​
EffectStartAt​
String​
是​
00:00​
告警策略生效的开始时间,格式为HH:MM,例如:00:00。​
EffectEndAt​
String​
是​
23:59​
告警策略生效的截止时间,格式为HH:MM,例如:23:59。​
说明​
EffectEndAt时间必须晚于EffectStartAt时间。​
ProjectName​
String​
是​
default​
生成告警策略所属的项目。​
UpgradePresetAlertTemplate​
Boolean​
否​
true​
当预置告警模版有新版本时,是否升级预置告警模板。取值:​
  • true:升级。​
  • false:不升级。​
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=EnablePresetAlertTemplate&Version=2018-01-01​
Content-Type: application/json​
{​
"TemplateId": "1354766247190******",​
"AlertMethods": [​
"Phone"​
],​
"ContactGroupIds": [​
"145080093687100****"​
],​
"EffectStartAt": "00:00",​
"EffectEndAt": "23:59",​
"ProjectName": "default",​
"UpgradePresetAlertTemplate": true,​
"NotifyTemplates": [​
{​
"Channel": "email",​
"NotifyTemplateId": "189828***00"​
}​
]​
}​
​
返回参数​
​
参数​
类型​
示例值​
描述​
Data​
Array of String​
["184361599203***"]​
告警模版所生成的告警策略的 ID 列表。​
​
返回示例​
​
{​
"ResponseMetadata": {​
"Action": "EnablePresetAlertTemplate",​
"Region": "cn-beijing",​
"Service": "cloudmonitor",​
"Version": "2018-01-01",​
"RequestId": "20230604110420****100232280022D31"​
},​
"Result": {​
"Data": [​
"184361599203***"​
]​
}​
}​
​
错误码​
本接口无特有的错误码。更多信息请参见 错误码。​
最近更新时间:2026.08.11 20:28:02
这个页面对您有帮助吗?
有用
有用
无用
无用