DescribeDisks

Last Updated: Feb 06, 2018

Description

Queries your available cloud disks. When you call this interface, consider the following:

  • You can specify request parameters to separate the possible response results. Request parameters, such as RegionId, ZoneId, DiskIds, and InstanceId, act as a filter, and parameters are passed in the logical relation of AND (&&).

  • The value of parameter DisksIds is a Json array in the format of [“DiskId1”, “DiskId2”, “DiskId3”, …], you can specify at most 100 DiskId each time. If DiskIds is not passed, no disk is specified. If you specify DiskIds=[], all your cloud disks are queried.

Request parameters

Name Type Required Description
Action String Yes The name of this interface. Value: DescribeDisks.
RegionId String Yes The Region ID of the disk. See Regions and zones for more information.
ZoneId String No The default value is blank, which indicates a query of disks in all zones.
DiskIds String No ID of the disk. A formatted Json Array: [“d-xxxxxxxxx”, “d-yyyyyyyyy”, … “d-zzzzzzzzz”]. A maximum of 10 IDs separated by single-byte commas.
InstanceId String No ID of an instance.
DiskType String No The type of disk. Value range:
  • all
  • system
  • data
The default value: all.
Category String No The disk category. Optional values:
  • all
  • cloud: Basic cloud disk
  • cloud_efficiency: Ultra cloud disk
  • cloud_ssd: Cloud SSD
  • ephemeral: Ephemeral disk
  • ephemeral_ssd: Ephemeral SSD
  • local_ssd_pro: Local NVMe SSD
  • local_hdd_pro: Local SATA HDD
Default value: all.
Status String No Disk status. See Basic Cloud Disk Status Table for more information. Value range:
  • In_use
  • Available
  • Attaching
  • Detaching
  • Creating
  • ReIniting
  • All
The default value: All.
SnapshotId String No The snapshot used to create the disk.
DiskName String No The name of queried disk.
Encrypted Boolean No Filter an encrypted disk. Value range:
  • true: Only query encrypted disks.
  • false: Have no restriction on the encryption attribute.
The default value: false.
Portable String No Whether or not the disk can be detached. Value range:
  • True: an independent general cloud disk that exists independently and can be freely attached and detached in a zone.
  • False: not an independent General cloud disk. These disks are created and deleted along with instances.
If the user needs to attach or detach a disk, he needs to query disks with a property value of true.
For ephemeral disks, general cloud system disks, and general cloud disks with subscriptions, this property has a value of false.
Users cannot modify this property.
DeleteWithInstance String No Whether or not the disk is released along with the instance:
  • True: when the instance is released, this disk is released with it.
  • False: when the instance is released, this disk is retained.
Default value: false.
DeleteAutoSnapshot String No Whether or not auto snapshots are deleted when the disk is deleted. Value range:
  • True: the auto snapshots are deleted with the disk.
  • False: the auto snapshots are retained.
Default value: false.
EnableAutoSnapshot String No Whether the queried cloud disks have been applied automatic snapshot policies. Optional values:
  • true: The queried cloud disks have been applied automatic snapshot policies.
  • false: The queried cloud disks have no automatic snapshot policies applied.
Default value: false.
DiskChargeType String No The billing method of the queried cloud disks. Optional values:
Tag.n.Key String No The key of tag to which your cloud disk has been attached. Value range of n: [1, 5].
Tag.n.Value String No The value of tag to which your cloud disk has been attached. Value range of n: [1, 5].
PageNumber Integer No The current page of the disk status list. The start value: 1.
Default value: 1.
PageSize Integer No The number of lines per page set for paging query. The maximum value: 100.
Default value: 10.

Response parameters

Name Type Description
RegionId String The region ID of the image
TotalCount Integer The total number of instances
PageNumber Integer The page number of the instance list
PageSize Integer The number of lines per page set during input
Disks DiskItemType A collection composed of disk information, such as DiskItemType

Examples

Request example

  1. https://ecs.aliyuncs.com/?Action=DescribeDisks
  2. &RegionId=cn-qingdao
  3. &PageNumber=1
  4. &ZoneId=cn-qingdao-b
  5. &<Common Request Parameters>

Response example

