Queries information about VPN connections, such as the status, IPsec connection ID, and billing method of VPN connections.
Operation description
The ListTransitRouterVpnAttachments operation supports the following three query methods:
Specify only TransitRouterAttachmentId to query information about a specific VPN connection.
Specify only TransitRouterId to query information about all VPN connections associated with the specified transit router.
Specify CenId and RegionId to query information about VPN connections in a specific region of the Cloud Enterprise Network (CEN) instance.
When calling the ListTransitRouterVpnAttachments operation, make sure that the parameter values are correct. If you specify incorrect parameter values, the response still returns a RequestId, but does not include the information about the target VPN connections.
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 Cloud Enterprise Network (CEN) instance ID. |
cen-rsgxs8ng2awen2**** |
| RegionId |
string |
No |
The region ID of the transit router instance. You can call the DescribeChildInstanceRegions operation to query region IDs. |
cn-hangzhou |
| TransitRouterAttachmentId |
string |
No |
The ID of the VPN connection. |
tr-attach-a6p8voaodog5c0**** |
| TransitRouterId |
string |
No |
The transit router instance ID. |
tr-p0wm740vjnbaprv0m**** |
| MaxResults |
integer |
No |
The number of entries per page for a paged query. Default value: 20. |
20 |
| NextToken |
string |
No |
The pagination token that is used in the next request to retrieve a new page of results. Valid values:
|
FFmyTO70tTpLG6I3FmYAXGKPd**** |
| Tag |
array<object> |
No |
The tag information of the CEN instance. You can query up to 20 tags at a time. |
|
|
object |
No |
|||
| Key |
string |
No |
The tag key of the resource. The tag key cannot be an empty string. It can be up to 64 characters in length and cannot start with You can specify up to 20 tag keys at a time. |
tagtest |
| Value |
string |
No |
The tag value of the resource. The tag value can be an empty string or up to 128 characters in length. It cannot start with Each tag key corresponds to one tag value. You can specify up to 20 tag values at a time. |
value_A1 |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The response parameters. |
||
| NextToken |
string |
The pagination token that is used in the next request to retrieve a new page of results. Valid values:
|
FFmyTO70tTpLG6I3FmYAXGKPd**** |
| RequestId |
string |
The request ID. |
3D5530D2-3BBB-524E-8E98-59AB06A250E4 |
| TotalCount |
integer |
The total number of entries returned. |
1 |
| MaxResults |
integer |
The number of entries per page in a paged query. This is used for paging the results. |
20 |
| TransitRouterAttachments |
array<object> |
The list of VPN connections. |
|
|
array<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 transit router instance ID. |
tr-p0wm740vjnbaprv0m**** |
| ResourceType |
string |
The resource type of the VPN connection. The value is VPN only, which indicates that the transit router is connected to an IPsec connection. |
VPN |
| VpnOwnerId |
integer |
The ID of the Alibaba Cloud account to which the IPsec connection belongs. |
1210123456123456 |
| VpnId |
string |
The ID of the IPsec connection. |
vco-p0wtu1xgd0l7fjo7k**** |
| TransitRouterAttachmentDescription |
string |
The description of the VPN connection. |
desctest |
| VpnRegionId |
string |
The region ID of the IPsec connection. You can call the DescribeRegions operation to query region IDs. |
cn-hangzhou |
| AutoPublishRouteEnabled |
boolean |
Indicates whether the transit router instance is allowed to automatically publish route entries to the IPsec connection. Valid values:
|
true |
| TransitRouterAttachmentName |
string |
The name of the VPN connection. |
nametest |
| Zones |
array<object> |
The 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> |
The 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 POSTPAY only, which indicates pay-as-you-go. |
POSTPAY |
| CenId |
string |
The Cloud Enterprise Network (CEN) instance ID. |
cen-j3jzhw1zpau2km**** |
| OrderType |
string |
The payer of the VPN connection. 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. | The MaxResults value 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.