Home > Article > Operation and Maintenance > How to use DescribeTags to query available tags
The content of this article is about how to use DescribeTags to query the tags that can be used. It has certain reference value. Friends in need can refer to it. I hope it will be helpful to you.
DescribeTags
Query the tags available for you to use. You can query tags based on conditions such as resource type, resource ID, tag key or tag value. The filter conditions are logically ANDed (&&), and tags that meet all filter conditions are returned.
Description
If you specify the tag key (Tag.n.Key) but not the tag value (Tag.n.Value) , we will query all tag key-value pairs corresponding to the tag key. If you specify a tag key-value pair, search for tags that exactly match that key-value pair.
Request parameters
##Return parameters
Example
Request Example
https://ecs.aliyuncs.com/?Action=DescribeTags &ResourceType=snapshot &ResourceId=s-946ntx4wr &RegionId=cn-hangzhou &Tag.1.Key=test &Tag.1.Value=api &<公共请求参数>
Return example
XML format
<DescribeTagsResponse> <RequestId>B04B8CF3-4489-432D-83BA-6F128E4F2295</RequestId> <PageNumber>1</PageNumber> <PageSize>50</PageSize> <Tags> <Tag> <TagKey>test</TagKey> <TagValue>api</TagValue> </Tag> </Tags> <TotalCount>1</TotalCount> </DescribeTagsResponse>
JSON format
{ "PageNumber": 1, "PageSize": 50, "RequestId": "B04B8CF3-4489-432D-83BA-6F128E4F2295", "Tags": { "Tag": [ { "TagKey": "test", "TagValue": "api" } ] }, "TotalCount": 1 }
Error code
The following are error codes unique to this interface. For more error codes, please visit the API Error Center.The above is the detailed content of How to use DescribeTags to query available tags. For more information, please follow other related articles on the PHP Chinese website!