# DescribeDomains

## 1. API Description

This interface is used to query information about multiple accelerated domain names. Users can query based on conditions such as ID or name.

## 2. Request Parameters

The following request parameter list includes only the necessary parameters for the interface

| Parameter Name       | Required | Type            | Description                                                                                                               |
| -------------------- | -------- | --------------- | ------------------------------------------------------------------------------------------------------------------------- |
| domainIds            | No       | Array of String | <p>Accelerated domain IDs.</p><p>Supports up to 100 IDs for querying.</p>                                                 |
| domainName           | No       | String          | Accelerated domain name                                                                                                   |
| domainStatus         | No       | String          | [Accelerated domain status](https://docs.console.zenlayer.com/api-reference/networking/datastructure#domainstatusvalue)   |
| configStatus         | No       | String          | [Domain configuration status](https://docs.console.zenlayer.com/api-reference/networking/datastructure#configstatusvalue) |
| accelerationRegionId | No       | String          | [Acceleration region ID](https://docs.console.zenlayer.com/api-reference/networking/datastructure#region)                 |
| businessTypeId       | No       | String          | [Business type ID](https://docs.console.zenlayer.com/api-reference/networking/datastructure#region)                       |
| resourceGroupId      | No       | String          | <p>Resource group ID.</p><p>If not provided, returns instances in all visible resource groups.</p>                        |
| pageSize             | No       | Integer         | <p>Size of the returned page.</p><p>Defaults to 20, maximum is 1000.</p>                                                  |
| pageNum              | No       | Integer         | <p>Page number of the returned data.</p><p>Defaults to 1.</p>                                                             |

## 3. Output Parameters

| Parameter Name | Type                                                                                                       | Description                                                                                 |
| -------------- | ---------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- |
| requestId      | String                                                                                                     | Unique request ID, returned with each request. Provide this requestId when locating issues. |
| totalCount     | Integer                                                                                                    | Total number of data that meets the conditions.                                             |
| dataSet        | Array of [DomainInfo](https://docs.console.zenlayer.com/api-reference/networking/datastructure#domaininfo) | Result set.                                                                                 |

## 4. Code Example

{% tabs %}
{% tab title="Example" %}

1. **Paginate through the list of accelerated domains**

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

Request:
{
  "pageNum": 1,
  "pageSize": 1
}

Response:
{
  "requestId": "TEEFDCA5B-76FB-4E91-A18E-DF7F5D2CE41F",
  "response": {
    "requestId": "TEEFDCA5B-76FB-4E91-A18E-DF7F5D2CE41F",
    "totalCount": 6,
    "dataSet": [
          {
            "domainId": "domainIdxxxxx",
            "businessType": "LF",
            "domainName": "cdntest.zenlayer.com",
            "domainStatus": "DEPLOYED",
            "configStatus": "ENABLED",
            "cname": "xxx.zga.globalconnetct.com",
            "createTime": "2023-04-28T03:38:53Z",
            "resourceGroupId":"xxx-xx"
          }
    ]
  }
}
```

{% endtab %}
{% endtabs %}

## 5. 错误码

The following includes error codes encountered in business logic. For other error codes, see [Common Error Codes](https://docs.console.zenlayer.com/api-reference/api-introduction/instruction/commonerrorcode).
