Queries the tags that are bound to resources.
Operation description
-
Specify at least ResourceId.N or Tag.N (Tag.N.Key and Tag.N.Value) in the request to determine the objects to query.
-
Tag.N is a tag of a resource and consists of a key-value pair. If you specify only Tag.N.Key, all tag values associated with the tag key are returned. If you specify only Tag.N.Value, an error is returned.
-
If you specify both Tag.N and ResourceId.N to filter tags, ResourceId.N must match all specified tag key-value pairs.
-
If you specify multiple tag key-value pairs, the resources that contain all specified 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 list of resource IDs. You can specify up to 50 resource IDs. |
|
|
string |
No |
The service resource ID. |
ep-hp3i05294c2d2d****** |
|
| ResourceType |
string |
Yes |
The resource type. Valid values:
|
vpcendpoint |
| Tag |
array<object> |
No |
The list of tags. |
|
|
object |
No |
The tag of the resource. |
||
| Key |
string |
No |
The tag key of the resource. You can specify up to 20 tag keys. If you specify this parameter, the value cannot be an empty string. The tag key can be up to 64 characters in length. It must start with a letter or Chinese character and can contain digits, periods (.), underscores (_), and hyphens (-). It cannot start with |
FinanceDept |
| Value |
string |
No |
The tag value of the resource. You can specify up to 20 tag values. If you specify this parameter, the value can be an empty string. The tag value can be up to 128 characters in length. It must start with a letter or Chinese character and can contain digits, periods (.), underscores (_), and hyphens (-). It cannot start with |
FinanceJoshua |
| ClientToken |
string |
No |
The client token that is used to ensure the idempotence of the request. Generate a parameter value from your client to ensure that the value is unique among different requests. ClientToken supports only ASCII characters. |
0c593ea1-3bea-11e9-b96b-88e9fe637760 |
| RegionId |
string |
Yes |
The region ID of the resource. You can call the DescribeRegions operation to query the region ID. |
cn-hangzhou |
| NextToken |
string |
No |
Specifies whether a next query token is available. Valid values:
|
caeba0bbb2be03f84eb48b699f0a**** |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| RequestId |
string |
The request ID. |
8D8992C1-6712-423C-BAC5-E5E817484C6B |
| TagResources |
array<object> |
The information about the resources to which tags are bound. |
|
|
object |
The information about the resources to which tags are bound. |
||
| TagKey |
string |
The tag key. |
endpoint |
| TagValue |
string |
The tag value. |
FinanceJoshua |
| ResourceId |
string |
The resource ID. |
ep-hp3i05294c2d2d****** |
| ResourceType |
string |
The resource type. Valid values:
|
vpcendpoint |
| NextToken |
string |
Specifies whether a next query token is available. 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.