Create a CDS Disk
Last Updated:2020-08-07
- This API is used to create the CDS disk. It supports the creation of CDS disk through the snapshot, but the system disk snapshot can not be used to create the CDS disk.
- You must select one of cdsSizeInGB and snapshotId in the request parameter to specify the CDS disk capacity, or create a CDS disk through the snapshot.
- When the snapshot ID parameter exists and is not empty, the CDS disk is created through the snapshot size by default if the parameter cdsSizeInGB is not specified. If the parameter cdsSizeInGB is specified, the parameter value can not be less than the snapshot size.
- The creation API is an asynchronous interface. You can query the disk status through the Query Disk Details interface.
Request Structure
POST /v{version}/volume?clientToken={clientToken} HTTP/1.1
Host: bcc.bj.baidubce.com
Authorization: authorization string
{
"storageType": storageType,
"cdsSizeInGB" : cdsSizeInGB,
"purchaseCount" : purchaseCount,
"Name": Name,
"Description": Description,
"billing":{
"paymentTiming":paymentTiming,
"reservation":{
"reservationLength":reservationLength,
"reservationTimeUnit":reservationTimeUnit
}
},
"zoneName": zoneName
}
Request Header Field
There are no other special header fields except the public header field.
Request Parameters
Parameter Name | Type | Required? | Parameter Position | Description |
---|---|---|---|---|
version | String | Yes | URL parameter | API version number |
clientToken | String | Yes | Query Parameter | The idempotent Token is an ASCII string with a length not exceeding 64 bits. For more information, please see the Idempotent. |
purchaseCount | int | No | RequestBody parameter | The CDS disks created in batch must be an integer greater than 0, and no more than 5 CDS disks can be created at a time. Optional parameters, the default value is 1. |
Name | String | No | RequestBody parameter | New name of disk, Custom image name, which supports uppercase and lowercase letters, numbers, Chinese, -, _ , / and. Special character with length 1-65, it must begin with the letter. |
Description | String | No | RequestBody parameter | New description information of disk |
cdsSizeInGB | int | No | RequestBody parameter | The CDS disk capacity must be an integer greater than 0GB, and the size is 5~32765GB. This parameter is required when the parameter snapshotId is null or does not exist. |
storageType | StorageType | No | RequestBody parameter | Storage type of CDS disk, including ,HDD_Throughput (High throughput HDD),hp1 (high-performance cloud disk), std1 (series 1 cloud disk), cloud_hp1 (SSD cloud disk) and hdd (HDD cloud disk), the cloud disk is of hp1 type by default. |
billing | Billing | Yes | RequestBody parameter | Order and billing related parameters |
snapshotId | String | No | RequestBody parameter | Snapshot ID, which supports to create disks from snapshot. When this parameter exists and is not null, the parameter cdsSizeInGB is ignored and not required at this time. |
zoneName | String | No | RequestBody parameter | Specify the availability zone information, which is empty by default and selected by the system automatically. |
Return Header Field
There are no other special header fields except the common header field.
Return Parameter
Parameter Name | Type | Description |
---|---|---|
volumeIds | List |
Disk ID, which conforms to the BCE specification, must be a string with fixed length, and can contain uppercase and lowercase letters, numbers, hyphen (-) and underline (_) only. |
Error Code
Error Code | Error Description | HTTP Status Code | Explanations |
---|---|---|---|
Volume.SystemSnapshotForbiddenOperation | System snapshot can not be used to create volume. | 403 | The system snapshot is not allowed to create the disk. |
Request Instance
POST http://bcc.bj.baidubce.com/v2/volume?clientToken=3A8d84403d-a94b-40ce-9d6a-f6225dd26676
Host: bcc.bj.baidubce.com
Authorization: bce-auth-v1/f81d3b34e48048fbb2634dc7882d7e21/2015-08-11T04:17:29Z/3600/host/74c506f68c65e26c633bfa104c863fffac5190fdec1ec24b7c03eb5d67d2e1de
{
"storageType": "std1",
"cdsSizeInGB" : 5,
"purchaseCount" : 2,
"Name": "TestName2",
"Description": "TestDesc2",
"billing":{
"paymentTiming":"Prepaid",
"reservation":{
"reservationLength":1,
"reservationTimeUnit":"Month"
}
}
}
Return Instance
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Date: Wed, 08 Jul 2015 03:28:11 GMT
x-bce-request-id: d8752367-38e8-45e4-b4c7-e53be3137ce5
Server: BWS
{
"volumeIds": [
"v-NSuv0ssl",
"v-MPO0YONO"
]
}