# DescribeDatacentersWithService

## 1. API Description

This API is used to query data centers supporting the specified services.

## 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>cloudRegionId</td><td>No</td><td>String</td><td>Region ID of public cloud.</td></tr><tr><td>dcId</td><td>No</td><td>String</td><td>Data center ID.</td></tr><tr><td>serviceType</td><td>No</td><td><a href="../../datastructure#servicetype">ServiceType</a></td><td>Access point type supported.</td></tr></tbody></table>

## 3. Output Parameters

<table><thead><tr><th width="161.71484375">Parameter Name</th><th width="236.03760208711435">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#datacenterwithserviceinfo">DatacenterWithServiceInfo</a></td><td>The list of data centers available.</td></tr></tbody></table>

## 4. Code Example

{% tabs %}
{% tab title="Example" %}
**Query data centers supporting AWS services.**

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

Request: 
{
    "serviceType": "AWS"
}

Response: 
{
    "requestId": "TEEFDCA5B-76FB-4E91-A18E-DF7F5D2CE41F",
    "response": {
        "requestId": "TEEFDCA5B-76FB-4E91-A18E-DF7F5D2CE41F",
        "dcSet": [{
            "dcId":"NYC1",
            "areaName": "North America",
            "dcName": "Digital Realty JFK12",
            "cityName": "New York City",
            "cloudRegionId": "ap-east-1",
            "latitude": 40.718651,
            "longitude": -74.008261,
            "serviceTypes": ["AWS", "DATACENTER_PORT"]
        }]
    }
}
```

{% 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).​
