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

云监控

复制全文
下载 pdf
告警模板
ListPresetAlertTemplates
复制全文
下载 pdf
ListPresetAlertTemplates
查询预置告警模版列表。​
请求说明​
  • 请求方式:POST​
  • 请求地址:https://cloudmonitor.cn-beijing.volcengineapi.com?Action=ListPresetAlertTemplates&Version=2018-01-01​
调试​
API Explorer
您可以通过 API Explorer 在线发起调用,无需关注签名生成过程,快速获取调用结果。
​
请求参数​
​
参数​
类型​
是否必选​
示例值​
描述​
Action​
String​
是​
ListPresetAlertTemplates​
接口名称。当前 API 的名称为 ListPresetAlertTemplates。​
Version​
String​
是​
2018-01-01​
接口版本。当前 API 的版本为 2018-01-01。​
Name​
String​
否​
云服务器告警模版​
使用模版名称筛选告警模版。​
  • 字符串形式,支持中文、英文大小写和特殊字符。​
  • 不能以数字、中划线-,特殊字符开头。​
  • 长度限制为 1~128 字符。​
Namespaces​
Array of String​
否​
["VCM_ECS"]​
按照模版中的云产品筛选告警模版。详情请参见 云产品监控指标 下各产品的 Namespace。​
TemplateIds​
Array of String​
否​
["1354766247190******"]​
按照模版 ID 筛选告警模版。​
PageNumber​
Integer​
否​
1​
分页查询参数,用于设置当前页码。默认值为 1。​
  • 实际起始位置 = (PageNumber-1) * PageSize​
  • 实际终止位置 = PageNumber * PageSize​
PageSize​
Integer​
否​
30​
分页查询参数,用于设置每页行数。默认值为 30。​
​
请求示例​
​
POST https://cloudmonitor.cn-beijing.volcengineapi.com?Action=ListPresetAlertTemplates&Version=2018-01-01​
Content-Type: application/json​
{​
"Name": "云服务器告警模版",​
"Namespaces": [​
"VCM_ECS"​
],​
"TemplateIds": [​
"1354766247190******"​
],​
"PageNumber": 1,​
"PageSize": 30​
}​
​
返回参数​
​
参数​
类型​
示例值​
描述​
Data​
-​
告警模版详情。​
​
PresetAlertTemplateVO​
​
参数​
类型​
示例值​
描述​
Id​
String​
1354766247190******​
告警模版 ID。​
Description​
String​
this is an alert template demo​
告警模版描述信息。​
Name​
String​
云服务器告警模版​
告警模版名称。​
NoData​
Object of NoData​
-​
无数据告警配置。​
Status​
Boolean​
true​
告警模版是否已启用,取值:​
  • true:已启用。​
  • false:未启用。​
NotifyMode​
String​
rule​
告警发送聚合策略。​
  • rule:(默认)按照规则聚合。​
  • Resource:按照规则和资源聚合。​
SilenceTime​
Integer​
5​
告警通知周期。​
TemplateRules​
Array of TemplateRuleVO​
-​
告警模板中包含的告警规则,包括:告警对象、资源、指标、触发条件等。​
RecoveryNotify​
Object of RecoveryNotify​
-​
告警恢复通知。​
AlertNotification​
Object of AlertNotificationVO​
-​
模版关联的告警通知策略。​
AppliedProjectName​
String​
default​
告警模板生成告警策略所属项目。​
CreatedAt​
String​
2024-10-08T15:22:30+08:00​
告警模版的创建时间。​
UpdatedAt​
String​
2024-10-08T15:22:30+08:00​
告警模版的更新时间。​
​
NoData​
​
参数​
类型​
示例值​
描述​
Enable​
Boolean​
true​
是否开启无数据告警。取值:​
  • true:开启无数据告警。​
  • false:(默认)关闭无数据告警。​
