調用CreateVpcPeerConnection介面建立VPC對等串連。
介面說明
建立 VPC 對等串連前,您需要完成以下事項:
- CreateVpcPeerConnection 介面屬於非同步介面,即系統會先返回一個 InstanceId,但該 VPC 對等串連執行個體並未建立完成,系統背景建立任務仍在進行。您可以調用 GetVpcPeerConnectionAttribute 查詢 VPC 對等串連的狀態。
當 VPC 對等串連處於 Creating 狀態時,表示 VPC 對等串連正在建立中。
當 VPC 對等串連處於 Activated 狀態時,表示 VPC 對等串連建立完成。
當 VPC 對等串連處於 Accepting 狀態時,為跨帳號情境,跨帳號情境需要在接收端接收。
CreateVpcPeerConnection 介面不支援在同一個 VPC 下並發建立 VPC 對等串連。
建立 VPC 對等串連時,系統會為您自動開通非跨境雲資料轉送 CDT(Cloud DataTransfer)功能。
調試
您可以在OpenAPI Explorer中直接運行該介面,免去您計算簽名的困擾。運行成功後,OpenAPI Explorer可以自動產生SDK程式碼範例。
調試
授權資訊
|
操作 |
存取層級 |
資源類型 |
條件關鍵字 |
關聯操作 |
|
vpc:CreateVpcPeerConnection |
create |
*全部資源
|
無 | 無 |
請求參數
|
名稱 |
類型 |
必填 |
描述 |
樣本值 |
| RegionId |
string |
是 |
需要建立 VPC 對等串連的地區 ID。 您可以通過調用 DescribeRegions 介面擷取地區 ID。 |
cn-hangzhou |
| VpcId |
string |
是 |
需要建立 VPC 對等串連發起端的 VPC ID。 |
vpc-bp1gsk7h12ew7oegk**** |
| AcceptingAliUid |
integer |
是 |
需要建立的 VPC 對等串連接收端的阿里雲帳號(主帳號)ID。
說明
如果接收端的帳號為 RAM 使用者(子帳號),則 AcceptingAliUid 需要輸入該 RAM 使用者對應的阿里雲帳號 ID。 |
1210123456123456 |
| AcceptingRegionId |
string |
是 |
需要建立的 VPC 對等串連接收端的地區 ID。
|
cn-hangzhou |
| AcceptingVpcId |
string |
是 |
VPC 對等串連接收端的 VPC ID。 |
vpc-bp1vzjkp2q1xgnind**** |
| Name |
string |
否 |
需要建立的 VPC 對等串連名稱。 名稱長度為 2~128 個字元,以英文字母或中文開頭,可包含數字、底線(_)和短劃線(-)。 |
vpcpeer |
| Description |
string |
否 |
需要建立的 VPC 對等串連描述資訊。 長度為 2~256 個字元,必須以字母或中文開頭,但不能以 |
description |
| DryRun |
boolean |
否 |
是否只預檢此次請求。取值:
|
false |
| ClientToken |
string |
否 |
用戶端 Token,用於保證請求的等冪性。 由用戶端產生該參數值,要保證在不同請求間唯一,最大值不超過 64 個 ASCII 字元。 說明
若您未指定,則系統自動使用 API 請求的 RequestId 作為 ClientToken 標識。每次 API 請求的 RequestId 可能不一樣。 |
02fb3da4-130e-11e9-8e44-001**** |
| ResourceGroupId |
string |
否 |
資源群組 ID。 關於資源群組的更多資訊,請參見什麼是資源群組。 |
rg-acfmxazb4ph6aiy**** |
| Bandwidth |
integer |
否 |
需要建立的 VPC 對等串連的頻寬值,單位:Mbps,取值範圍為大於 0 的整數。 說明
如需指定該參數,請確保您建立的是跨地區的對等串連。 |
100 |
| LinkType |
string |
否 |
鏈路類型。 可選值為 Platinum(鉑金),Gold(金),預設為 Gold(金)。 說明
如需指定該參數,請確保您建立的是跨地區的對等串連。 |
Gold |
| Tag |
array<object> |
否 |
標籤資訊。 |
|
|
object |
否 |
標籤資訊。 |
||
| Key |
string |
否 |
資源的標籤鍵。至少輸入 1 個標籤鍵,最多支援輸入 20 個標籤鍵。一旦傳入該值,則不允許為空白字串。 最多支援 128 個字元,不能以 |
FinanceDept |
| Value |
string |
否 |
資源的標籤值。至少輸入 1 個標籤值,最多支援輸入 20 個標籤值。一旦傳入該值,可以為空白字串。 最多支援 128 個字元,不能以 |
FinanceJoshua |
返回參數
|
名稱 |
類型 |
描述 |
樣本值 |
|
object |
請求 ID。 |
||
| RequestId |
string |
請求 ID。 |
54B48E3D-DF70-471B-AA93-08E683A1B45 |
| InstanceId |
string |
建立的 VPC 對等串連的執行個體 ID。 |
pcc-lnk0m24khwvtkm**** |
樣本
正常返回樣本
JSON格式
{
"RequestId": "54B48E3D-DF70-471B-AA93-08E683A1B45",
"InstanceId": "pcc-lnk0m24khwvtkm****"
}
錯誤碼
|
HTTP status code |
錯誤碼 |
錯誤資訊 |
描述 |
|---|---|---|---|
| 400 | OperationFailed.CdtNotOpened | The operation failed because the Cdt service is not opened. | 建立操作失敗,因為未開通Cdt服務 |
| 400 | OperationFailed.CrossBorderCdtNotOpened | The operation failed because the CrossBorderCdt service is not opened. | 操作失敗,因為未開啟CrossBorderCdt服務。 |
| 400 | IncorrectStatus.Vpc | The status of %s [%s] is incorrect. | 發起端VPC執行個體狀態不正確。 |
| 400 | IncorrectStatus.AcceptingVpc | The status of %s [%s] is incorrect. | 接收端VPC狀態不正確。 |
| 400 | ResourceAlreadyExist.RouterInterface | The specified resource of %s already exists. | 指定的路由器介面已經存在 |
| 400 | ResourceAlreadyExist.VpcPeer | The specified resource of %s already exists. | 指定的VpcPeer已經存在 |
| 400 | OperationDenied.CloudBoxExistsInVpc | The operation is not allowed because the CloudBox device exists in vpc. | 在發起端VPC記憶體在雲盒執行個體,因此不允許建立VpcPeer執行個體。 |
| 400 | OperationDenied.CloudBoxExistsInAcceptingVpc | The operation is not allowed because the CloudBox device exists in accepting vpc. | 在接收端VPC記憶體在雲盒執行個體,因此不允許建立VpcPeer執行個體。 |
| 400 | QuotaExceeded.VpcPeerCountPerVpc | The quota of %s is exceeded, usage %s/%s. | 指定VPC中的VpcPeer數量超出限制 |
| 400 | UnsupportedRegion | The feature of %s is not supported in the region of %s. | VpcPeer特性在此地區不支援 |
| 400 | QuotaExceeded.VpcPeerCountPerUserPerRegion | The quota of %s is exceeded, usage %s/%s. | 單個地區內VpcPeer執行個體數量超過閾值。 |
| 400 | IncorrectBusinessStatus.VpcPeer | The business status of %s [%s] is incorrect. | 當前執行個體狀態異常,不允許進行當前操作 |
| 400 | OperationFailed.NotExist.ResourceGroup | The operation failed because the resource group does not exist. | 資源群組不存在,操作失敗。 |
| 400 | OperationFailed.AcceptUserCdtNotOpened | The operation failed because the Cdt service of accept user is not opened. | 對端Cdt服務未開通,操作失敗。 |
| 400 | OperationFailed.AcceptUserCrossBorderCdtNotOpened | The operation failed because the CrossBorderCdt service of accept user is not opened. | 對端跨境Cdt服務未開通,操作失敗。 |
| 400 | IncorrectBusinessStatus.AcceptUserVpcPeer | The business status of %s [%s] is incorrect. | 對端VpcPeer商業狀態異常。 |
| 400 | OperationFailed.ViolativeVpcPeer | The creation operation fails because it is not allowed to create a vpc peer instance between the originating region and the receiving region. | 建立操作失敗是因為不允許建立發起地區與接受地區之間的vpc peer執行個體。 |
| 400 | QuotaExceeded.CrossRegionVpcPeerCountPerVpc | The quota of %s is exceeded, usage %s/%s. | 指定VPC中的跨地區VpcPeer數量超出限制 |
| 400 | QuotaExceeded.IntraRegionVpcPeerCountPerVpc | The quota of %s is exceeded, usage %s/%s. | 指定VPC中的同地區VpcPeer數量超出限制 |
| 400 | OperationDenied.OperateShareResource | The operation is not allowed because of operating shared resource. | 操作共用資源導致操作失敗 |
| 400 | IncorrectBusinessStatus.AcceptVpcPeer | The business status of peer account is incorrect. | 對端VpcPeer商業狀態異常。 |
| 400 | OperationFailed.InterRegionLinkTypeNotSupported | The same region not supported link type feature. | 同地區不支援鏈路類型特性 |
| 400 | OperationFailed.RegionIdNotSupportLinkType | The feature link type is not supported in the region. | 地區不支援該特性金銀銅設定 |
| 400 | OperationFailed.SpecificLinkTypeNotSupported | The operation failed because the special link type of user is not opened. | 該帳號不支援特殊鏈路類型 |
訪問錯誤中心查看更多錯誤碼。
變更歷史
更多資訊,參考變更詳情。