All Products
Search
Document Center

Virtual Private Cloud:ListDhcpOptionsSets

Last Updated:Nov 27, 2024

Queries Dynamic Host Configuration Protocol (DHCP) options sets.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
vpc:ListDhcpOptionsSetsget
*DhcpOptionsSet
acs:vpc:{#regionId}:{#accountId}:dhcpoptionsset/*
*DhcpOptionsSet
acs:vpc:{#regionId}:{#accountId}:dhcpoptionsset/{#DhcpOptionsSetId}
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
RegionIdstringYes

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.

cn-hangzhou
NextTokenstringNo

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 the NextToken parameter.
FFmyTO70tTpLG6I3FmYAXGKPd****
MaxResultsintegerNo

The number of entries per page. Valid values: 1 to 100. Default value: 10.

10
DomainNamestringNo

The root domain. For example, you can set the value to 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 ECS instances in the VPC.

example.com
DhcpOptionsSetNamestringNo

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.

Valid values:

  • tf-testAccVpcDhcpOptionsSets-1585169790614573448

    :

    tf-testAccVpcDhcpOptionsSets-1585169790614573448

    .

test
DhcpOptionsSetIdarrayNo

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

stringNo

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

dopt-o6w0df4epg9zo8isy****
ResourceGroupIdstringNo

The ID of the resource group to which the DHCP options set belongs.

rg-acfmxazb4ph****
Tagsarray<object>No

The tag list.

objectNo
KeystringNo

The tag key. You can specify up to 20 tag keys. The tag key cannot be an empty string.

The tag key can be up to 64 characters in length and can contain digits, periods (.), underscores (_), and hyphens (-). The tag key must start with a letter but cannot start with aliyun or acs:. The tag key cannot contain http:// or https://.

FinanceDept
ValuestringNo

The tag value. 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 can contain digits, periods (.), underscores (_), and hyphens (-). The tag value must start with a letter but cannot start with aliyun or acs:. The tag value cannot contain http:// or https://.

FinanceJoshua

Response parameters

ParameterTypeDescriptionExample
object

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 indicates the token that is used for the next request to retrieve a new page of results.
NextTokenstring

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 used to retrieve a new page of results.
FFmyTO70tTpLG6I3FmYAXGKPd********
RequestIdstring

The request ID.

0ED8D006-F706-4D23-88ED-E11ED28DCAC0
DhcpOptionsSetsarray<object>

The list of the DHCP options sets.

DhcpOptionsSetobject
DhcpOptionsSetDescriptionstring

The description of the DHCP options set.

test
Statusstring

The status of the DHCP options set. Valid values:

  • Available
  • InUse
  • Pending
  • Deleted
Available
DhcpOptionsSetIdstring

The ID of the DHCP options set.

dopt-o6w0df4epg9zo8isy****
DhcpOptionsSetNamestring

The name of the DHCP options set.

test
AssociateVpcCountinteger

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

2
OwnerIdlong

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

253460731706911258
DhcpOptionsobject

The configuration information about the DHCP options set.

DomainNameServersstring

The IP address of the DNS server.

192.168.XX.XX
DomainNamestring

The suffix of the hostname.

example.com
LeaseTimestring

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.
3650d
Ipv6LeaseTimestring

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.
3650d
ResourceGroupIdstring

The ID of the resource group to which the DHCP options set belongs.

rg-acfmxazb4ph****
Tagsarray<object>

The tag list.

Tagobject
Keystring

The key of tag N added to the resource.

FinanceDept
Valuestring

The value of tag N added to the resource.

FinanceJoshua
TotalCountstring

The number of entries.

10

Examples

Sample success responses

JSONformat

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

HTTP status codeError codeError messageDescription
400IllegalParam.NextTokenThe specified NextToken is invalid.The specified NextToken is invalid.
404InvalidRegionId.NotFoundThe specified RegionId does not exist.The specified region does not exist.

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2023-03-23The Error code has changed. The request parameters of the API has changed. The response structure of the API has changedView Change Details
2021-11-17The Error code has changed. The response structure of the API has changedView Change Details