All Products
Search
Document Center

ApsaraDB RDS:DescribeTags

Last Updated:Nov 22, 2024

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

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

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.
OperationAccess levelResource typeCondition keyAssociated operation
rds:DescribeTagsget
*All Resources
*
  • rds:ResourceTag
none

Request parameters

ParameterTypeRequiredDescriptionExample
ClientTokenstringNo

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****
proxyIdstringNo

The ID of the proxy mode.

API
RegionIdstringYes

The region ID. You can call the DescribeRegions operation to query the most recent region list.

cn-hangzhou
DBInstanceIdstringNo

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****
TagsstringNo

The tag that you want to query. The value of the parameter consists of TagKey and TagValue. Format: {"TagKey":"TagValue"}.

{“key1”:”value1”}
ResourceTypestringNo

The type of resource. Set the value to INSTANCE.

INSTANCE

Response parameters

ParameterTypeDescriptionExample
object

The response parameters.

RequestIdstring

The ID of the request.

1AD222E9-E606-4A42-BF6D-8A4442913CEF
Itemsarray<object>

The tags that are added to the instance.

TagInfosobject

The information about the tag.

TagValuestring

The tag value.

value1
TagKeystring

The tag key.

key1
DBInstanceIdsarray

The IDs of the instances to which the tag is added.

DBInstanceIdsstring

The ID of the instance to which the tag is added.

rm-uf6wjk5****

Examples

Sample success responses

JSONformat

{
  "RequestId": "1AD222E9-E606-4A42-BF6D-8A4442913CEF",
  "Items": {
    "TagInfos": [
      {
        "TagValue": "value1",
        "TagKey": "key1",
        "DBInstanceIds": {
          "DBInstanceIds": [
            "rm-uf6wjk5****"
          ]
        }
      }
    ]
  }
}

Error codes

HTTP status codeError codeError messageDescription
400Tag.NoRegionIdExistthe region Id can not be blank.The RegionId parameter cannot be empty. Specify this parameter.
400Tag.NoTagInfoExistall the tags and tagN parameters is null.The key and value of the tag are invalid. Specify a valid key and a valid value.
400Tag.TagKeyCanNotBeAlltag key can not be all.The operation failed. Check the value of the TagKey parameter.
400Tag.TagKeyDuplextag key must be sole in one operation.The tag has been added to the RDS instance. Define a different tag.
400Tag.NoDBInstanceIdExistthe dbinstance Id can not be blank.The database instance ID must not be empty.
400Tag.TooManyDBInstanceIdsthe dbinstance Ids is more than 30.The number of database instance ID must not exceed 30.
400Tag.TooManyTagsForOneInstancetotal 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.
400Tag.Allow5TagInfosonly 5 tags allowed in one operation.The operation failed. You can specify up to five tags at a time.
400Tag.TagKeyIsBlanktag key can not be blank.The tag is invalid. The key of the tag cannot be left unspecified.
400Tag.TagKeyStartWith.aliyuntag key and value can not be started with aliyun.The tag is invalid. The key of the tag cannot start with aliyun.
400Tag.TagKeyTooLongthe max length of tag key is 64.-
400Tag.TagValueTooLongthe max length of tag value is 128.-
400Tag.MalformedThe specified parameter Tag is not valid.The key and value of the tag are invalid. Specify a valid key and a valid value.
400Tag.MalformedThe specified parameter Value is not valid.The key and value of the tag are invalid. Specify a valid key and a valid value.
400Tag.SetTagInfoAtTwoParameteronly tags or tagN parameter could be setted.The settings of the tag are invalid.
400Tag.InvalidTagsParametertags parameter is invalid.The key and value of the tag are invalid. Specify a valid key and a valid value.
404InvalidDBInstanceId.NotFoundThe 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 timeSummary of changesOperation
2022-11-14The Error code has changedView Change Details
2022-09-01The Error code has changedView Change Details