TerminateInstance
Last updated
This API (TerminateInstance) is used to return an instance.
Note
Use this API to return an instance that is no longer required. A pay-as-you-go instance will stop billing after it is returns.
Calling this API on a subscription instance will cancel the subscription and the instance will be automatically returned after the subscription expires.
When this API is called, the instance will be moved to the recycle bin and be released in 24 hours if there are no other operations. You can also call ReleaseInstances to release the instance.
Operations on instances in recycle bin or in stalling status are not supported.
Operations on instances in CREATE_FAILED status will delete the instance directly. For prepaid instances, all payment amounts will be refunded.
The following request parameter list only provides API request parameters.
instanceId
Yes
String
Instance ID.
To obtain the instance ID, you can call DescribeInstances and look for instanceId in the response.
requestId
String
The unique request ID, which is returned for each request.
RequestId is required for locating a problem.
Return an instance with the ID: instanceId
Zenlayer Cloud API 2.0 integrates SDKs,to make it easier for you to call APIs. More programming languages will be supported.
The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.
403
OPERATION_DENIED_INSTANCE_SUBSCRIPTION
Instances with subscription pricing model do not support this operation.
403
OPERATION_DENIED_INSTANCE_RECYCLED
The instance is in the recycle bin.
403
OPERATION_DENIED_INSTANCE_STATUS_INSTALLING
This operation is not supported for instances that are being installed.
403
OPERATION_DENIED_INSTANCE_CREATING
Instances that are being created do not support this operation.
404
INVALID_INSTANCE_NOT_FOUND
Instance does not exist.
Last updated
POST /api/v2/bmc HTTP/1.1
Host: console.zenlayer.com
Content-Type: application/json
X-ZC-Action: TerminateInstance
<Common Request Params>
Request:
{
"instanceId": "instanceId"
}
Response:
{
"requestId": "TC1748D3E-452D-4F74-8485-7AA73718E453",
"response": {
"requestId": "TC1748D3E-452D-4F74-8485-7AA73718E453"
}
}