Queries the message resources of an alert rule.

The message resources are Message Notification Service (MNS) resources.

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

Name Type Required Example Description
Action String Yes DescribeMetricRuleTargets

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

RuleId String Yes rulIdxxxxx1

The ID of the alert rule.

Response parameters

parameter Type Example Description
Code String 200

The status code. The status code 200 indicates a successful request.

Message String Rule does not exist.

The error message. If the call is successful, no error message is returned.

RequestId String 786E92D2-AC66-4250-B76F-F1E2FCDDBA1C

The ID of the request. It is used to locate error.

Success Boolean true

Indicates whether the call was successful.

Targets Array

The message resources.

Target
Arn String acs:mns:cn-hangzhou:111:/queues/test/message

The Alibaba Cloud Resource Name (ARN) of the resource. The format of the ARN is acs:{Service name abbreviation}:{regionId}:{userId}:/{Message resource type}/{Resource name}/message. For example, you can set the parameter to acs:mns:cn-hangzhou:111:/queues/test/message. The fields are described as follows:

  • {Service name abbreviation}: the abbreviation of the service name. Set the value to MNS.
  • {userId}: the ID of the user account.
  • {regionId}: the region ID of the message queue or topic.
  • {Message resource type}: the type of the message resource. Valid values: -- **queues**: indicates a message queue. -- **topics**: indicates a message topic. {resource name}: the name of a queue if the resource type is queue, or the name of a topic if the type is topic.
Id String 1

The ID of the message resource.

Level String ["INFO", "WARN", "CRITICAL"]

The level of the alert. It is a JSON array. Valid values:

  • INFO
  • WARN
  • CRITICAL

Examples

Sample requests

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

Sample success responses

XML format

<Code>200</Code>
<Success>true</Success>
<RequestId>786E92D2-AC66-4250-B76F-F1E2FCDDBA1C</RequestId>
<Targets>
    <Arn>acs:mns:cn-hangzhou:111:/queues/test/message</Arn>
    <Id>1</Id>
    <Level>INFO</Level>
    <Level>WARN</Level>
    <Level>CRITICAL</Level>
</Targets>

JSON format

{
    "Code": "200",
    "Success": true,
    "RequestId": "786E92D2-AC66-4250-B76F-F1E2FCDDBA1C",
    "Targets": [
            {
                "Arn": "acs:mns:cn-hangzhou:111:/queues/test/message",
                "Id": 1,
                "Level": [
                    "INFO",
                    "WARN",
                    "CRITICAL"
                ]
            }
    ]
}

Error codes

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