Queries the notification channels of a specified alert rule by calling the DescribeMetricRuleTargets operation.
Operation description
Usage notes
This topic provides an example to query the target resources associated with the alert rule ae06917_75a8c43178ab66****.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
cms:DescribeMetricRuleTargets |
list |
*All Resource
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| RuleId |
string |
Yes |
The ID of the alert rule. For information about how to obtain the alert rule ID, see DescribeMetricRuleList. |
ae06917_75a8c43178ab66**** |
For more information about common request parameters, see Common parameters.
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| Code |
string |
The status code. Note
The value 200 indicates success. |
200 |
| Message |
string |
The error message. |
User not authorized to operate on the specified resource. |
| RequestId |
string |
The request ID. |
786E92D2-AC66-4250-B76F-F1E2FCDDBA1C |
| Success |
boolean |
Indicates whether the operation was successful. Valid values:
|
true |
| Targets |
object |
||
| Target |
array<object> |
The alert trigger targets. |
|
|
object |
The alert trigger targets. |
||
| Id |
string |
The ID of the resource for which alerts are triggered. |
1 |
| Arn |
string |
The Alibaba Cloud Resource Name (ARN) of the resource. Format:
|
acs:mns:cn-hangzhou:120886317861****:/queues/test/message |
| Level |
string |
The level of the alert. Valid values:
|
INFO |
| JsonParams |
string |
The parameters of the alert callback. The parameters are in the JSON format. |
{"customField1":"value1","customField2":"$.name"} |
Examples
Success response
JSON format
{
"Code": "200",
"Message": "User not authorized to operate on the specified resource.",
"RequestId": "786E92D2-AC66-4250-B76F-F1E2FCDDBA1C",
"Success": true,
"Targets": {
"Target": [
{
"Id": "1",
"Arn": "acs:mns:cn-hangzhou:120886317861****:/queues/test/message",
"Level": "INFO",
"JsonParams": "{\"customField1\":\"value1\",\"customField2\":\"$.name\"}"
}
]
}
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | InvalidParameterValue | %s | |
| 400 | %s | %s | |
| 500 | InternalError | %s | |
| 403 | AccessForbidden | User not authorized to operate on the specified resource. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.