All Products
Search
Document Center

:ListDhcpOptionsSets

最終更新日:Aug 21, 2023

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 No FFmyTO70tTpLG6I3FmYAXGKPd****

The pagination token that is used in the next request to retrieve a new page of results. Valid values:

  • You do not need to specify this parameter for the first request.
  • You must specify the token that is obtained from the previous query as the value of NextToken.
MaxResults Integer No 10

The number of entries per 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 1 to 128 characters in length and can contain digits, underscores (_), and hyphens (-). It must start with a letter.

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

The ID of the DHCP options set. You can specify at most 20 IDs.

Action String Yes ListDhcpOptionsSets

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

ResourceGroupId String No rg-acfmxazb4ph****

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

Tags.N.Key String No FinanceDept

The key of tag N to add to the resource. You can specify at most 20 tag keys. The tag key cannot be an empty string.

The tag key can be at most 128 characters in length. It cannot start with aliyun or acs:, and cannot contain http:// or https://.

Tags.N.Value String No FinanceJoshua

The value of tag N to add to the resource. You can specify at most 20 tag values. The tag value can be an empty string.

The tag value can be up to 128 characters in length and cannot start with acs: or aliyun. The tag value cannot contain http:// or https://.

Response parameters

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

A pagination token. It can be used in the next request to retrieve a new page of results. Valid values:

  • If NextToken is empty, no next page exists.
  • If a value is returned for NextToken, the value is the token that is used for the next query.
RequestId String 0ED8D006-F706-4D23-88ED-E11ED28DCAC0

The request ID.

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
  • InUse
  • Pending
  • 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.

LeaseTime String 3650d

The lease time of the IPv4 addresses for the DHCP options set.

  • If you use hours as the unit, valid values are 24h to 1176h and 87600h to 175200h. Default value: 87600h.
  • If you use days as the unit, valid values are 1d to 49d and 3650d to 7300d. Default value: 3650d.
Ipv6LeaseTime String 3650d

The lease time of the IPv6 addresses for the DHCP options set.

  • If you use hours as the unit, valid values are 24h to 1176h and 87600h to 175200h. Default value: 87600h.
  • If you use days as the unit, valid values are 1d to 49d and 3650d to 7300d. Default value: 3650d.
ResourceGroupId String rg-acfmxazb4ph****

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

Tags Array of Tag

The list of tags.

Key String FinanceDept

The key of tag N.

Value String FinanceJoshua

The value of tag N.

TotalCount String 10

The number of entries returned.

Examples

Sample requests

http(s)://[Endpoint]/?RegionId=cn-hangzhou
&NextToken=FFmyTO70tTpLG6I3FmYAXGKPd****
&MaxResults=10
&DomainName=example.com
&DhcpOptionsSetName=test
&DhcpOptionsSetId=["dopt-o6w0df4epg9zo8isy****"]
&Action=ListDhcpOptionsSets
&ResourceGroupId=rg-acfmxazb4ph****
&Tags=[{"Key":"FinanceDept","Value":"FinanceJoshua"}]
&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>
            <LeaseTime>3650d</LeaseTime>
            <Ipv6LeaseTime>3650d</Ipv6LeaseTime>
        </DhcpOptions>
        <ResourceGroupId>rg-acfmxazb4ph****</ResourceGroupId>
        <Tags>
            <Key>FinanceDept</Key>
            <Value>FinanceJoshua</Value>
        </Tags>
    </DhcpOptionsSets>
    <TotalCount>10</TotalCount>
</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",
      "LeaseTime" : "3650d",
      "Ipv6LeaseTime" : "3650d"
    },
    "ResourceGroupId" : "rg-acfmxazb4ph****",
    "Tags" : [ {
      "Key" : "FinanceDept",
      "Value" : "FinanceJoshua"
    } ]
  } ],
  "TotalCount" : "10"
}

Error codes

HttpCode Error code Error message Description
400 IllegalParam.NextToken The specified NextToken is invalid. The error message returned because the value of 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, see Service error codes.