> 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/vm/disk/describedisks.md).

# DescribeDisks

## 1. API Description

This API (DescribeDisks) is used to query the details of disks.

## 2. Input Parameters

The following request parameter list only provides API request parameters.

| Parameter Name  | Required | Type                                                                | Description                                                                                                                                                                                                                                                                                       |
| --------------- | -------- | ------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| diskIds         | No       | Array of String                                                     | ID list of disks.                                                                                                                                                                                                                                                                                 |
| diskName        | No       | String                                                              | Disk name.                                                                                                                                                                                                                                                                                        |
| diskStatus      | No       | [DiskStatus](/api-reference/compute/vm/datastructure.md#diskstatus) | Disk status.                                                                                                                                                                                                                                                                                      |
| diskType        | No       | [DiskType](/api-reference/compute/vm/datastructure.md#disktype)     | Disk type.SYSTEM: System Disk;DATA: Data Disk.                                                                                                                                                                                                                                                    |
| diskCategory    | No       | String                                                              | <p>Disk type.Standard Disk: Hard Disk DriveSSD: Solid State DriveThe default value is Standard Disk.</p><p>Call DescribeDiskCategory to obtain disk type.</p>                                                                                                                                     |
| diskSize        | No       | Integer                                                             | <p>Disk size. Unit: GB.</p><p>Value range: \[20, 20000]</p>                                                                                                                                                                                                                                       |
| portable        | No       | Boolean                                                             | <p>Whether the disk is detachable or not.</p><p>true: the disk is detachable, and thus will not be deleted while deleting its attached instance and becomes AVAILABLE.</p><p>false: the disk is undetachable, and thus will be deleted at the same time while deleting its attached instance.</p> |
| instanceId      | No       | String                                                              | Instance ID.                                                                                                                                                                                                                                                                                      |
| zoneId          | No       | String                                                              | <p>Zone ID.</p><p>To obtain zone ID, call DescribeZones.</p>                                                                                                                                                                                                                                      |
| pageNum         | No       | Integer                                                             | <p>Number of pages returned.</p><p>Default value: 1.</p><p>Default value: 1</p>                                                                                                                                                                                                                   |
| pageSize        | No       | Integer                                                             | <p>Number of items in the current page result.</p><p>Default value: 20;</p><p>Maximum value: 1000.</p>                                                                                                                                                                                            |
| resourceGroupId | No       | String                                                              | <p>Resource group ID.</p><p>If the value is null, then return all the instances in the authorized resource groups.</p>                                                                                                                                                                            |
| tagKeys         | No       | Array of String                                                     | <p>Query using tag keys.</p><p>A maximum of 20 tag keys can be used.</p>                                                                                                                                                                                                                          |
| tags            | No       | Array of [Tag](/api-reference/compute/vm/datastructure.md#tag)      | <p>Query using tags.</p><p>A maximum of 20 tags can be used.</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> |
| totalCount     | Integer                                                                  | Number of disks meeting the filtering conditions.                                                                     |
| dataSet        | Array of [DiskInfo](/api-reference/compute/vm/datastructure.md#diskinfo) | Information on a disk.                                                                                                |

## 4. Code Example

{% tabs %}
{% tab title="Example" %}
**Query the details of disks.**

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

Request:
{
  "diskStatus": "AVAILABLE",
  "diskSize": 20,
  "portable": true,
  "zoneId": "SIN-E"
}

Response:
{
  "requestId": "T83B6A963-B111-4BF9-8466-1C3351E2DFD1",
  "response": {
    "requestId": "T83B6A963-B111-4BF9-8466-1C3351E2DFD1",
    "dataSet": [
      {
        "diskName": "default-SIN-20GB-01",
        "period": 1,
        "instanceName": "Test-Instanc",
        "chargeType": "PREPAID",
        "portable": true,
        "expiredTime": "2023-02-01T00:00:00Z",
        "diskSize": 20,
        "instanceId": "your-instance-id-1",
        "createTime": "2023-02-01T00:00:00Z",
        "zoneId": "SIN-E",
        "diskStatus": "AVAILABLE",
        "diskId": "disk-id-1",
        "diskType": "DATA",
        "diskCategory": "Standard Disk",
        "autoRenew": true
      },
      {
        "diskName": "default-SIN-20GB-01",
        "period": 1,
        "instanceName": "Test-Instance",
        "chargeType": "PREPAID",
        "portable": true,
        "expiredTime": "2023-02-01T00:00:00Z",
        "diskSize": 20,
        "instanceId": "your-instance-id-1",
        "createTime": "2023-01-01T00:00:00Z",
        "zoneId": "SIN-E",
        "diskStatus": "AVAILABLE",
        "diskId": "disk-id-2",
        "diskType": "SYSTEM",
        "diskCategory": "Standard Disk",
        "autoRenew": true
      }
    ],
    "totalCount": 2
  }
}
```

{% 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\_ZONE\_NOT\_FOUND | Zone not found. |
