All Products
Search
Document Center

Virtual Private Cloud:UpdateDhcpOptionsSetAttribute

Last Updated:Mar 04, 2024

Modifies the configuration of a DHCP options set.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

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:UpdateDhcpOptionsSetAttributeWrite
  • DhcpOptionsSet
    acs:vpc:{#regionId}:{#accountId}:dhcpoptionsset/{#DhcpOptionsSetId}
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
RegionIdstringYes

The region where the DHCP options set is deployed. You can call the DescribeRegions operation to query the most recent region list.

cn-hangzhou
DhcpOptionsSetIdstringYes

The ID of the DHCP options set.

dopt-o6w0df4epg9zo8isy****
DomainNameServersstringNo

The IP address of the DNS server. You can enter at most four DNS server IP addresses. Separate IP addresses with commas (,).

Note If you do not specify a DNS server IP address, Elastic Compute Service (ECS) instances use the IP addresses of the Alibaba Cloud DNS servers, which are 100.100.2.136 and 100.100.2.138.
192.XX.XX.123
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 2 to 128 characters in length, and can contain letters, digits, underscores (_), and hyphens (-). The name must start with a letter.

name
DhcpOptionsSetDescriptionstringNo

Enter a description for the DHCP options set.

The description must be 2 to 256 characters in length. It must start with a letter and cannot start with http:// or https://. You can also leave the description empty.

description
ClientTokenstringNo

The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters.

Note If you do not set this parameter, ClientToken is set to the value of RequestId. The value of RequestId for each API request may be different.
0c593ea1-3bea-11e9-b96b-88e9fe637760
DryRunbooleanNo

Specifies whether to perform a dry run. Valid values:

true: performs a dry run. The system checks the required parameters, request format, and limits. If the request fails the dry run, an error message is returned. If the request passes the dry run, the DryRunOperation error code is returned.

false (default): performs a dry run and sends the request. If the request passes the dry run, a 2xx HTTP status code is returned and the operation is performed.

false
LeaseTimestringNo

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.
Note If you specify a value, you must also specify the unit.
3650d
Ipv6LeaseTimestringNo

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.
Note If you specify a value, you must also specify the unit.
3650d

Response parameters

ParameterTypeDescriptionExample
object
RequestIdstring

The ID of the request.

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

Examples

Sample success responses

JSONformat

{
  "RequestId": "0ED8D006-F706-4D23-88ED-E11ED28DCAC0"
}

Error codes

HTTP status codeError codeError messageDescription
400InvalidDhcpOptionsSetId.NotFoundThe specified dhcpOptionsSetId does not exist.The DHCP options set does not exist. Check whether the parameter is set to a valid value.
400IncorrectStatus.DhcpOptionsSetThe DhcpOptionsSet status does not support this operation.The DHCP options set that is associated with the VPC is being configured. As a result, the DHCP options set does not support this operation. You can perform the operation after the status of the DHCP options set is stable.
400IllegalParam.DomainNameServersThe specified DomainNameServers is invalid.DomainNameServers is set to an invalid value.
400IllegalParam.DomainNameThe specified DomainName is invalid.The error message returned because DomainName is set to an invalid value.
400IllegalParam.DhcpOptionsSetNameThe specified DhcpOptionsSetName is invalid.DhcpOptionsSetName is set to an invalid value.
400IllegalParam.DhcpOptionsSetDescriptionThe specified DhcpOptionsSetDescription is invalid.DhcpOptionsSetDescription 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-07-05The Error code has changedsee changesets
Change itemChange content
Error CodesThe Error code has changed.
    Error Codes 400 change
    delete Error Codes: 404
2021-11-16The Error code has changed. The request parameters of the API has changedsee changesets
Change itemChange content
Error CodesThe Error code has changed.
    delete Error Codes: 400
    delete Error Codes: 404
Input ParametersThe request parameters of the API has changed.
    Added Input Parameters: LeaseTime
    Added Input Parameters: Ipv6LeaseTime