CreateTransitRouterVpcAttachment_云企业网_API文档

插件下载了解更多
VS Code 插件
安装插件之前,确保已安装 VS Code安装插件之前,确保已安装 VS Code
Alibaba Cloud Developer Toolkit is a collection of extensions that can help access Alibaba Cloud services in Visual Studio Code.
JetBrains 插件
安装插件之前,确保已安装 JetBrains IDE安装插件之前,确保已安装 JetBrains IDE
The Alibaba Cloud Developer Toolkit for JetBrains makes it easier to access Alibaba Cloud services.

接口说明

  • 您可以通过以下两种方式在企业版转发路由器下创建 VPC 连接:

    • 如果您已经在目标地域创建了企业版转发路由器实例,您可以通过指定 VpcIdZoneMappings.N.VSwitchIdZoneMappings.N.ZoneIdTransitRouterIdRegionId 创建 VPC 连接。
    • 如果您在目标地域没有企业版转发路由器实例,您可以通过指定 VpcIdZoneMappings.N.VSwitchIdZoneMappings.N.ZoneIdCenIdRegionId 创建 VPC 连接。创建 VPC 连接时系统为您自动创建企业版转发路由器实例。
  • CreateTransitRouterVpcAttachment 接口属于异步接口,即系统会先返回一个 VPC 连接 ID,但该 VPC 连接并未创建完成,系统后台的创建任务仍在进行。您可以调用 ListTransitRouterVpcAttachments 接口查询 VPC 连接的状态。

    • 当 VPC 连接处于 Attaching 状态时,表示 VPC 连接正在创建中,在该状态下,您只能对 VPC 连接执行查询操作,不能执行其他操作。
    • 当 VPC 连接处于 Attached 状态时,表示 VPC 连接创建完成。
  • 创建 VPC 连接后,VPC 连接默认不与任何转发路由器路由表建立路由学习关系和关联转发关系。

前提条件

在调用本接口创建 VPC 连接前,请确保满足以下条件:

  • VPC 实例在企业版转发路由器支持的可用区拥有至少一个交换机实例,且该交换机实例拥有至少一个空闲的 IP 地址。关于企业版转发路由器支持的地域和可用区信息,请参见企业版转发路由器支持的地域和可用区
  • 如果您要连接跨账号的网络实例,请先获得跨账号网络实例授权。具体操作,请参见跨账号网络实例授权
  • VPC 连接创建后会产生费用,请确保您已经了解相关计费规则。更多信息,请参见计费说明

流控信息

当前云产品API请求速率暂未透出。

授权信息

如下是此API对应的授权信息,用于RAM权限策略语句的Action元素中,为RAM用户或RAM角色授予调用此API的权限。请通过 RAM 访问控制设置,使用方法可参考访问控制帮助文档

具体说明如下:展开详情

