Queries the tags that are added to resources.
Operation description
You must specify ResourceId.N or Tag.N in the request to specify the object that you want to query.
Tag.N is a resource tag that consists of a key-value pair (Tag.N.Key and Tag.N.Value). If you specify only Tag.N.Key, all tag values that are associated with the specified key are returned. If you specify only Tag.N.Value, an error message is returned.
If you specify Tag.N and ResourceId.N to filter tags, ResourceId.N must match all specified key-value pairs.
If you specify multiple key-value pairs, resources that contain these key-value pairs are returned.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
privatelink:ListTagResources |
get |
*VpcEndpoint
*VpcEndpointService
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| ResourceId |
array |
No |
The resource IDs. You can specify up to 50 resource IDs. |
|
|
string |
No |
The resource ID. |
ep-hp3i05294c2d2d****** |
|
| ResourceType |
string |
Yes |
The type of the resource. Valid values:
|
vpcendpoint |
| Tag |
array<object> |
No |
The tags to add to the resource. |
|
|
object |
No |
The tags to add to the resource. |
||
| Key |
string |
No |
The key of tag N to add to the resource. You can specify up to 20 tag keys. The tag key cannot be an empty string. The tag key can be up to 64 characters in length and can contain letters, digits, periods (.), underscores (_), and hyphens (-). The tag key must start with a letter but cannot start with |
FinanceDept |
| Value |
string |
No |
The value of tag N to add to the resource. You can specify up to 20 tag values. The tag value can be an empty string. The tag value can be up to 128 characters in length and can contain letters, digits, periods (.), underscores (_), and hyphens (-). The tag value must start with a letter but cannot start with |
FinanceJoshua |
| ClientToken |
string |
No |
The client token that is used to ensure the idempotence of the request. You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters. |
0c593ea1-3bea-11e9-b96b-88e9fe637760 |
| RegionId |
string |
Yes |
The ID of the region where the resource resides. You can call the DescribeRegions operation to query the most recent region list. |
cn-hangzhou |
| NextToken |
string |
No |
The pagination token that is used in the next request to retrieve a new page of results.
|
caeba0bbb2be03f84eb48b699f0a**** |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| RequestId |
string |
The request ID. |
8D8992C1-6712-423C-BAC5-E5E817484C6B |
| TagResources |
array<object> |
The resources to which the tags are added. |
|
|
object |
The resources to which the tags are added. |
||
| TagKey |
string |
The key of tag N added to the resource. |
endpoint |
| TagValue |
string |
The value of tag N added to the resource. |
FinanceJoshua |
| ResourceId |
string |
The resource ID. |
ep-hp3i05294c2d2d****** |
| ResourceType |
string |
The type of the resource. Valid values:
|
vpcendpoint |
| NextToken |
string |
The pagination token that is used in the next request to retrieve a new page of results. Valid values:
|
caeba0bbb2be03f84eb48b699f0a4883 |
Examples
Success response
JSON format
{
"RequestId": "8D8992C1-6712-423C-BAC5-E5E817484C6B",
"TagResources": [
{
"TagKey": "endpoint",
"TagValue": "FinanceJoshua",
"ResourceId": "ep-hp3i05294c2d2d******",
"ResourceType": "vpcendpoint"
}
],
"NextToken": "caeba0bbb2be03f84eb48b699f0a4883"
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | DuplicatedTagKey | The tag keys is duplicated. | The tag key must be unique. |
| 400 | MissingTagKeyParam | The tag key is empty. | The tag key is empty. |
| 400 | MissingTagValueParam | The tag value is empty. | The tag value is empty. |
| 400 | MissingResourceIdOrTagParam | The resource id and tag is empty. | The resource id and tag is empty. |
| 400 | IllegalTagKeyParam | IllegalTagKeyParam | IllegalTagKeyParam |
| 400 | IllegalTagValueParam | The tag value is Illegal. | The tag value is Illegal. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.