Queries tags of an instance.
Operation description
Supported database engines
- MySQL
- PostgreSQL
- SQL Server
- MariaDB
Usage notes
- If an instance ID is specified, all tags that are added to this instance are queried, and other filter conditions are invalid.
- If you specify only TagKey, the results that match the specified TagKey are returned. If you specify both TagKey and TagValue, the results that match both the specified TagKey and TagValue are returned.
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 |
---|---|---|---|---|
rds:DescribeTags | get | *All Resources * |
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
ClientToken | string | No | The client token that is used to ensure the idempotence of the request. You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters and cannot exceed 64 characters in length. | ETnLKlblzczshOTUbOC**** |
proxyId | string | No | The ID of the proxy mode. | API |
RegionId | string | Yes | The region ID. You can call the DescribeRegions operation to query the most recent region list. | cn-hangzhou |
DBInstanceId | string | No | The instance ID. You can call the DescribeDBInstances operation to query the instance ID. Note
If you specify this parameter, all tags that are added to this instance are queried, and other filter conditions becomes invalid.
| rm-uf6wjk5**** |
Tags | string | No | The tag that you want to query. The value of the parameter consists of TagKey and TagValue. Format: | {“key1”:”value1”} |
ResourceType | string | No | The type of resource. Set the value to INSTANCE. | INSTANCE |
Response parameters
Examples
Sample success responses
JSON
format
{
"RequestId": "1AD222E9-E606-4A42-BF6D-8A4442913CEF",
"Items": {
"TagInfos": [
{
"TagValue": "value1",
"TagKey": "key1",
"DBInstanceIds": {
"DBInstanceIds": [
"rm-uf6wjk5****"
]
}
}
]
}
}
Error codes
HTTP status code | Error code | Error message | Description |
---|---|---|---|
400 | Tag.NoRegionIdExist | the region Id can not be blank. | The RegionId parameter cannot be empty. Specify this parameter. |
400 | Tag.NoTagInfoExist | all the tags and tagN parameters is null. | The key and value of the tag are invalid. Specify a valid key and a valid value. |
400 | Tag.TagKeyCanNotBeAll | tag key can not be all. | The operation failed. Check the value of the TagKey parameter. |
400 | Tag.TagKeyDuplex | tag key must be sole in one operation. | The tag has been added to the RDS instance. Define a different tag. |
400 | Tag.NoDBInstanceIdExist | the dbinstance Id can not be blank. | The database instance ID must not be empty. |
400 | Tag.TooManyDBInstanceIds | the dbinstance Ids is more than 30. | The number of database instance ID must not exceed 30. |
400 | Tag.TooManyTagsForOneInstance | total 10 tags can be added to one resource. | The number of tags exceeds the maximum number of tags that is allowed. The maximum number is 10. |
400 | Tag.Allow5TagInfos | only 5 tags allowed in one operation. | The operation failed. You can specify up to five tags at a time. |
400 | Tag.TagKeyIsBlank | tag key can not be blank. | The tag is invalid. The key of the tag cannot be left unspecified. |
400 | Tag.TagKeyStartWith.aliyun | tag key and value can not be started with aliyun. | The tag is invalid. The key of the tag cannot start with aliyun. |
400 | Tag.TagKeyTooLong | the max length of tag key is 64. | - |
400 | Tag.TagValueTooLong | the max length of tag value is 128. | - |
400 | Tag.Malformed | The specified parameter Tag is not valid. | The key and value of the tag are invalid. Specify a valid key and a valid value. |
400 | Tag.Malformed | The specified parameter Value is not valid. | The key and value of the tag are invalid. Specify a valid key and a valid value. |
400 | Tag.SetTagInfoAtTwoParameter | only tags or tagN parameter could be setted. | The settings of the tag are invalid. |
400 | Tag.InvalidTagsParameter | tags parameter is invalid. | The key and value of the tag are invalid. Specify a valid key and a valid value. |
404 | InvalidDBInstanceId.NotFound | The DBInstanceId provided does not exist in our records. | The RDS instance cannot be found. Check whether the RDS instance is created and whether the RDS instance has not been deleted. |
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|---|---|
2022-11-14 | The Error code has changed | View Change Details |
2022-09-01 | The Error code has changed | View Change Details |