调用CreateMetricRuleTemplate接口创建报警模板。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
授权信息
请求参数
名称 | 类型 | 必填 | 描述 | 示例值 |
---|
名称 | 类型 | 必填 | 描述 | 示例值 |
---|---|---|---|---|
Name | string | 是 | 报警模板名称。 | Template1 |
Description | string | 否 | 报警模板描述信息。 | ECS_Template1 |
AlertTemplates | array<object> | 否 | 报警模板列表。 | |
object | 否 | 报警模板。 | ||
Escalations.Info.Threshold | string | 否 | 普通级别报警阈值。 N 的取值范围:1~200。
报警级别 Critical(严重)、Warn(警告)或 Info(信息)至少设置一个,且该报警级别中的参数 Statistics、ComparisonOperator、Threshold 和 Times 必须同时设置。
| 20 |
MetricName | string | 是 | cpu_total | |
Webhook | string | 否 | 报警发生回调时的 URL 地址。 N 的取值范围:1~200。 填写公网可访问的 URL 地址,云监控会将报警信息通过 POST 请求推送到该地址,目前仅支持 HTTP 协议。 | http://ww.aliyun.com |
Escalations.Warn.Threshold | string | 否 | 警告级别报警阈值。 N 的取值范围:1~200。
报警级别 Critical(严重)、Warn(警告)或 Info(信息)至少设置一个,且该报警级别中的参数 Statistics、ComparisonOperator、Threshold 和 Times 必须同时设置。
| 30 |
Namespace | string | 是 | acs_ecs_dashboard | |
Period | integer | 否 | 监控数据的聚合周期。单位:秒。 默认为监控项对应的最小周期,通常不需要指定。 N 的取值范围:1~200。 | 60 |
RuleName | string | 是 | 报警规则名称。 N 的取值范围:1~200。 | ECS_Rule1 |
Escalations.Critical.Times | integer | 否 | 发送紧急报警通知需要监控指标达到报警阈值的次数。 N 的取值范围:1~200。
报警级别 Critical(严重)、Warn(警告)或 Info(信息)至少设置一个,且该报警级别中的参数 Statistics、ComparisonOperator、Threshold 和 Times 必须同时设置。
| 3 |
Selector | string | 否 | Dimension 扩展字段的选项。 N 的取值范围:1~200。 例如:报警模板被应用到了一个应用分组中,当该参数设置为
关于扩展字段选项的取值,请参见 DescribeMetricRuleTemplateAttribute 。
| {"disk":"/"} |
Escalations.Info.Statistics | string | 否 | 普通级别报警统计方法。 N 的取值范围:1~200。 该参数的取值由指定云产品的
报警级别 Critical(严重)、Warn(警告)或 Info(信息)至少设置一个,且该报警级别中的参数 Statistics、ComparisonOperator、Threshold 和 Times 必须同时设置。
| Average |
Escalations.Warn.Times | integer | 否 | 发送警告报警通知需要监控指标达到报警阈值的次数。 N 的取值范围:1~200。
报警级别 Critical(严重)、Warn(警告)或 Info(信息)至少设置一个,且该报警级别中的参数 Statistics、ComparisonOperator、Threshold 和 Times 必须同时设置。
| 1 |
Escalations.Info.ComparisonOperator | string | 否 | 普通级别阈值比较符。取值:
N 的取值范围:1~200。
报警级别 Critical(严重)、Warn(警告)或 Info(信息)至少设置一个,且该报警级别中的参数 Statistics、ComparisonOperator、Threshold 和 Times 必须同时设置。
| GreaterThanOrEqualToThreshold |
Category | string | 是 | ecs | |
Escalations.Critical.Threshold | string | 否 | 触发紧急级别报警通知的阈值。 N 的取值范围:1~200。
报警级别 Critical(严重)、Warn(警告)或 Info(信息)至少设置一个,且该报警级别中的参数 Statistics、ComparisonOperator、Threshold 和 Times 必须同时设置。
| 30 |
Escalations.Critical.Statistics | string | 否 | 紧急级别报警统计方法。 N 的取值范围:1~200。 该参数的取值由指定云产品的
报警级别 Critical(严重)、Warn(警告)或 Info(信息)至少设置一个,且该报警级别中的参数 Statistics、ComparisonOperator、Threshold 和 Times 必须同时设置。
| Average |
Escalations.Critical.ComparisonOperator | string | 否 | 紧急级别阈值比较符。取值:
N 的取值范围:1~200。
报警级别 Critical(严重)、Warn(警告)或 Info(信息)至少设置一个,且该报警级别中的参数 Statistics、ComparisonOperator、Threshold 和 Times 必须同时设置。
| GreaterThanOrEqualToThreshold |
Escalations.Warn.ComparisonOperator | string | 否 | 警告级别阈值比较符。取值:
N 的取值范围:1~200。
报警级别 Critical(严重)、Warn(警告)或 Info(信息)至少设置一个,且该报警级别中的参数 Statistics、ComparisonOperator、Threshold 和 Times 必须同时设置。
| GreaterThanOrEqualToThreshold |
Escalations.Info.Times | integer | 否 | 发送普通报警通知需要监控指标达到报警阈值的次数。 N 的取值范围:1~200。
报警级别 Critical(严重)、Warn(警告)或 Info(信息)至少设置一个,且该报警级别中的参数 Statistics、ComparisonOperator、Threshold 和 Times 必须同时设置。
| 1 |
Escalations.Warn.Statistics | string | 否 | 警告级别报警统计方法。 N 的取值范围:1~200。 该参数的取值由指定云产品的
报警级别 Critical(严重)、Warn(警告)或 Info(信息)至少设置一个,且该报警级别中的参数 Statistics、ComparisonOperator、Threshold 和 Times 必须同时设置。
| Average |
返回参数
示例
正常返回示例
JSON
格式
{
"Code": 200,
"Message": "The Request is not authorization.",
"RequestId": "9763ED1A-4D09-41BF-851E-310421750204",
"Success": true,
"Id": 12345
}
错误码
HTTP status code | 错误码 | 错误信息 | 描述 |
---|
HTTP status code | 错误码 | 错误信息 | 描述 |
---|---|---|---|
206 | %s | %s | - |
400 | InvalidQueryParameter | %s | - |
401 | AccessDeniedException | You donot have sufficient access to perform this action. | - |
402 | LimitExceeded | The quota for this customer had been reached. | - |
403 | InvalidClientTokenId | not allow this operation. | 没有权限 |
409 | ResourceConflict | Concurrent modification of resources. | - |
409 | ResourceExist | Resources already exist. | - |
412 | ResourcesOverLimit | Resources over limit. | - |
429 | Throttli∂ngException | The request was denied due to request throttling. | - |
500 | InternalFailure | %s | - |
访问错误中心查看更多错误码。
变更历史
变更时间 | 变更内容概要 | 操作 |
---|
变更时间 | 变更内容概要 | 操作 |
---|