You can call this operation to query one or more DHCP options sets.


OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes ListDhcpOptionsSets

The operation that you want to perform. Set the value to ListDhcpOptionsSets.

NextToken String Yes caeba0bbb2be03f84eb48b699f0a4883

The query token. Set this parameter to the NextToken parameter value that is returned in the last API call. If no subsequent queries are to be sent, you can leave the parameter empty.

RegionId String Yes cn-hangzhou

The region of the DHCP options sets that you want to query. You can call the DescribeRegions operation to query region IDs.

MaxResults Integer No 50

The maximum number of results to be returned with a single call when the NextToken parameter is used in the call. Valid values: 1 to 50.

Default value: 50.

DomainName String No

The root domain, for example,

After a DHCP options set is associated with a Virtual Private Cloud (VPC) network, the root domain in the DHCP options set is automatically synchronized to the ECS instances in the VPC network.

DhcpOptionsSetId.N RepeatList No dopt-o6w0df4epg9zo8isy****

The IDs of the DHCP options sets to be queried.

You can specify up to 20 IDs of DHCP options sets.

DhcpOptionsSetName String No test

The name of the DHCP options set.

The name must be 2 to 128 characters in length and can contain letters, Chinese characters, digits, underscores (_), and hyphens (-). It must start with a letter or a Chinese character.

Response parameters

Parameter Type Example Description
DhcpOptionsSets Array

The list of the DHCP options sets.

AssociateVpcCount Integer 2

The number of VPC networks that are associated with the DHCP options set.

DhcpOptions Struct

The configuration information of the DHCP options set.

DomainName String

The root domain.

DomainNameServers String 192.xx.xx.123

The DNS server IP addresses.

DhcpOptionsSetDescription String test

The description of the DHCP options set.

DhcpOptionsSetId String dopt-o6w0df4epg9zo8isy****

The ID of the DHCP options set.

DhcpOptionsSetName String test

The name of the DHCP options set.

OwnerId Long 12345678

The ID of the account to which the DHCP options set belongs.

Status String Available

The status of the DHCP options set. Valid values:

  • Available: The DHCP options set is available for use.
  • InUse: The DHCP options set is in use.
  • Deleted:The DHCP options set is deleted.
  • Pending: The DHCP options set is being configured.
NextToken String caeba0bbb2be03f84eb48b699f0a4883

The token required by the next query. If the NextToken parameter is empty, this indicates that no subsequent query will be sent.

RequestId String 0ED8D006-F706-4D23-88ED-E11ED28DCAC0

The ID of the request.


Sample requests

http(s)://[Endpoint]/? Action=ListDhcpOptionsSets
&<Common request parameters>

Sample success responses

XML format


JSON format

  "DhcpOptionsSets": [
      "Status": "Available",
      "DhcpOptionsSetId": "dopt-o6w0df4epg9zo8isy****",
      "DhcpOptions": {
        "DomainNameServers": ""
      "OwnerId": "119059297981xxxx",
      "DhcpOptionsSetName": "df",
      "AssociateVpcCount": 0
      "Status": "Available",
      "DhcpOptionsSetId": "dopt-o6wia340xes2gipi5****",
      "DhcpOptions": {
        "DomainNameServers": "1.xx.xx.1"
      "OwnerId": "119059297981xxxx",
      "DhcpOptionsSetName": "new",
      "AssociateVpcCount": 0
  "RequestId": "4DAD3F76-2DB8-4336-B847-D7C0446C7952"

Error codes

HTTP status code Error code Error message Description
404 InvalidRegionId.NotFound The specified RegionId does not exist. The error message returned because the specified region ID does not exist. Check whether the region ID is valid.
400 IllegalParam.NextToken The specified NextToken is invalid. The error message returned because the specified NextToken is invalid.

For a list of error codes, visit the API Error Center.