Query a disk

Last Updated: Jul 25, 2017

Description

In the parameters below, RegionId, ZoneId, DiskIds, InstanceId, and the like are filter parameters. The parameters are of the logical relation of AND. DiskIds is a Json format Json Array. The format is shown below.

If this parameter is blank, the filter will not take effect. However, if DiskIds is an empty Json Array (i.e. []), the filter is regarded as effective and a blank result will be returned.

Request Parameters

Name Type Required Description
Action String Yes Required parameter, with a value: DescribeDisks.
RegionId String Yes The Region ID of the disk. See Regions and zones for region IDs.
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 all | system | data. The default value is all.
Category String No The disk category
all | cloud | ephemeral. The default value is all.
Status String No The disk status
In_use | Available | Attaching | Detaching | Creating | ReIniting | All. The default value is All.
SnapshotId String No The snapshot used to create the disk.
Name String No Description
Portable String No Whether or not the disk can be detached:
  • True indicates it is an independent general cloud disk that exists independently and can be freely attached and detached in a zone.
  • False indicates it is not an independent General cloud disk. These disks are created and deleted along with instances.
If the user needs to perform attach or detach operations, he needs to query disks with a property value of true.
For ephemeral disks, general cloud system disks, and general cloud disks with monthly 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 indicates that when the instance is released, this disk will be released with it.
  • False indicates that when the instance is released, this disk will be retained.
DeleteAutoSnapshot String No Whether or not auto snapshots are deleted when the disk is deleted.
  • True indicates the auto snapshots are deleted with the disk.
  • False indicates the auto snapshots are retained.
PageNumber Integer No The current page of the disk status list. The start value is 1 and the default value is 1.
PageSize Integer No The number of lines per page set for paging query. The maximum value is 50 and default value is 10.

Return 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

Error Code

Error Code Description Http status code Meaning
MissingParameter The input parameter RegionId that is mandatory for processing this request is not supplied. 400 The RegionId parameter is not specified. See Regions and zones for region IDs.
InvalidDiskType.ValueNotSupported The specified disk type is not supported. 400 The specified disk type is not supported.
InvalidCategory.ValueNotSupported The specified disk category is not supported. 400 The specified disk category is not supported or not authorized.
InvalidStatus.ValueNotSupported The specified disk status is not supported. 400 The specified disk status is not supported.
InvalidParameter The specified parameter Portable is not valid. 400 The specified Portable parameter is invalid.
InvalidParameter The specified parameter DeleteWithInstance is not valid. 400 The specified DeleteWithInstance parameter is invalid.
InvalidParameter The specified parameter DeleteAutoSnapshot is not valid. 400 The specified DeleteAutoSnapshot parameter is invalid.
InvalidParameter The specified parameter PageNumber is not valid. 400 The specified PageNumber parameter is invalid.
InvalidParameter The specified parameter PageSize is not valid. 400 The specified PageSize parameter is invalid.
InvalidDiskIds.Malformed The amount of specified disk Ids exceeds the limit. 403 The specified DiskId format is incorrect.

Examples

Request Example

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

Return 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. }
Thank you! We've received your feedback.