All Products
Search
Document Center

Cloud Enterprise Network:ListTransitRouterVpnAttachments

Last Updated:Mar 01, 2024

Queries the information about VPN attachments.

Operation description

When you call the ListTransitRouterVpnAttachments operation, take note of the following items:

  • If you set only CenId and RegionId, the VPN attachments in the current region are queried.
  • If you set CenId, RegionId, and TransitRouterAttachmentId, only the specified VPN attachment is queried.
  • If you set CenId and RegionId, you do not need to set TransitRouterId. If you set TransitRouterId, you do not need to set CenId or RegionId.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
cen:ListTransitRouterVpnAttachmentsList
  • CenInstance
    acs:cen:*:{#accountId}:ceninstance/{#ceninstanceId}
  • TransitRouterVpnAttachment
    acs:cen:*:{#accountId}:centransitrouterattachment/*
  • TransitRouterVpnAttachment
    acs:cen:*:{#accountId}:centransitrouterattachment/{#centransitrouterattachmentId}
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
CenIdstringNo

The ID of the Cloud Enterprise Network (CEN) instance.

cen-rsgxs8ng2awen2****
RegionIdstringNo

The ID of the region where the transit router is deployed.

You can call the DescribeChildInstanceRegions operation to query the most recent region list.

ap-southeast-2
TransitRouterAttachmentIdstringNo

The ID of the VPN attachment.

tr-attach-a6p8voaodog5c0****
TransitRouterIdstringNo

The ID of the transit router.

tr-p0wm740vjnbaprv0m****
MaxResultsintegerNo

The number of entries to return on each page. Default value: 20.

20
NextTokenstringNo

The token that determines the start point of the next query. Valid values:

  • If this is your first query and no subsequent queries are to be sent, ignore this parameter.
  • If a subsequent query is to be sent, set the parameter to the value of NextToken that is returned from the last call.
FFmyTO70tTpLG6I3FmYAXGKPd****
Tagobject []No

The information about the tags that are added to the CEN instance.

You can query at most 20 tags in each call.

KeystringNo

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 acs: or aliyun. It cannot contain http:// or https://.

You can specify at most 20 tag keys.

tagtest
ValuestringNo

The tag value.

The tag value can be 0 to 128 characters in length, and cannot start with aliyun or acs:. It cannot contain http:// or https://.

Each tag key must have a unique tag value. You can specify at most 20 tag values in each call.

value_A1

Response parameters

ParameterTypeDescriptionExample
object

The response.

NextTokenstring

The token that determines the start point of the next query. Valid values:

  • If NextToken is not returned, it indicates that no additional results exist.
  • If NextToken was returned in the previous query, specify the value to obtain the next set of results.
FFmyTO70tTpLG6I3FmYAXGKPd****
RequestIdstring

The ID of the request.

3D5530D2-3BBB-524E-8E98-59AB06A250E4
TotalCountinteger

The total number of entries returned.

1
MaxResultsinteger

The number of entries returned per page.

20
TransitRouterAttachmentsobject []

The information about the VPN attachment.

CreationTimestring

The time when the VPN attachment was created.

The time follows the ISO8601 standard in the YYYY-MM-DDThh:mmZ format. The time is displayed in UTC.

2022-07-08T08:45Z
Statusstring

The status of the VPN attachment. Valid values:

  • Attached: The VPC attachment has been created on the transit router.
  • Attaching: The VPN attachment is being created on the transit router.
  • Detaching: The VPN attachment is being deleted from the transit router.
  • Detached: The VPN attachment is deleted from the transit router.
Attached
TransitRouterAttachmentIdstring

The ID of the VPN attachment.

tr-attach-a6p8voaodog5c0****
TransitRouterIdstring

The ID of the transit router.

tr-p0wm740vjnbaprv0m****
ResourceTypestring

The type of resource to which the transit router is connected.

Valid value: VPN, which indicates that an IPsec-VPN connection is attached to the transit router.

VPN
VpnOwnerIdlong

The ID of the Alibaba Cloud account to which the IPsec-VPN connection belongs.

1210123456123456
VpnIdstring

The ID of the IPsec-VPN connection.

vco-p0wtu1xgd0l7fjo7k****
TransitRouterAttachmentDescriptionstring

The description of the VPN attachment.

desctest
VpnRegionIdstring

The ID of the region to which the IPsec-VPN connection belongs.

You can call the DescribeRegions operation to query the most recent region list.

ap-southeast-2
AutoPublishRouteEnabledboolean

Specifies whether to allow the transit router to automatically advertise routes to the IPsec-VPN connection. Valid values:

  • true: yes
  • false: no
true
TransitRouterAttachmentNamestring

The name of the VPN attachment.

nametest
Zonesobject []

The zones where the VPN attachment is deployed.

ZoneIdstring

The ID of the zone.

You can call the DescribeZones operation to query the most recent zone list.

ap-southeast-2a
Tagsobject []

A list of tags.

Keystring

The tag key.

test
Valuestring

The tag value.

value_A1
ChargeTypestring

The billing method of the VPN attachment.

The value is POSTPAY, which is the default value and specifies the pay-as-you-go billing method.

POSTPAY
CenIdstring

The ID of the CEN instance.

cen-j3jzhw1zpau2km****

Examples

Sample success responses

JSONformat

{
  "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": "ap-southeast-2",
      "AutoPublishRouteEnabled": true,
      "TransitRouterAttachmentName": "nametest",
      "Zones": [
        {
          "ZoneId": "ap-southeast-2a"
        }
      ],
      "Tags": [
        {
          "Key": "test",
          "Value": "value_A1"
        }
      ],
      "ChargeType": "POSTPAY",
      "CenId": "cen-j3jzhw1zpau2km****\n"
    }
  ]
}

Error codes

HTTP status codeError codeError messageDescription
400IllegalParam.NextTokenThe specified NextToken is invalid.The error message returned because the NextToken parameter is set to an invalid value.
400IllegalParam.TrInstanceThe specified TransitRouter is invalid.The error message returned because the TransitRouter parameter is set to an invalid value.
400IllegalParam.RegionThe specified Region is invalid.The error message returned because the specified region is invalid.
400IllegalParam.CenIdThe specified CenId is invalid.The error message returned because the ID of the CEN instance is invalid.
400IllegalParam.CenIdOrRegionIdThe specified CenId or RegionId is invalid.The error message returned because the specified CEN instance ID or region ID is invalid.
400IllegalParam.TransitRouterIdThe specified TransitRouterId is illegal.The error message returned because the specified transit router ID is invalid.
400IllegalParam.MaxResultsThe specified MaxResults is invalid.-
400InvalidParameterInvalid parameter.The error message returned because the parameter is set to an invalid value.
400UnauthorizedThe AccessKeyId is unauthorized.The error message returned because you do not have the permissions to perform this operation.

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2023-03-01API Description Update. The Error code has changed. The response structure of the API has changedsee changesets
Change itemChange content
API DescriptionAPI Description Update.
Error CodesThe Error code has changed.
    delete Error Codes: 400
Output ParametersThe response structure of the API has changed.
2022-12-22The Error code has changedsee changesets
Change itemChange content
Error CodesThe Error code has changed.
    Error Codes 400 change
2022-09-15The Error code has changedsee changesets
Change itemChange content
Error CodesThe Error code has changed.
    delete Error Codes: 400
2022-09-15The Error code has changedsee changesets
Change itemChange content
Error CodesThe Error code has changed.
    delete Error Codes: 400