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. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes UpdateDhcpOptionsSetAttribute

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

RegionId String Yes cn-hangzhou

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

DhcpOptionsSetId String Yes dopt-o6w0df4epg9zo8isy****

The ID of the DHCP options set.

DomainNameServers String No 192.XX.XX.123

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.
DomainName String No example.com

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.

DhcpOptionsSetName String No name

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.

DhcpOptionsSetDescription String No description

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.

ClientToken String No 0c593ea1-3bea-11e9-b96b-88e9fe637760

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.
DryRun Boolean No false

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.

LeaseTime String No 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.
Note If you specify a value, you must also specify the unit.
Ipv6LeaseTime String No 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.
Note If you specify a value, you must also specify the unit.

Response parameters

Parameter Type Example Description
RequestId String 0ED8D006-F706-4D23-88ED-E11ED28DCAC0

The ID of the request.

Examples

Sample requests

http(s)://[Endpoint]/?Action=UpdateDhcpOptionsSetAttribute
&RegionId=cn-hangzhou
&DhcpOptionsSetId=dopt-o6w0df4epg9zo8isy****
&DomainNameServers=192.XX.XX.123
&DomainName=example.com
&DhcpOptionsSetName=name
&DhcpOptionsSetDescription=description
&ClientToken=0c593ea1-3bea-11e9-b96b-88e9fe637760
&DryRun=false
&LeaseTime=3650d
&Ipv6LeaseTime=3650d
&Common request parameters

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<UpdateDhcpOptionsSetAttributeResponse>
    <RequestId>0ED8D006-F706-4D23-88ED-E11ED28DCAC0</RequestId>
</UpdateDhcpOptionsSetAttributeResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

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

Error codes

HttpCode Error code Error message Description
400 InvalidDhcpOptionsSetId.NotFound The specified dhcpOptionsSetId does not exist. The error message returned because the DHCP options set does not exist. Check whether the parameter is set to a valid value.
400 IncorrectStatus.DhcpOptionsSet The DhcpOptionsSet status does not support this operation. The error message returned because 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.
400 IllegalParam.DomainNameServers The specified DomainNameServers is invalid. The error message returned because DomainNameServers is set to an invalid value. Check whether the parameter is set to a valid value.
400 IllegalParam.DomainName The specified DomainName is invalid. The error message returned because DomainName is set to an invalid value.
400 IllegalParam.DhcpOptionsSetName The specified DhcpOptionsSetName is invalid. The error message returned because DhcpOptionsSetName is set to an invalid value. Check whether the parameter is set to a valid value.
400 IllegalParam.DhcpOptionsSetDescription The specified DhcpOptionsSetDescription is invalid. The error message returned because DhcpOptionsSetDescription is set to an invalid value. Check whether the parameter is set to a valid value.
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.