Queries the tags bound to resources.

Note The tag feature is suitable only for Anti-DDoS Pro.

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 DescribeTagResources

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

RegionId String Yes cn-hangzhou

The region ID of the instance. Set the value to cn-hangzhou, which indicates an Anti-DDoS Pro instance.

ResourceType String Yes INSTANCE

The type of the resource. Set the value to INSTANCE, which indicates an Anti-DDoS Pro instance.

ResourceGroupId String No default

The ID of the resource group to which the instance belongs in Resource Management. This parameter is empty by default, which indicates that the instance belongs to the default resource group.

ResourceIds.N RepeatList No ddoscoo-cn-mp91j1ao****

The ID of resource N whose tags you want to query. The resource indicates the instance.

Note You must either specify ResourceIds.N or specify both Tags.N.Key and Tags.N.Value. You can call the DescribeInstanceIds operation to query the IDs of all instances.
Tags.N.Key String No testkey

The key of tag N that you want to query.

Note You must either specify ResourceIds.N or specify both Tags.N.Key and Tags.N.Value. If you specify the Tags.N.Key parameter, you must also specify the Tags.N.Value parameter.
Tags.N.Value String No testvalue

The value of tag N that you want to query.

Note You must either specify ResourceIds.N or both Tags.N.Key and Tags.N.Value. If you specify the Tag.N.Key parameter, you must also specify the Tags.N.Value parameter.
NextToken String No RGuYpqDdKhzXb8C3.D1BwQgc1tMBsoxdGiEKHHUUCf****

The token used to query the next page. If the next page does not exist, leave this parameter empty.

Response parameters

Parameter Type Example Description
NextToken String RGuYpqDdKhzXb8C3.D1BwQgc1tMBsoxdGiEKHHUUCf****

The token used to query the next page. If the value of this parameter is empty, the next page does not exist.

RequestId String 36E698F7-48A4-48D0-9554-0BB4BAAB99B3

The ID of the request.

TagResources Array

The tag bound to the resource.

TagResource
ResourceId String ddoscoo-cn-mp91j1ao****

The ID of the resource. The resource indicates the instance.

ResourceType String INSTANCE

The type of the resource. The value is INSTANCE, which indicates an Anti-DDoS Pro instance.

TagKey String aa1

The key of the tag bound to the resource.

TagValue String aa1_1

The value of the tag bound to the resource.

Examples

Sample requests

http(s)://[Endpoint]/? Action=DescribeTagResources
&RegionId=cn-hangzhou
&ResourceType=INSTANCE
&<Common request parameters>

Sample success responses

XML format

<DescribeTagResources>
      <NextToken>RGuYpqDdKhzXb8C3.D1BwQgc1tMBsoxdGiEKHHUUCf****</NextToken>
      <RequestId>36E698F7-48A4-48D0-9554-0BB4BAAB99B3</RequestId>
      <TagResources>
            <ResourceId>ddoscoo-cn-mp91j1ao****</ResourceId>
            <TagKey>aa1</TagKey>
            <ResourceType>INSTANCE</ResourceType>
            <TagValue>aa1_1</TagValue>
      </TagResources>
</DescribeTagResources>

JSON format

{
    "NextToken":"RGuYpqDdKhzXb8C3.D1BwQgc1tMBsoxdGiEKHHUUCf****",
    "RequestId":"36E698F7-48A4-48D0-9554-0BB4BAAB99B3",
    "TagResources":[
        {
            "ResourceId":"ddoscoo-cn-mp91j1ao****",
            "TagKey":"aa1",
            "ResourceType":"INSTANCE",
            "TagValue":"aa1_1"
        }
    ]
}

Error codes

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