Queries the tags of resources.
Debugging
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.
Operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|
gwlb:ListTagResources | list | *All Resources * |
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
ResourceType | string | Yes | The type of resource. Valid values:
| loadbalancer |
ResourceId | array | No | The resource IDs. You can specify at most 50 resource IDs in each call. | |
ResourceId | string | No | The resource ID. | gwlb-nrnrxwd15en27r**** |
Tag | array<object> | No | The tags. You can specify at most 20 tags in each call. | |
TagModel | object | No | The tag. | |
Key | string | No | The tag key. | testKey |
Value | string | No | The tag value. | testValue |
NextToken | string | No | The pagination token that is used in the next request to retrieve a new page of results. Valid values:
| WyI2NDQ3MWUxM2EzOWNhMmY0Y2M2YTRiNzZhOWQwNmU1Y2RlNTYzMGEzIiwibiIsIm4iLDEsLTEsMTY5ODcxMzI2NjU0MywiNjU0MDRlYjI2MmI3MDhjY2JiMjM0ZmU0ODNkNTVmMGRhZDllOTBi**** |
MaxResults | integer | No | 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
Examples
Sample success responses
JSON
format
{
"NextToken": "d209f4e63ec942c967c50c888a13****",
"RequestId": "A95325A2-E421-58A6-88AD-7A26CE610F45",
"TagResources": [
{
"ResourceId": "gwlb-nrnrxwd15en27r****\n",
"ResourceType": "loadbalancer",
"TagKey": "testKey",
"TagValue": "testValue"
}
]
}
Error codes
HTTP status code | Error code | Error message | Description |
---|---|---|---|
400 | MissingParam.TagsOrResourceIds | The param of TagsOrResourceIds is missing. | The param of TagsOrResourceIds is missing. |
400 | MissingParam.TagKey | The param of TagKey is missing. | The parameter of tag key is missing. |
400 | DuplicatedParam.ResourceId | The param of %s is duplicated. | The param of %s is duplicated. |
400 | DuplicatedParam.TagKey | The param of %s is duplicated. | The parameter of tag key is duplicated. |
For a list of error codes, visit the Service error codes.