ListTags

更新时间:
复制 MD 格式

Queries all tags in a region.

Request parameters

ParameterTypeRequiredExampleDescription
ActionStringYesListTagsThe operation to perform. Set the value to ListTags.
RegionIdStringYescn-shanghaiThe ID of the region. To get the region list, call DescribeRegions.

Response parameters

ParameterTypeExampleDescription
RequestIdString36D1BE9B-3C4A-425B-947A-69E3D77999C4The request ID.
TagsArray of TagThe tags returned.
TagA tag.
TagKeyStringk1The tag key.
TagValueStringv2The tag value.

Examples

Sample request

http(s)://[Endpoint]/?Action=ListTags
&RegionId=cn-shanghai
&<Common request parameters>

Sample responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<Tags>
    <Tag>
        <TagValue/>
        <TagKey>k1</TagKey>
    </Tag>
    <Tag>
        <TagValue>v1</TagValue>
        <TagKey>k1</TagKey>
    </Tag>
    <Tag>
        <TagValue>v2</TagValue>
        <TagKey>k1</TagKey>
    </Tag>
    <Tag>
        <TagValue>v2</TagValue>
        <TagKey>k2</TagKey>
    </Tag>
    <Tag>
        <TagValue>v3</TagValue>
        <TagKey>k3</TagKey>
    </Tag>
    <Tag>
        <TagValue>single</TagValue>
        <TagKey>type</TagKey>
    </Tag>
</Tags>
<RequestId>36D1BE9B-3C4A-425B-947A-69E3D77999C4</RequestId>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "Tags" : {
    "Tag" : [ {
      "TagValue" : "",
      "TagKey" : "k1"
    }, {
      "TagValue" : "v1",
      "TagKey" : "k1"
    }, {
      "TagValue" : "v2",
      "TagKey" : "k1"
    }, {
      "TagValue" : "v2",
      "TagKey" : "k2"
    }, {
      "TagValue" : "v3",
      "TagKey" : "k3"
    }, {
      "TagValue" : "single",
      "TagKey" : "type"
    } ]
  },
  "RequestId" : "36D1BE9B-3C4A-425B-947A-69E3D77999C4"
}

Error codes

For a list of error codes, see the Error Center.