> For the complete documentation index, see [llms.txt](https://docs.console.zenlayer.com/api-reference/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.console.zenlayer.com/api-reference/networking/sdn/port/describeports.md).

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

<table><thead><tr><th width="168.23091133004928">Parameter Name</th><th width="107">Required</th><th width="100">Type</th><th>Description</th></tr></thead><tbody><tr><td>portIds</td><td>No</td><td>Array of String</td><td><p>Port ID list.</p><p>Up to 100 characters in length are allowed.</p></td></tr><tr><td>dcId</td><td>No</td><td>String</td><td><p>Code of data center.</p><p>To obtain code, you can call <a href="/pages/6NryHUpaL9ykwvihast7"><code>DescribeDataCenters</code></a>, and find <code>dcId</code> in the response.</p></td></tr><tr><td>portName</td><td>No</td><td>String</td><td><p>Port name.</p><p>Up to 255 characters in length are allowed with fuzzy search supported and and not case-sensitive.</p></td></tr><tr><td>portRemarks</td><td>No</td><td>String</td><td><p>Note of port.</p><p>Up to 255 characters in length are allowed with fuzzy search supported and and not case-sensitive.</p></td></tr><tr><td>cityName</td><td>No</td><td>String</td><td><p>City name.</p><p>Up to 64 characters in length are allowed with fuzzy search supported and and not case-sensitive.</p></td></tr><tr><td>tagKeys</td><td>No</td><td>Array of String</td><td><p>Query using tag keys.</p><p>A maximum of 20 tag keys can be used.</p></td></tr><tr><td>tags</td><td>No</td><td>Array of <a href="/pages/QGlc5uBFvAM7iixepjmI#tag">Tag</a></td><td><p>Query using tags.</p><p>A maximum of 20 tags can be used.</p></td></tr></tbody></table>

## 3. Output Parameters

<table><thead><tr><th width="188.73509933774835">Parameter Name</th><th width="177">Type</th><th>Description</th></tr></thead><tbody><tr><td>requestId</td><td>String</td><td>The unique request ID, which is returned for each request. RequestId is required for locating a problem.</td></tr><tr><td>totalCount</td><td>Integer</td><td>Number of ports meeting the filtering conditions.</td></tr><tr><td>dataSet</td><td>Array of <a href="/pages/QGlc5uBFvAM7iixepjmI#portinfo">PortInfo</a></td><td>Information on ports.</td></tr></tbody></table>

## 4. Code Example

{% tabs %}
{% tab title="Example" %}
**Query port list.**

```json
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"
        }]
    }
}
```

{% endtab %}
{% endtabs %}

## 5. Developer Resources

Zenlayer Cloud API 2.0 integrates [SDKs](/api-reference/api-introduction/toolkit/api-sdk.md) 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](/api-reference/api-introduction/instruction/commonerrorcode.md).​

<table><thead><tr><th width="201.33333333333331">HTTP Status Code</th><th width="313">Error Code</th><th>Description</th></tr></thead><tbody><tr><td>7105</td><td>SELF_SERVICE_PORT_NOT_FOUND</td><td>Port not found.</td></tr></tbody></table>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.console.zenlayer.com/api-reference/networking/sdn/port/describeports.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
