全部產品
Search
文件中心

:CreateTransitRouterEcrAttachment - 在企業版轉寄路由器下建立專線網關ECR串連

更新時間:Aug 07, 2025

您可以調用CreateTransitRouterEcrAttachment介面將要互連的專線網關ECR(ExpressConnect Router)網路執行個體串連到同地區的轉寄路由器執行個體中。

介面說明

  • 僅企業版轉寄路由器支援建立 ECR 串連。

  • 您可以通過以下兩種方式在企業版轉寄路由器下建立 ECR 串連:

    • 如果您已經在目標地區建立了企業版轉寄路由器執行個體,您可以通過指定 EcrIdRegionIdTransitRouterId 建立 ECR 串連。

    • 如果您在目標地區沒有企業版轉寄路由器執行個體,您可以通過指定 EcrIdCenIdRegionId 建立 ECR 串連。建立 ECR 串連時系統為您自動建立企業版轉寄路由器執行個體。

  • CreateTransitRouterEcrAttachment 介面屬於非同步介面,即系統會先返回一個 ECR 串連 ID,但該 ECR 串連並未建立完成,系統背景建立任務仍在進行。您可以調用 ListTransitRouterEcrAttachments 介面查詢 ECR 串連的狀態。

    • 當 ECR 串連處於 Attaching 狀態時,表示 ECR 串連正在建立中,在該狀態下,您只能對 ECR 串連執行查詢操作,不能執行其他動作。

    • 當 ECR 串連處於 Attached 狀態時,表示 ECR 串連建立完成。

  • 建立 ECR 串連後,ECR 串連預設不與任何企業版轉寄路由器路由表建立路由學習關係和關聯轉寄關係。

    當 ECR 串連與企業版轉寄路由器路由表建立路由學習關係後,系統會自動將 ECR 執行個體的路由傳播至企業版轉寄路由器路由表中。

  • 建立 ECR 串連後,系統自動將 ECR 串連關聯的企業版轉寄路由器路由表中的路由傳播到 ECR 執行個體的路由表中。

前提條件

  • 企業版轉寄路由器所屬的阿里雲帳號和 ECR 執行個體所屬的阿里雲帳號屬於同一家企業。

  • 企業版轉寄路由器支援串連同帳號和跨帳號的 ECR 執行個體。在建立跨帳號的 ECR 串連前,請先獲得跨帳號 ECR 執行個體的授權。具體操作,請參見跨帳號網路執行個體授權

  • 調用本介面建立 ECR 串連前,請先調用 CreateExpressConnectRouterAssociation 介面為 ECR 執行個體和企業版轉寄路由器執行個體建立關聯關係。

    當您調用 DeleteTransitRouterEcrAttachment 介面強制移除 ECR 串連時,系統將會一併刪除 ECR 執行個體和企業版轉寄路由器執行個體間的關聯關係,無需再額外刪除。

調試

您可以在OpenAPI Explorer中直接運行該介面,免去您計算簽名的困擾。運行成功後,OpenAPI Explorer可以自動產生SDK程式碼範例。

調試

授權資訊

下表是API對應的授權資訊,可以在RAM權限原則語句的Action元素中使用,用來給RAM使用者或RAM角色授予調用此API的許可權。具體說明如下:

  • 操作:是指具體的許可權點。

  • 存取層級:是指每個操作的存取層級,取值為寫入(Write)、讀取(Read)或列出(List)。

  • 資源類型:是指操作中支援授權的資源類型。具體說明如下:

    • 對於必選的資源類型,用前面加 * 表示。

    • 對於不支援資源級授權的操作,用全部資源表示。

  • 條件關鍵字:是指雲產品自身定義的條件關鍵字。

  • 關聯操作:是指成功執行操作所需要的其他許可權。操作者必須同時具備關聯操作的許可權,操作才能成功。

操作

存取層級

資源類型

條件關鍵字

關聯操作

cen:CreateTransitRouterEcrAttachment

create

*CenInstance

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

TransitRouter

