All Products
Search
Document Center

Server Load Balancer:ListTagResources

Last Updated:Nov 22, 2024

Queries the tags of resources.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
gwlb:ListTagResourceslist
*All Resources
*
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
ResourceTypestringYes

The type of resource. Valid values:

  • loadbalancer: Gateway Load Balancer (GWLB) instance
  • listener: listener
  • servergroup: server group
loadbalancer
ResourceIdarrayNo

The resource IDs. You can specify at most 50 resource IDs in each call.

ResourceIdstringNo

The resource ID.

gwlb-nrnrxwd15en27r****
Tagarray<object>No

The tags. You can specify at most 20 tags in each call.

TagModelobjectNo

The tag.

KeystringNo

The tag key.

testKey
ValuestringNo

The tag value.

testValue
NextTokenstringNo

The pagination token that is used in the next request to retrieve a new page of results. Valid values:

  • If NextToken is empty, no next page exists.
  • If a value of NextToken is returned, the value indicates the token that is used for the next query.
WyI2NDQ3MWUxM2EzOWNhMmY0Y2M2YTRiNzZhOWQwNmU1Y2RlNTYzMGEzIiwibiIsIm4iLDEsLTEsMTY5ODcxMzI2NjU0MywiNjU0MDRlYjI2MmI3MDhjY2JiMjM0ZmU0ODNkNTVmMGRhZDllOTBi****
MaxResultsintegerNo

The maximum number of results to be returned from a single query when the NextToken parameter is used in the query. Valid values: 1 to 1000. Default value: 20.

20

Response parameters

ParameterTypeDescriptionExample
object

The response parameters.

NextTokenstring

A pagination token. It can be used in the next request to retrieve a new page of results. Valid values:

  • If NextToken is empty, no next page exists.
  • If a value of NextToken is returned, the value indicates the token that is used for the next query.
d209f4e63ec942c967c50c888a13****
RequestIdstring

The request ID.

A95325A2-E421-58A6-88AD-7A26CE610F45
TagResourcesarray<object>

The tags.

tagResourceobject

The information about the tag that is added to the resource.

ResourceIdstring

The resource ID.

gwlb-nrnrxwd15en27r****
ResourceTypestring

The resource type. Valid values:

  • loadbalancer: GWLB instance
  • listener: listener
  • servergroup: server group
loadbalancer
TagKeystring

The tag key.

testKey
TagValuestring

The tag value.

testValue

Examples

Sample success responses

JSONformat

{
  "NextToken": "d209f4e63ec942c967c50c888a13****",
  "RequestId": "A95325A2-E421-58A6-88AD-7A26CE610F45",
  "TagResources": [
    {
      "ResourceId": "gwlb-nrnrxwd15en27r****\n",
      "ResourceType": "loadbalancer",
      "TagKey": "testKey",
      "TagValue": "testValue"
    }
  ]
}

Error codes

HTTP status codeError codeError messageDescription
400MissingParam.TagsOrResourceIdsThe param of TagsOrResourceIds is missing.The param of TagsOrResourceIds is missing.
400MissingParam.TagKeyThe param of TagKey is missing.The parameter of tag key is missing.
400DuplicatedParam.ResourceIdThe param of %s is duplicated.The param of %s is duplicated.
400DuplicatedParam.TagKeyThe param of %s is duplicated.The parameter of tag key is duplicated.

For a list of error codes, visit the Service error codes.