Queries tag keys and tag values of Application Load Balancer (ALB) instances.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

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 start position of the query. If this parameter is left empty, the query starts from the beginning.

MaxResults Integer No 10

The maximum number of entries to return.

ResourceType String Yes loadbalancer

The type of resource. Valid values:

  • acl: an access control list (ACL)
  • loadbalancer: an ALB instance
  • securitypolicy: a security policy
  • servergroup: a server group
ResourceId Array of String No d-2ze1ot4ah7xjyv0d****

The ID of the resource.

Tag Array No

The tag.

Key String No env

The tag key.

Value String No product

The tag value.

Response parameters

Parameter Type Example Description
MaxResults Integer 10

The maximum number of entries returned.

NextToken String FFmyTO70tTpLG6I3FmYAXGKPd****

The token for the next query. If you leave this parameter empty, it indicates that no token is specified.

RequestId String 593B0448-D13E-4C56-AC0D-FDF0FDE0E9A3

The ID of the request.

TagResources Array of TagResource

The returned tags that match the tag keys and key values.

ResourceId String d-2ze1ot4ah7xjyv0d****

The ID of the resource.

ResourceType String loadbalancer

The type of resource. Valid values:

  • acl: an ACL
  • loadbalancer: an ALB instance
  • securitypolicy: a security policy
  • servergroup: a server group
TagKey String env

The tag key.

TagValue String product

The tag value.

TotalCount Integer 10

The maximum number of entries returned.

Valid values: 1 to 100.

Default value: 20. This value indicates that this parameter is not set.

Examples

Sample requests

http(s)://[Endpoint]/?Action=ListTagResources
&NextToken=FFmyTO70tTpLG6I3FmYAXGKPd****
&MaxResults=10
&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>10</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>
    <TotalCount>10</TotalCount>
</ListTagResourcesResponse>

JSON format

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

{
  "MaxResults" : 10,
  "NextToken" : "FFmyTO70tTpLG6I3FmYAXGKPd****",
  "RequestId" : "593B0448-D13E-4C56-AC0D-FDF0FDE0E9A3",
  "TagResources" : [ {
    "ResourceId" : "d-2ze1ot4ah7xjyv0d****",
    "ResourceType" : "loadbalancer",
    "TagKey" : "env",
    "TagValue" : "product"
  } ],
  "TotalCount" : 10
}

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.