6.3. Uploading image data¶
Upload a binary image file to an image record created, according to Creating image records.
Before you can store binary image data, you must meet the following preconditions:
- The image must exist.
- You must set the disk and container formats in the image.
- The image status must be
- Your image storage quota must be sufficient.
- The size of the data that you want to store must not exceed the size that the OpenStack Image service allows.
After the operation completes, the image status will change to
||header||string||The media type descriptor for the request body. Use
||header||string||A store identifier to upload or import image data. Should only be included when making a request to a cloud that supports multiple backing stores. Use the store discovery call to determine an appropriate store identifier. Simply omit this header to use the default store. (Since Image API v2.8)|
||path||string||The UUID of the image.|
Content-Type request header to
# curl -ks -X PUT -H 'Content-Type: application/octet-stream' -H 'X-Auth-Token: gAAAAA<...>' \ --data-binary @cirros2.qcow2 \ https://<node_IP_addr>:9292/v2/images/8988013f-9079-4f7d-855f-d2cb67e9d71c/file
220.127.116.11. Status codes¶
||The server has fulfilled the request.|
||Some content in the request was invalid.|
||User must authenticate before making a request.|
||Policy does not allow current user to do this operation.|
||The requested resource could not be found.|
||This operation conflicted with another operation on this resource.|
||The access request to the target resource is no longer available.|
||The request is larger than the server is willing or able to process.|
||The request entity has a media type which the server or resource does not support.|
||Service is not available. This is mostly caused by service configuration errors which prevents the service from successful start up.|