操作访问级别资源类型条件关键字关联操作
cen:CreateTransitRouterVpcAttachment
Create
CenInstance
acs:cen:*:{#accountId}:ceninstance/{#ceninstanceId}
TransitRouter
acs:cen:*:{#accountId}:centransitrouter/{#TransitRouterId}

请求参数

字段名称字段详情
ClientTokenstring

客户端 Token,用于保证请求的幂等性。展开详情

示例值:02fb3da4-130e-11e9-8e44-001****
CenIdstring

云企业网实例 ID。

示例值:cen-j3jzhw1zpau2km****参考取值来源:
    CreateCen
TransitRouterIdstring

企业版转发路由器实例 ID。

示例值:tr-bp1su1ytdxtataupl****参考取值来源:
    ListTransitRouters
    CreateTransitRouter
RegionIdstring

VPC 实例所属地域 ID。展开详情

示例值:cn-hangzhou参考取值来源:
    DescribeChildInstanceRegions
TransitRouterAttachmentNamestring

VPC 连接的名称。展开详情

示例值:testname参考取值来源:
    ListTransitRouterPeerAttachments
TransitRouterAttachmentDescriptionstring

VPC 连接的描述信息。展开详情

示例值:testname
VpcIdstring

VPC 实例 ID。

示例值:vpc-bp1kbjcre9vtsebo1****
VpcOwnerIdinteger<int64>

VPC 实例所属阿里云账号(主账号)ID。默认值为当前登录的阿里云账号 ID。展开详情

注意 该字段类型为 Long,在序列化/反序列化的过程中可能导致精度丢失,请注意数值不得大于 9007199254740991。
示例值:1250123456123456
ChargeTypestring

付费方式。默认值:POSTPAY,表示按量付费。

示例值:POSTPAY
DryRunboolean

是否对此次请求执行预检,包括权限、实例状态校验等。取值:展开详情

示例值:false
ZoneMappingsarray<object>

请在企业版转发路由器的可用区中选择一个交换机实例。展开详情

子级条数 <= 10
AutoPublishRouteEnabledboolean

是否使企业版转发路由器自动发布路由到 VPC 实例。展开详情

示例值:true
TransitRouterVPCAttachmentOptionsmap<string>

VPC 连接的功能属性列表。

Tagarray<object>

标签列表。展开详情

子级条数 <= 20

返回参数

字段名称字段详情
TransitRouterAttachmentIdstring

VPC 连接 ID。

示例值:tr-attach-ia340z7xis7t5s****
RequestIdstring

请求 ID。

示例值:C087A369-82B9-43EF-91F4-4B63A9C6E6B6

返回示例

错误码

全局错误码
HTTP 状态码错误码错误信息操作
400
OperationUnsupported.TransitRouterRegionId
The specified TransitRouterRegion does not support the operation.诊断
400
NoPermission.AliyunServiceRoleForCEN
You are not authorized to create the service linked role. Role Name: AliyunServiceRoleForCEN. Service Name: cen.aliyuncs.com. Make sure that the user has been granted the ram:CreateServiceLinkedRole permission.诊断
400
IllegalParam.RegionId
The Specified Parameter RegionId is illegal诊断
400
MissingParam.CenIdOrRegionId
Either CenId or RegionId must be specified.诊断
400
IllegalParam.ZoneId
The specified ZoneId is illegal.诊断
400
IllegalParam.ChargeType
The specified ChargeType is illegal.诊断
400
InvalidTransitRouterId.NotFound
The specified TransitRouterId is not found.诊断
400
IncorrectStatus.VpcResource
The resource is not in a valid state for the attachment operation.诊断
400
IncorrectStatus.Vpc
The resource is not in a valid state for the attachment operation.诊断
400
IncorrectStatus.VpcOrVswitch
The Vpc Or Vswith is not in a valid state for the attachment operation.诊断
400
OperationNotSupport.VpcAutoRoutesPublish
Auto publish vpc routes is not supported in this region.诊断
400
InvalidOperation.VpnAssociated
The operation is not supported because the VPC is associated with VPN.诊断
400
Forbbiden.TransitRouterServiceNotOpen
The user has not open transit router service.诊断
400
IllegalParam.ZoneMappings
The Specified Parameter ZoneMappings is illegal诊断
400
OperationUnsupported.TransitRouterType
The specified TransitRouterType does not support the operation.诊断
400
InvalidCenId.NotFound
CenId is not found.诊断
400
IllegalParam.VSwitchId
VSwitchId is illegal.诊断
400
IncorrectStatus.TransitRouterInstance
The status of TransitRouter is incorrect.诊断
400
OperationUnsupported.CenFullLevel
CEN full level does not support TransitRouter诊断
400
IllegalParam.ServiceMode
ServiceMode is illegal.诊断
400
QuotaFull.ChildInstanceRelatedCen
The childinstance has exceed the quota of the times that a childinstance can be attached as an attachment.诊断
400
OperationUnsupported.CloudBoxVswNotSupport
Cloud Box vsw does not support.诊断
400
IncorrectStatus.TransitRouter
The status of TransitRouter is incorrect.诊断
400
Duplicated.ZoneMapping
The parameter ZoneMapping is duplicated.诊断
400
QuotaExceeded.CenQuotaVpcAttachPerTransitRouter
The maximum number of VPC attachment per Transit Router is exceeded.诊断
400
IncorrectStatus.VpcRouteTable
The VPC route table is not in a desired state.诊断
400
InvalidStatus.VpcAttachedFullModeCen
The VPC has been attached to another CEN instance whose protection level is FULL.诊断
400
Forbbiden.AttachChildInstanceAcrossBid
VPCs that belong to another BID cannot be associated. You need to apply for cross-BID attaching.诊断
400
InvalidOperation.VpcAutoRoutesPublishInOtherCEN
The specified VPC already has its routes synchronized with another CEN instance.诊断
400
QuotaExceeded.VpcAutoRoutesPublishPerTransitRouter
The number of VPCs that have route synchronization enabled has reached the upper limit.诊断
400
InsufficientIpAddr.vsw
Insufficient available IP addresses in the vSwitch.诊断
400
Forbidden.ResourceOwnerTransitRouterServiceNotOpen
The resource owner user has not opened transit router service.诊断
400
IllegalParam.TransitRouterRegionId
TransitRouterRegionId is illegal.诊断
400
InvalidTransitRouterMode.NeedUpgrade
TransitRouter need to upgrade.诊断
400
IllegalParam.Ipv6Support
Ipv6Support is illegal. Valid Values are [enable, disable].诊断
400
OperationFailed.VSwitchNotFound
The specified vswitch not found.诊断
400
OperationFailed.VSwitchIpv6CidrNotAllocated
The specified vswitch does not have IPv6 address allocated.诊断
400
Forbidden.ResourceOwnerTransitRouterServiceExpired
The transit router service of the account to which the resource belongs has been suspended due to arrears. Please notify the other party to renew the service and try again.诊断
400
Forbidden.TransitRouterServiceExpired
The transit router service is out of service.诊断
400
InvalidParameter
Invalid parameter.诊断
400
Unauthorized
The AccessKeyId is unauthorized.诊断
404
InvalidVSwitchId.NotFound
The specified VSwitchId is not found.诊断
409
InvalidOperation.CenInstanceStatus
The CEN instance is not in a valid state for the operation.诊断
409
IncorrectStatus.VpcSwitch
The resource is not in a valid state for the attachment operation.诊断

变更历史

变更时间变更内容概要操作
2024-10-28
变更错误码400
2024-09-10
新增请求参数TransitRouterVPCAttachmentOptions
2024-04-19
变更错误码400
2024-03-13
变更错误码400
2024-01-10
变更错误码400
2023-09-08
变更错误码409
2023-03-14
变更错误码400
  • 1
  • 2
  • 10 条/页

相关示例

创建企业版转发路由器并创建VBR、VPC连接,查询TR实例信息
2021-12-24