# ResizeDisk

## 1. API Description

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

{% hint style="info" %} <mark style="color:blue;">**Note**</mark>

* <mark style="color:blue;">This API only supports expanding cloud disks.</mark>
* <mark style="color:blue;">This API is an async API. After the call, you can use</mark> [<mark style="color:purple;">`DescribeDisks`</mark>](/api-reference/compute/zec/disk/describedisks.md) <mark style="color:blue;">to query the status of the disk. If disk has been queried with the</mark> <mark style="color:blue;">`CHANGING`</mark> <mark style="color:blue;">status, it means that the disk is being expanding.</mark>
  {% endhint %}

## 2. Input Parameters

The following request parameter list only provides API request parameters.

| Parameter Name | Required | Type    | Description                                                                                                                                                                           |
| -------------- | -------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| diskId         | Yes      | String  | <p>Disk ID.</p><p>Call DescribeDisks to get the disk ID.</p>                                                                                                                          |
| diskSize       | Yes      | Integer | <p>New disk size after expansion.</p><p>Unit: GB .</p><p>Must be greater than the current size Maximum limit: 32,768 GB (32 TB). Valid range: \[1, ∞).</p><p>Value range: \[1, +)</p> |

## 3. Output Parameters

| Parameter Name | Type   | Description                                                                                                           |
| -------------- | ------ | --------------------------------------------------------------------------------------------------------------------- |
| requestId      | String | <p>The unique request ID, which is returned for each request.</p><p>RequestId is required for locating a problem.</p> |

## 4. Code Example

{% tabs %}
{% tab title="Example" %}
**Expand a cloud volume to 100 GB.**

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

Request：
{
    "diskId": "<Disk ID>",
    "diskSize": 100
}

Response：
{
  "requestId": "T05992D0C-7E8B-4047-B0C0-780F2CD549D3",
  "response": {
    "requestId": "T05992D0C-7E8B-4047-B0C0-780F2CD549D3"
  }
}
```

{% endtab %}
{% endtabs %}

## 5. Developer Resources

Zenlayer Cloud API 2.0 integrates [SDKs](/api-reference/api-introduction/toolkit/api-sdk.md)，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](/api-reference/api-introduction/instruction/commonerrorcode.md).

| HTTP Status Code | Error Code                                        | Description                                                   |
| ---------------- | ------------------------------------------------- | ------------------------------------------------------------- |
| 400              | INVALID\_DISK\_SIZE\_MAX\_EXCEED                  | Disk size exceeds the maximum limit.                          |
| 404              | INVALID\_DISK\_NOT\_FOUND                         | Disk does not exist.                                          |
| 400              | INVALID\_DISK\_SIZE\_PARAM\_ERROR                 | Invalid disk size. It must be greater than the current size.  |
| 400              | OPERATION\_DENIED\_INSTANCE\_STATUS\_NOT\_SUPPORT | Current instance state does not allow this operation.         |
| 400              | OPERATION\_DENIED\_DISK\_STATUS                   | Operations on the disk with current status are not supported. |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.console.zenlayer.com/api-reference/compute/zec/disk/resizedisk.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
