Queries the visible resource tags.
Operation description
- The Tag.N.Key and Tag.N.Value parameters constitute a key-value pair.
- ResourceId.N must meet all the key-value pairs that are entered. If you enter multiple key-value pairs, resources that contain the specified key-value pairs are returned.
- This operation is used to query resource tags based on conditions. If no relationship matches the conditions, an empty list is returned.
- You can query both user tags and visible system tags.
- In addition to the required parameters, you can also specify ResourceId.N to query the visible resource tags of a specified resource in a region.
- You can also specify Tag.N.Key to query the visible keys of a specified key in a region.
- At least one of ResourceId.N, Tag.N.Key, and Tag.N.Value exists.
- You can query tags of the same type or different types in a single operation.
- You can query all your user types and visible system tags.
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:
- For mandatory resource types, indicate with a prefix of * .
- If the permissions cannot be granted at the resource level,
All Resourcesis 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 |
|---|---|---|---|---|
| apigateway:ListTagResources | get | *ApiGroup acs:apigateway:{#regionId}:{#accountId}:apigroup/{#ResourceId} |
| none |
Request parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
| ResourceType | string | Yes | The type of the resource. Currently, tags are supported for API groups, plug-ins, and apps. Operations performed on APIs are based on the tags of API groups.
| apiGroup |
| NextToken | string | No | The token used to start the next query. | 1d2db86sca4384811e0b5e8707e68181f |
| ResourceId | array | No | The ID of the resource. Valid values of N: | |
| string | No | The ID of the resource. | 285bb759342649a1b70c2093a772e087 | |
| Tag | array<object> | No | The tag of objects that match the lifecycle rule. You can specify multiple tags. | |
| object | No | The tag of objects that match the lifecycle rule. You can specify multiple tags. | ||
| Key | string | No | The key of the tag. Valid values of N: | env |
| Value | string | No | The value of the tag. If the parameter has a value, a value is also required for the tag key of the same N in the corresponding tag.N.Key. Otherwise, an error is reported. Valid values of N: | product |
Response parameters
Examples
Sample success responses
JSONformat
{
"NextToken": "1d2db86sca4384811e0b5e8707e68181f",
"RequestId": "2D69A58F-345C-4FDE-88E4-BF5189484043",
"TagResources": {
"TagResource": [
{
"TagValue": "zhangsan",
"ResourceType": "apiGroup",
"ResourceId": "285bb759342649a1b70c2093a772e087",
"TagKey": "owner"
}
]
}
}Error codes
For a list of error codes, visit the Service error codes.
Change history
| Change time | Summary of changes | Operation |
|---|---|---|
| 2024-11-14 | API Description Update | View Change Details |
