GetVolumes【获取云硬盘列表】¶
获取云硬盘列表:指定获取磁盘类型disk/system,可获取数据盘/系统盘信息列表。
Request Parameters
Parameter name | Type | Description | Required |
---|---|---|---|
action | String | API 标识符 | Yes |
type | String | 磁盘类型,有效值 disk, system disk:数据盘
system:系统盘
|
Yes |
Response Elements
Name | Type | Description |
---|---|---|
message | String | 执行结果信息 |
code | Integer | HTTP Resonpe响应状态码 |
data | Array | JSON 格式的云硬盘信息列表,每项参数可见下面 Data Item |
Data Item
Name | Type | Description |
---|---|---|
status | String | 云硬盘状态(是否已绑定到云主机) |
billing_type | String | 计费类型 |
display_name | String | 云硬盘名称 |
volume_type | String | 云硬盘类型 |
bootable | Boolean | 是否为系统启动盘 |
instance_name | String | 绑定的主机名称 |
id | String | 云硬盘ID |
display_description | String | 云硬盘的描述 |
size | Integer | 云硬盘的大小 |
Example
Example Request:
Request Headers:
POST /api/ HTTP/1.1
Origin: https://console.plcloud.com
X-CSRFToken: 6An6xEuOJqW6dVDtlgzZr6FqgkSbJmqp
Content-Type: application/x-www-form-urlencoded
Form Data:
action: GetVolumes
type: disk
Example Response:
{
"message": "成功",
"code": 200,
"data": [
{
"status": "in-use",
"billing_type": "hour",
"instance_name": "host-1",
"display_name": "disk",
"volume_type": "SAS",
"bootable": "false",
"id": "bfebb74e-6257-43f3-bae2-f50a4f350959",
"display_description": "test",
"size": 11
}
]
}