Creates an alert template.
Debugging
Authorization information
The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action
policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:
- Operation: the value that you can use in the Action element to specify the operation on a resource.
- Access level: the access level of each operation. The levels are read, write, and list.
- Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
- The required resource types are displayed in bold characters.
- If the permissions cannot be granted at the resource level,
All Resources
is used in the Resource type column of the operation.
- Condition Key: the condition key that is defined by the cloud service.
- Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
Operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|
cms:CreateMetricRuleTemplate | create |
|
| 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 | ||
object | No | The statistical method for Warn-level alerts. | ||
Escalations.Info.Threshold | string | No | The threshold for Info-level alerts. | 20 |
MetricName | string | Yes | The name of the metric. Valid values of N: 1 to 200. Note
For more information, see DescribeMetricMetaList or Appendix 1: Metrics.
| cpu_total |
Webhook | string | No | The callback URL to which a POST request is sent when an alert is triggered based on the alert rule. | http://ww.aliyun.com |
Escalations.Warn.Threshold | string | No | The threshold for Warn-level alerts. | 30 |
Namespace | string | Yes | The namespace of the cloud service. Valid values of N: 1 to 200. Note
For more information, 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. | |
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. | 2 |
Selector | string | No | The extended field selectors. Valid values of N: 1 to 200. | {"disk":"/"} |
Escalations.Info.Statistics | string | No | The statistical method for Info-level alerts. | 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. | 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 of N: 1 to 200. Valid values:
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 the selected alert level.
| GreaterThanOrEqualToThreshold |
Category | string | Yes | The abbreviation of the Alibaba Cloud service name. To obtain the abbreviation of an Alibaba Cloud service name, call the DescribeProjectMeta operation. The | ecs |
Escalations.Critical.Threshold | string | No | The threshold for Critical-level alerts. | 30 |
Escalations.Critical.Statistics | string | No | The statistical method for Critical-level alerts. | 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 of N: 1 to 200. Valid values:
LessThanLastPeriod: less than the metric value in the last monitoring cycle 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 the selected 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 of N: 1 to 200. Valid values:
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 the selected 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. | 1 |
Escalations.Warn.Statistics | string | No | The statistical method for Warn-level alerts. | Average |
Response parameters
Examples
Sample success responses
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 |
---|---|---|
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 | The X.509 certificate or cms access key ID provided does not exist in our records. |
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 |
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|