# DescribeDatacenters

## 1. API Description

This API is used to query data centers available.

## 2. Input Parameters

The following request parameter list only provides API request parameters.

<table><thead><tr><th width="189">Parameter Name</th><th width="104.34482758620689">Required</th><th width="114">Type</th><th>Description</th></tr></thead><tbody><tr><td>dcIds</td><td>No</td><td>Array of String</td><td>Codes of data centers, consisting of IATA airport codes and numbers.</td></tr><tr><td>isPortAvailable</td><td>No</td><td>Boolean</td><td><p>Filter data centers in which whether port creation is supported or not.</p><ul><li><code>true</code>: Port creation is supported in this data center.</li><li><code>false</code>: Port creation is not supported in this data center.</li></ul><p>By default, data centers in which port creation is not supported are filtered.</p></td></tr></tbody></table>

## 3. Output Parameters

<table><thead><tr><th width="196">Parameter Name</th><th width="216.50635208711435">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>dcSet</td><td>Array of <a href="../../datastructure#datacenterinfo">DatacenterInfo</a></td><td>The list of data centers available.</td></tr></tbody></table>

## 4. Code Example

{% tabs %}
{% tab title="Example" %}
**Query data center information by the** `dcId` `SIN1`**.**

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

Request: 
{
    "dcIds": ["SIN1"]
}

Response: 
{
    "requestId": "TEEFDCA5B-76FB-4E91-A18E-DF7F5D2CE41F",
    "response": {
        "requestId": "TEEFDCA5B-76FB-4E91-A18E-DF7F5D2CE41F",
        "dcSet": [{
            "dcId":"SIN1",
            "dcName":"AP-Singapore1",
            "cityName":"Singapore",
            "areaName":"Asia Pacific",
            "countryName":"Singapore",
            "dcAddress":"20 Ayer Rajah Crescent, Ayer Rajah Industrial Park, Singapore 139964"
        }]
    }
}
```

{% endtab %}
{% endtabs %}

## 5. Developer Resources

Zenlayer Cloud API 2.0 integrates [SDKs](https://docs.console.zenlayer.com/api-reference/api-introduction/toolkit/api-sdk) to make it easier for you to call APIs. More programming languages will be supported.

## 6. Error Codes

No error codes related to the API business logic. For other error codes, see [Common Error Codes](https://docs.console.zenlayer.com/api-reference/api-introduction/instruction/commonerrorcode).​
