Create peering connections
Updated at:2025-10-16
Description
Create peering connections.
- For peering connections with the same local and peer regions, only postpay is supported;
- Cross-account peering connections become available only after acceptance by the receiving end;
- For peering connections under the same account, the system will trigger automatic acceptance by the peer;
- Only one peering connection can exist between any two VPCs;
- The VPCs of initiator and acceptor cannot be the same;
- If both local VPC and peer VPC are relay VPCs, peering connections cannot be established;
Request structure
Plain Text
1POST /v{version}/peerconn?clientToken={clientToken} HTTP/1.1
2Host: bcc.bj.baidubce.com
3Authorization: authorization string
4{
5 "bandwidthInMbps" : bandwidthInMbps,
6 "description" : description,
7 "localIfName" : localIfName,
8 "localVpcId" : localVpcId,
9 "peerAccountId": peerAccountId,
10 "peerVpcId" : peerVpcId,
11 "peerRegion" : peerRegion,
12 "peerIfName" : peerIfName,
13 "billing": {
14 "paymentTiming": paymentTiming,
15 "reservation": {
16 "reservationLength": reservationLength,
17 "reservationTimeUnit": reservationTimeUnit
18 }
19 },
20 "tags":[
21 {
22 "tagKey": tagKey,
23 "tagValue": tagValue
24 }
25 ],
26 "resourceGroupId": resourceGroupId,
27 "deleteProtect": deleteProtect
28}
Request headers
There are no special headers required beyond the common headers.
Request parameters
| Parameter name | Types | Whether required | Parameter location | Description |
|---|---|---|---|---|
| version | String | Yes | URL parameter | API version number, current value is 1. |
| clientToken | String | Yes | Query | Idempotence token, which is an ASCII string with a length not exceeding 64 bits, see details in [ClientToken Idempotence Support](VPC/API Reference/General Description.md#Idempotence) |
| bandwidthInMbps | Integer | Yes | RequestBody | Bandwidth of peering connection |
| description | String | No | RequestBody | Remark for peering connection |
| localIfName | String | No | RequestBody | Local API name |
| localVpcId | String | Yes | RequestBody | Local VPC ID |
| peerAccountId | String | No | RequestBody | Peer account ID, required only when establishing cross-account peering connections |
| peerVpcId | String | Yes | RequestBody | ID of peer VPC for peering connection |
| peerRegion | String | Yes | RequestBody | Peer region of peering connection |
| peerIfName | String | No | RequestBody | Peer API name of the peering connection, only configurable for peering connections under this account |
| billing | [Billing](VPC/API Reference/Appendix.md#Billing) | Yes | RequestBody | Billing information |
| tags | List<[TagModel](VPC/API Reference/Appendix.md#tagmodel)> | No | RequestBody | List of tag key-value pairs to be created |
| resourceGroupId | String | No | RequestBody | Resource group ID |
| deleteProtect | Boolean | No | RequestBody | Option to enable release protection. By default, it is set to false, allowing deletion. |
Response headers
No special headers are required beyond the standard ones.
Response parameters
| Parameter name | Types | Description |
|---|---|---|
| peerConnId | String | ID of peering connection created |
Request example - current account
Plain Text
1POST /v1/peerconn?clientToken=be31b98c-5e51-48e8-9830-9be700de5a20 HTTP/1.1
2Host: bcc.bj.baidubce.com
3Authorization: bce-auth-v1/930192808c0c11e8b62ccf3a4a052967/2018-07-20T11:06:43Z/3600/host;x-bce-account;x-bce-client-ip;x-bce-date;x-bce-request-id;x-bce-security-token/749f35181233d0f744f30e77457dc605c6eed31c9a45856e2bf8c415245d9af1
4{
5 "bandwidthInMbps":500,
6 "description":"peer_same_account",
7 "localIfName":"localIfName",
8 "localVpcId":"vpc-13vuxu016dew",
9 "peerVpcId":"vpc-jcvmhw9h1a35",
10 "peerRegion":"bj",
11 "peerIfName":"peerIfName",
12 "billing":{
13 "paymentTiming":"Postpaid"
14 },
15 "tags":[
16 {
17 "tagKey": "tagKey",
18 "tagValue": "tagValue"
19 }
20 ],
21 "resourceGroupId": "RESG-UoMgbkuLNjj"
22}
Request example - cross-account
Plain Text
1POST /v1/peerconn?clientToken=be31b98c-5ss1-4638-9530-9be700de5a20 HTTP/1.1
2Host: bcc.bj.baidubce.com
3Authorization: bce-auth-v1/930192808c0c11e8b62ccf3a4a052967/2018-07-20T11:06:43Z/3600/host;x-bce-account;x-bce-client-ip;x-bce-date;x-bce-request-id;x-bce-security-token/749f35181233d0f744f30e77457dc605c6eed31c9a45856e2bf8c415245d9af1
4{
5 "bandwidthInMbps":500,
6 "description":"peer_diff_account",
7 "localIfName":"sss",
8 "localVpcId":"vpc-zuqfiksbu5cu",
9 "peerAccountId":"7058ff6052254a679f5714548feda935",
10 "peerVpcId":"vpc-mivwn2w9xicb",
11 "peerRegion":"bj",
12 "billing":{
13 "paymentTiming":"Postpaid"
14 },
15 "tags":[
16 {
17 "tagKey": "tagKey",
18 "tagValue": "tagValue"
19 }
20 ],
21 "resourceGroupId": "RESG-UoMgbkuLNjj",
22 "deleteProtect":true
23}
Response example
Plain Text
1HTTP/1.1 200 OK
2x-bce-request-id: 1214cca7-4ad5-451d-9215-71cb844c0a50
3Date: Fri, 06 July 2018 07:06:06 GMT
4Content-Type: application/json;charset=UTF-8
5Server: BWS
6
7{
8 "peerConnId": "peerconn-9td54fmx143e"
9}
