You can call the ListTransitRouterVpnAttachments operation to query information about VPN connections, such as their status, IPsec-VPN connection ID, and billing method.
Operation description
The ListTransitRouterVpnAttachments operation supports the following query methods:
Enter only TransitRouterAttachmentId to query a specific VPN connection.
Enter only TransitRouterId to query all VPN connections that are associated with the specified transit router.
Enter CenId and RegionId to query VPN connections in a specific region of the specified Cloud Enterprise Network (CEN) instance.
When you call the ListTransitRouterVpnAttachments operation, make sure that you enter valid parameter values. If you enter invalid parameters, the system returns a RequestId but does not return the queried VPN connection information.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
cen:ListTransitRouterVpnAttachments |
list |
*CenInstance
TransitRouterVpnAttachment
TransitRouterVpnAttachment
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| CenId |
string |
No |
The ID of the CEN instance. |
cen-rsgxs8ng2awen2**** |
| RegionId |
string |
No |
The ID of the region where the transit router is deployed. For more information, see DescribeChildInstanceRegions. |
cn-hangzhou |
| TransitRouterAttachmentId |
string |
No |
The ID of the VPN connection. |
tr-attach-a6p8voaodog5c0**** |
| TransitRouterId |
string |
No |
The ID of the transit router. |
tr-p0wm740vjnbaprv0m**** |
| MaxResults |
integer |
No |
The number of entries to return on each page. Default value: 20. |
20 |
| NextToken |
string |
No |
The token that is used for the next query. Valid values:
|
FFmyTO70tTpLG6I3FmYAXGKPd**** |
| Tag |
array<object> |
No |
The tags of the CEN instance. You can query a maximum of 20 tags at a time. |
|
|
object |
No |
|||
| Key |
string |
No |
The tag key. The tag key cannot be an empty string. The tag key can be up to 64 characters in length and cannot start with You can specify up to 20 tag keys. |
tagtest |
| Value |
string |
No |
The tag value. The tag value can be an empty string or a string of up to 128 characters. It cannot start with Each tag key must have a unique tag value. You can specify up to 20 tag values. |
value_A1 |
Response parameters
|
Parameter |
Type |
Description |
Example |
|
object |
The response. |
||
| NextToken |
string |
The token that is used for the next query. Valid values:
|
FFmyTO70tTpLG6I3FmYAXGKPd**** |
| RequestId |
string |
The request ID. |
3D5530D2-3BBB-524E-8E98-59AB06A250E4 |
| TotalCount |
integer |
The total number of entries. |
1 |
| MaxResults |
integer |
The number of entries returned per page. |
20 |
| TransitRouterAttachments |
array<object> |
A list of VPN connections. |
|
|
object |
The information about the VPN connection. |
||
| CreationTime |
string |
The time when the VPN connection was created. The time is displayed in the ISO 8601 standard in the YYYY-MM-DDThh:mmZ format. The time is displayed in UTC. |
2022-07-08T08:45Z |
| Status |
string |
The status of the VPN connection.
|
Attached |
| TransitRouterAttachmentId |
string |
The ID of the VPN connection. |
tr-attach-a6p8voaodog5c0**** |
| TransitRouterId |
string |
The ID of the transit router. |
tr-p0wm740vjnbaprv0m**** |
| ResourceType |
string |
The resource type of the VPN connection. The value is set to VPN, which indicates that the transit router is connected to an IPsec-VPN connection. |
VPN |
| VpnOwnerId |
integer |
The ID of the Alibaba Cloud account to which the IPsec-VPN connection belongs. |
1210123456123456 |
| VpnId |
string |
The ID of the IPsec-VPN connection. |
vco-p0wtu1xgd0l7fjo7k**** |
| TransitRouterAttachmentDescription |
string |
The description of the VPN connection. |
desctest |
| VpnRegionId |
string |
The ID of the region where the IPsec-VPN connection is deployed. For more information, see DescribeRegions. |
cn-hangzhou |
| AutoPublishRouteEnabled |
boolean |
Indicates whether the transit router automatically advertises routes to the IPsec-VPN connection. Valid values:
|
true |
| TransitRouterAttachmentName |
string |
The name of the VPN connection. |
nametest |
| Zones |
array<object> |
A list of zones where the VPN connection is deployed. |
|
|
object |
The zone where the VPN connection is deployed. |
||
| ZoneId |
string |
The zone ID. For more information, see DescribeZones. |
cn-hangzhou-h |
| Tags |
array<object> |
A list of tags. |
|
|
object |
|||
| Key |
string |
The tag key. |
test |
| Value |
string |
The tag value. |
value_A1 |
| ChargeType |
string |
The billing method of the VPN connection. The value is set to POSTPAY, which indicates the pay-as-you-go billing method. |
POSTPAY |
| CenId |
string |
The ID of the CEN instance. |
cen-j3jzhw1zpau2km**** |
| OrderType |
string |
The party that pays for the network instance. Valid values:
|
PayByCenOwner |
Examples
Success response
JSON format
{
"NextToken": "FFmyTO70tTpLG6I3FmYAXGKPd****",
"RequestId": "3D5530D2-3BBB-524E-8E98-59AB06A250E4",
"TotalCount": 1,
"MaxResults": 20,
"TransitRouterAttachments": [
{
"CreationTime": "2022-07-08T08:45Z",
"Status": "Attached",
"TransitRouterAttachmentId": "tr-attach-a6p8voaodog5c0****",
"TransitRouterId": "tr-p0wm740vjnbaprv0m****",
"ResourceType": "VPN",
"VpnOwnerId": 1210123456123456,
"VpnId": "vco-p0wtu1xgd0l7fjo7k****",
"TransitRouterAttachmentDescription": "desctest",
"VpnRegionId": "cn-hangzhou",
"AutoPublishRouteEnabled": true,
"TransitRouterAttachmentName": "nametest",
"Zones": [
{
"ZoneId": "cn-hangzhou-h"
}
],
"Tags": [
{
"Key": "test",
"Value": "value_A1"
}
],
"ChargeType": "POSTPAY",
"CenId": "cen-j3jzhw1zpau2km****\n",
"OrderType": "PayByCenOwner"
}
]
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | IllegalParam.NextToken | The specified NextToken is invalid. | The error message returned because the NextToken parameter is set to an invalid value. |
| 400 | IllegalParam.TrInstance | The specified TransitRouter is invalid. | The error message returned because the TransitRouter parameter is set to an invalid value. |
| 400 | IllegalParam.Region | The specified Region is invalid. | The error message returned because the specified region is invalid. |
| 400 | IllegalParam.CenId | The specified CenId is invalid. | The error message returned because the ID of the CEN instance is invalid. |
| 400 | IllegalParam.CenIdOrRegionId | The specified CenId or RegionId is invalid. | The error message returned because the specified CEN instance ID or region ID is invalid. |
| 400 | IllegalParam.TransitRouterId | The specified TransitRouterId is illegal. | The error message returned because the specified transit router ID is invalid. |
| 400 | IllegalParam.MaxResults | The specified MaxResults is invalid. | |
| 400 | InvalidParameter | Invalid parameter. | The error message returned because the parameter is set to an invalid value. |
| 400 | Unauthorized | The AccessKeyId is unauthorized. | The error message returned because you do not have the permissions to perform this operation. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.