CreateMetricRuleTemplate
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 alert templates. |
|
|
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 specify at least one of the following alert levels: Critical, Warn, or Info. For the specified alert level, you must specify the Statistics, ComparisonOperator, Threshold, and Times parameters at the same time. |
20 |
| MetricName |
string |
Yes |
The name of the metric. Valid values of N: 1 to 200. Note
For more information, see DescribeMetricMetaList or Cloud service metrics. |
cpu_total |
| Webhook |
string |
No |
The webhook URL to which a POST request is sent when an alert is triggered. |
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 specify at least one of the following alert levels: Critical, Warn, or Info. For the specified alert level, you must specify the Statistics, ComparisonOperator, Threshold, and Times parameters at the same time. |
30 |
| Namespace |
string |
Yes |
The namespace of the Alibaba Cloud service. Valid values of N: 1 to 200. Note
For more information, see DescribeMetricMetaList or Cloud service metrics. |
acs_ecs_dashboard |
| Period |
integer |
No |
The aggregation period of the monitoring data. Unit: seconds. Default value: the minimum aggregation period of the metric. You do not need to specify this parameter in most cases. Valid values of N: 1 to 200. |
60 |
| RuleName |
string |
Yes |
The name of the alert rule. Valid values of N: 1 to 200. |
My CPU monitoring |
| Escalations.Critical.Times |
integer |
No |
The number of consecutive times the monitoring metrics must reach the alert threshold to send a critical-level alert notification. Valid values of N: 1 to 200. Note
You must specify at least one of the following alert levels: Critical, Warn, or Info. For the specified alert level, you must specify the Statistics, ComparisonOperator, Threshold, and Times parameters at the same time. |
3 |
| Selector |
string |
No |
The options for extended fields. Valid values of N: 1 to 200. |
{"disk":"/"} |
| Escalations.Info.Statistics |
string |
No |
The statistical method for info-level alerts. Valid values of N: 1 to 200. The valid values of this parameter are determined by the Note
You must specify at least one of the following alert levels: Critical, Warn, or Info. For the specified alert level, you must specify the Statistics, ComparisonOperator, Threshold, and Times parameters at the same time. |
Average |
| Escalations.Warn.Times |
integer |
No |
The number of consecutive times the monitoring metrics must reach the alert threshold to send a warning alert notification. Valid values of N: 1 to 200. Note
You must specify at least one of the following alert levels: Critical, Warn, or Info. For the specified alert level, you must specify the Statistics, ComparisonOperator, Threshold, and Times parameters at the same time. |
1 |
| Escalations.Info.ComparisonOperator |
string |
No |
The comparison operator for the info-level threshold. Valid values:
Valid values of N: 1 to 200. Note
You must specify at least one of the following alert levels: Critical, Warn, or Info. For the specified alert level, you must specify the Statistics, ComparisonOperator, Threshold, and Times parameters at the same time. |
GreaterThanOrEqualToThreshold |
| Category |
string |
Yes |
The Alibaba Cloud service name or product specification abbreviation. Valid values of N: 1 to 200. Valid values:
|
ecs |
| Escalations.Critical.Threshold |
string |
No |
The threshold that triggers a critical-level alert notification. Valid values of N: 1 to 200. Note
You must specify at least one of the following alert levels: Critical, Warn, or Info. For the specified alert level, you must specify the Statistics, ComparisonOperator, Threshold, and Times parameters at the same time. |
30 |
| Escalations.Critical.Statistics |
string |
No |
The statistical method for critical-level alerts. Valid values of N: 1 to 200. The valid values of this parameter are determined by the Note
You must specify at least one of the following alert levels: Critical, Warn, or Info. For the specified alert level, you must specify the Statistics, ComparisonOperator, Threshold, and Times parameters at the same time. |
Average |
| Escalations.Critical.ComparisonOperator |
string |
No |
The comparison operator for the critical-level threshold. Valid values:
Valid values of N: 1 to 200. Note
You must specify at least one of the following alert levels: Critical, Warn, or Info. For the specified alert level, you must specify the Statistics, ComparisonOperator, Threshold, and Times parameters at the same time. |
GreaterThanOrEqualToThreshold |
| Escalations.Warn.ComparisonOperator |
string |
No |
The comparison operator for the warn-level threshold. Valid values:
Valid values of N: 1 to 200. Note
You must specify at least one of the following alert levels: Critical, Warn, or Info. For the specified alert level, you must specify the Statistics, ComparisonOperator, Threshold, and Times parameters at the same time. |
GreaterThanOrEqualToThreshold |
| Escalations.Info.Times |
integer |
No |
The number of consecutive times the monitoring metrics must reach the alert threshold to send an info-level alert notification. Valid values of N: 1 to 200. Note
You must specify at least one of the following alert levels: Critical, Warn, or Info. For the specified alert level, you must specify the Statistics, ComparisonOperator, Threshold, and Times parameters at the same time. |
1 |
| Escalations.Warn.Statistics |
string |
No |
The statistical method for warning alerts. Valid values of N: 1 to 200. The valid values of this parameter are determined by the Note
You must specify at least one of the following alert levels: Critical, Warn, or Info. For the specified alert level, you must specify the Statistics, ComparisonOperator, Threshold, and Times parameters at the same time. |
Average |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The response data. |
||
| Code |
integer |
The HTTP status code. Note
A status code of 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 operation 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.