> 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/cn/zec/disk/describelocaldiskspecs.md). Agents can also search and read this documentation through its [MCP server](https://docs.console.zenlayer.com/api-reference/~gitbook/mcp).

# DescribeLocalDiskSpecs

## 1. 接口描述

本接口(DescribeLocalDiskSpecs)用于查询指定可用区可售的本地盘规格。本地盘只能在创建实例时购买，按固定容量档位售卖。

{% hint style="info" %}
**注意事项**

* 本地盘只能在创建实例时购买（通过 [CreateZecInstances](https://docs.console.zenlayer.com/api-reference/cn/zec/instance/createzecinstances.md) 的`localDisks`参数），随实例删除而删除，不支持卸载、扩容、快照和单独释放。
* 本地盘按固定容量档位售卖，创建实例或询价时`localDisks.diskCategory`与`localDisks.diskSize`必须取本接口返回的组合。
* 返回空列表表示该可用区不售卖本地盘。
  {% endhint %}

## 2. 请求参数

以下请求参数列表仅列出了接口中需要的请求参数

| 参数名称   | 必选 | 类型     | 描述                                                                                                                                         |
| ------ | -- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------ |
| zoneId | 是  | String | <p>可用区ID。</p><p>可通过调用 <a href="https://docs.console.zenlayer.com/api-reference/cn/zec/location/describezones.md">DescribeZones</a> 获取。</p> |

## 3. 响应结果

| 参数名称           | 类型                                                                                                              | 描述                                                       |
| -------------- | --------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------- |
| requestId      | String                                                                                                          | <p>唯一请求 ID。</p><p>每次请求都会返回。定位问题时需要提供该次请求的 requestId。</p> |
| localDiskSpecs | Array of [LocalDiskSpec](https://docs.console.zenlayer.com/api-reference/cn/zec/datastructure.md#localdiskspec) | <p>可用区可售的本地盘规格列表。</p><p>返回空列表表示该可用区不售卖本地盘。</p>           |

## 4. 代码示例

{% tabs %}
{% tab title="示例" %}
**1. 查询可用区可售的本地盘规格。**

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

Request:
{
  "zoneId": "asia-southeast-1a"
}

Response:
{
  "requestId": "T6B4E2C1A-3D5F-4B7E-9A1C-2E8F0D6B4A13",
  "response": {
    "requestId": "T6B4E2C1A-3D5F-4B7E-9A1C-2E8F0D6B4A13",
    "localDiskSpecs": [
      {
        "diskCategory": "LOCAL_NVME_SSD",
        "diskSize": 375
      },
      {
        "diskCategory": "LOCAL_NVME_SSD",
        "diskSize": 575
      }
    ]
  }
}
```

**2. 可用区不售卖本地盘。**

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

Request:
{
  "zoneId": "europe-central-1a"
}

Response:
{
  "requestId": "T0C9D8E7F-6A5B-4C3D-2E1F-0A9B8C7D6E5F",
  "response": {
    "requestId": "T0C9D8E7F-6A5B-4C3D-2E1F-0A9B8C7D6E5F",
    "localDiskSpecs": []
  }
}
```

{% endtab %}
{% endtabs %}

## 5. 开发者工具

Zenlayer Cloud API 2.0 提供了配套的[开发工具集（SDK）](https://docs.console.zenlayer.com/api-reference/cn/api-introduction/toolkit.md)，未来会陆续支持更多开发语言，方便快速接入和使用Zenlayer的产品和服务。

## 6. 错误码

下面包含业务逻辑中遇到的错误码，其他错误码见[公共错误码](https://docs.console.zenlayer.com/api-reference/cn/api-introduction/instruction/commonerrorcode.md)

| HTTP状态码 | 错误码                       | 说明      |
| ------- | ------------------------- | ------- |
| 404     | INVALID\_ZONE\_NOT\_FOUND | 可用区不存在。 |
