Replaces the DHCP options set that is associated with a virtual private cloud (VPC).
Usage notes
- ReplaceVpcDhcpOptionsSet is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the DescribeVpcAttribute operation to query the status of the task:
- If the DHCP options set is in the Pending state, the DHCP options set is being replaced.
- If the DHCP options set is in the InUse state, the DHCP options set is replaced.
- You cannot repeatedly call the ReplaceVpcDhcpOptionsSet operation within a specific time period.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
Action | String | Yes | ReplaceVpcDhcpOptionsSet | The operation that you want to perform. Set the value to ReplaceVpcDhcpOptionsSet. |
RegionId | String | Yes | cn-hangzhou | The region to which the DHCP options set belongs. You can call the DescribeRegions operation to query the most recent region list. |
DhcpOptionsSetId | String | Yes | dopt-o6w0df4epg9zo8isy**** | The ID of the new DHCP options set. |
VpcId | String | Yes | vpc-dsferghthth**** | The ID of the associated VPC. |
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 specify this parameter, the system automatically uses the request ID as the client token. The request ID may be different for each request. |
DryRun | Boolean | No | false | Specifies whether to perform only a dry run, without performing the actual request. Valid values:
|
Response parameters
Parameter | Type | Example | Description |
RequestId | String | 0ED8D006-F706-4D23-88ED-E11ED28DCAC0 | The request ID. |
Examples
Sample requests
http(s)://[Endpoint]/?Action=ReplaceVpcDhcpOptionsSet
&RegionId=cn-hangzhou
&DhcpOptionsSetId=dopt-o6w0df4epg9zo8isy****
&VpcId=vpc-dsferghthth****
&ClientToken=0c593ea1-3bea-11e9-b96b-88e9fe637760
&DryRun=false
&Common request parameters
Sample success responses
XML
format
HTTP/1.1 200 OK
Content-Type:application/xml
<ReplaceVpcDhcpOptionsSetResponse>
<RequestId>0ED8D006-F706-4D23-88ED-E11ED28DCAC0</RequestId>
</ReplaceVpcDhcpOptionsSetResponse>
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 | OperationFailed.AttachmentNotExist | The current VPC is not attahced to a DHCP options set. | The VPC is not associated with a DHCP options set. |
400 | IncorrectStatus.VpcDhcpOptionsSet | The dhcpOptionsSet status of VPC does not support this operation. | The DHCP options set is in an unstable state. |
400 | AttrMismatching.VpcDhcpOptionsSetId | The dhcpOptionsSetId does not match the VPC. | The ID of the DHCP options set does not match the VPC. Check whether the specified DHCP options set is associated with the VPC. |
400 | TaskConflict | The operation is too frequent. Please wait a moment and try again. | The system is unavailable. Try again later. |
400 | InvalidVpcId.NotFound | Specified value of VpcId is not found in our record. | The VPC is not found. |
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. |
400 | IncorrectStatus.DhcpOptionsSet | The DhcpOptionsSet status does not support this operation. | The DHCP options set is in an unstable state. Try again after the DHCP options set enters a stable state. |
For a list of error codes, see Service error codes.