Queries the resources for which active alerts are triggered based on an alert rule.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
cms:DescribeAlertingMetricRuleResources |
get |
*All Resource
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| RuleId |
string |
No |
The ID of the alert rule. For information about how to obtain the ID of an alert rule, see DescribeMetricRuleList. |
putNewAlarm_user_7e78d765-0e3e-4671-ba6d-7ce39108**** |
| GroupId |
string |
No |
The ID of the application group. For information about how to obtain the ID of an application group, see DescribeMonitorGroups. |
7671**** |
| Page |
integer |
No |
The page number. Default value: 1. |
1 |
| PageSize |
integer |
No |
The number of entries per page. Default value: 10. |
10 |
| Namespace |
string |
No |
The namespace of the cloud service. For more information about the namespaces of cloud services, see Appendix 1: Metrics. |
acs_mns_new |
| Dimensions |
string |
No |
The dimensions that specify the resources whose monitoring data you want to query. |
{\"userId\":\"120886317861****\",\"region\":\"cn-huhehaote\",\"queue\":\"test-0128\"} |
| AlertBeforeTime |
string |
No |
Queries the alerts that were triggered before the specified time. Timestamps in milliseconds are supported. |
1698827400000 |
For more information about common request parameters, see Common parameters.
Response elements
|
Element |
Type |
Description |
Example |
|
object |
None. |
||
| Code |
integer |
The status code. Note
The status code 200 indicates that the request was successful. |
200 |
| Message |
string |
The error message. |
The request processing has failed due to some unknown error. |
| RequestId |
string |
The request ID. |
0724011B-D9E0-4B2F-8C51-F17A894CC42C |
| Total |
integer |
The total number of entries returned. |
2 |
| Success |
boolean |
Indicates whether the request was successful. Valid values:
|
true |
| Resources |
object |
||
| Resource |
array<object> |
The resources that are associated with the alert rule. |
|
|
array<object> |
None |
||
| MetricName |
string |
The metric name. |
ActiveMessages |
| RetryTimes |
string |
The consecutive number of times for which the metric value meets the alert condition before an alert is triggered. |
3 |
| MetricValues |
string |
The metric value that triggered the alert based on the alert rule. The value is a JSON string. |
{\"timestamp\":1623727500000,\"Sum\":926,\"value\":463,\"Maximum\":463,\"Minimum\":463,\"Average\":463,\"SampleCount\":2,\"userId\":\"120886317861****\",\"region\":\"cn-huhehaote\",\"queue\":\"test-0128\"} |
| Namespace |
string |
The namespace of the cloud service. |
acs_mns_new |
| RuleName |
string |
The name of the alert rule. |
test123456789 |
| RuleId |
string |
The ID of the alert rule. |
putNewAlarm_user_7e78d765-0e3e-4671-ba6d-7ce39108**** |
| ProductCategory |
string |
The type of the cloud service. |
mns |
| StartTime |
string |
The time when the resource was associated with the alert rule. The value is a timestamp. Unit: milliseconds. |
1622427900000 |
| Resource |
string |
The resources that are monitored. |
userId=120886317861****,region=cn-huhehaote,queue=test-0128 |
| LastModifyTime |
string |
The time when the alert rule was last modified. The value is a timestamp. Unit: milliseconds. |
1622827900000 |
| GroupId |
string |
The ID of the application group. Note
If the alert rule is associated with an application group, the ID of the application group is returned in this parameter. |
7671**** |
| Dimensions |
string |
The dimensions based on which the resources are queried. |
{\"region\":\"cn-huhehaote\",\"queue\":\"test-0128\",\"userId\":\"120886317861****\"} |
| LastAlertTime |
string |
The time when the last alert was triggered for the resource based on the alert rule. The value is a timestamp. Unit: milliseconds. |
1622427900000 |
| Level |
integer |
The severity level and notification methods of the alert. Valid values:
|
3 |
| Threshold |
string |
The alert threshold. |
10 |
| Statistics |
string |
The method used to calculate the metric values that trigger alerts. |
Average |
| Enable |
string |
Indicates whether the alert rule is enabled. Valid values:
|
true |
| Escalation |
object |
||
| Resource |
array<object> |
The alert rule based on which the alert is triggered. |
|
|
array<object> |
None |
||
| ComparisonOperator |
string |
The operator that is used to compare the metric value with the threshold. Valid values:
|
GreaterThanOrEqualToThreshold |
| PreCondition |
string |
The operator that is used to compare the metric value with the threshold. Valid values:
|
>= |
| Expression |
string |
The description of the alert rule. Note
This parameter indicates the content of the alert rule. If the metric value meets the alert condition, an alert is triggered. |
$Average>=10 |
| Times |
integer |
The consecutive number of times for which the metric value meets the alert condition before an alert is triggered. |
1 |
| Tag |
string |
This parameter is deprecated. |
无 |
| Threshold |
string |
The alert threshold. |
10 |
| Level |
integer |
The severity level and notification methods of the alert. Valid values:
|
3 |
| ExpressionListJoin |
string |
The relationship between multiple metrics. Valid values:
|
&& |
| ExpressionList |
object |
||
| ExpressionList |
array<object> |
The description of the multi-metric alert rule. |
|
|
object |
None |
||
| ComparisonOperator |
string |
The operator that is used to compare the metric value with the threshold. Valid values:
|
GreaterThanOrEqualToThreshold |
| MetricName |
string |
The metric name. |
cpu_total |
| Period |
string |
The statistical period of the metric. Unit: seconds. The default value is the interval at which the monitoring data of the metric is collected. |
60 |
| Statistics |
string |
The statistical method of the alert level. Valid values:
|
Average |
| Threshold |
string |
The alert threshold. |
90 |
| ExpressionRaw |
string |
The trigger conditions that are created by using expressions. You can use expressions to create trigger conditions in the following scenarios:
|
$Average > ($instanceId == 'i-io8kfvcpp7x5****'? 80: 50) |
Examples
Success response
JSON format
{
"Code": 200,
"Message": "The request processing has failed due to some unknown error.",
"RequestId": "0724011B-D9E0-4B2F-8C51-F17A894CC42C",
"Total": 2,
"Success": true,
"Resources": {
"Resource": [
{
"MetricName": "ActiveMessages",
"RetryTimes": "3",
"MetricValues": "{\\\"timestamp\\\":1623727500000,\\\"Sum\\\":926,\\\"value\\\":463,\\\"Maximum\\\":463,\\\"Minimum\\\":463,\\\"Average\\\":463,\\\"SampleCount\\\":2,\\\"userId\\\":\\\"120886317861****\\\",\\\"region\\\":\\\"cn-huhehaote\\\",\\\"queue\\\":\\\"test-0128\\\"}",
"Namespace": "acs_mns_new",
"RuleName": "test123456789",
"RuleId": "putNewAlarm_user_7e78d765-0e3e-4671-ba6d-7ce39108****",
"ProductCategory": "mns",
"StartTime": "1622427900000",
"Resource": "userId=120886317861****,region=cn-huhehaote,queue=test-0128",
"LastModifyTime": "1622827900000",
"GroupId": "7671****",
"Dimensions": "{\\\"region\\\":\\\"cn-huhehaote\\\",\\\"queue\\\":\\\"test-0128\\\",\\\"userId\\\":\\\"120886317861****\\\"}",
"LastAlertTime": "1622427900000",
"Level": 3,
"Threshold": "10",
"Statistics": "Average",
"Enable": "true",
"Escalation": {
"Resource": [
{
"ComparisonOperator": "GreaterThanOrEqualToThreshold",
"PreCondition": ">=",
"Expression": "$Average>=10",
"Times": 1,
"Tag": "无",
"Threshold": "10",
"Level": 3,
"ExpressionListJoin": "&&",
"ExpressionList": {
"ExpressionList": [
{
"ComparisonOperator": "GreaterThanOrEqualToThreshold",
"MetricName": "cpu_total",
"Period": "60",
"Statistics": "Average",
"Threshold": "90"
}
]
},
"ExpressionRaw": "$Average > ($instanceId == 'i-io8kfvcpp7x5****'? 80: 50)"
}
]
}
}
]
}
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | %s | %s | |
| 500 | %s | %s | |
| 500 | InternalError | The request processing has failed due to some unknown error. | |
| 403 | %s | %s | |
| 404 | %s | %s | |
| 503 | %s | %s |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.