Queries the tags that are added to one or more resources of DLA CU Edition.

Description

  • You must specify either the ResourceId.N parameter or the Tag.N parameters to determine the objects that you want to query. The Tag.N parameters are Tag.N.Key and Tag.N.Value.
  • Tag.N is a resource tag that consists of a key-value pair. If you specify only the Tag.N.Key parameter, all the tag values that are associated with the specified tag key are returned. If you specify only the Tag.N.Value parameter, InvalidParameter.TagValue is returned.
  • If you specify both the Tag.N and ResourceId.N parameters to filter tags, ResourceId.N must match all the specified tag keys and tag values.
  • If you specify multiple key-value pairs, resources that contain these key-value pairs are returned.

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.

Category String Yes Standard

The type of the snapshot.

Note ListTagResources does not support this parameter.
RegionId String Yes cn-hangzhou

The region ID of the resource. 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 dla-qw4hqmvxrwqdya8m2qq***

The IDs of resources. Valid values of N: 1 to 50.

Tag.N.Key String No k1

The key of tag N. Valid values of N: 1 to 20. The value of this parameter cannot be an empty string. A tag key can be up to 64 characters in length. It cannot start with aliyun or acs: and cannot contain http:// or https://.

Tag.N.Value String No v1

The value of tag N. Valid values of N: 1 to 20. The value of this parameter cannot be an empty string. A tag value can be up to 128 characters in length. It cannot start with aliyun or acs: and cannot contain http:// or https://.

NextToken String No caeba0bbb2be03f84eb48b699f0a4883

The token for starting the next query.

Response parameters

Parameter Type Example Description
NextToken String caeba0bbb2be03f84eb48b699f0a4883

The token for starting the next query.

RequestId String 84F76E32-2536-4A70-8B65-937EDC68CCA3

The ID of the request.

TagResources Array of TagResources

The collection of details about resources and tags, such as resource IDs, resource types, and tag key-value pairs.

ResourceId String dla-qw4hqmvxrwqdya8m2qq***

The ID of the resource.

ResourceType String ALIYUN::OPENANALYTICS::INSTANCE

The type of the resource.

TagKey String k1

The tag key.

TagValue String v1

The tag value.

Examples

Sample requests

http(s)://[Endpoint]/?Action=ListTagResources
&Category=Standard
&RegionId=cn-hangzhou
&ResourceType=instance
&<Common request parameters>

Sample success responses

XML format

<RequestId>9599FB1B-F34F-4C95-8813-A97BC5546452</RequestId>
<TagResources>
    <ResourceId>dla-qw4hqmvxrwqdya8m2qqpjb</ResourceId>
    <TagKey>k2</TagKey>
    <ResourceType>ALIYUN::OPENANALYTICS::INSTANCE</ResourceType>
    <TagValue>v2</TagValue>
</TagResources>
<TagResources>
    <ResourceId>dla-qw4hqmvxrwqdya8m2qqpjb</ResourceId>
    <TagKey>k1</TagKey>
    <ResourceType>ALIYUN::OPENANALYTICS::INSTANCE</ResourceType>
    <TagValue>v1</TagValue>
</TagResources>

JSON format

{
  "RequestId": "9599FB1B-F34F-4C95-8813-A97BC5546452",
  "TagResources": [
    {
      "ResourceId": "dla-qw4hqmvxrwqdya8m2qqpjb",
      "TagKey": "k2",
      "ResourceType": "ALIYUN::OPENANALYTICS::INSTANCE",
      "TagValue": "v2"
    },
    {
      "ResourceId": "dla-qw4hqmvxrwqdya8m2qqpjb",
      "TagKey": "k1",
      "ResourceType": "ALIYUN::OPENANALYTICS::INSTANCE",
      "TagValue": "v1"
    }
  ]
}

Error codes

HTTP status code Error code Error message Description
600 Openanalytics.Internal.Exception An internal error occurred. The error message returned because an internal error has occurred.

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