Description
Specify tenant ID and volume ID to upload, then store it as Glance image.
Request URL
Block Storage API v2
POST /v2/{tenant_id}/volumes/{volume_id}/action
Request Parameters
| Parameter | Value | Style | Description |
|---|---|---|---|
| X-Auth-Token | User Token | header | |
| tenant_id | Tenant ID | URI | |
| volume_id | Volume ID | URI | |
| image_name | Image Name | plain | |
| disk_format (Optional) | Disk Format | plain | |
| container_format (Optional) | Container Format | plain |
Request Json
{
"os-volume_upload_image": {
"image_name": "upload-img-name",
"disk_format": "qcow2",
"container_format": "ovf"
}
}
Normal response codes
202 Accepted
Example
curl -i -X POST \
-H "Accept: application/json" \
-H "X-Auth-Token: 35941e7df872405d84e5b026dba8323c" \
-d '{"os-volume_upload_image": {"image_name": "upload-img-name"}}' \
https://block-storage.tyo1.cloud.z.com/v2/1864e71d2deb46f6b47526b69c65a45d/volumes/40e84769-f99a-4d7f-8594-4d0db87bc7e4/action
HTTP/1.1 202 Accepted
Date: Thu, 25 Dec 2014 02:40:42 GMT
Server: Apache
Content-Length: 339
Content-Type: application/json
{
"os-volume_upload_image": {
"container_format": "ovf",
"disk_format": "qcow2",
"display_description": null,
"id": "40e84769-f99a-4d7f-8594-4d0db87bc7e4",
"image_id": "4a4549e9-0be3-45ec-b05a-20af9eaa54c0",
"image_name": "upload-img-name",
"size": 200,
"status": "uploading",
"updated_at": "2015-05-08T09:17:07.00000000",
"volume_type": {
"created_at": "2015-03-02T04:13:50.00000000",
"deleted": false,
"deleted_at": null,
"id": "6569f080-0f4b-469c-b548-fe9d6b4f84a5",
"name": "gnc_ext_ssd",
"qos_specs_id": "77eb429f-25e0-4962-9b97-67ef73ca032f",
"updated_at": "2015-03-02T04:45:15.00000000"
}
}
}