Releases a pay-as-you-go dedicated host.

Description

Before you release a pay-as-you-go dedicated host, make sure that no Elastic Compute Service (ECS) instances are deployed on the dedicated host.

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 ReleaseDedicatedHost

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

RegionId String Yes cn-hangzhou

The region ID of the dedicated host. You can call the DescribeRegions operation to query the most recent region list.

DedicatedHostId String Yes dh-bp199lyny9b3****

The ID of the dedicated host.

Response parameters

Parameter Type Example Description
RequestId String A1B15AC8-E6F6-49A4-8985-8C07104B9199

The ID of the request.

Examples

Sample requests

http(s)://ecs.aliyuncs.com/?Action=ReleaseDedicatedHost
&DedicatedHostId=dh-bp199lyny9b3****
&RegionId=cn-hangzhou
&<Common request parameters>

Sample success responses

XML format

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

<ReleaseDedicatedHostResponse>
  <RequestId>A1B15AC8-E6F6-49A4-8985-8C07104B9199</RequestId>
</ReleaseDedicatedHostResponse>

JSON format

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

{
  "RequestId" : "A1B15AC8-E6F6-49A4-8985-8C07104B9199"
}

Error codes

HttpCode Error code Error message Description
400 ChargeTypeViolation The operation is not permitted due to charge type of the dedicated host. The error message returned because the billing method of the dedicated host does not support the operation.
400 IncorrectHostStatus.Initializing The specified dedicatedHost status is not support this operation The error message returned because the operation is not supported while the dedicated host is in the current state.
500 InternalError The request processing has failed due to some unknown error. The error message returned because an internal error has occurred. Try again later.
403 InstanceExist Instance exists on the dedicated host. The error message returned because ECS instances are deployed on the dedicated host. You must remove the instances before you can release the dedicated host.
404 InvalidDedicatedHostId.NotFound The specified DedicatedHostId does not exist. The error message returned because the specified dedicated host does not exist.

For a list of error codes, see Service error codes.