> For the complete documentation index, see [llms.txt](https://docs.console.zenlayer.com/api-reference/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.console.zenlayer.com/api-reference/compute/zec/disk/inquirypriceresizedisk.md).

# InquiryPriceResizeDisk

## 1. API Description

This API (InquiryPriceResizeDisk) is used to inquire the new price after expanding a cloud disk

{% hint style="info" %}
**Notes**

* The target size must be greater than or equal to the current cloud disk size.
  {% endhint %}

## 2. Input Parameters

The following request parameter list only provides API request parameters.

| Parameter Name | Required | Type    | Description                                                                                            |
| -------------- | -------- | ------- | ------------------------------------------------------------------------------------------------------ |
| diskId         | Yes      | String  | Cloud disk ID.                                                                                         |
| diskSize       | Yes      | Integer | <p>Target size of the cloud disk after expansion.</p><p>Unit: GiB.</p><p>Value range: \[20, 20000]</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>                                               |
| diskPrice      | [PriceItem](/api-reference/compute/zec/datastructure.md#priceitem)       | Price of the cloud disk after expansion.                                                                                                                            |
| specPrice      | [PriceItem](/api-reference/compute/zec/datastructure.md#priceitem)       | <p>Spec price of the corresponding instance when expanding a system disk.</p><p>Returned only when the cloud disk is a system disk and the instance type is VM.</p> |
| gpuPrice       | [PriceItem](/api-reference/compute/zec/datastructure.md#priceitem)       | <p>GPU price of the corresponding instance when expanding a system disk.</p><p>Returned only when the cloud disk is a system disk and the instance type is GPU.</p> |
| diskPerf       | [DiskPerfItem](/api-reference/compute/zec/datastructure.md#diskperfitem) | Performance configuration details of the cloud disk after expansion.                                                                                                |

## 4. Code Example

{% tabs %}
{% tab title="Example" %}
**Inquires the new price and performance configuration after expanding a cloud disk to 500 GiB.**

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

Request:
{
  "diskId": "disk-xxx",
  "diskSize": 500
}

Response:
{
  "requestId": "T12345678-A123-4B5C-DE67-8F9G01234567",
  "response": {
    "requestId": "T12345678-A123-4B5C-DE67-8F9G01234567",
    "diskPrice": {
      "discount": 100.0,
      "discountPrice": null,
      "originalPrice": null,
      "unitPrice": 0.138,
      "discountUnitPrice": 0.138,
      "chargeUnit": "HOUR",
      "stepPrices": null
    },
    "specPrice": null,
    "gpuPrice": null,
    "diskPerf": {
      "maxIops": 25000,
      "maxBandwidth": 350,
      "iopsBurst": 50000,
      "bandwidthBurst": 700
    }
  }
}
```

{% 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                                                  |
| ---------------- | --------------------------------- | ------------------------------------------------------------ |
| 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              | INVALID\_DISK\_SIZE\_MAX\_EXCEED  | Disk size exceeds the maximum limit.                         |
