全部產品
Search
文件中心

Cloud Enterprise Network:CreateTransitRouterPeerAttachment

更新時間:Jul 15, 2026

網路執行個體(VPC、VBR、IPsec 連線)被連線至轉發路由器後,如果要實現不同地域網路執行個體的互通,需要在網路執行個體連線的轉發路由器下建立跨地域連線,您可以呼叫 CreateTransitRouterPeerAttachment 介面為企業版轉發路由器執行個體建立跨地域連線。

介面說明

  • 企業版轉發路由器支援以下兩種頻寬分配方式:

    • 從頻寬包分配

      使用此種分配方式,您需要先購買頻寬包,從頻寬包中為跨地域連線分配頻寬。購買頻寬包具體操作,請參見 CreateCenBandwidthPackage

    • 按流量付費

      使用此種分配方式,您需要為跨地域連線設定限速頻寬,系統會按照跨地域連線實際使用的流量計費。具體計費資訊,請參見跨地域流量

  • CreateTransitRouterPeerAttachment 介面屬於非同步介面,即系統會先返回一個跨地域連線 ID,但該跨地域連線並未建立完成,系統背景的建立任務仍在進行。您可以呼叫 ListTransitRouterPeerAttachments 介面查詢跨地域連線的狀態。

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

    • 當跨地域連線處於 Attached 狀態時,表示跨地域連線建立完成。

調試

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

調試

授權資訊

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

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

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

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

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

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

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

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

操作

存取層級

資源類型

條件關鍵字

關聯操作

cen:CreateTransitRouterPeerAttachment

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-j3jzhw1zpau2km****

TransitRouterId

string

本端企業版轉發路由器執行個體 ID。

tr-bp1su1ytdxtataupl****

RegionId

string

本端企業版轉發路由器執行個體所屬地域 ID。

您可以透過呼叫 DescribeRegions 介面取得地域 ID。

cn-hangzhou

TransitRouterAttachmentName

string

跨地域連線的名稱。

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

testname

TransitRouterAttachmentDescription

string

跨地域連線的描述資訊。

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

testdesc

PeerTransitRouterId

string

對端轉發路由器執行個體 ID。

tr-m5eq27g6bndum7e88****

PeerTransitRouterRegionId

string

對端轉發路由器執行個體所屬地域 ID。

cn-qingdao

AutoPublishRouteEnabled

boolean

是否使企業版轉發路由器自動發佈跨地域連線的路由到對端地域。

  • false(預設值):否。

  • true:是。

false

Bandwidth

integer

跨地域連線的頻寬值。單位:Mbps。

  • BandwidthType 取值為 BandwidthPackage 時,該參數表示跨地域連線可使用的頻寬值。

  • BandwidthType 取值為 DataTransfer 時,該參數表示跨地域連線的限速頻寬值。

2

CenBandwidthPackageId

string

跨地域連線要綁定的頻寬包 ID。

說明

BandwidthType 取值為 DataTransfer 時,無需設定該項。

cenbwp-3xrxupouolw5ou****

DryRun

boolean

是否對此次請求執行預檢,包括權限、執行個體狀態驗證等。取值:

  • false(預設值):傳送正常請求,通過檢查後直接建立跨地域連線。

  • true:傳送檢查請求,只進行驗證,不會建立跨地域連線。檢查項目包括是否填寫了必需參數、請求格式等。如果檢查不通過,則返回對應錯誤。如果檢查通過,則返回對應請求 ID。

false

BandwidthType

string

跨地域連線的頻寬分配方式。取值:

  • BandwidthPackage:從頻寬包中分配頻寬。

  • DataTransfer:不為跨地域連線分配頻寬,按使用流量計費。

BandwidthPackage

Tag

array<object>

標籤資訊。

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

object

Key

string

資源的標籤鍵。

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

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

tag_A1

Value

string

資源的標籤值。

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

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

value_A1

DefaultLinkType

string

預設鏈路類型。

可選值為 Platinum(鉑金),Gold(金),預設為 Gold(金)。

且僅在頻寬分配方式是按流量計費時,才可以設定為 Platinum(鉑金)。

Gold

返回參數

名稱

類型

描述

樣本值

object

返回結果。

TransitRouterAttachmentId

string

跨地域連線 ID。

tr-attach-nwkiqfvw22qesz****

RequestId

string

請求 ID。

59422BF5-BAAD-4CFD-9019-9557BD3ACFA3

樣本

正常返回樣本

JSON格式

{
  "TransitRouterAttachmentId": "tr-attach-nwkiqfvw22qesz****",
  "RequestId": "59422BF5-BAAD-4CFD-9019-9557BD3ACFA3"
}

錯誤碼

HTTP status code

錯誤碼

錯誤資訊

描述

