查询预置告警模版列表。
参数 | 类型 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|
Action | String | 是 | ListPresetAlertTemplates | 接口名称。当前 API 的名称为 ListPresetAlertTemplates 。 |
Version | String | 是 | 2018-01-01 | 接口版本。当前 API 的版本为 2018-01-01 。 |
Name | String | 否 | 云服务器告警模版 | 使用模版名称筛选告警模版。
|
Namespaces | Array of String | 否 | ["VCM_ECS"] | 按照模版中的云产品筛选告警模版。详情请参见 云产品监控指标 下各产品的 Namespace。 |
TemplateIds | Array of String | 否 | ["1354766247190******"] | 按照模版 ID 筛选告警模版。 |
PageNumber | Integer | 否 | 1 | 分页查询参数,用于设置当前页码。默认值为 1。
|
PageSize | Integer | 否 | 30 | 分页查询参数,用于设置每页行数。默认值为 30。 |
POST https://open.volcengineapi.com?Action=ListPresetAlertTemplates&Version=2018-01-01 Content-Type: application/json { "Name": "云服务器告警模版", "Namespaces": [ "VCM_ECS" ], "TemplateIds": [ "1354766247190******" ], "PageNumber": 1, "PageSize": 30 }
参数 | 类型 | 示例值 | 描述 |
---|---|---|---|
Data | Array of PresetAlertTemplateVO | - | 告警模版详情。 |
参数 | 类型 | 示例值 | 描述 |
---|---|---|---|
Id | String | 1354766247190****** | 告警模版 ID。 |
Description | String | this is an alert template demo | 告警模版描述信息。 |
Name | String | 云服务器告警模版 | 告警模版名称。 |
NoData | Object of NoData | - | 无数据告警配置。 |
Status | Boolean | true | 告警模版是否已启用,取值:
|
NotifyMode | String | rule | 告警发送聚合策略。
|
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 | 告警模版的更新时间。 |
参数 | 类型 | 示例值 | 描述 |
---|---|---|---|
Enable | Boolean | true | 是否开启无数据告警。取值:
|
EvaluationCount | Integer | 10 | 无数据告警触发阈值,如果在配置的阈值周期内检测无数据上报,则会触发无数据告警。
|
Level | String | notice | 无数据告警级别。取值:
|
参数 | 类型 | 示例值 | 描述 |
---|---|---|---|
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 | 告警策略是否用多指标。
|
参数 | 类型 | 示例值 | 描述 |
---|---|---|---|
Enable | Boolean | true | 是否开启告警恢复通知。取值:
|
参数 | 类型 | 示例值 | 描述 |
---|---|---|---|
Webhook | String | https://qyapi.weixin.qq.com/xxxx | 告警回调 Webhook 地址。 |
WebhookIds | Array of String | ["18913208***4528"] | 告警回调 Webhook 回调 ID。 |
AlertMethods | Array of String | Phone | 告警通知方式,取值:
|
ContactGroupIds | Array of String | 145080093687100**** | 告警联系组 ID。 |
NotificationId | String | 189898***00 | 通知策略 ID。 注意
|
EffectStartAt | String | 00:00 | 告警通知策略生效的开始时间,格式为HH:MM ,例如:00:00。 |
EffectEndAt | String | 23:59 | 告警通知策略生效的截止时间,格式为 说明
|
参数 | 类型 | 示例值 | 描述 |
---|---|---|---|
Id | String | alarm_rule_demo | 告警策略 ID。 |
Name | String | 1354766247190****** | 告警策略名称。 |
参数 | 类型 | 示例值 | 描述 |
---|---|---|---|
Level | String | warning | 告警通知等级,取值:
|
Conditions | Array of RuleCondition | - | 告警分级配置。 |
参数 | 类型 | 示例值 | 描述 |
---|---|---|---|
MetricName | String | Instance_CpuBusy | 监控指标的名称。详情请参见 云监控指标查询 下各产品的 MetricName。 |
Statistics | String | avg | 统计方法,取值:
说明 统计方法会应用到检测时间段内的数据上。例如,默认每次检测数据的时间跨度是 1 分钟,如果统计方法为 avg,那就是对 1 分钟内的数据取平均值。 |
ComparisonOperator | String | > | 比较符号。支持普通阈值告警: >、>=、<、<=、!=、= ,以及以下同环比告警:
|
Threshold | String | 100 | 指标阈值。
|
MetricUnit | String | Percent | 监控指标的单位。详情请参见 云监控指标查询 下各产品的 MetricUnit。 说明
|
{ "ResponseMetadata": { "Action": "ListPresetAlertTemplates", "Region": "cn-beijing", "Service": "Volc_Observe", "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****" ] }, "EffectStartAt": "00:00", "EffectEndAt": "23:59", "AppliedProjectName": "default" } ] } }
本接口无特有的错误码。更多信息请参见 错误码。