On 03-11-2014 14:32, Aline Manera wrote:
It is like a clone, right?
So the API should be POST /storagepools/<pool>/storagevolumes/<volumes>/clone

Well, you can see it that way as well but I was influenced by the libvirt naming used to implement this: virStorageVolCreateXMLFrom(pool, xml, flags). We can think of it as a clone and change its API to the one you suggested.

And what about the destination path? Isn't it needed to do the clone? Even if it is optional.
Because, in the guest clone case the volume can be cloned in a different pool from the existing one.

Using the API I implemented, the destination path was provided by the pool used to create the new volume:

POST /storagepool/mypool/storagevolumes {'volume_path': '/home/user/image.img'}

The command above would create a new volume on the pool "mypool", that's why the destination path wasn't needed.

But if implement it as a clone, we will need to provide a new parameter (e.g. "pool") to act as the destination path.