Queries the tags that are attached to one or more gateways.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | ListTagResources |
The operation that you want to perform. Set the value to ListTagResources. |
RegionId | String | Yes | cn-hangzhou |
The ID of the region. You can call the DescribeRegions operation to query available region IDs. |
ResourceType | String | Yes | GATEWAY |
The type of the resource. Valid value: GATEWAY. |
NextToken | String | No | 212db86sca4384811e0b5e8707ec21345 |
The token required to obtain more results. This parameter is not required in the first query. If a query does not return all results, in the next query, you can specify the token returned from the previous query to obtain more results. |
ResourceId.N | RepeatList | No | gw-uf6wjk5xxxxxxx |
The list of gateway IDs. You can query the tags of N gateways at a time. Valid values of N: 1 to 50. Note You need to specify either ResourceId.N or Tag.N.Key.
|
Tag.N.Key | String | No | testkey1 |
The key of the tag. You can query N tag keys at a time. Valid values of N: 1 to 20.
This parameter cannot be an empty string.
Note You need to specify either ResourceId.N or Tag.N.Key.
|
Tag.N.Value | String | No | testvalue1 |
The tag value that corresponds to the tag key. You can specify N tag values at a time. Valid values of N: 1 to 20. This parameter can be an empty string. |
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
RequestId | String | 47A514A1-4B77-4E30-B4C5-2A880650B3FD |
The ID of the request. |
NextToken | String | 212db86sca4384811e0b5e8707ec21345 |
The token required to obtain more results. If a query does not return all results, in the next query, you can provide the token returned by the previous query to obtain more results. |
TagResources | Array |
The list of gateways and tags. |
|
TagKey | String | testkey1 |
The key of the tag. |
TagValue | String | testvalue1 |
The tag value that corresponds to the tag key. |
ResourceId | String | 47A514A1-4B77-4E30-B4C5-2A880650B3FD |
The ID of the gateway. |
ResourceType | String | ALIYUN::HCS_SGW::GATEWAY |
The type of the resource. Valid value: ALIYUN::HCS_SGW::GATEWAY. |
Examples
Sample requests
http(s)://[Endpoint]/?Action=ListTagResources
&RegionId=cn-hangzhou
&ResourceType=GATEWAY
&ResourceId.1=rm-uf6wjk5xxxxxxx
&Tag.1.Key=testkey1
&<Common request parameters>
Sample success responses
XML
format
<ListTagResourcesResponse>
<TagResources>
<TagResource>
<ResourceType>ALIYUN::HCS_SGW::GATEWAY</ResourceType>
<TagValue>testvalue1</TagValue>
<ResourceId>gw-uf6wjk5xxxxxxx</ResourceId>
<TagKey>testkey1</TagKey>
</TagResource>
</TagResources>
<RequestId>47A514A1-4B77-4E30-B4C5-2A880650B3FD</RequestId>
</ListTagResourcesResponse>
JSON
format
{
"TagResources":{
"TagResource":[
{
"ResourceType":"ALIYUN::HCS_SGW::GATEWAY",
"TagValue":"testvalue1",
"ResourceId":"gw-uf6wjk5xxxxxxx",
"TagKey":"testkey1"
}
]
},
"RequestId":"47A514A1-4B77-4E30-B4C5-2A880650B3FD"
}
Error codes
For a list of error codes, visit the API Error Center.