Queries the resources for which active alerts are triggered based on an alert rule.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes DescribeAlertingMetricRuleResources

The operation that you want to perform. Set the value to DescribeAlertingMetricRuleResources.

RuleId String No putNewAlarm_user_7e78d765-0e3e-4671-ba6d-7ce39108****

The ID of the alert rule. For more information about how to query alert rule IDs, see DescribeMetricRuleList.

GroupId String No 7671****

The ID of the application group. For more information about how to query the ID of an application group, see DescribeMonitorGroups.

Page Integer No 1

The number of the page to return. Default value: 1.

PageSize Integer No 10

The number of entries to return on each page. Default value: 10.

Namespace String No acs_mns_new

The namespace of the cloud service. For more information, see Appendix 1: Metrics.

Dimensions String No {\"userId\":\"120886317861****\",\"region\":\"cn-huhehaote\",\"queue\":\"test-0128\"}

The dimensions that specify the resources for which you want to query monitoring data.

For more information about common request parameters, see Common parameters.

Response parameters

Parameter Type Example Description
RequestId String 0724011B-D9E0-4B2F-8C51-F17A894CC42C

The ID of the request.

Success Boolean true

Indicates whether the call was successful. Valid values:

  • true: The call was successful.
  • false: The call failed.
Code Integer 200

The HTTP status code.

Note The value 200 indicates that the call was successful.
Total Integer 2

The total number of returned entries.

Resources Array of Resource

The resources to which the alert rule is applied.

Resource
Dimensions String {\"region\":\"cn-huhehaote\",\"queue\":\"test-0128\",\"userId\":\"120886317861****\"}

The dimensions that specify the resources for which you want to query monitoring data.

Enable String true

Indicates whether the alert rule is enabled for the resource. Valid values:

  • true
  • false
Escalation Array of Resource

The alert rule based on which the alert is triggered.

Resource
ComparisonOperator String GreaterThanOrEqualToThreshold

The comparison operator of the threshold. Valid values:

  • GreaterThanOrEqualToThreshold
  • GreaterThanThreshold
  • LessThanOrEqualToThreshold
  • LessThanThreshold
  • NotEqualToThreshold
  • GreaterThanYesterday
  • LessThanYesterday
  • GreaterThanLastWeek
  • LessThanLastWeek
  • GreaterThanLastPeriod
  • LessThanLastPeriod
Expression String $Average>=10

The description of the alert rule.

Note The content of the alert rule. This value indicates the conditions that trigger an alert.
Level Integer 3

The level and notification method of the alert. Valid values:

  • 4: Alert notifications are sent by using emails and DingTalk chatbots.
  • OK: No alert is generated.
PreCondition String >=

The comparison operator before the threshold. Valid values:

  • >=
  • =
  • <=
  • >
  • <
  • !=
Tag String mns

The tags of the instance.

Threshold String 10

The alert threshold.

Times Integer 1

The consecutive number of times for which the metric value was measured before the alert was triggered.

GroupId String 7671****

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.
LastAlertTime String 1622427900000

The timestamp when the last alert was triggered for the resource based on the alert rule.

This value is a UNIX timestamp that represents the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC.

LastModifyTime String 1622827900000

The timestamp when the alert rule was last modified.

This value is a UNIX timestamp that represents the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC.

Level Integer 3

The level and notification method of the alert. Valid values:

  • 4: Alert notifications are sent by using emails and DingTalk chatbots.
  • OK: No alert is generated.
MetricName String ActiveMessages

The name of the metric.

MetricValues String {\"timestamp\":1623727500000,\"Sum\":926,\"value\":463,\"Maximum\":463,\"Minimum\":463,\"Average\":463,\"SampleCount\":2,\"userId\":\"120886317861****\",\"region\":\"cn-huhehaote\",\"queue\":\"test-0128\"}

The metric value that triggered the alert based on the alert rule. The value is a JSON string.

Namespace String acs_mns_new

The namespace of the cloud service.

ProductCategory String mns

The name of the cloud service.

Resource String userId=120886317861****,region=cn-huhehaote,queue=test-0128

The resource to which the alert rule is applied.

RetryTimes String 3

The consecutive number of times for which the metric value was measured before the alert was triggered.

RuleId String putNewAlarm_user_7e78d765-0e3e-4671-ba6d-7ce39108****

The ID of the alert rule.

RuleName String test123456789

The name of the alert rule.

StartTime String 1622427900000

The time when the resource was associated with the alert rule.

This value is a UNIX timestamp that represents the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC.

Statistics String Average

The method that is used to calculate the metric values that trigger alerts.

Threshold String 10

The alert threshold.

Message String The request processing has failed due to some unknown error.

The returned message.

Examples

Sample requests

http(s)://[Endpoint]/?Action=DescribeAlertingMetricRuleResources
&<Common request parameters>

Sample success response

XML format

<DescribeAlertingMetricRuleResourcesResponse>
	  <RequestId>0724011B-D9E0-4B2F-8C51-F17A894CC42C</RequestId>
	  <Message></Message>
	  <Total>2</Total>
	  <Resources>
		    <Resource>
			      <RuleId>putNewAlarm_user_7e78d765-0e3e-4671-ba6d-7ce39108****</RuleId>
			      <Escalation>
				        <Resource>
					          <Expression>$Average&gt;=10</Expression>
					          <Times>1</Times>
					          <Level>3</Level>
					          <Tag>mns</Tag>
				        </Resource>
			      </Escalation>
			      <Resource>userId=120886317861****,region=cn-huhehaote,queue=test-0128</Resource>
			      <StartTime>1622427900000</StartTime>
			      <Dimensions>{\"userId\":\"120886317861****\",\"region\":\"cn-huhehaote\",\"queue\":\"test-0128\"}</Dimensions>
			      <MetricValues>{\"timestamp\":1623727500000,\"Sum\":926,\"value\":463,\"Maximum\":463,\"Minimum\":463,\"Average\":463,\"SampleCount\":2,\"userId\":\"120886317861****\",\"region\":\"cn-huhehaote\",\"queue\":\"test-0128\"}</MetricValues>
			      <LastModifyTime>1623727904000</LastModifyTime>
			      <Statistics>Average</Statistics>
			      <Namespace>acs_mns_new</Namespace>
			      <GroupId>7671****</GroupId>
			      <MetricName>ActiveMessages</MetricName>
			      <LastAlertTime>1622427900000</LastAlertTime>
			      <ProductCategory>mns</ProductCategory>
			      <Enable>true</Enable>
			      <Level>3</Level>
			      <RuleName>test123456789</RuleName>
			      <RetryTimes>1</RetryTimes>
			      <Threshold>10</Threshold>
		    </Resource>
		    <Resource>
			      <RuleId>putNewAlarm_user_7e78d765-0e3e-4671-ba6d-7ce39108****</RuleId>
			      <Escalation>
				        <Resource>
					          <Expression>$Average&gt;=10</Expression>
					          <Times>1</Times>
					          <Level>3</Level>
					          <Tag>mns</Tag>
				        </Resource>
			      </Escalation>
			      <Resource>userId=120886317861****,region=cn-huhehaote,queue=test-022401-1</Resource>
			      <StartTime>1622427900000</StartTime>
			      <Dimensions>{\"userId\":\"120886317861****\",\"region\":\"cn-huhehaote\",\"queue\":\"test-022401-1\"}</Dimensions>
			      <MetricValues>{\"timestamp\":1623727500000,\"queue\":\"test-022401-1\",\"Maximum\":349,\"Minimum\":349,\"Sum\":698,\"value\":349,\"userId\":\"120886317861****\",\"region\":\"cn-huhehaote\",\"Average\":349,\"SampleCount\":2}</MetricValues>
			      <LastModifyTime>1623727904000</LastModifyTime>
			      <Statistics>Average</Statistics>
			      <Namespace>acs_mns_new</Namespace>
			      <GroupId>7671****</GroupId>
			      <MetricName>ActiveMessages</MetricName>
			      <LastAlertTime>1622427900000</LastAlertTime>
			      <ProductCategory>mns</ProductCategory>
			      <Enable>true</Enable>
			      <Level>3</Level>
			      <RuleName>test123456789</RuleName>
			      <RetryTimes>1</RetryTimes>
			      <Threshold>10</Threshold>
		    </Resource>
	  </Resources>
	  <Success>true</Success>
</DescribeAlertingMetricRuleResourcesResponse>

JSON format

{
	"RequestId": "0724011B-D9E0-4B2F-8C51-F17A894CC42C",
	"Message": "",
	"Total": 2,
	"Resources": {
		"Resource": [
			{
				"RuleId": "putNewAlarm_user_7e78d765-0e3e-4671-ba6d-7ce39108****",
				"Escalation": {
					"Resource": [
						{
							"Expression": "$Average>=10",
							"Times": 1,
							"Level": 3,
							"Tag": "mns"
						}
					]
				},
				"Resource": "userId=120886317861****,region=cn-huhehaote,queue=test-0128",
				"StartTime": 1622427900000,
				"Dimensions": "{\"userId\":\"120886317861****\",\"region\":\"cn-huhehaote\",\"queue\":\"test-0128\"}",
				"MetricValues": "{\"timestamp\":1623727500000,\"Sum\":926,\"value\":463,\"Maximum\":463,\"Minimum\":463,\"Average\":463,\"SampleCount\":2,\"userId\":\"120886317861****\",\"region\":\"cn-huhehaote\",\"queue\":\"test-0128\"}",
				"LastModifyTime": 1623727904000,
				"Statistics": "Average",
				"Namespace": "acs_mns_new",
				"GroupId": "7671****",
				"MetricName": "ActiveMessages",
				"LastAlertTime": 1622427900000,
				"ProductCategory": "mns",
				"Enable": true,
				"Level": 3,
				"RuleName": "test123456789",
				"RetryTimes": 1,
				"Threshold": "10"
			},
			{
				"RuleId": "putNewAlarm_user_7e78d765-0e3e-4671-ba6d-7ce39108****",
				"Escalation": {
					"Resource": [
						{
							"Expression": "$Average>=10",
							"Times": 1,
							"Level": 3,
							"Tag": "mns"
						}
					]
				},
				"Resource": "userId=120886317861****,region=cn-huhehaote,queue=test-022401-1",
				"StartTime": 1622427900000,
				"Dimensions": "{\"userId\":\"120886317861****\",\"region\":\"cn-huhehaote\",\"queue\":\"test-022401-1\"}",
				"MetricValues": "{\"timestamp\":1623727500000,\"queue\":\"test-022401-1\",\"Maximum\":349,\"Minimum\":349,\"Sum\":698,\"value\":349,\"userId\":\"120886317861****\",\"region\":\"cn-huhehaote\",\"Average\":349,\"SampleCount\":2}",
				"LastModifyTime": 1623727904000,
				"Statistics": "Average",
				"Namespace": "acs_mns_new",
				"GroupId": "7671****",
				"MetricName": "ActiveMessages",
				"LastAlertTime": 1622427900000,
				"ProductCategory": "mns",
				"Enable": true,
				"Level": 3,
				"RuleName": "test123456789",
				"RetryTimes": 1,
				"Threshold": "10"
			}
		]
	},
	"Success": true
}

Error codes

For a list of error codes, visit the API Error Center.