All Products
Search
Document Center

Virtual Private Cloud:ListDhcpOptionsSets

Last Updated:Dec 02, 2023

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.

debugging

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:ListDhcpOptionsSetsRead
  • 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 token that is used for the next query. Valid values:

  • If this is your first query or no next queries are to be sent, ignore this parameter.
  • If a subsequent query is to be sent, set the value to the value of NextToken that is returned from the last call.
FFmyTO70tTpLG6I3FmYAXGKPd****
MaxResultsintegerNo

The number of entries to return on each 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 Elastic Compute Service (ECS) instances in the VPC.

example.com
DhcpOptionsSetNamestringNo

The name of the DHCP options set.

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

Enumeration Value:
  • tf-testAccVpcDhcpOptionsSets-1585169790614573448
test
DhcpOptionsSetIdarrayNo
stringNo

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

dopt-o6w0df4epg9zo8isy****

Response parameters

ParameterTypeDescriptionExample
object
NextTokenstring

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

  • If NextToken is empty, it indicates that no next query is to be sent.
  • If a value is returned for NextToken, the value is the token that is used for the next query.
FFmyTO70tTpLG6I3FmYAXGKPd********
RequestIdstring

The ID of the request.

0ED8D006-F706-4D23-88ED-E11ED28DCAC0
DhcpOptionsSetsobject []

The list of the DHCP options sets.

DhcpOptionsSetDescriptionstring

The description of the DHCP options set.

test
Statusstring

The status of the DHCP options set. Valid values:

  • Available: available
  • InUse: in use
  • Pending: being configured
  • Deleted: 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 DNS server IP address.

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

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.NextToken is set to an invalid value.
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 codes of the API operation change.,The input parameters of the API operation change.,The response structure of the API operation changes.see changesets
Change itemChange content
Error CodesThe error codes of the API operation change.
    delete Error Codes: 400
    delete Error Codes: 404
Input ParametersThe input parameters of the API operation change.
    Added Input Parameters: ResourceGroupId
    Added Input Parameters: Tags
Output ParametersThe response structure of the API operation changes.
2021-11-17The error codes of the API operation change.,The response structure of the API operation changes.see changesets
Change itemChange content
Error CodesThe error codes of the API operation change.
    delete Error Codes: 400
    delete Error Codes: 404
Output ParametersThe response structure of the API operation changes.