All Products
Search
Document Center

Simple Application Server:ListDisks

Last Updated:Oct 31, 2024

Queries the information about disks in a region.

Operation description

The InstanceId, DiskIds, and ResourceGroupId parameters are optional. However, you can specify them as filter conditions and combine them with the logical AND operator to filter disks that you want to query.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
swas-open:ListDisksget
  • Disk
    acs:swas-open:{#regionId}:{#accountId}:disk/{#DiskId}
  • Disk
    acs:swas-open:{#regionId}:{#accountId}:disk/*
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
RegionIdstringYes

The region ID of the disks.

cn-hangzhou
InstanceIdstringNo

The ID of the simple application server.

2ad1ae67295445f598017499dc****
DiskIdsstringNo

The IDs of the disks. The value can be a JSON array that consists of up to 100 disk IDs. Separate multiple disk IDs with commas (,).

["d-bp14wq0149cpp2x****", "d-bp14wq0149cpp2y****"]
PageSizeintegerNo

The number of entries per page.

Maximum value: 100.

Default value: 10.

10
PageNumberintegerNo

The page number.

Default value: 1.

1
DiskTypestringNo

The disk type. Valid values:

  • system: system disk
  • data: data disk

By default, system disks and data disks are both queried.

System
Tagarray<object>No

The tags that are added to the disks.

objectNo

The tags of the disk.

KeystringNo

The tag key. The tag key can be up to 64 characters in length. Valid values of N: 1 to 20.

TestKey
ValuestringNo

The tag value. The tag value can be up to 64 characters in length. Valid values of N: 1 to 20.

TestValue
ResourceGroupIdstringNo

The ID of the resource group.

rg-aek2bti7cf7****

Response parameters

ParameterTypeDescriptionExample
object
TotalCountinteger

The total number of entries returned.

1
RequestIdstring

The request ID.

20758A-585D-4A41-A9B2-28DA8F4F534F
PageSizeinteger

The number of entries per page.

10
PageNumberinteger

The page number.

1
Disksarray<object>

The queried disks.

Diskobject

The information about the disks.

CreationTimestring

The time when the disk was created. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.

2021-03-08T05:31:06Z
Statusstring

The status of the disk. Valid values:

  • ReIniting: The disk is being initialized.
  • Creating: The disk is being created.
  • In_use: The disk is in use.
  • Available: The disk can be attached.
  • Attaching: The disk is being attached.
  • Detaching: The disk is being detached.
In_use
Devicestring

The device name of the disk after the disk is attached to the simple application server.

/dev/xvda
Sizeinteger

The size of the disk. Unit: GB.

50
DiskNamestring

The name of the disk.

SystemDisk
DiskChargeTypestring

The billing method of the disk.

PrePaid
DiskTypestring

The disk type. Valid values:

  • system: system disk
  • data: data disk
System
Categorystring

The category of the disk. Valid values:

  • ESSD: enhanced SSD (ESSD) of PL0
  • SSD: standard SSD
  • CLOUD_EFFICIENCY: ultra disk
ESSD
DiskIdstring

The disk ID.

d-bp14wq0149cpp2x****
InstanceIdstring

The ID of the simple application server to which the disk is attached.

2ad1ae67295445f598017499dc****
RegionIdstring

The region ID.

cn-hangzhou
Remarkstring

The remarks of the disk.

remark
Tagsarray<object>

The tags that are added to the disks.

tagobject

The tags of the disk.

Keystring

The tag key.

TestKey
Valuestring

The tag value.

TestValue
InstanceNamestring

The name of the simple application server.

myInstance
ResourceGroupIdstring

The ID of the resource group to which the disk belongs.

rg-aek2bti7cf7****

Examples

Sample success responses

JSONformat

{
  "TotalCount": 1,
  "RequestId": "20758A-585D-4A41-A9B2-28DA8F4F534F",
  "PageSize": 10,
  "PageNumber": 1,
  "Disks": [
    {
      "CreationTime": "2021-03-08T05:31:06Z",
      "Status": "In_use",
      "Device": "/dev/xvda",
      "Size": 50,
      "DiskName": "SystemDisk",
      "DiskChargeType": "PrePaid",
      "DiskType": "System",
      "Category": "ESSD",
      "DiskId": "d-bp14wq0149cpp2x****",
      "InstanceId": "2ad1ae67295445f598017499dc****",
      "RegionId": "cn-hangzhou",
      "Remark": "remark",
      "Tags": [
        {
          "Key": "TestKey",
          "Value": "TestValue"
        }
      ],
      "InstanceName": "myInstance",
      "ResourceGroupId": "rg-aek2bti7cf7****"
    }
  ]
}

Error codes

HTTP status codeError codeError message
500InternalErrorAn error occurred while processing your request.

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2024-05-29The Error code has changed. The request parameters of the API has changed. The response structure of the API has changedView Change Details
2024-02-20The Error code has changed. The request parameters of the API has changed. The response structure of the API has changedView Change Details
2023-05-25API Description Update. The Error code has changed. The request parameters of the API has changed. The response structure of the API has changedView Change Details