Queries the tags that are attached to a VPC peering connection.
Operation description
You must specify at least ResourceId.N or Tag.N, which consists of Tag.N.Key and Tag.N.Value, to identify the resources that you want to query.
Tag.N is a resource tag that consists of a key-value pair. If you specify only Tag.N.Key, all tag values associated with the tag key are returned. Specifying only Tag.N.Value returns an error.
If you specify both Tag.N and ResourceId.N, only resources that have all the specified tags and match the specified resource IDs are returned.
If you specify multiple tag key-value pairs, only the resources that have all the specified tags are returned.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
vpc:ListTagResources |
list |
*All Resource
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| ResourceType |
string |
Yes |
The resource type. Valid value: PeerConnection. This value specifies a VPC peering connection. |
PeerConnection |
ResourceId
deprecated
|
array |
No |
The IDs of the resources. You can specify up to 20 resource IDs. |
|
|
string |
No |
The ID of the resource. You can specify up to 20 resource IDs. Note
You must specify at least ResourceId.N or Tag.N (which consists of Tag.N.Key and Tag.N.Value). |
pcc-bp16qjewdsunr41m1**** |
|
Tag
deprecated
|
array<object> |
No |
The tags. |
|
|
object |
No |
The tag. |
||
| Key |
string |
No |
The tag key of the resource. You can specify up to 20 tag keys. The tag key cannot be an empty string. A tag key can be up to 128 characters in length. It cannot start with Note
You must specify at least ResourceId.N or Tag.N (which consists of Tag.N.Key and Tag.N.Value). |
FinanceDept |
| Value |
string |
No |
The tag value of the resource. You can specify up to 20 tag values. The tag value can be an empty string. A tag value can be up to 128 characters in length. It cannot start with Note
You must specify at least ResourceId.N or Tag.N (which consists of Tag.N.Key and Tag.N.Value). |
FinanceJoshua |
| MaxResults |
integer |
No |
The number of entries to return on each page. Valid values: 1 to 50. Default value: 50. |
50 |
| NextToken |
string |
No |
The token that is used to start the next query. Valid values:
|
FFmyTO70tTpLG6I3FmYAXGKPd**** |
| RegionId |
string |
Yes |
The ID of the region where the resource is deployed. See DescribeRegions. |
cn-hangzhou |
| Category |
string |
No |
The type of the tag.
Valid values:
|
All |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
Request ID. |
||
| RequestId |
string |
Request ID. |
DE65F6B7-7566-4802-9007-96F2494AC512 |
| TagResources |
array<object> |
A list of the resources and their tags. |
|
|
object |
The details of a resource and its tag. |
||
| ResourceId |
string |
The ID of the resource. |
pcc-bp16qjewdsunr41m1**** |
| ResourceType |
string |
The type of the resource. Valid value: PeerConnection, which indicates a VPC peering connection. |
PeerConnection |
| RegionNo |
string |
The region of the requester VPC of the peering connection. |
cn-hangzhou |
| TagKey |
string |
The tag key. |
FinanceDept |
| TagValue |
string |
The tag value. |
FinanceJoshua |
| NextToken |
string |
The token that is used for the next query. Valid values:
|
FFmyTO70tTpLG6I3FmYAXGKPd**** |
| MaxResults |
integer |
The number of entries returned per page. |
50 |
Examples
Success response
JSON format
{
"RequestId": "DE65F6B7-7566-4802-9007-96F2494AC512",
"TagResources": [
{
"ResourceId": "pcc-bp16qjewdsunr41m1****",
"ResourceType": "PeerConnection",
"RegionNo": "cn-hangzhou",
"TagKey": "FinanceDept",
"TagValue": "FinanceJoshua"
}
],
"NextToken": "FFmyTO70tTpLG6I3FmYAXGKPd****",
"MaxResults": 50
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | InvalidTagKey | The tag keys are not valid. | The tag index is invalid. |
| 400 | NumberExceed.Tags | The maximum number of tags is exceeded. | The number of tags has reached the upper limit. |
| 400 | NumberExceed.ResourceIds | The maximum number of resource IDs is exceeded. | The number of resource group IDs exceeds the upper limit. |
| 400 | Forbidden.TagKeys | The tag key cannot be operated by the request. | You cannot manage the tag key by calling the operation. |
| 400 | Forbidden.TagKey.Duplicated | The specified tag key already exists. | The tag resources are duplicate. |
| 400 | InvalidInstanceIds.NotFound | The instance IDs are not found. | The instance ID is invalid. |
| 400 | InvalidInstanceType.NotFound | The instance type is not found. | The instance type is invalid. |
| 400 | BothEmpty.TagsAndResources | The specified Tags and ResourcesIds are not allow to both empty. | The tag and resource information cannot be empty at the same time. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.