CreatePort

1. API Description

This API is used to create a port.

Prerequisites

Before creating a port, you can call DescribeDatacenters to query data centers in which port creation is supported.

Note

This API is an async API. A port ID is returned after the creation request is sent. However, it does not mean the creation has been completed. The status of the port will be CREATING during the creation. You can use DescribePorts to query the status of the port. If the status changes from Creating to Running, it means that the port has been created successfully; No means the port is still being created. Any operations on the port are not allowed while creating.

2. Input Parameters

The following request parameter list only provides API request parameters.

3. Output Parameters

4. Code Example

Create a 1G port in SIN1.

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

Request:
{
  "dcId": "SIN1",
  "portName": "your-port-name",
  "portRemarks": "your-port-remarks",
  "portType": "1G",
  "businessEntityName": "your-business-entity-name"
}

Response:
{
  "requestId": "T3811A0E7-C250-40A2-96AD-08AD759E1BC2",
  "response": {
    "requestId": "T3811A0E7-C250-40A2-96AD-08AD759E1BC2",
    "portId": "your-port-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.​

Last updated