# DescribeDisks

## 1. 接口描述

本接口(DescribeDisks)用于查询云盘的列表信息。

## 2. 请求参数

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

| 参数名称            | 必选 | 类型                                                                      | 描述                                    |
| --------------- | -- | ----------------------------------------------------------------------- | ------------------------------------- |
| diskIds         | 否  | Array of String                                                         | 根据云盘ID列表筛选。                           |
| diskName        | 否  | String                                                                  | 根据云盘名称筛选，该字段支持模糊搜索。                   |
| diskStatus      | 否  | [DiskStatus](/api-reference/cn/compute/zec/datastructure.md#diskstatus) | 根据云盘的状态进行筛选。                          |
| diskType        | 否  | [DiskType](/api-reference/cn/compute/zec/datastructure.md#disktype)     | 根据云盘的类型进行筛选。                          |
| diskCategory    | 否  | String                                                                  | 根据云盘的分类进行筛选。                          |
| instanceId      | 否  | String                                                                  | 根据云盘挂载的实例ID进行筛选。                      |
| zoneId          | 否  | String                                                                  | 根据云盘所在的可用区进行筛选。                       |
| pageNum         | 否  | Integer                                                                 | <p>返回的分页数。</p><p>默认值：1</p>            |
| pageSize        | 否  | Integer                                                                 | <p>返回的分页大小。</p><p>默认为20，最大为1000。</p>  |
| regionId        | 否  | String                                                                  | 根据云盘所在的节点ID进行筛选。                      |
| snapshotAbility | 否  | Boolean                                                                 | 根据云盘是否有快照能力进行筛选。                      |
| resourceGroupId | 否  | String                                                                  | 根据快照所属的资源组进行筛选。                       |
| tagKeys         | 否  | Array of String                                                         | <p>根据标签键进行搜索。</p><p>最长不得超过20个标签键。</p> |
| tags            | 否  | Array of [Tag](/api-reference/cn/compute/zec/datastructure.md#tag)      | <p>根据标签进行搜索。</p><p>最长不得超过20个标签。</p>   |

## 3. 响应结果

| 参数名称       | 类型                                                                           | 描述                                                       |
| ---------- | ---------------------------------------------------------------------------- | -------------------------------------------------------- |
| requestId  | String                                                                       | <p>唯一请求 ID。</p><p>每次请求都会返回。定位问题时需要提供该次请求的 requestId。</p> |
| totalCount | Integer                                                                      | 符合条件的数据总数。                                               |
| dataSet    | Array of [DiskInfo](/api-reference/cn/compute/zec/datastructure.md#diskinfo) | 云盘的结果集。                                                  |

## 4. 代码示例

{% tabs %}
{% tab title="示例" %}
**1. 查询云硬盘列表。**

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

Request：
{
  "diskStatus": "IN_USE",
  "diskSize": 20,
  "zoneId": "asia-east-1a"
}

Response：
{
  "requestId": "TB96A2CBB-F6D8-402B-B58B-7D869E4FC6EA",
  "response": {
    "requestId": "TB96A2CBB-F6D8-402B-B58B-7D869E4FC6EA",
    "totalCount": 1,
    "dataSet": [
      {
        "diskName": "Boot-disk-asia-east-1a-20GiB-01",
        "period": null,
        "resourceGroupName": "Default Resource Group",
        "instanceName": "Ubuntu-1vCPU-2gb-asia-east-1a-1",
        "chargeType": "PAY_AS_YOU_GO_BY_HOUR",
        "snapshotAbility": true,
        "portable": false,
        "expiredTime": null,
        "diskSize": 20,
        "instanceId": "your instance id",
        "regionId": "asia-east-1",
        "createTime": "2025-07-02T03:41:32Z",
        "serial": "d2n7st313u62hsnqrr7g",
        "zoneId": "asia-east-1a",
        "autoSnapshotPolicyId ": null,
        "diskStatus": "IN_USE",
        "diskId": "your disk id",
        "resourceGroupId": "e48af6cc-095b-494c-92b1-d0c011bc9e87",
        "diskType": "SYSTEM",
        "diskCategory": "Basic NVMe SSD",
        "tags":null
      }
    ]
  }
}
```

{% endtab %}
{% endtabs %}

## 5. 开发者工具

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

## 6. 错误码

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

| HTTP状态码 | 错误码 | 说明 |
| ------- | --- | -- |


---

# 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/cn/compute/zec/disk/describedisks.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.
