You can call this operation to query the tags that have been bound to one or more ApsaraDB for RDS instances.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes ListTagResources

The operation that you want to perform. Set the value to ListTagResources.

RegionId String Yes cn-hangzhou

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

ResourceType String Yes INSTANCE

The type of the resource. Set the value to INSTANCE.

ResourceId.N RepeatList No rm-uf6wjk5xxxxxxx

The ID of Instance N. You can query tags of N instances at a time. Valid values of N: 1 to 50.

Tag.N.Key String No testkey1

The key of Tag N. You can query N keys at a time. Valid values of N: 1 to 20. It cannot be an empty string.

Tag.N.Value String No testvalue1

The key value of Tag N. You can query N values at a time. Valid values of N: 1 to 20. It can be an empty string.

NextToken String No 212db86sca4384811e0b5e8707ec21345

Specifies to obtain the next set of results. This parameter is not required in the first query. If not all results are returned in one query, you can enter the token returned in the previous query to query again.

AccessKeyId String No LTAIfCxxxxxxx

The AccessKey ID provided to you by Alibaba Cloud.

Response parameters

Parameter Type Example Description
NextToken String 212db86sca4384811e0b5e8707ec21345

If not all results are returned in one query, you can enter the token returned in the previous query to query again.

RequestId String 47A514A1-4B77-4E30-B4C5-2A880650B3FD

The ID of the request.

TagResources

The information of queried instances and tags.

TagResource

The information of queried instances and tags.

ResourceId String rm-uf6wjk5xxxxxxx

The ID of the instance.

ResourceType String ALIYUN::RDS::INSTANCE

The type of the resource, ALIYUN::RDS::INSTANCEnamely the ApsaraDB for RDS instance.

TagKey String testkey1

The key of the tag.

TagValue String testvalue1

The key value of the tag.

Examples

Sample requests


http(s)://rds.aliyuncs.com/? Action=ListTagResources
&RegionId=cn-hangzhou
&ResourceType=INSTANCE
&ResourceId.1=rm-uf6wjk5xxxxxxx
&Tag.1.Key=testkey1
&<Common request parameters>

Sample success responses

XML format

<ListTagResourcesResponse>
  <TagResources>
        <TagResource>
              <ResourceType>ALIYUN::RDS::INSTANCE</ResourceType>
              <TagValue>testvalue1</TagValue>
              <ResourceId>rm-uf6wjk5xxxxxxx</ResourceId>
              <TagKey>testkey1</TagKey>
        </TagResource>
  </TagResources>
  <RequestId>47A514A1-4B77-4E30-B4C5-2A880650B3FD</RequestId>
</ListTagResourcesResponse>

JSON format

{
	"TagResources":{
		"TagResource":[
			{
				"ResourceType":"ALIYUN::RDS::INSTANCE",
				"TagValue":"testvalue1",
				"ResourceId":"rm-uf6wjk5xxxxxxx",
				"TagKey":"testkey1"
			}
		]
	},
	"RequestId":"47A514A1-4B77-4E30-B4C5-2A880650B3FD"
}

Error codes

For a list of error codes, visit the API Error Center.