Queries the tags bound to VPC peering connections.
Operation description
Specify at least one of the ResourceId.N and Tag.N (Tag.N.Key and Tag.N.Value) parameters in the request to determine the resources to query.
Tag.N is the tag of the 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 reported.
If you specify both Tag.N and ResourceId.N to filter tags, the ResourceId.N parameter must match all the specified tag key-value pairs.
If you specify multiple tag key-value pairs, the returned resources contain all the specified key-value pairs.
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 values: PeerConnection (VPC peering connection). |
PeerConnection |
ResourceId
deprecated
|
array |
No |
The resource IDs. You can specify up to 20 resource IDs. |
|
|
string |
No |
The resource ID. You can specify up to 20 resource IDs. Note
You must specify at least one of the ResourceId.N and Tag.N (Tag.N.Key and Tag.N.Value) parameters. |
pcc-bp16qjewdsunr41m1**** |
|
Tag
deprecated
|
array<object> |
No |
The tag information. |
|
|
object |
No |
The tags of the resource. |
||
| Key |
string |
No |
The tag key of the resource. You can specify up to 20 tag keys. This parameter 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 one of the ResourceId.N and Tag.N (Tag.N.Key and Tag.N.Value) parameters. |
FinanceDept |
| Value |
string |
No |
The tag value of the resource. You can specify up to 20 tag values. This parameter 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 one of the ResourceId.N and Tag.N (Tag.N.Key and Tag.N.Value) parameters. |
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 pagination token. Valid values:
|
FFmyTO70tTpLG6I3FmYAXGKPd**** |
| RegionId |
string |
Yes |
The region ID of the resource. You can call the DescribeRegions operation to query region IDs. |
cn-hangzhou |
| Category |
string |
No |
The tag type. Valid values:
Valid values:
|
All |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The request ID. |
||
| RequestId |
string |
The request ID. |
DE65F6B7-7566-4802-9007-96F2494AC512 |
| TagResources |
array<object> |
The information about the resources to which tags are bound. |
|
|
object |
The information about the resources to which tags are bound. |
||
| ResourceId |
string |
The resource ID. |
pcc-bp16qjewdsunr41m1**** |
| ResourceType |
string |
The resource type. Valid values: PeerConnection (VPC peering connection). |
PeerConnection |
| RegionNo |
string |
The region of the initiator of the VPC peering connection. |
cn-hangzhou |
| TagKey |
string |
The tag key. |
FinanceDept |
| TagValue |
string |
The tag value. |
FinanceJoshua |
| NextToken |
string |
The pagination token. 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.