ListTransitRouterVpcAttachments

更新时间:
复制 MD 格式

Call the ListTransitRouterVpcAttachments operation to query details about VPC connections on an Enterprise Edition Transit Router, including the connection status, billing method, and zone, as well as the vSwitches and elastic network interfaces (ENIs) of the connected VPC.

Operation description

You can query the VPC connections of an Enterprise Edition transit router in one of the following ways:

  • Specify the ID of an Enterprise Edition transit router instance to query all its VPC connections.

  • Specify the ID of a Cloud Enterprise Network (CEN) instance and the region ID of the Enterprise Edition transit router instance to query all its VPC connections.

  • Specify the ID of a region that contains an Enterprise Edition transit router instance to query all VPC connections in that region.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

cen:ListTransitRouterVpcAttachments

list

*CenInstance

acs:cen:*:{#accountId}:ceninstance/{#ceninstanceId}

TransitRouterVpcAttachment

acs:cen:*:{#accountId}:centransitrouterattachment/*

TransitRouterVpcAttachment

acs:cen:*:{#accountId}:centransitrouterattachment/{#centransitrouterattachmentId}

None None

Request parameters

Parameter

Type

Required

Description

Example

CenId

string

No

The ID of the CEN instance.

cen-j3jzhw1zpau2km****

RegionId

string

No

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

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

cn-hangzhou

TransitRouterAttachmentId

string

No

The ID of the VPC connection.

tr-attach-nls9fzkfat8934****

TransitRouterId

string

No

The ID of the enterprise edition transit router.

tr-bp1su1ytdxtataupl****

MaxResults

integer

No

The number of entries to return on each page. The default value is 20.

20

NextToken

string

No

The pagination token that is used in the next request to retrieve a new page of results.

  • If this is your first query or no more results are available, you do not need to specify this parameter.

  • For subsequent queries, set this parameter to the NextToken value from the previous response.

FFmyTO70tTpLG6I3FmYAXGKPd****

Tag

array<object>

No

The tags.

You can specify up to 20 tags.

object

No

Key

string

No

The tag key.

The tag key must be 1 to 64 characters in length, and cannot start with aliyun or acs:. It cannot contain http:// or https://.

tagtest

Value

string

No

The tag value.

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

tagtest

VpcId

string

No

The VPC ID.

vpc-bp1kbjcre9vtsebo1****

OrderType

string

No

The entity that pays for the network instance. Valid values:

  • PayByCenOwner: The fees are paid by the account that owns the CEN instance.

  • PayByResourceOwner: The fees are paid by the account that owns the network instance.

PayByCenOwner

Status

string

No

The status of the VPC connection. Valid values:

  • Attaching: The VPC connection is being created.

  • Attached: The VPC connection is created.

  • Detaching: The VPC connection is being deleted.

Attached

Response elements

Element

Type

Description

Example

object

The returned data.

NextToken

string

The token to retrieve the next page of results.

  • If this parameter is empty, all results have been returned.

  • If a value is returned for NextToken, it is the token to start the next query.

FFmyTO70tTpLG6I3FmYAXGKPd****

RequestId

string

The request ID.

C97FF53F-3EF8-4883-B459-60E171924B23

TotalCount

integer

The total number of entries.

1

MaxResults

integer

The number of entries to return on each page.

20

TransitRouterAttachments

array<object>

A list of VPC connections.

array<object>

CreationTime

string

The time when the VPC connection was created.

The time is in the YYYY-MM-DDThh:mmZ format and in UTC.

2021-06-15T02:14Z

Status

string

The status of the VPC connection.

  • Attached: The connection is established.

  • Attaching: The connection is being created.

  • Detaching: The connection is being deleted.

Attached

VpcId

string

The ID of the Virtual Private Cloud (VPC).

vpc-bp1h8vbrbcgohcju5****

TransitRouterAttachmentId

string

The ID of the VPC connection.

tr-attach-nls9fzkfat8934****

TransitRouterId

string

The ID of the Enterprise Edition transit router.

tr-bp1su1ytdxtataupl****

ResourceType

string

The type of resource to which the connection is attached.

The value is always VPC, which indicates a Virtual Private Cloud (VPC).

VPC

TransitRouterAttachmentDescription

string

The description of the VPC connection.

testdesc

VpcOwnerId

integer

The ID of the account that owns the VPC.

1250123456123456

VpcRegionId

string

The ID of the region where the VPC is deployed.

cn-hangzhou

TransitRouterAttachmentName

string

The name of the VPC connection.

testname

ZoneMappings

array<object>

The zone mappings of the VPC connection. This includes the vSwitches and elastic network interfaces (ENIs) in the associated VPC.

object

ZoneId

string

The ID of the availability zone.

cn-hangzhou-h

VSwitchId

string

The ID of the vSwitch.

vsw-bp1a214sbus8z3b54****

NetworkInterfaceId

string

The ID of the elastic network interface (ENI) that the Enterprise Edition transit router creates in the vSwitch.

eni-bp149hmyaqegerml****

AutoPublishRouteEnabled

boolean

Specifies whether the Enterprise Edition transit router automatically advertises routes to the VPC.

  • false: Routes are not automatically advertised.

  • true: Routes are automatically advertised.

true

ChargeType

string

The billing method of the VPC connection.

The value is always POSTPAY, which indicates the pay-as-you-go billing method.

POSTPAY

Tags

array<object>

A list of tags.

object

Key

string

The tag key.

test

Value

string

The tag value.

test

OrderType

string

Specifies who pays for the network instance. Valid values:

  • PayByCenOwner: The account that owns the Cloud Enterprise Network (CEN) instance pays the fees.

  • PayByResourceOwner: The account that owns the network instance pays the fees.

PayByCenOwner

ManagedService

string

The cloud service to which the resource belongs.

SAS

TransitRouterVPCAttachmentOptions

object

The feature attributes of the VPC connection. This parameter is deprecated. We recommend that you use the Options parameter instead.

string

  • ipv6Support: Indicates whether IPv6 is enabled. This setting defaults to the current IPv6 status of the VPC connection.

    • enable: IPv6 is enabled.

    • disable: IPv6 is disabled.

{ "ipv6Support": "disable" }

CenId

string

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

cen-j3jzhw1zpau2km****

Options

object

A collection of feature attributes.

Ipv6Support

string

Specifies whether IPv6 is enabled.

  • disable (default): IPv6 is disabled.

  • enable: IPv6 is enabled.

ApplianceModeSupport

string

Specifies whether appliance mode is enabled.

  • disable (default): Appliance mode is disabled.

  • enable: Appliance mode is enabled.

Examples

Success response

JSON format

{
  "NextToken": "FFmyTO70tTpLG6I3FmYAXGKPd****",
  "RequestId": "C97FF53F-3EF8-4883-B459-60E171924B23",
  "TotalCount": 1,
  "MaxResults": 20,
  "TransitRouterAttachments": [
    {
      "CreationTime": "2021-06-15T02:14Z",
      "Status": "Attached",
      "VpcId": "vpc-bp1h8vbrbcgohcju5****",
      "TransitRouterAttachmentId": "tr-attach-nls9fzkfat8934****",
      "TransitRouterId": "tr-bp1su1ytdxtataupl****",
      "ResourceType": "VPC",
      "TransitRouterAttachmentDescription": "testdesc",
      "VpcOwnerId": 1250123456123456,
      "VpcRegionId": "cn-hangzhou",
      "TransitRouterAttachmentName": "testname",
      "ZoneMappings": [
        {
          "ZoneId": "cn-hangzhou-h",
          "VSwitchId": "vsw-bp1a214sbus8z3b54****",
          "NetworkInterfaceId": "eni-bp149hmyaqegerml****"
        }
      ],
      "AutoPublishRouteEnabled": true,
      "ChargeType": "POSTPAY",
      "Tags": [
        {
          "Key": "test",
          "Value": "test"
        }
      ],
      "OrderType": "PayByCenOwner",
      "ManagedService": "SAS",
      "TransitRouterVPCAttachmentOptions": {
        "key": "{ \"ipv6Support\": \"disable\" }"
      },
      "CenId": "cen-j3jzhw1zpau2km****\n",
      "Options": {
        "Ipv6Support": "",
        "ApplianceModeSupport": ""
      }
    }
  ]
}

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.TransitRouterId The specified TransitRouterId is invalid. The error message returned because the specified transit router ID 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.MaxResults The specified MaxResults is illegal. MaxResults illegal.
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.