EvaluationCount​
Integer​
10​
无数据告警触发阈值,如果在配置的阈值周期内检测无数据上报,则会触发无数据告警。​
  • 当Enable配置为true时,该字段为必填。​
  • 整数形式,取值范围为 3~20。​
Level​
String​
notice​
无数据告警级别。取值:​
  • critical:严重​
  • warning:警告​
  • notice:通知​
​
TemplateRuleVO​
​
参数​
类型​
示例值​
描述​
Name​
String​
demo​
告警规则名称。​
Namespace​
String​
VCM_ECS​
此模板规则的监控指标所属的云产品。详情请参见 云产品监控指标 下各产品的 Namespace。​
SubNamespace​
String​
GPU​
此模板规则引用的指标所属的维度。详情请参见 云监控指标查询 下各产品的 SubNamespace。​
AppliedRules​
Array of AppliedRulesBasic​
-​
关联的告警策略信息。​
CheckInterval​
Integer​
1​
生成的告警规则的执行周期 ,由产品配置决定,单位为分钟。​
EvaluationCount​
Integer​
1​
触发告警需要持续的周期。单位为分钟。​
LevelConditions​
Array of LevelCondition​
-​
告警分级。​
ConditionOperator​
String​
&&​
多指标判定条件。​
  • &&:多个指标同时成立才判定为触发告警​
  • ||:任意指标满足条件就判定为触发告警​
MultipleConditions​
Boolean​
ture​
告警策略是否用多指标。​
  • true:多指标​
  • false:单指标(默认)​
​
RecoveryNotify​
​
参数​
类型​
示例值​
描述​
Enable​
Boolean​
true​
是否开启告警恢复通知。取值:​
  • true:(默认)开启告警恢复通知。​
  • false:关闭告警恢复通知。​
​
AlertNotificationVO​
​
参数​
类型​
示例值​
描述​
Webhook​
String​
https://qyapi.weixin.qq.com/xxxx​
告警回调 Webhook 地址。​
WebhookIds​
Array of String​
["18913208***4528"]​
告警回调 Webhook 回调 ID。​
可以调用 ListWebhooks接口,获取 Webhook 回调 ID。​
AlertMethods​
Array of String​
Phone​
告警通知方式,取值:​
  • Email:使用邮箱接收告警通知。​
  • Phone:使用电话接收告警通知。​
  • SMS:使用短信接收告警通知。​
  • Webhook:使用 Webhook 接收告警通知。​
ContactGroupIds​
Array of String​
145080093687100****​
告警联系组 ID。​
可以调用 ListContactGroups接口,获取联系组 ID。​
NotificationId​
String​
189898***00​
通知策略 ID。​
可以调用 ListNotifications 接口,获取通知策略 ID。​
注意​
NotificationId与AlertMethods参数不会同时返回,仅会返回一个。​
EffectStartAt​
String​
00:00​
告警通知策略生效的开始时间,格式为HH:MM,例如:00:00。​
EffectEndAt​
String​
23:59​
告警通知策略生效的截止时间,格式为HH:MM,例如:23:59。​
说明​
EffectEndAt时间必须晚于EffectStartAt时间。​
NotifyTemplates​
-​
通知模版配置。​
​
AppliedRulesBasic​
​
参数​
类型​
示例值​
描述​
Id​
String​
alarm_rule_demo​
告警策略 ID。​
Name​
String​
1354766247190******​
告警策略名称。​
ObjectId​
String​
​
关联的对象Id​
ObjectGroupId​
String​
​
关联的对象分组Id​
​
LevelCondition​
​
参数​
类型​
示例值​
描述​
Level​
String​
warning​
告警通知等级,取值:​
  • notice:通知​
  • warning:警告​
  • critical:严重​
  • recovery:恢复​
Conditions​
Array of RuleCondition​
-​
告警分级配置。​
​
NotifyTemplateBasic​
​
参数​
类型​
示例值​
描述​
Channel​
String​
email​
通知渠道,取值:​
  • email:邮箱​
  • sms:短信​
  • phone:电话​
  • lark:飞书​
  • dingtalk:钉钉​
  • wecom:企业微信​
  • slack:Slack​
  • api:回调地址​
