创建告警模版。
参数 | 类型 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|
Action | String | 是 | CreateAlertTemplate | 接口名称。当前 API 的名称为 CreateAlertTemplate 。 |
Version | String | 是 | 2018-01-01 | 接口版本。当前 API 的版本为 2018-01-01 。 |
Name | String | 是 | alert-template-demo | 告警模版名称。
|
Description | String | 否 | this is an alert template demo | 告警模版描述信息。
|
NoData | Object of NoData | 否 | - | 无数据告警配置。 |
NotifyMode | String | 是 | rule | 告警发送聚合策略。
|
RecoveryNotify | Object of RecoveryNotify | 否 | - | 告警恢复通知。 |
SilenceTime | Integer | 是 | 5 | 告警通知周期。单位为分钟。支持 5、10、15、30、60、180、360、720、1440。 |
TemplateRules | Array of TemplateRule | 是 | - | 告警模版配置详情。 |
参数 | 类型 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|
Enable | Boolean | 否 | true | 是否开启无数据告警。取值:
|
EvaluationCount | Integer | 否 | 10 | 无数据告警触发阈值,如果在配置的阈值周期内检测无数据上报,则会触发无数据告警。
|
Level | String | 否 | notice | 无数据告警级别。取值:
|
参数 | 类型 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|
Enable | Boolean | 否 | true | 是否开启告警恢复通知。取值:
|
参数 | 类型 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|
Name | String | 是 | CPU useage | 告警规则名称。
说明 告警模版名称和该名称拼接获得模版生成的告警规则名称。 |
Namespace | String | 是 | VCM_ECS | 此策略监控指标所属的云产品。详情请参见 云产品监控指标 下各产品的 Namespace。 |
SubNamespace | String | 是 | GPU | 此策略引用指标所属的维度。详情请参见 云监控指标查询 下各产品的 SubNamespace。 |
EvaluationCount | Integer | 是 | 1 | 触发告警需要持续的周期。单位为分钟。取值为 1、3、5、10、15、30、60、120。 |
LevelConditions | Array of LevelCondition | 是 | - | 告警分级。 |
ConditionOperator | String | 否 | && | 多指标判定条件。
|
MultipleConditions | Boolean | 否 | true | 告警策略是否用多指标。
|
参数 | 类型 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|
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。 说明
|
POST https://open.volcengineapi.com?Action=CreateAlertTemplate&Version=2018-01-01 Content-Type: application/json { "Description": "this is an alert template demo", "Name": "alert-template-demo", "NoData": { "Level": "notice", "Enable": true, "EvaluationCount": 10 }, "NotifyMode": "rule", "RecoveryNotify": { "Enable": true }, "SilenceTime": 5, "TemplateRules": [ { "Name": "CPU useage", "Namespace": "VCM_ECS", "LevelConditions": [ { "Level": "warning", "Conditions": [ { "Threshold": "100", "MetricName": "Instance_CpuBusy", "MetricUnit": "Percent", "Statistics": "avg", "ComparisonOperator": ">" } ] } ], "EvaluationCount": 1, "SubNamespace": "GPU", "ConditionOperator": "&&", "MultipleConditions": true } ] }
参数 | 类型 | 示例值 | 描述 |
---|---|---|---|
Data | String | 1354766247190****** | 告警模版 ID。 |
{ "ResponseMetadata": { "Action": "CreateAlertTemplate", "Region": "cn-beijing", "Service": "Volc_Observe", "Version": "2018-01-01", "RequestId": "20230604110420****100232280022D31" }, "Result": { "Data": "1354766247190******" } }
本接口无特有的错误码。更多信息请参见 错误码。