ChangeDisksAttach

1. API Description

This API is used to attach one or more disks to another instance. These disks are already attached to one instance.

Note

  • Call this API to detach disks (DetachDisks) first and then attach disks (AttachDisks).

  • Status of disks must be IN_USE, and disks are already attached to other instance.

  • Disks are currently attached to the same instance.

  • Quantity of disks cannot exceed available disk numbers of new instance.

  • This API is an async API. A request ID is returned after the creation request is sent. However, it does not mean the operation has been completed. You can use DescribeDisks to query the instance to which disks are attached. If the instance has changed to the new one, it means that the operation is successful.

2. Input Parameters

The following request parameter list only provides API request parameters.

3. Output Parameters

4. Code Example

Attach disks to another instance.

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

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

Response:
{
  "requestId": "T425ED38F-1BE5-4274-B076-9A58C51F21A8",
  "response": {
    "requestId": "T425ED38F-1BE5-4274-B076-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.​

Last updated