DetachDisks

1. API Description

This API is used to detach one or more disks from an instance.

2. Input Parameters

The following request parameter list only provides API request parameters.

Parameter Name
Required
Type
Description

diskIds

Yes

Array of String

ID list of disks to be detached.

3. Output Parameters

Parameter Name
Type
Description

requestId

String

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

4. Code Example

Detach one or more disks from an instance.

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

Request:
{
  "diskIds": [
    "your-disk-id"
  ]
}

Response:
{
  "requestId": "T86A56634-582A-4615-BBE2-ABFE192EE7CE",
  "response": {
    "requestId": "T86A56634-582A-4615-BBE2-ABFE192EE7CE"
  }
}

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 Code
Error Code
Description

400

INVALID_DISK_NOT_PORTABLE

Disk is not detachable.

400

UNSUPPORTED_OPERATION_DISK_STATUS

Operations on the disk with current status are not supported.

400

UNSUPPORTED_OPERATION_INSTANCE_STATUS

Operations on the instance with current status are not supported.

400

UNSUPPORTED_OPERATION_DISK_SYSTEM_TYPE

Operations on boot disks are not supported.

400

UNSUPPORTED_OPERATION_DISK_NO_ATTACH

Disk is not attached to any instance.

400

UNSUPPORTED_OPERATION_DISK_BELONG_MULTIPLE_INSTANCE

Disks are attached to different instances.

Last updated