acs:cen:*:{#accountId}:centransitrouter/{#TransitRouterId}

請求參數

名稱

類型

必填

描述

樣本值

ClientToken

string

用戶端 Token,用於保證請求的等冪性。

從您的用戶端產生一個參數值,確保不同請求間該參數值唯一。ClientToken 只支援 ASCII 字元。

說明

若您未指定,則系統自動使用 API 請求的 RequestId 作為 ClientToken 標識。每次 API 請求的 RequestId 不一樣。

02fb3da4-130e-11e9-8e44-001****

CenId

string

雲企業網執行個體 ID。

cen-7qthudw0ll6jmc****

TransitRouterId

string

轉寄路由器執行個體 ID。

tr-bp1su1ytdxtataupl****

RegionId

string

轉寄路由器執行個體所屬的地區 ID。

您可以通過調用 DescribeChildInstanceRegions 介面擷取地區 ID。

eu-central-1

TransitRouterAttachmentName

string

ECR 串連的名稱。

名稱可以為空白或長度為 1~128 個字元,不能以 http://或 https://開頭。

nametest

TransitRouterAttachmentDescription

string

ECR 串連描述。

描述可以為空白或長度為 1~256 個字元,不能以 http://或 https://開頭。

testdesc

EcrId

string

關聯的專線網關執行個體 ID。

ecr-upyc0viial107r****

EcrOwnerId

integer

ECR 執行個體所屬阿里雲帳號(主帳號)ID。預設值為當前登入的阿里雲帳號 ID。

說明

如果您要載入跨帳號的網路執行個體,本參數必填。

1250123456123456

DryRun

boolean

是否只預檢此次請求。取值:

  • true:發送檢查請求,不會修改 VPN 串連的配置。檢查項包括是否填寫了必需參數、請求格式、業務限制。如果檢查不通過,則返回對應錯誤。如果檢查通過,則返回錯誤碼DryRunOperation

  • false(預設值):發送正常請求,通過檢查後直接修改 VPN 串連的配置。

false

Tag

array<object>

標籤資訊列表。

一次最多支援輸入 20 個標籤資訊。

object

Key

string

資源的標籤鍵。

一旦傳入該值,則不允許為空白字串。最多支援 64 個字元,不能以aliyun或者acs:開頭,不能包含http://或者https://

一次最多支援輸入 20 個標籤的標籤鍵。

tagtest

Value

string

資源的標籤值。

標籤值可以為空白或輸入不超過 128 個字元的字串,不能以aliyun或者acs:開頭,不能包含http://或者https://

每一個標籤鍵對應一個標籤值,一次最多支援輸入 20 個標籤鍵對應的標籤值。

tagtest

返回參數

名稱

類型

描述

樣本值

object

TransitRouterAttachmentId

string

ECR 串連 ID。

tr-attach-qieks13jnt1cchy***

RequestId

string

請求 ID。

C0245BEF-52AC-44A8-A776-EF96FD26A5CA

樣本

正常返回樣本

JSON格式

{
  "TransitRouterAttachmentId": "tr-attach-qieks13jnt1cchy***",
  "RequestId": "C0245BEF-52AC-44A8-A776-EF96FD26A5CA"
}

錯誤碼

HTTP status code

錯誤碼

錯誤資訊

描述

400 NoPermission.AliyunServiceRolePolicyForCEN You are not authorized to create the service linked role. Role Name: AliyunServiceRolePolicyForCEN. Service Name: cen.aliyuncs.com. Make sure that the user has been granted the ram:CreateServiceLinkedRole permission. 您沒有許可權建立服務關聯角色,角色名稱:AliyunServiceRolePolicyForCEN,服務名:cen.aliyuncs.com。請確保已授予目前使用者ram:CreateServiceLinkedRole許可權。
400 OperationUnsupported.TransitRouterRegionId The specified TransitRouterRegion does not support the operation.
400 InvalidCenId.NotFound CenId is not found. CEN執行個體不存在。
400 InvalidStatus.ResourceStatus The resource is not in a valid state for the attachment operation. 當前資源狀態不支援該操作,請稍後重試。
400 InvalidTransitRouterId.NotFound TransitRouterId is not found. 轉寄路由執行個體ID不存在。
400 Forbbiden.TransitRouterServiceNotOpen The user has not open transit router service. 轉寄路由器服務未開啟,請開啟後重試。
400 OperationUnsupported.TransitRouterType The specified TransitRouterType does not support the operation. 當前TransitRouter類型不支援該操作。
400 MissingParam.CenIdOrRegionId Either CenId or RegionId must be specified. CenId或者RegionId是必選參數。
400 IllegalParam.AssociateRouteTableId The specified AssociateRouteTableId is illegal. 參數中指定的AssociateRouteTableId不合法。
400 Forbbiden.AttachChildInstanceAcrossBid Operation is invalid, please apply for cross-bid attaching.
400 IllegalParam.RegionId RegionId is illegal. 參數中指定的Region不合法。
400 OperationUnsupported.CenFullLevel CEN full level does not support TransitRouter Full類型CEN不支援建立企業版轉寄路由器。
400 InvalidOperation.CenInstanceStatus The CEN instance is not in a valid state for the operation.
400 IncorrectStatus.TransitRouter The status of TransitRouter is incorrect. 當前TransitRouter的狀態不支援該操作,請稍後重試。
400 QuotaFull.ChildInstanceRelatedCen The childinstance has exceed the quota of the times that a childinstance can be attached as an attachment. 該執行個體綁定CEN數量已達到上限,無法載入。
400 Forbidden.ResourceOwnerTransitRouterServiceNotOpen The resource owner user has not opened transit router service. 資源所屬帳號轉寄路由器服務未開通,請通知對方開通後重試。
400 OperationUnsupported.BandwidthType The specified BandwidthType does not support the operation. 當前BandwidthType不支援該操作。
400 IllegalParam.BandwidthType BandwidthType is illegal. 頻寬包類型不合法。
400 IncorrectStatus.EcrResource The ECR resource is not in a valid state for the attachment operation. ECR資源狀態非法。
400 QuotaExceeded.CenQuotaEcrAttachPerTransitRouter The maximum number of ECR attachment per Transit Router is exceeded. 轉寄路由器下的ECR串連數量超限。
400 OperationUnsupported.ECRAttachment ECR Attachment is not supported. 不支援ECR Attachment。
400 InvalidTransitRouterMode.NeedUpgrade TransitRouter need to upgrade. 當前轉寄路由器模式不支援。
400 ResourceNotFound The resource does not found. 資源不存在。
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 Forbbiden.AttachAcrossBidEcr Attach cross bid ECR is unsupported. Please submit a ticket. 不允許綁定不同Bid帳號下的ECR,請提交工單申請。
400 InvalidParameter Invalid parameter. 參數不合法。
400 Unauthorized The AccessKeyId is unauthorized. 帳號無許可權操作。
400 InvalidParameter.ResourceType The specified parameter ResourceType is invalid.
400 SystemBusy The system is busy. Please try again later. 當前系統繁忙,請稍後重試。
400 OperationDenied.AttachmentInCurrentRegionExisted The current operation is rejected. The Express Connect Router instance can only associate one Transit Router in the same region.

訪問錯誤中心查看更多錯誤碼。

變更歷史

更多資訊,參考變更詳情