400 OperationUnsupported.TransitRouterRegionId The specified TransitRouterRegion does not support the operation.
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 InvalidTransitRouterId.NotFound TransitRouterId is not found. 參數中指定的 TransitRouterId 不存在。
400 IllegalParam.PeerTransitRouterId PeerTransitRouterId is illegal. 跨地域連線時,對端的轉送路由器 ID 無效。
400 OperationUnsupported.TransitRouterId TransitRouterId is unsupported. 轉發路由器類型是基礎版時不支援。
400 MissingParam.Bandwidth The parameter Bandwidth is mandatory. 頻寬值參數是必需的。
400 IllegalParam.Bandwidth Bandwidth is illegal. 頻寬套件 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 OperationUnsupported.BandwidthType The specified BandwidthType does not support the operation. 目前的 BandwidthType 不支援此操作。
400 InvalidCenId.NotFound CenId is not found. 參數中指定的 CenId 不存在。
400 IllegalParam.BandwidthType BandwidthType is illegal. 頻寬套件類型不合法。
400 MissingParam.CenIdOrRegionId Either CenId or RegionId must be specified. CenId 或 RegionId 是必選參數。
400 OperationUnsupported.BandwidthHS This bandwidth limit can only be set in China-AsiaPacific-HS
400 OperationUnsupported.CenFullLevel CEN full level does not support TransitRouter Full 模式的 CEN 不支援 VPN Bpg。
400 OperationUnsupported.CloudDataTransferService CCN region not support cloud data transfer service. CCN 地域中不支援 cloud data transfer 服務。
400 InvalidPeerTransitRouterId.NotFound The specified PeerTransitRouterId is not found. 參數中指定的 PeerTransitRouterId 不存在。
400 IllegalParam.RegionId RegionId is illegal. 參數中指定的 Region 無效。
400 IllegalParam.PeerRegionId PeerRegionId is illegal. 參數中指定的 PeerRegionId 無效。
400 IllegalParam.TransitRouterRegionId TransitRouterRegionId is illegal. TransitRouterRegionId 不合法。
400 InvalidOperation.CenInstanceStatus The CEN instance is not in a valid state for the operation.
400 IncorrectStatus.TransitRouter The status of TransitRouter is incorrect. 目前 TR 的狀態不支援此操作,請稍後重試。
400 InvalidOperation.BwpNotAssociated Operation is invalid because a bandwidth package corresponding to the geographic span is not associated. 與地域對應的頻寬包未關聯,無法操作。
400 InvalidOperation.BwpBusinessStatus The CBN bandwidth package is not in a valid business state for the operation. 頻寬包未處於穩定狀態,無法操作。
400 IllegalParam.CenBandwidthPackageId Parameter CenBandwidthPackageId is illegal. 參數中指定的 CenBandwidthPackageId 不合法。
400 InvalidOperation.BwpBandwidthExceeded Operation is invalid because the total bandwidth limit has exceeded that of the bandwidth package.
400 ParameterIllegal.CdtDefaultLinkTypeOnlySupportPlatinumOrGold DataTransfer only support Platinum and Gold. 頻寬分配方式為按流量計費時,預設連結類型僅支援鉑金(Platinum)和金(Gold)。
400 ParameterIllegal.BandwidthPackageDefaultLinkTypeOnlySupportGold Cen bandwidthPackage only support Gold. 頻寬分配方式為頻寬包時,預設連結類型僅支援金(Gold)。
400 ParameterIllegal.CdtDefaultLinkTypeOnlySupportGold CDT only support Gold when both transitrouters for cross regional connections are not all enterprise version. 當跨地域連線的兩端轉發路由器不全是企業版且頻寬分配方式為按流量計費時,預設連結類型僅支援金(Gold)。
400 OperationNotAllowed.DefaultLinkTypeOnlySupportGold Operation is not allowed because this user can only set default link type to Gold. 本使用者只能設定預設鏈路類型為金。
400 OperationInvalid.UserCanNotBuyCrossBorderBwp According to the laws and regulations of the operator and mainland China, you are currently not eligible to purchase or renew a cross-border bandwidth package. Please contact online customer service or your business manager for consultation. 根據營運商及中國大陸法律法規的要求,您目前暫不符合購買/續約跨境頻寬包條件,請聯絡線上客服或您的商務經理諮詢處理。
400 OperationInvalid.IdentityRegistrationStatusNotSupport Real name registration of enterprises required. 因您在「地域」或「對端地域」選擇了「中國內地」的地域,您需要是企業使用者且已完成企業實名登記,才能繼續購買。關於如何進行企業實名登記,請檢視實名認證文件。
400 InvalidOperation.OnlyOneRegionSupportIpv6 Peer Attachment is only allowed when both regions support IPv6 or do not support IPv6 at all. 只有當兩端地域均支援或均不支援 IPv6 時,才可以建立跨地域連線。
400 InvalidOperation Operation is invalid. 非法操作。
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 OperationUnsupported.RegionId The specified RegionId does not support the operation. 目前區域不支援此操作。
400 QuotaExceeded.Bandwidth Bandwidth quota exceeded. 頻寬值超出配額限制。
400 InvalidParameter Invalid parameter. 參數不合法。
400 Unauthorized The AccessKeyId is unauthorized. 帳號無權限操作。
400 InvalidParameter.PeerTransitRouterId The specified parameter PeerTransitRouterId is invalid.
400 InvalidParameter.ResourceType The specified parameter ResourceType is invalid.
400 ParameterIllegal.CdtDefaultLinkTypeOnlySupportUnderlaySilver CDT only support UnderlaySilver when both transitrouters for cross regional connections are not all enterprise version. 當跨地域連線的兩端轉送路由器不全是企業版且頻寬分配方式為按流量計費時,預設連結類型僅支援銀(UnderlaySilver)。
400 ParameterIllegal.DefaultLinkTypeOnlySupportUnderlaySilver Cen bandwidthPackage only support UnderlaySilver. 頻寬分配方式為頻寬套件時,預設連結類型僅支援銀(UnderlaySilver)。
400 OperationNotAllowed.DefaultLinkTypeOnlySupportUnderlaySilver This user can only set the default link type to UnderlaySilver. 本使用者只能設定預設連結類型為銀(UnderlaySilver)。
400 OperationFailed.ValidateVbrInstanceFailedForLowLatencyCircuit Operation failed when validate VBR instance for Low Latency Circuit. 建立低延遲鏈路時驗證載入的VBR執行個體失敗。
400 InvalidParameter.TagValue The specified parameter TagValue is invalid. 輸入的參數 Tag Value 不合法。

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

變更歷史

更多資訊,參考變更詳情