Queries information about the keys and values of tags added to resources.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | ListTagResources |
The operation that you want to perform. Set the value to ListTagResources. |
NextToken | String | No | FFmyTO70tTpLG6I3FmYAXGKPd**** |
The token that is used for the next query. Valid values:
|
MaxResults | Integer | No | 20 |
The number of entries to return on each page. Valid values: 1 to 100. Default value: 20. |
ResourceType | String | Yes | loadbalancer |
The type of the resource. Valid values:
|
ResourceId | Array of String | No | d-2ze1ot4ah7xjyv0d**** |
The ID of the resource. |
Tag | Array | No |
The tags. |
|
Key | String | No | env |
The tag key. It can be up to 128 characters in length and cannot start with |
Value | String | No | product |
The tag value. It can be up to 128 characters in length and cannot start with |
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
MaxResults | Integer | 20 |
The number of entries returned per page. |
NextToken | String | FFmyTO70tTpLG6I3FmYAXGKPd**** |
The token that is used for the next query. Valid values:
|
RequestId | String | 593B0448-D13E-4C56-AC0D-FDF0FDE0E9A3 |
The ID of the request. |
TagResources | Array of TagResource |
The tags that match the specified keys and values. |
|
ResourceId | String | d-2ze1ot4ah7xjyv0d**** |
The ID of the resource. |
ResourceType | String | loadbalancer |
The type of the resource. Valid values:
|
TagKey | String | env |
The tag key. |
TagValue | String | product |
The tag value. |
Examples
Sample requests
http(s)://[Endpoint]/?Action=ListTagResources
&NextToken=FFmyTO70tTpLG6I3FmYAXGKPd****
&MaxResults=20
&ResourceType=loadbalancer
&ResourceId=["d-2ze1ot4ah7xjyv0d****"]
&Tag=[{"Key":"env","Value":"product"}]
&Common request parameters
Sample success responses
XML
format
HTTP/1.1 200 OK
Content-Type:application/xml
<ListTagResourcesResponse>
<MaxResults>20</MaxResults>
<NextToken>FFmyTO70tTpLG6I3FmYAXGKPd****</NextToken>
<RequestId>593B0448-D13E-4C56-AC0D-FDF0FDE0E9A3</RequestId>
<TagResources>
<ResourceId>d-2ze1ot4ah7xjyv0d****</ResourceId>
<ResourceType>loadbalancer</ResourceType>
<TagKey>env</TagKey>
<TagValue>product</TagValue>
</TagResources>
</ListTagResourcesResponse>
JSON
format
HTTP/1.1 200 OK
Content-Type:application/json
{
"MaxResults" : 20,
"NextToken" : "FFmyTO70tTpLG6I3FmYAXGKPd****",
"RequestId" : "593B0448-D13E-4C56-AC0D-FDF0FDE0E9A3",
"TagResources" : [ {
"ResourceId" : "d-2ze1ot4ah7xjyv0d****",
"ResourceType" : "loadbalancer",
"TagKey" : "env",
"TagValue" : "product"
} ]
}
Error codes
HttpCode | Error code | Error message | Description |
---|---|---|---|
404 | ResourceNotFound.Acl | The specified resource %s is not found. | The error message returned because the specified resource %s does not exist. |
404 | ResourceNotFound.LoadBalancer | The specified resource %s is not found. | The error message returned because the specified resource %s does not exist. |
404 | ResourceNotFound.SecurityPolicy | The specified resource %s is not found. | The error message returned because the specified resource %s does not exist. |
404 | ResourceNotFound.ServerGroup | The specified resource %s is not found. | The error message returned because the specified resource %s does not exist. |
For a list of error codes, visit the API Error Center.