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.

Parameter NameRequiredTypeDescription

dcId

Yes

String

Code of data center.

To obtain code, you can call DescribeDataCenters, and find dcId in the response.

portName

Yes

String

Port name.

Up to 255 characters in length are allowed. You're recommended to use data center code combined with port speed.

portRemarks

No

String

Note of port.

Up to 255 characters in length are allowed.

portType

Yes

String

Port speed.

To obtain port speed, you can call DescribeDataCenterPortType, and find portType in the response.

businessEntityName

Yes

String

Your business entity name.

The entity name to be used on the Letter of Authorization (LOA). This should be the name that is registered with the colocation facility.

3. Output Parameters

Parameter NameTypeDescription

requestId

String

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

portId

String

Port ID.

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.​

HTTP Status CodeError CodeDescription

7111

SELF_SERVICE_PORT_NOT_SHELF

Port is unavailable for sale.

Last updated