DescribePorts

DescribePorts

1. API Description

This API is used to query port list.

2. Input Parameters

The following request parameter list only provides API request parameters.

Parameter NameRequiredTypeDescription

portIds

No

Array of String

Port ID list.

Up to 100 characters in length are allowed.

dcId

No

String

Code of data center.

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

portName

No

String

Port name.

Up to 255 characters in length are allowed with fuzzy search supported and and not case-sensitive.

portRemarks

No

String

Note of port.

Up to 255 characters in length are allowed with fuzzy search supported and and not case-sensitive.

cityName

No

String

City name.

Up to 64 characters in length are allowed with fuzzy search supported and and not case-sensitive.

3. Output Parameters

Parameter NameTypeDescription

requestId

String

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

totalCount

Integer

Number of ports meeting the filtering conditions.

dataSet

Array of PortInfo

Information on ports.

4. Code Example

Query port list.

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

Request: {
  "portIds": ["your-port-id"]
}

Response: {
    "requestId": "TEEFDCA5B-76FB-4E91-A18E-DF7F5D2CE41F",
    "response": {
        "requestId": "TEEFDCA5B-76FB-4E91-A18E-DF7F5D2CE41F",
        "totalCount": 1,
        "dataSet": [
        {
            "portId":"your-port-id",
            "portName":"your-port-name",
            "portRemarks":"your-port-remark",
            "portType":"1G",
            "dcId":"SIN1",
            "dcName":"AP-Singapore1",
            "cityName":"Singapore",
            "areaName":"Asia Pacific",
            "connectionStatus":"ACTIVE",
            "portStatus":"RUNNING",
            "loaStatus":"LOA_NOT_UPLOAD",
            "createdTime":"YYYY-MM-DDThh:mm:ssZ",
            "expiredTime":"YYYY-MM-DDThh:mm:ssZ",
            "portChargeType":"POSTPAID"
        }]
    }
}

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

7105

SELF_SERVICE_PORT_NOT_FOUND

Port not found.

Last updated