# DescribeDhcpOptionsSets

## 1. API Description

This API (DescribeDhcpOptionsSets) is used to query the list of DHCP option sets that have been created.

## 2. Input Parameters

The following request parameter list only provides API request parameters.

| Parameter Name     | Required | Type                                                                                      | Description                                                                                                                                   |
| ------------------ | -------- | ----------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- |
| dhcpOptionsSetIds  | No       | Array of String                                                                           | <p>ID list of the DHCP options sets.</p><p>Up to 20 IDs of DHCP options sets can be entered.</p>                                              |
| dhcpOptionsSetName | No       | String                                                                                    | <p>Name list of the DHCP options sets.</p><p>This field supports fuzzy search.</p>                                                            |
| subnetId           | No       | String                                                                                    | Associated subnet ID.                                                                                                                         |
| pageSize           | No       | Integer                                                                                   | <p>The returned page size.</p><p>Default value: 20; Maximum value: 1000.</p><p>Available range: \[1, 1000].</p><p>Value range: \[1, 1000]</p> |
| pageNum            | No       | Integer                                                                                   | <p>Number of pages returned.</p><p>Default value: 1.</p><p>Available range: \[1, +).</p><p>Value range: \[1, +)</p><p>Default value: 1</p>    |
| resourceGroupId    | No       | String                                                                                    | Filter by resource group ID.                                                                                                                  |
| tagKeys            | No       | Array of String                                                                           | <p>Search by tag key.</p><p>You can query up to 20 tag keys in each request.</p>                                                              |
| tags               | No       | Array of [Tag](https://docs.console.zenlayer.com/api-reference/compute/datastructure#tag) | <p>Search by tag.</p><p>You can query up to 20 tags in each request.</p>                                                                      |

## 3. Output Parameters

| Parameter Name | Type                                                                                                            | Description                                                                                                           |
| -------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- |
| requestId      | String                                                                                                          | <p>The unique request ID, which is returned for each request.</p><p>RequestId is required for locating a problem.</p> |
| totalCount     | Integer                                                                                                         | Number of disks meeting the filtering conditions.                                                                     |
| dataSet        | Array of [DhcpOptionsSet](https://docs.console.zenlayer.com/api-reference/compute/datastructure#dhcpoptionsset) | Data for the list of DHCP options sets.                                                                               |

## 4. Code Example

{% tabs %}
{% tab title="Example" %}
**Query the list of DHCP option sets created.**

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

Request：
{
  "dhcpOptionsSetName": "dhcpOptionsSetName1",
  "pageSize": 10,
  "pageNum": 1
}

Response：
{
  "dataSet": [
    {
      "createTime": "2025-12-31T06:35:42Z",
      "description": "",
      "dhcpOptionsSetId": "dhcpOptionsSetId1",
      "dhcpOptionsSetName": "dhcpOptionsSetName1",
      "domainNameServers": "88.88.88.88",
      "ipv6DomainNameServers": "2001:2:0:e344:0:2::3",
      "ipv6LeaseTime": "48",
      "leaseTime": "48",
      "resourceGroupId": "resourceGroupId",
      "resourceGroupName": "resourceGroupName"
    }
  ],
  "requestId": "T82F6B775-F09D-4C13-803B-3033DA839659",
  "totalCount": 1
}
```

{% 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

The following only lists the 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).

| HTTP Status Code | Error Code | Description |
| ---------------- | ---------- | ----------- |
