move doc sources to other location Reviewed-by: OpenTelekomCloud Bot <None>
22 KiB
Creating a Disk (Discarded)
Function
This API is used to create a disk.
This API has been discarded. Use the EVS API "Creating EVS Disks (OpenStack Cinder API v2)".
URI
POST /v2/{project_id}/os-volumes
POST /v2.1/{project_id}/os-volumes
Request
Table 2 describes the request parameters.
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
availability_zone |
No |
String |
Specifies the AZ to which the volume to be created belongs. If the specified AZ does not exist, creating the volume failed, and the volume is in error state. The AZ to which the volume to be created belongs must be specified in the public cloud system. |
display_description |
No |
String |
Specifies the volume description. |
snapshot_id |
No |
String |
Specifies the snapshot ID. If this parameter is specified, the volume is to be created from a snapshot. |
size |
Yes (If the volume is created from a snapshot, this parameter is optional.) |
Integer |
Specifies the volume size. Unit: GB |
display_name |
No |
String |
Specifies the volume name. |
volume_type |
No |
String |
Specifies the volume type. Currently, the value can be SSD, SAS, SATA, co-p1, or uh-l1.
|
metadata |
No |
Object |
Specifies the volume metadata. |
Response
Table 3 describes the response parameters.
Parameter |
Type |
Description |
---|---|---|
id |
String |
Specifies the disk ID in UUID format. |
displayName |
String |
Specifies the volume name. |
status |
String |
Specifies the volume status. |
attachments |
Array of objects |
Specifies the volume attachment information. |
availabilityZone |
String |
Specifies the AZ to which the volume belongs. |
createdAt |
String |
Specifies the time when the volume was created. |
displayDescription |
String |
Specifies the volume description. |
volumeType |
String |
Specifies the volume type. |
snapshotId |
String |
Specifies the snapshot ID. |
metadata |
Object |
Specifies the volume metadata. |
size |
Integer |
Specifies the size of the volume. |
Example Request
POST https://{endpoint}/v2/b84c367e4d1047fc9b54f28b400ddbc2/os-volumes POST https://{endpoint}/v2.1/b84c367e4d1047fc9b54f28b400ddbc2/os-volumes
{ "volume": { "availability_zone": "az1-dc1", "display_description": "test1", "snapshot_id": null, "size": 1, "display_name": "test", "volume_type": "SSD", "metadata": { "testkey": "testvalue" } } }
Example Response
{ "volume": { "displayDescription": "test1", "volumeType": "SATA", "createdAt": "2018-05-18T01:17:03.871808", "metadata": { "testkey": "testvalue", "resourceSpecCode": "SATA" }, "attachments": [ {} ], "snapshotId": null, "size": 1, "displayName": "test", "id": "b4fb891c-c665-4478-92b0-8a7fa65a57cd", "availabilityZone": "az1.dc1", "status": "creating" } }