Create Intra-region Peering Connections

Last updated: 2019-07-31 11:40:01

PDF

1. API Description

This API (CreateVpcPeeringConnection) is used to create regional peering connection.
Domain for API request: vpc.api.qcloud.com

1) Regional peering connection is used to establish connectivity between two VPCs within the same region. The segments of the two VPCs that need to interconnect with each other cannot overlap.
2) Cross-account peering connection will take effect only after the receiver accepts the request. The connection between the same accounts will take effect immediately.
3) There is no limit for the traffic of regional peering connection.
4) Regional peering connection is available for free.

2. Input Parameters

The following request parameter list only provides API request parameters. Common request parameters need to be added when the API is called. For more information, refer to Common Request Parameters. The Action field for this API is CreateVpcPeeringConnection.

Parameter Name Required Type Description
vpcId Yes String ID of VPC, which can be vpcId or unVpcId. unVpcId is recommended. It can be queried through API DescribeVpcEx.
peerVpcId Yes String Receiver's VPC ID, which can be vpcId or unVpcId. unVpcId is recommended. It can be queried through API DescribeVpcEx.
peerUin Yes String Receiver's uin.
peeringConnectionName Yes String Peering connection name. You can specify any name you like, but its length should be limited to 60 characters. The name must be unique within the same VPC.

3. Output Parameters

Parameter Name Type Description
code Int Error code. 0: Succeeded; other values: Failed.
message String Error message.
peeringConnectionId String Peering connection ID assigned by the system, e.g. pcx-6gw5wvmk

4. Error Codes

The following error code list only provides the business logic error codes for this API. For additional common error codes, refer to VPC Error Codes.

Error Code Description
InvalidPeeringConnectionName Invalid peering connection name. You can specify any name you like, but its length should be limited to 60 characters.
PeeringConnectionVpcConflict Conflict occurs between VPC segments in peering connection
PeeringConnectionLimitExceeded The limit of requested peering connection resources for the specified region has been reached. Please contact customer service for more resources. For more information, see VPC Service Limits.
InvalidVpc.NotFound VPC does not exist. Please verify that you have entered resource information correctly.

5. Example

Input

https://vpc.api.qcloud.com/v2/index.php?Action=CreateVpcPeeringConnection
&<Common request parameters>
&vpcId=gz_vpc_226
&peerVpcId=gz_vpc_89
&peerUin=2407912486
&peeringConnectionName=tses

Output

{
    "code":"0",
    "message":"",
    "peeringConnectionId":"pcx-6gw5wvmk"
}