DescribeDisks

1. API Description

This API is used to query the details of disks.

2. Input Parameters

The following request parameter list only provides API request parameters.

Parameter NameRequiredTypeDescription

diskIds

No

Array of String

ID list of disks.

diskName

No

String

Disk name.

diskStatus

No

Disk status.

diskType

No

String

Disk type.

  • SYSTEM: System Disk;

  • DATA: Data Disk.

diskSize

No

Integer

Disk size. Unit: GB.

diskCategory

No

String

Disk type.

  • Standard Disk: Hard Disk Drive

  • SSD: Solid State Drive

The default value is Standard Disk. Call DescribeDiskCategory to obtain disk type.

portable

No

Boolean

Whether the disk is detachable or not. true: the disk is detachable, and thus will not be deleted while deleting its attached instance and becomes AVAILABLE. false: the disk is undetachable, and thus will be deleted at the same time while deleting its attached instance.

instanceId

No

String

Instance ID.

zoneId

No

String

Zone ID. To obtain zone ID, call DescribeZones.

pageSize

No

Integer

Number of items in the current page result.

Default value: 20;

Maximum value: 1000.

pageNum

No

Integer

Number of pages returned.

Default value: 1.

3. Output Parameters

Parameter NameTypeDescription

requestId

String

The unique request ID, which is returned for each request. RequestId is required for locating a problem.

totalCount

Integer

Number of disks meeting the filtering conditions.

dataSet

Array of DiskInfo

Information on a disk.

4. Code Example

Query the details of disks.

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
  }
}

5. Developer Resources

Zenlayer Cloud API 2.0 integrates SDKs 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.​

HTTP Status CodeError CodeDescription

404

INVALID_ZONE_NOT_FOUND

Zone does not exist.

Last updated