VolumeCreate【新建云硬盘】¶
创建一块云硬盘:可根据创建源类型创建空白云硬盘或基于快照的硬盘,如果选择快照作为源类型,必须指定快照ID。
Request Parameters
Parameter name | Type | Description | Required |
---|---|---|---|
action | String | API 标识符 | Yes |
description | String | 云硬盘的描述 | No |
image_source | String | 源镜像 | No |
billing_type | String | 计费类型,有效值有hour,month | Yes |
name | String | 云硬盘名称 | Yes |
size | String | 云硬盘的大小 | Yes |
snapshot_source | String | 选择指定快照作为源 | Yes |
type | String | 云硬盘类型 | Yes |
volume_source_type | String | 云硬盘创建源类型,有效值有no_source_type,snapshot_source no_source_type:空白云硬盘作为源
snapshot_source:快照作为源
|
Yes |
Response Elements
Name | Type | Description |
---|---|---|
message | String | 执行结果信息 |
code | Integer | HTTP Resonpe响应状态码 |
Example
Example Request:
Request Headers:
POST /api/ HTTP/1.1
Origin: https://console.plcloud.com
X-CSRFToken: 6An6xEuOJqW6dVDtlgzZr6FqgkSbJmqp
Content-Type: application/json
JSON Data:
{
"action": "VolumeCreate",
"name": "disk-test",
"description": "test",
"type": "PDS",
"size": "10",
"volume_source_type": "no_source_type",
"snapshot_source": "",
"image_source": "",
"billing_type": "hour"
}
Example Response:
{
"message": "成功",
"code": 200
}