> 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/zec/disk/inquirypriceresizedisk.md).

# InquiryPriceResizeDisk

## 1. API Description

This API (InquiryPriceResizeDisk) is used to inquire the new price after expanding a disk. The currently effective price of each billing item before the expansion is also returned through previousPrices, so that you can compare which billing items have price changes.

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

* The target size must be greater than or equal to the current disk size.
  {% 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>It can be obtained by calling <a href="/api-reference/zec/disk/describedisks.md">DescribeDisks</a>.</p> |
| 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/zec/datastructure.md#priceitem)                               | Price of the cloud disk after expansion.                                                                                                                                                                                             |
| specPrice        | [PriceItem](/api-reference/zec/datastructure.md#priceitem)                               | <p>Instance type price of the corresponding instance when the system disk is expanded.</p><p>It is returned only when the disk is a system disk and the instance type is VM.</p>                                                     |
| gpuPrice         | [PriceItem](/api-reference/zec/datastructure.md#priceitem)                               | <p>GPU price of the corresponding instance when the system disk is expanded.</p><p>It is returned only when the disk is a system disk and the instance type is GPU.</p>                                                              |
| acceleratorPrice | [PriceItem](/api-reference/zec/datastructure.md#priceitem)                               | <p>Accelerator 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 accelerator.</p>                                                  |
| diskPerf         | [DiskPerfItem](/api-reference/zec/datastructure.md#diskperfitem)                         | Performance configuration details of the cloud disk after expansion.                                                                                                                                                                 |
| previousPrices   | [ResizeDiskPreviousPrices](/api-reference/zec/datastructure.md#resizediskpreviousprices) | <p>Currently effective price of each billing item before the expansion. The fields correspond one by one to those above and are used to compare which billing items have price changes.</p><p>It is null when there is no order.</p> |

## 4. Code Example

{% tabs %}
{% tab title="Example" %}
**Query the new price and performance configuration after expanding a 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,
    "acceleratorPrice": null,
    "diskPerf": {
      "maxIops": 25000,
      "maxBandwidth": 350,
      "iopsBurst": 50000,
      "bandwidthBurst": 700
    },
    "previousPrices": {
      "diskPrice": {
        "discount": 100.0,
        "discountPrice": null,
        "originalPrice": null,
        "unitPrice": 0.11,
        "discountUnitPrice": 0.11,
        "chargeUnit": "HOUR",
        "stepPrices": null
      },
      "specPrice": null,
      "gpuPrice": null,
      "acceleratorPrice": null
    }
  }
}

The example above is a data disk expansion, in which only the disk billing item has a price change (0.11 → 0.138), and the three instance-side fields are all null.

When the system disk is expanded, the specification price of the instance it belongs to is returned as well. The three fields are mutually exclusive depending on the instance type: a VM returns `specPrice`, a GPU returns `gpuPrice`, and an accelerator returns `acceleratorPrice`, with the other two being null. The fields with the same names under `previousPrices` correspond to them one by one.
```

{% 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.                         |