NotifyTemplateId​
String​
189828***00​
通知模版 ID。​
注意​
每种通知渠道仅支持配置 1 个通知模版 ID。​
​
RuleCondition​
​
参数​
类型​
示例值​
描述​
MetricName​
String​
Instance_CpuBusy​
监控指标的名称。详情请参见 云监控指标查询 下各产品的 MetricName。​
Statistics​
String​
avg​
统计方法,取值:​
  • avg:平均值。​
  • max:最大值。​
  • min:最小值。​
说明​
统计方法会应用到检测时间段内的数据上。例如,默认每次检测数据的时间跨度是 1 分钟,如果统计方法为 avg,那就是对 1 分钟内的数据取平均值。​
ComparisonOperator​
String​
>​
比较符号。支持普通阈值告警: >、>=、<、<=、!=、= ,以及以下同环比告警:​
  • last_period_increase_pct:环比上周期上涨。​
  • last_period_decrease_pct:环比上周起下降。​
  • last_period_abs_pct:环比上周期上涨或下降。​
  • last_day_increase_pct:同比昨天同一时段上涨。​
  • last_day_decrease_pct:同比昨天同一时段下降。​
  • last_day_abs_pct:同比昨天同一时段上涨或下降。​
  • last_week_increase_pct:同比上周同一时段上涨。​
  • last_week_decrease_pct:同比上周同一时段下降。​
  • last_week_abs_pct:同比上周同一时段上涨或下降。​
Threshold​
String​
100​
指标阈值。​
  • 支持输入正数或 0。​
  • 最多支持三位小数。​
MetricUnit​
String​
Percent​
监控指标的单位。详情请参见 云监控指标查询 下各产品的 MetricUnit。​
说明​
  • 同环比告警,MetricUnit 需要填写为 "Percent"。​
  • MetricUnit 中是否带有 IEC 表示不同的进位:​
  • 带有 IEC:进位是 1024​
  • 不带 IEC:进位是 1000​
​
返回示例​
​
{​
"ResponseMetadata": {​
"Action": "ListPresetAlertTemplates",​
"Region": "cn-beijing",​
"Service": "cloudmonitor",​
"Version": "2018-01-01",​
"RequestId": "20230604110420****100232280022D31"​
},​
"Result": {​
"Data": [​
{​
"Id": "1354766247190******",​
"Name": "云服务器告警模版",​
"NoData": {​
"Level": "notice",​
"Enable": true,​
"EvaluationCount": 10​
},​
"Status": true,​
"CreatedAt": "2024-10-08T15:22:30+08:00",​
"UpdatedAt": "2024-10-08T15:22:30+08:00",​
"NotifyMode": "rule",​
"Description": "this is an alert template demo",​
"SilenceTime": 5,​
"TemplateRules": [​
{​
"Name": "demo",​
"Namespace": "VCM_ECS",​
"AppliedRules": [​
{​
"Id": "alarm_rule_demo",​
"Name": "1354766247190******"​
}​
],​
"SubNamespace": "GPU",​
"CheckInterval": 1,​
"EvaluationCount": 1,​
"LevelConditions": [​
{​
"Level": "warning",​
"Conditions": [​
{​
"Threshold": "100",​
"MetricName": "Instance_CpuBusy",​
"MetricUnit": "Percent",​
"Statistics": "avg",​
"ComparisonOperator": ">"​
}​
]​
}​
],​
"ConditionOperator": "&&",​
"MultipleConditions": false​
}​
],​
"RecoveryNotify": {​
"Enable": true​
},​
"AlertNotification": {​
"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",​
"AppliedProjectName": "default"​
}​
]​
}​
}​
​
错误码​
本接口无特有的错误码。更多信息请参见 错误码。​
最近更新时间:2026.08.11 20:28:02
这个页面对您有帮助吗?
有用
有用
无用
无用