edit-icon download-icon

DescribeTags

Last Updated: Apr 12, 2018

Description

Query tags.

Note:

  • You can query the tags by instance ID, tag key, and tag value.

  • The specified conditions are of “and” relation, and only tag sets meeting all specified conditions are returned.

  • If you specify the tag key but not the tag value, all tags associated with the tag key are queried.

  • You cannot specify only the tag value but not the tag key.

  • If you specify a tag key/tag value pair, the corresponding tag is exactly matched.

Request parameters

Name Type Required Description
Action String Yes

The action to perform. Valid value:

DescribeTags

RegionId String Yes The region ID of the Server Load Balancer instance.
LoadBalancerID String No The ID of the Server Load Balancer instance.
Tags JSON String No The tags to query.
PageSize Integer No The default value is 50 and the maximum value is 100.
PageNumber Integer No The page number of the instance list. The start value is 1 and the default value is 1.
Tags objects
TagKey String Yes

The key of the tag.

It can contain up to 64 characters, and cannot start with aliyun or be empty.

TagValue String No

The value of the tag.

It can contain up to 128 characters, and cannot start with aliyun.

Response parameters

Name Type Description
RequestId String The ID of the request.
TagSets List The list of tags.
PageSize Integer The default value is 50 and the maximum value is 100.
PageNumber Integer The page number of the instance list. The start value is 1 and the default value is 1.
TotalCount Integer The total number of instances obtained according to the filtration conditions.
TagSet objects
TagKey String The key of the tag.
TagValue String The value of the tag.
InstanceCount Integer The total number of instances bound to the tag.

Examples

Request example

  1. https://slb.aliyuncs.com/
  2. &Action=DescribeTags
  3. &RegionId=cn-east-hangzhou-01
  4. &LoadBalancerID=139a00604ad-cn-east-hangzhou-01
  5. &<Common parameters>

Response example

  • XML format

    1. <?xml version="1.0" encoding="UTF-8"?>
    2. <DescribeTagsResponse>
    3. <RequestId>365F4154-92F6-4AE4-92F8-7FF34B540710</RequestId>
    4. <TagSets>
    5. <TagSet>
    6. <TagKey>test</TagKey>
    7. <TagValue>api</TagValue>
    8. </TagSet>
    9. </TagSets>
    10. <PageSize>50</PageSize>
    11. <PageNumber>1</PageNumber>
    12. <TotalCount>1</TotalCount>
    13. </DescribeTagsResponse>
  • JSON format

    1. {
    2. "RequestId":"365F4154-92F6-4AE4-92F8-7FF34B540710",
    3. "TagSets": {
    4. "TagSet": [
    5. {
    6. "TagKey": "test",
    7. "TagValue": "api"
    8. }
    9. "PageNumber": 1,
    10. "PageSize": 50,
    11. "TotalCount": 1
    12. }
Thank you! We've received your feedback.