AttachDisks

1. API Description

This API is used to attach disks to 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.

instanceId

Yes

String

ID of the instance to which the disks to be attached.

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

Attach disks to an instance.

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

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

Response:
{
  "requestId": "T425ED37F-1BE5-4274-B068-9A58C51F21A8",
  "response": {
    "requestId": "T425ED37F-1BE5-4274-B068-9A58C51F21A8"
  }
}

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

Operations on undetachable disks are not supported.

400

UNSUPPORTED_OPERATION_INSTANCE_STATUS

Operations on the instance with current status are not supported.

400

UNSUPPORTED_OPERATION_DISK_ATTACHED

The current disk is already attached to other instance.

400

INVALID_DISK_AND_INSTANCE_ZONE_MISMATCHED

The disk and the instance to which you want to attach the disk should reside in the same availability zone.

400

LIMIT_EXCEEDED_INSTANCE_CAN_ATTACH

Quantity of attached disks exceed available disk numbers of an instance.

Last updated