All Products
Search
Document Center

Virtual Private Cloud:GetDhcpOptionsSet

Last Updated:Sep 07, 2026

Queries a created DHCP options set by calling the GetDhcpOptionsSet operation.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

vpc:GetDhcpOptionsSet

get

*DhcpOptionsSet

acs:vpc:{#regionId}:{#accountId}:dhcpoptionsset/{#DhcpOptionsSetId}

None None

Request parameters

Parameter

Type

Required

Description

Example

RegionId

string

Yes

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

You can call the DescribeRegions operation to query the region ID.

Valid values:

  • ap-southeast-1 :

    ap-southeast-1

cn-hangzhou

DhcpOptionsSetId

string

Yes

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

dopt-o6w0df4epg9zo8isy****

Response elements

Element

Type

Description

Example

object

The description of the DHCP options set.

AssociateVpcs

array<object>

The information about the VPCs associated with the DHCP options set.

object

The information about the VPCs associated with the DHCP options set.

AssociateStatus

string

The status of the VPC associated with the DHCP options set. Valid values:

  • InUse: in use.

  • Pending: being configured.

InUse

VpcId

string

The ID of the VPC associated with the DHCP options set.

vpc-eb3b54r6otues4tjj****

CreationTime

string

The creation time.

2025-08-21 ***

DhcpOptions

object

The DHCP options configuration information.

DomainName

string

The hostname suffix.

example.com

DomainNameServers

string

The IP address of the DNS server.

192.XX.XX.123

Ipv6LeaseTime

string

The lease time of the IPv6 DHCP options set.

  • When the lease time is set in hours: Unit: h. Valid values: 24h to 1176h and 87600h to 175200h. Default value: 24h.

  • When the lease time is set in days: Unit: d. Valid values: 1d to 49d and 3650d to 7300d. Default value: 1d.

3650d

LeaseTime

string

The lease time of the IPv4 DHCP options set.

  • When the lease time is set in hours: Unit: h. Valid values: 24h to 1176h and 87600h to 175200h. Default value: 87600h.

  • When the lease time is set in days: Unit: d. Valid values: 1d to 49d and 3650d to 7300d. Default value: 3650d.

3650d

DhcpOptionsSetDescription

string

The description of the DHCP options set.

test

DhcpOptionsSetId

string

The ID of the DHCP options set.

dopt-o6w0df4epg9zo8isy****

DhcpOptionsSetName

string

The name of the DHCP options set.

test

OwnerId

integer

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

283117732402483989

RequestId

string

The request ID.

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

ResourceGroupId

string

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

rg-acfmxazb4ph****

Status

string

The status of the DHCP options set. Valid values:

  • Available: available.

  • InUse: in use.

  • Deleted: deleted.

  • Pending: being configured.

Available

Tags

array<object>

The tag information.

object

The tag information.

Key

string

The tag key.

FinanceDept

Value

string

The tag value.

FinanceJoshua

Examples

Success response

JSON format

{
  "AssociateVpcs": [
    {
      "AssociateStatus": "InUse",
      "VpcId": "vpc-eb3b54r6otues4tjj****"
    }
  ],
  "CreationTime": "2025-08-21 ***",
  "DhcpOptions": {
    "DomainName": "example.com",
    "DomainNameServers": "192.XX.XX.123",
    "Ipv6LeaseTime": "3650d",
    "LeaseTime": "3650d"
  },
  "DhcpOptionsSetDescription": "test",
  "DhcpOptionsSetId": "dopt-o6w0df4epg9zo8isy****",
  "DhcpOptionsSetName": "test",
  "OwnerId": 283117732402484000,
  "RequestId": "0ED8D006-F706-4D23-88ED-E11ED28DCAC0",
  "ResourceGroupId": "rg-acfmxazb4ph****",
  "Status": "Available",
  "Tags": [
    {
      "Key": "FinanceDept",
      "Value": "FinanceJoshua"
    }
  ]
}

Error codes

HTTP status code

Error code

Error message

Description

400 InvalidRegionId.NotFound The specified RegionId does not exist. The specified region does not exist.
400 InvalidDhcpOptionsSetId.NotFound The specified dhcpOptionsSetId does not exist. The DHCP options set does not exist. Check whether the parameter is set to a valid value.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.