[Kimchi-devel] [RFC] Upload and download image for OOTB storage pool

Royce Lv lvroyce at linux.vnet.ibm.com
Tue Jul 1 03:19:39 UTC 2014


Now OOTB ISO pool is available, but user has to copy ISO manually to the 
ISO pool, which is not convenient.
So here we propose two ways to transfer ISOs.

1. User ---upload --> Kimchi Server

REST API will be:

     POST /storagepools/isos/upload
    {'file': file_local_abs_path}

Ding Xiao had already posted a piece of code in his patch:

using cherrypy file upload interface. His code can support following 
requirements:
     (1) upload task can be cancelled.
     (2) non-blocking, other request can be handled.
     (3) progress can be monitored with a progress bar.
     (4) multi-file selected support.

Only nits are UI part needs to be refactored a little.

Also for multiple file upload, number of upload session needs to be 
controlled through config file.

2. Http server -- download -->Kimchi server

REST API will be:

     POST /storagepools/isos/download
     {'file': file_remote_path}

RETURN:
     {'task_id': id_of_download_task}

This will start a backend task for download. The UI will query the task 
for progress.

For implementation, we will use python libcurl to download image/ISO.
REF:
     http://curl.haxx.se/libcurl/python/







More information about the Kimchi-devel mailing list