On 11/04/2016 09:42 PM, gregor wrote:
I'm started the migration of my backup tool  from sdk v3 to v4.
Whats the correct REST URI to create a snapshost from a given VM and how
can this be done with the SnapshotsService.add(...) method?
Please take a look at following example:
This method needs a "snapshot" object, but currently I don't know how to
obtain one from a given VM or initialize one which works with the
A REST way will also be interesting because the Python SDK is horrible
documented and I plan to move to basic REST. Also the Python SDK has
lots of bug's which consumes many of the migration time. For example a
obtained VmService object get by the VmsService.list(with filter) method
has no information about the ID but iterating over all objects from
list() without filter result in usable VmService objects. This will
later be documented, meanwhile I wrote a workaround.
VmsService.list doesn't return list of VmService objects, but list of
So what you will see in above add_vm_snapshot example is follwoing:
# Obtain types.Vm object which is actually a Python representation of
# XML, which oVirt API returns, when you send request like this:
vm = vms_service.list(search='name=myvm')
# Locate the service that manages the snapshots of the virtual machine,
# which we have found in previous step:
snapshots_service = vms_service.vm_service(vm.id).snapshots_service()
# Add the new snapshot to that VM:
Everything works here as expected. Can you please tell us what is
confusing and what should be better documented?
The documentation of SnapshotsService class is here:
We want to improve, so the pages will contain also Python examples and
maybe some tutorial.
Users mailing list