ResizeDisk

1. API Description

This API is used to expand a cloud volume to a specified size.

Note

  • This API only supports expanding cloud disks.

  • This API is an async API. After the call, you can use DescribeDisks to query the status of the disk. If disk has been queried with the CHANGING status, it means that the disk is being expanding.

2. Input Parameters

The following request parameter list only provides API request parameters.

Parameter Name
Required
Type
Description

diskId

Yes

String

Disk ID.

Call DescribeDisks to get the disk ID.

diskSize

Yes

Integer

New disk size after expansion.

Unit: GB.

  • Must be greater than the current size

  • Maximum limit: 32,768 GB (32 TB).

  • Valid range: [1, ∞).

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

Expand a cloud volume to 100 GB.

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_SIZE_MAX_EXCEED

Disk size exceeds the maximum limit.

404

INVALID_DISK_NOT_FOUND

Disk not found.

400

INVALID_DISK_SIZE_PARAM_ERROR

Invalid disk size. It must be greater than the current size.

400

OPERATION_DENIED_INSTANCE_STATUS_NOT_SUPPORT

Operation not allowed in the current instance state.

400

INVALID_DISK_STATUS_NOT_SUPPORT

Operation not allowed in the current disk state.

Last updated