Queries Dynamic Host Configuration Protocol (DHCP) options sets.

Debugging

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
RegionId String Yes cn-hangzhou

The region ID of the DHCP options sets that you want to query.

You can call the DescribeRegions operation to query the most recent region list.

NextToken String Yes FFmyTO70tTpLG6I3FmYAXGKPd****

The token that is used for the next query. Valid values:

  • If this is your first query or no next query is to be sent, ignore this parameter.
  • If a next query is to be sent, set the value to the value of NextToken that is returned from the last call.
MaxResults Integer No 10

The number of entries to return on each page. Valid values: 1 to 100. Default value: 10.

DomainName String No example.com

The root domain, such as example.com.

After a DHCP options set is associated with a virtual private cloud (VPC), the root domain in the DHCP options set is automatically synchronized with the Elastic Compute Service (ECS) instances in the VPC.

DhcpOptionsSetName String No test

The name of the DHCP options set.

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

Action String Yes ListDhcpOptionsSets

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

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

The ID of the DHCP options set.

Valid values of N: 1 to 20. You can enter at most 20 IDs.

Response parameters

Parameter Type Example Description
NextToken String FFmyTO70tTpLG6I3FmYAXGKPd********

The token that is used for the next query. Valid values:

  • If the value returned of NextToken is empty, it indicates that no next query is to be sent.
  • If the value returned of NextToken is not empty, the value indicates the token that is used for the next query.
RequestId String 0ED8D006-F706-4D23-88ED-E11ED28DCAC0

The ID of the request.

DhcpOptionsSets Array of DhcpOptionsSet

The list of the DHCP options sets.

DhcpOptionsSetDescription String test

The description of the DHCP options set.

Status String Available

The status of the DHCP options set. Valid values:

  • Available: available
  • InUse: in use
  • Pending: being configured
  • Deleted: deleted
DhcpOptionsSetId String dopt-o6w0df4epg9zo8isy****

The ID of the DHCP options set.

DhcpOptionsSetName String test

The name of the DHCP options set.

AssociateVpcCount Integer 2

The number of VPCs with which the DHCP options set is associated.

OwnerId Long 253460731706911258

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

DhcpOptions Object

The configuration information about the DHCP options set.

DomainNameServers String 192.168.XX.XX

The DNS server IP address.

DomainName String example.com

The suffix of the hostname.

Examples

Sample requests

http(s)://[Endpoint]/?RegionId=cn-hangzhou
&NextToken=FFmyTO70tTpLG6I3FmYAXGKPd****
&MaxResults=10
&DomainName=example.com
&DhcpOptionsSetName=test
&DhcpOptionsSetId=["dopt-o6w0df4epg9zo8isy****"]
&Action=ListDhcpOptionsSets
&Common request parameters

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<ListDhcpOptionsSetsResponse>
    <NextToken>FFmyTO70tTpLG6I3FmYAXGKPd********</NextToken>
    <RequestId>0ED8D006-F706-4D23-88ED-E11ED28DCAC0</RequestId>
    <DhcpOptionsSets>
        <DhcpOptionsSetDescription>test</DhcpOptionsSetDescription>
        <Status>Available</Status>
        <DhcpOptionsSetId>dopt-o6w0df4epg9zo8isy****</DhcpOptionsSetId>
        <DhcpOptionsSetName>test</DhcpOptionsSetName>
        <AssociateVpcCount>2</AssociateVpcCount>
        <OwnerId>253460731706911260</OwnerId>
        <DhcpOptions>
            <DomainNameServers>192.168.XX.XX</DomainNameServers>
            <DomainName>example.com</DomainName>
        </DhcpOptions>
    </DhcpOptionsSets>
</ListDhcpOptionsSetsResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "NextToken" : "FFmyTO70tTpLG6I3FmYAXGKPd********",
  "RequestId" : "0ED8D006-F706-4D23-88ED-E11ED28DCAC0",
  "DhcpOptionsSets" : [ {
    "DhcpOptionsSetDescription" : "test",
    "Status" : "Available",
    "DhcpOptionsSetId" : "dopt-o6w0df4epg9zo8isy****",
    "DhcpOptionsSetName" : "test",
    "AssociateVpcCount" : 2,
    "OwnerId" : 253460731706911260,
    "DhcpOptions" : {
      "DomainNameServers" : "192.168.XX.XX",
      "DomainName" : "example.com"
    }
  } ]
}

Error codes

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

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