CreatePrivateConnect

1. API Description

This API is used to create a Layer 2 private connect.

Prerequisites

You can call DescribePrivateConnectAvailablePorts to query ports that can be added in to the Layer 2 private connect.

Note

  • Only operations on pay-as-you-go private connects billed by flat rate are supported.

  • You can only call API to add ports into a Layer 2 private connect. If you want to add public clouds, such as AWS, Tencent and Google cloud, into a private connect, please operate on console.

  • This API is an async API. A private connect ID is returned after the creation request is sent. However, it does not mean the creation has been completed. The status of the private connect will be DEPLOYING during the creation. You can use DescribePrivateConnects to query the status of the private connect. If the status changes from DEPLOYING to AVAILABLE, it means that the private connect has been created successfully; if no result has been queried, it means the private connect has been created failed. Any operations on the private connect are not allowed while creating.

2. Input Parameters

The following request parameter list only provides API request parameters.

Parameter Name
Required
Type
Description

privateConnectName

No

String

Private connect name. Up to 255 characters in length are allowed. The default is private-connect-{current time}.

endpointA

Yes

One access point (A) of the private connect.

endpointZ

No

The other access point (Z) of the private connect.

bandwidthMbps

No

Integer

Maximum bandwidth cap of the private connect, ranging from 1 to 500. Default value: 1

Unit: Mbps

resourceGroupId

No

String

Resource group ID.

If the value is null, then return all the private connects in the authorized resource groups.

3. Output Parameters

Parameter Name
Type
Description

requestId

String

The unique request ID, which is returned for each request. RequestId is required for locating a problem.

privateConnectId

String

Private connect ID.

4. Code Example

Create a Layer 2 private connect with ports as both access point A and access point Z. The bandwidth cap is 10 Mbps.

POST /api/v2/sdn HTTP/1.1
Host: console.zenlayer.com
Content-Type: application/json
X-ZC-Action: CreatePrivateConnect
<Common Request Params>

Request:
{
   "endpointA": {
      "vlanId": 1001,
      "portId": "your port id"
   },
   "privateConnectName": "fra-sel-prviate-line",
   "endpointZ": {
      "vlanId": 2001,
      "portId": "your portId id"
   },
   "bandwidthMbps": 10
}

Response:
{   
  "requestId": "T05992D0C-7E8B-4047-B0C0-780F2CD549D3",
  "response": {
     "requestId": "T98044459-95B2-477E-9A2F-00253A70CC6E"
     "privateConnectId": "your private connect id"
  }
}

5. Developer Resources

Zenlayer Cloud API 2.0 integrates SDKs to make it easier for you to call APIs. More programming languages will be supported.

6. Error Codes

The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.​

HTTP Status Code
Error Code
Description

404

INVALID_PORT_NOT_FOUND

Port does not exist.

400

INVALID_PORT_STATUS

The state of port should be Available.

400

INVALID_ENDPOINT_PARAMETER

Invalid access point type.

400

INVALID_CONNECT_ENDPOINT_CONFLICT

Duplicated access point A and Z.

Last updated