Creates or modifies an alert rule for an application group.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | PutGroupMetricRule |
The operation that you want to perform. Set the value to PutGroupMetricRule. |
Category | String | Yes | ecs |
The name of the cloud service. Valid values:
|
GroupId | String | Yes | 123456 |
The ID of the application group. |
MetricName | String | Yes | cpu_total |
The name of the metric. Note For more information, see Metrics.
|
Namespace | String | Yes | acs_ecs_dashboard |
The namespace of the cloud service. Note For more information, see Metrics.
|
RuleId | String | Yes | bfae2ca5b4e07d2c7278772eccda169808c7b**** |
The ID of the alert rule. |
RuleName | String | Yes | rule1 |
The name of the alert rule. |
Dimensions | String | No | [{"instanceId":"i-m5e1qg6uo38rztr4****"}] |
The dimensions that specify the resources for which you want to query metric data. Set the value to a set of key-value pairs. A typical pair is The key and value can be 1 to 64 bytes in length. Excessive characters are truncated. The key and value can contain letters, digits, periods (.), hyphens (-), underscores (_), forward slashes (/), and backslashes (\). Note Dimensions must be formatted as a JSON string in a specified order.
|
EffectiveInterval | String | No | 00:00-23:59 |
The time period during which the alert rule is effective. |
NoEffectiveInterval | String | No | 00:00-05:30 |
The time period during which the alert rule is ineffective. |
SilenceTime | Integer | No | 86400 |
The mute period during which new alerts are not reported even if the alert trigger conditions are met. Unit: seconds. Default value: 86400. |
Period | String | No | 60 |
The aggregation period of the metric data. Unit: seconds. The value is an integral multiple of 60. Default value: 300. |
Interval | String | No | 60 |
The interval at which Cloud Monitor checks whether the alert rule is triggered. Unit: seconds. Note We recommend that you set this interval to the data aggregation period. If this interval
is shorter than the data aggregation period, alerts cannot be triggered due to insufficient
data.
|
Webhook | String | No | https://www.aliyun.com |
The callback URL. |
EmailSubject | String | No | ECS instance |
The subject of the alert notification email. |
ContactGroups | String | No | ECS_Group1 |
The alert groups that receive alert notifications for the application group. |
Escalations.Critical.Statistics | String | No | Average |
The statistical aggregation method for critical-level alerts. Note For more information, see DescribeMetricMetaList.
|
Escalations.Critical.ComparisonOperator | String | No | GreaterThanOrEqualToThreshold |
The comparison operator of the threshold for critical-level alerts. Valid values:
|
Escalations.Critical.Threshold | String | No | 90 |
The threshold for critical-level alerts. |
Escalations.Critical.Times | Integer | No | 3 |
The consecutive number of times for which the metric value is measured before a critical-level alert is triggered. |
Escalations.Warn.Statistics | String | No | Average |
The statistical aggregation method for warn-level alerts. Note For more information, see DescribeMetricMetaList.
|
Escalations.Warn.ComparisonOperator | String | No | GreaterThanOrEqualToThreshold |
The comparison operator of the threshold for warn-level alerts. Valid values:
|
Escalations.Warn.Threshold | String | No | 90 |
The threshold for warn-level alerts. |
Escalations.Warn.Times | Integer | No | 3 |
The consecutive number of times for which the metric value is measured before a warn-level alert is triggered. |
Escalations.Info.Statistics | String | No | Average |
The statistical aggregation method for info-level alerts. Note For more information, see DescribeMetricMetaList.
|
Escalations.Info.ComparisonOperator | String | No | GreaterThanOrEqualToThreshold |
The comparison operator of the threshold for info-level alerts. Valid values:
|
Escalations.Info.Threshold | String | No | 90 |
The threshold for info-level alerts. |
Escalations.Info.Times | Integer | No | 3 |
The consecutive number of times for which the metric value is measured before an info-level alert is triggered. |
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
RequestId | String | 461CF2CD-2FC3-4B26-8645-7BD27E7D0F1D |
The ID of the request. |
Success | Boolean | true |
Indicates whether the call was successful. Valid values:
|
Code | String | 200 |
The HTTP status code. Note The status code 200 indicates that the call was successful.
|
Message | String | The Request is not authorization. |
The error message. |
Examples
Sample requests
http(s)://[Endpoint]/? Action=PutGroupMetricRule
&Category=ecs
&GroupId=123456
&MetricName=cpu_total
&Namespace=acs_ecs_dashboard
&RuleId=bfae2ca5b4e07d2c7278772eccda169808c7b****
&RuleName=rule1
&<Common request parameters>
Sample success responses
XML
format
<PutGroupMetricRuleResponse>
<RequestId>26C766DE-E759-4B38-8B23-28589C491CEF</RequestId>
<Code>200</Code>
<Success>true</Success>
</PutGroupMetricRuleResponse>
JSON
format
{
"RequestId":"26C766DE-E759-4B38-8B23-28589C491CEF",
"Code":200,
"Success":true
}
Error codes
For a list of error codes, visit the API Error Center.