TerminateDisk

1. API Description

This API is used to return a disk.

Note

  • When this API is called, the disk will be moved to the recycle bin and be released in 24 hours if there are no other operations. You can also call ReleaseDisk to release the disk.

  • Use this API to return a disk that is no longer required. A pay-as-you-go disk will stop billing after it is returns.

  • You cannot return a subscription disk using this API, which will be returned when subscription expires.

  • Only operations on data disks are supported.

2. Input Parameters

The following request parameter list only provides API request parameters.

Parameter NameRequiredTypeDescription

diskId

Yes

String

ID list of disks.

3. Output Parameters

Parameter NameTypeDescription

requestId

String

The unique request ID, which is returned for each request. RequestId is required for locating a problem.

4. Code Example

Return a disk.

POST /api/v2/vm HTTP/1.1
Host: console.zenlayer.com
Content-Type: application/json
X-ZC-Action: TerminateDisk
<Common Request Params>

Request:
{
  "diskId": "your-disk-id"
}

Response:
{
  "requestId": "TE2A08EDA-C514-4F82-8D9A-C5BA0A7B1BF3",
  "response": {
    "requestId": "TE2A08EDA-C514-4F82-8D9A-C5BA0A7B1BF3"
  }
}

5. Developer Resources

Zenlayer Cloud API 2.0 integrates SDKs to make it easier for you to call APIs. More programming languages will be supported.

6. Error Codes

The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.​

HTTP Status CodeError CodeDescription

404

INVALID_DISK_NOT_FOUND

Disk does not exist.

400

UNSUPPORTED_OPERATION_DISK_SYSTEM_TYPE

Only operations on data disks are supported.

404

INVALID_ORDER_NOT_FOUND

Order does not exist.

400

UNSUPPORTED_OPERATION_DISK_BEING_RECYCLE

Operations on the disk in recycle bin are not supported.

400

UNSUPPORTED_OPERATION_INSTANCE_CHARGE_TYPE

Only operations on a pay-as-you-go disk are supported.

400

UNSUPPORTED_OPERATION_DISK_STATUS

Operations on the disk with current status are not supported.

Last updated