DescribePortUsableVlan

DescribePortUsableVlan

1. API Description

This API is used to query available VLANs for the port.

Note

At least one of the following parameters needs to be passed in: Port or data center.

2. Input Parameters

The following request parameter list only provides API request parameters.

Parameter NameRequiredTypeDescription

dcId

No

String

Code of data center.

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

portId

No

String

Port ID.

3. Output Parameters

Parameter NameTypeDescription

requestId

String

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

start

Integer

Start value of VLAN range.

end

Integer

End value of VLAN range.

inuseVlanList

Array of Integer

List of occupied VLANs.

4. Code Example

Query available VLANs for a port.

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

Request: {
  "portId": "your-port-id"
}

Response: {
  "requestId": "TEEFDCA5B-76FB-4E91-A18E-DF7F5D2CE41F",
  "response": {
    "requestId": "TEEFDCA5B-76FB-4E91-A18E-DF7F5D2CE41F",
    "dataSet": {
      "start": 1,
      "end": 4000,
      "inuseVlanList":[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 3999, 4000]
    }
  }
}

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

7112

SELF_SERVICE_PORT_VLAN_PORT_AND_DC_NEED_AT_LEAST_ONE

At least one port or one data center needs to be passed in.

Last updated