XML format

  1. <DescribeDisksResponse>
  2. <Disks>
  3. <Disk>
  4. <DeleteAutoSnapshot>true</DeleteAutoSnapshot>
  5. <DeleteWithInstance>false</DeleteWithInstance>
  6. <EnableAutoSnapshot>false</EnableAutoSnapshot>
  7. <Category>cloud</Category>
  8. <Description></Description>
  9. <DiskName></DiskName>
  10. <Size>5</Size>
  11. <Type>data</Type>
  12. <InstanceId></InstanceId>
  13. <CreationTime>2014-07-23T02:44:07Z</CreationTime>
  14. <ImageId></ImageId>
  15. <ZoneId>cn-qingdao-b</ZoneId>
  16. <AttachedTime>2014-07-23T07:47:35Z</AttachedTime>
  17. <DetachedTime>2014-07-23T08:28:48Z</DetachedTime>
  18. <Device></Device>
  19. <OperationLocks></OperationLocks>
  20. <Portable>true</Portable>
  21. <ProductCode></ProductCode>
  22. <RegionId>cn-qingdao</RegionId>
  23. <DiskId>d-28m5zbua0</DiskId>
  24. <SourceSnapshotId></SourceSnapshotId>
  25. <Status>Available</Status>
  26. </Disk>
  27. <Disk>
  28. <DeleteAutoSnapshot>true</DeleteAutoSnapshot>
  29. <DeleteWithInstance>false</DeleteWithInstance>
  30. <EnableAutoSnapshot>false</EnableAutoSnapshot>
  31. <Category>cloud</Category>
  32. <Description></Description>
  33. <DiskName></DiskName>
  34. <Size>5</Size>
  35. <Type>data</Type>
  36. <InstanceId></InstanceId>
  37. <CreationTime>2014-07-23T02:44:06Z</CreationTime>
  38. <ImageId></ImageId>
  39. <ZoneId>cn-qingdao-b</ZoneId>
  40. <AttachedTime></AttachedTime>
  41. <DetachedTime></DetachedTime>
  42. <Device></Device>
  43. <OperationLocks></OperationLocks>
  44. <Portable>true</Portable>
  45. <ProductCode></ProductCode>
  46. <RegionId>cn-qingdao</RegionId>
  47. <DiskId>d-28zfrmo13</DiskId>
  48. <SourceSnapshotId></SourceSnapshotId>
  49. <Status>Available</Status>
  50. </Disk>
  51. </Disks>
  52. <PageNumber>1</PageNumber>
  53. <PageSize>2</PageSize>
  54. <TotalCount>9</TotalCount>
  55. <RequestId>ED5CF6DD-71CA-462C-9C94-A61A78A01479</RequestId>
  56. </DescribeDisksResponse>

JSON format

  1. {
  2. "Disks": {
  3. "Disk": [
  4. {
  5. "AttachedTime": "2014-07-23T07:47:35Z",
  6. "Category": "cloud",
  7. "CreationTime": "2014-07-23T02:44:07Z",
  8. "DeleteAutoSnapshot": "true",
  9. "DeleteWithInstance": "false",
  10. "EnableAutoSnapshot": "false"
  11. "Description": "",
  12. "DetachedTime": "2014-07-23T08:28:48Z",
  13. "Device": "",
  14. "DiskId": "d-28m5zbua0",
  15. "DiskName": "",
  16. "ImageId": "",
  17. "InstanceId": "",
  18. "OperationLocks": {
  19. "OperationLock": []
  20. },
  21. "Portable": "true",
  22. "ProductCode": "",
  23. "RegionId": "cn-qingdao",
  24. "Size": "5",
  25. "SourceSnapshotId": "",
  26. "Status": "Available",
  27. "Type": "data",
  28. "ZoneId": "cn-qingdao-b"
  29. },
  30. {
  31. "AttachedTime": "",
  32. "Category": "cloud",
  33. "CreationTime": "2014-07-23T02:44:06Z",
  34. "DeleteAutoSnapshot": "true",
  35. "DeleteWithInstance": "false",
  36. "EnableAutoSnapshot": "false",
  37. "Description": "",
  38. "DetachedTime": "",
  39. "Device": "",
  40. "DiskId": "d-28zfrmo13",
  41. "DiskName": "",
  42. "ImageId": "",
  43. "InstanceId": "",
  44. "OperationLocks": {
  45. "OperationLock": []
  46. },
  47. "Portable": "true",
  48. "ProductCode": "",
  49. "RegionId": "cn-qingdao",
  50. "Size": 5,
  51. "SourceSnapshotId": "",
  52. "Status": "Available",
  53. "Type": "data",
  54. "ZoneId": "cn-qingdao-b"
  55. }
  56. ]
  57. },
  58. "PageNumber": 1,
  59. "PageSize": 2,
  60. "RequestId": "ACD9BBB0-A9D1-46D7-9630-B7A69889E110",
  61. "TotalCount": 9
  62. }

Error codes

Error code Error message HTTP status code Meaning
InvalidCategory.ValueNotSupported The specified disk category is not supported. 400 The specified Category is not supported. Otherwise, you are not authorized to use the specified DiskType.
InvalidDiskType.ValueNotSupported The specified disk type is not supported. 400 The specified DiskType is not supported.
InvalidRegion.NotFound The specified parameter RegionId is not valid. 400 The specified RegionId does not exist.
InvalidStatus.ValueNotSupported The specified disk status is not supported. 400 The specified Status is not supported.
InvalidTag.Mismatch The specified Tag.n.Key and Tag.n.Value are not match. 400 The specified Tag.n.Key and Tag.n.Value must be matched.
InvalidTagCount The specified tags are beyond the permitted range. 400 A maximum of 5 Tag.n.Key can be spacified.
InvalidZoneId.NotFound The ZoneId provided does not exist. 400 The specified ZoneId does not exist.
InvalidDiskIds.Malformed The amount of specified disk Ids exceeds the limit. 403 The maximum number of DiskId is exceeded.
InvalidDiskChargeType.NotFound The DiskChargeType does not exist. 404 The specified DiskChargeType does not exist.
Thank you! We've received your feedback.