You can call the ListTagResources operation to query tags that are bound to one or more ApsaraDB RDS instances.
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 |
---|---|---|---|---|
rds:ListTagResources | READ |
|
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
RegionId | string | Yes | The ID of the region. You can call the DescribeRegions operation to query the most recent region list. | cn-hangzhou |
ResourceType | string | Yes | The type of the resource. Set the value to INSTANCE. | INSTANCE |
NextToken | string | No | The token required to obtain more results. This parameter is not required in the first query. If a query does not return all results, in the next query, you can specify the token returned from the previous query to obtain more results. | 212db86sca4384811e0b5e8707ec21345 |
ResourceId | array | No | The IDs of resources. You can specifies up to 50 resource IDs. | |
string | No | The ID of the instance. You can query the tags of N instances at a time. Valid values of N: 1 to 50. NoteYou must specify at least one of the ResourceId.N and Tag.N.Key parameters. | rm-uf6wjk5******* | |
Tag | object [] | No | The tags to query resources. You can specify up to 20 tags. | |
Key | string | No | The key of the tag. You can query N tag keys at a time. Valid values of N: 1 to 20. The value of this parameter cannot be an empty string. NoteYou must specify at least one of the ResourceId.N and Tag.N.Key parameters. | testkey1 |
Value | string | No | The tag value that is associated with the specified tag key. You can specify N tag values at a time. Valid values of N: 1 to 20. This parameter can be an empty string. | testvalue1 |
Response parameters
Examples
Sample success responses
JSON
format
{
"NextToken": "212db86sca4384811e0b5e8707ec21345",
"RequestId": "47A514A1-4B77-4E30-B4C5-2A880650B3FD",
"TagResources": {
"TagResource": [
{
"TagValue": "testvalue1",
"ResourceType": "ALIYUN::RDS::INSTANCE",
"ResourceId": "rm-uf6wjk5xxxxxxx",
"TagKey": "testkey1"
}
]
}
}
Error codes
HTTP status code | Error code | Error message | Description |
---|---|---|---|
400 | BothEmpty.TagsAndResources | The specified Tags and ResourcesIds are not allow to both empty. | The operation failed. The tag and the resource ID cannot be left unspecified at the same time. |
400 | NumberExceed.Tags | The number of Tags parameter is exceed, Valid : 20 | - |
400 | NumberExceed.ResourceIds | The number of ResourceIds parameter is exceed , Valid : 50 | - |
400 | InvalidParameter.ResourceType | The parameter ResourceType is invalid. | The operation failed. Check the resource type. |
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation | ||||
---|---|---|---|---|---|---|
2022-09-01 | The error codes of the API operation change. | |||||
|