Queries tag rules.
Operation description
This topic provides an example to show how to query tag rules that are related to tagkey1
. The sample responses indicate that two tag rules are found. The rule IDs are 1536df65-a719-429d-8813-73cc40d7****
and 56e8cebb-b3d7-4a91-9880-78a8c84f****
.
Debugging
Authorization information
The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action
policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:
- Operation: the value that you can use in the Action element to specify the operation on a resource.
- Access level: the access level of each operation. The levels are read, write, and list.
- Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
- The required resource types are displayed in bold characters.
- If the permissions cannot be granted at the resource level,
All Resources
is used in the Resource type column of the operation.
- Condition Key: the condition key that is defined by the cloud service.
- Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
Operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|
cms:DescribeDynamicTagRuleList | get |
|
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
TagRegionId | string | No | The ID of the region to which the tags belong. | cn-hangzhou |
TagKey | string | No | The tag key. For more information about how to obtain a tag key, see DescribeTagKeyList . | tagkey1 |
TagValue | string | No | The tag value. For more information about how to obtain a tag value, see DescribeTagKeyList . | * |
PageNumber | string | No | The number of the page to return. Pages start from page 1. Default value: 1. | 1 |
PageSize | string | No | The number of entries to return on each page. Minimum value: 1. Default value: 30. | 30 |
DynamicTagRuleId | string | No | The ID of the tag rule. | 004155fa-15ba-466d-b61a-*********** |
For more information about common request parameters, see Common parameters.
Response parameters
Examples
Sample success responses
JSON
format
{
"RequestId": "0D50523D-8D59-4A61-B58E-E2286ECFB3A9",
"Success": true,
"Code": "200",
"Message": "The specified resource is not found.",
"PageSize": "30",
"PageNumber": "1",
"Total": 2,
"TagGroupList": {
"TagGroup": [
{
"Status": "FINISH",
"MatchExpressFilterRelation": "or",
"RegionId": "cn-hangzhou",
"TagKey": "tagkey1",
"DynamicTagRuleId": "1536df65-a719-429d-8813-73cc40d7****",
"MatchExpress": {
"MatchExpress": [
{
"TagValue": "*",
"TagValueMatchFunction": "all",
"TagKey": "azone-version"
}
]
},
"TemplateIdList": {
"TemplateIdList": [
"71****"
]
},
"ContactGroupList": {
"ContactGroupList": [
"CloudMonitor"
]
}
}
]
}
}
Error codes
HTTP status code | Error code | Error message | Description |
---|---|---|---|
400 | InvalidParameterValue | Illegal parameters. | Illegal parameters. |
403 | AccessForbidden | User not authorized to operate on the specified resource. | - |
404 | ResourceNotFound | The specified resource is not found. | The specified resource is not found. |
500 | %s | %s | - |
500 | InternalError | The request processing has failed due to some unknown error. | - |
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|---|---|
2024-03-13 | The Error code has changed. The response structure of the API has changed | View Change Details |
2021-11-04 | API Description Update. The Error code has changed. The response structure of the API has changed | View Change Details |