Creates an alert template.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
cms:CreateMetricRuleTemplate |
create |
*All Resource
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| Name |
string |
Yes |
The name of the alert template. |
Template1 |
| Description |
string |
No |
The description of the alert template. |
ECS_Template1 |
| AlertTemplates |
array<object> |
No |
The details of the alert template. |
|
|
object |
No |
The alert template. |
||
| Escalations.Info.Threshold |
string |
No |
The threshold for Info-level alerts. Valid values of N: 1 to 200. Note
You must select at least one of the Critical, Warn, and Info alert levels and specify the Statistics, ComparisonOperator, Threshold, and Times parameters for each alert level. |
20 |
| MetricName |
string |
Yes |
The metric name. Valid values of N: 1 to 200. For information about how to obtain the name of a metric, see DescribeMetricMetaList or Metrics. |
cpu_total |
| Webhook |
string |
No |
The callback URL. Valid values of N: 1 to 200. The callback URL must be accessible over the Internet. CloudMonitor pushes an alert notification to the specified callback URL by sending an HTTP POST request. Only the HTTP protocol is supported. |
http://ww.aliyun.com |
| Escalations.Warn.Threshold |
string |
No |
The threshold for Warn-level alerts. Valid values of N: 1 to 200. Note
You must select at least one of the Critical, Warn, and Info alert levels and specify the Statistics, ComparisonOperator, Threshold, and Times parameters for each alert level. |
30 |
| Namespace |
string |
Yes |
The namespace of the cloud service. Valid values of N: 1 to 200. For information about how to obtain the namespace of a cloud service, see DescribeMetricMetaList or Appendix 1: Metrics. |
acs_ecs_dashboard |
| Period |
integer |
No |
The aggregation period of monitoring data. Unit: seconds. The default value is the minimum aggregation period. Generally, you do not need to specify the minimum aggregation period. Valid values of N: 1 to 200. |
60 |
| RuleName |
string |
Yes |
The name of the alert rule. Valid values of N: 1 to 200. |
ECS_Rule1 |
| Escalations.Critical.Times |
integer |
No |
The consecutive number of times for which the metric value meets the alert condition before a Critical-level alert is triggered. Valid values of N: 1 to 200. Note
You must select at least one of the Critical, Warn, and Info alert levels and specify the Statistics, ComparisonOperator, Threshold, and Times parameters for each alert level. |
3 |
| Selector |
string |
No |
The dimension of the alert. It is an extended field. Valid values of N: 1 to 200. For example, an alert template is applied to an application group, this parameter is set to Note
For more information about the values of extended fields, see DescribeMetricRuleTemplateAttribute. |
{"disk":"/"} |
| Escalations.Info.Statistics |
string |
No |
The statistical method for Info-level alerts. Valid values of N: 1 to 200. The value of this parameter is determined by the Note
You must select at least one of the Critical, Warn, and Info alert levels and specify the Statistics, ComparisonOperator, Threshold, and Times parameters for each alert level. |
Average |
| Escalations.Warn.Times |
integer |
No |
The consecutive number of times for which the metric value meets the alert condition before a Warn-level alert is triggered. Valid values of N: 1 to 200. Note
You must select at least one of the Critical, Warn, and Info alert levels and specify the Statistics, ComparisonOperator, Threshold, and Times parameters for each alert level. |
1 |
| Escalations.Info.ComparisonOperator |
string |
No |
The operator that is used to compare the metric value with the threshold for Info-level alerts. Valid values:
Valid values of N: 1 to 200. Note
You must select at least one of the Critical, Warn, and Info alert levels and specify the Statistics, ComparisonOperator, Threshold, and Times parameters for each alert level. |
GreaterThanOrEqualToThreshold |
| Category |
string |
Yes |
The abbreviation of the cloud service name. Valid values of N: 1 to 200. For more information about how to obtain the abbreviation of a cloud service name, see |
ecs |
| Escalations.Critical.Threshold |
string |
No |
The threshold for Critical-level alerts. Valid values of N: 1 to 200. Note
You must select at least one of the Critical, Warn, and Info alert levels and specify the Statistics, ComparisonOperator, Threshold, and Times parameters for each alert level. |
30 |
| Escalations.Critical.Statistics |
string |
No |
The statistical method for Critical-level alerts. Valid values of N: 1 to 200. The value of this parameter is determined by the Note
You must select at least one of the Critical, Warn, and Info alert levels and specify the Statistics, ComparisonOperator, Threshold, and Times parameters for each alert level. |
Average |
| Escalations.Critical.ComparisonOperator |
string |
No |
The operator that is used to compare the metric value with the threshold for Critical-level alerts. Valid values:
Valid values of N: 1 to 200. Note
You must select at least one of the Critical, Warn, and Info alert levels and specify the Statistics, ComparisonOperator, Threshold, and Times parameters for each alert level. |
GreaterThanOrEqualToThreshold |
| Escalations.Warn.ComparisonOperator |
string |
No |
The operator that is used to compare the metric value with the threshold for Warn-level alerts. Valid values:
Valid values of N: 1 to 200. Note
You must select at least one of the Critical, Warn, and Info alert levels and specify the Statistics, ComparisonOperator, Threshold, and Times parameters for each alert level. |
GreaterThanOrEqualToThreshold |
| Escalations.Info.Times |
integer |
No |
The consecutive number of times for which the metric value meets the alert condition before an Info-level alert is triggered. Valid values of N: 1 to 200. Note
You must select at least one of the Critical, Warn, and Info alert levels and specify the Statistics, ComparisonOperator, Threshold, and Times parameters for each alert level. |
1 |
| Escalations.Warn.Statistics |
string |
No |
The statistical method for the Warn-level alert. Valid values of N: 1 to 200. The value of this parameter is determined by the Note
You must select at least one of the Critical, Warn, and Info alert levels and specify the Statistics, ComparisonOperator, Threshold, and Times parameters for each alert level. |
Average |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The data returned. |
||
| Code |
integer |
The status code. Note
The status code 200 indicates that the request was successful. |
200 |
| Message |
string |
The error message. |
The Request is not authorization. |
| RequestId |
string |
The request ID. |
9763ED1A-4D09-41BF-851E-310421750204 |
| Success |
boolean |
Indicates whether the request was successful. Valid values:
|
true |
| Id |
integer |
The ID of the alert template. |
12345 |
Examples
Success response
JSON format
{
"Code": 200,
"Message": "The Request is not authorization.",
"RequestId": "9763ED1A-4D09-41BF-851E-310421750204",
"Success": true,
"Id": 12345
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | InvalidQueryParameter | %s | |
| 401 | AccessDeniedException | You donot have sufficient access to perform this action. | |
| 412 | ResourcesOverLimit | Resources over limit. | |
| 500 | InternalFailure | %s | |
| 402 | LimitExceeded | The quota for this customer had been reached. | |
| 403 | InvalidClientTokenId | not allow this operation. | No permission |
| 206 | %s | %s | |
| 503 | %s | %s | |
| 406 | %s | %s | |
| 429 | Throttli∂ngException | The request was denied due to request throttling. | |
| 409 | %s | %s | |
| 409 | ResourceConflict | Concurrent modification of resources. | |
| 409 | ResourceExist | Resources already exist. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.