Queries the resources with active alerts 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.

GroupId String No 123456

The ID of the application group.

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.

RuleId String No alerRuleId****

The ID of the alert rule.

Note You must specify either the GroupId or RuleId parameter. If you specify both parameters, only entries that meet both conditions are returned.

Response parameters

Parameter Type Example Description
RequestId String 9B868619-77B4-4623-AD64-6181EA7CF8FA

The ID of the request.

Success Boolean true

Indicates whether the call was successful.

Code Integer 200

The HTTP status code.

Note The status code 200 indicates that the call was successful.
Total Integer 1

The total number of entries returned.

Resources Array

The resources to which the alert rule is applied.

Resource

The resources to which the alert rule is applied.

Enable String true

Indicates whether the alert rule is enabled for the resource.

GroupId String 123456

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 1554718182000

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

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

LastModifyTime String 1554723762000

The time when the resource was last modified.

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

MetricValues String {"Value":631,"timestamp":1554723720000}

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

Resource String userId=177541323192****,taskId=3****,instanceId=i-bp1a0v6yzqrms01k****

The resource to which the alert rule is applied.

RetryTimes String 3

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

RuleId String alerRuleId****

The ID of the alert rule.

RuleName String cpuAlert

The name of the alert rule.

StartTime String 1545901080000

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

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

Threshold String 400

The alert threshold.

Message String success

The returned message.

Examples

Sample requests


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

Sample success responses

XML format

<Total>1</Total>
<Resources>
    <Resource>
        <Enable>true</Enable>
        <Resource>userId=12****,instanceId=i-bp1a012****</Resource>
        <RuleId>alerRuleId****</RuleId>
        <RetryTimes>3</RetryTimes>
        <LastAlertTime>1554718182000</LastAlertTime>
        <MetricValues>{"timestamp":1554723720000,"Value":631}</MetricValues>
        <LastModifyTime>1554723762000</LastModifyTime>
        <StartTime>1545901080000</StartTime>
        <RuleName>cpuAlert</RuleName>
        <Threshold>400</Threshold>
        <GroupId>123456</GroupId>
    </Resource>
</Resources>
<Success>true</Success>

JSON format

{
	"Success":true,
	"Total":1,
	"Resources":{
		"Resource":[
			{
				"LastAlertTime":1554718182000,
				"Resource":"userId=12****,instanceId=i-bp1a012****",
				"Threshold":"400",
				"Enable":true,
				"LastModifyTime":1554723762000,
				"RuleId":"alerRuleId****",
				"MetricValues":"{\"timestamp\":1554723720000,\"Value\":631}",
				"RetryTimes":3,
				"StartTime":1545901080000,
				"RuleName":"cpuAlert",
				"GroupId":"123456"
			}
		]
	}
}

Error codes

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