Commit 5362bcae authored by Sigmund Augdal's avatar Sigmund Augdal

Added support for creating, restoring and deleting VM checkpoints

parent e31140c3
......@@ -360,6 +360,26 @@ class VMMClient(Client):
def get_job(self, stampid, jobid):
return self.get_from_collection("Jobs", StampId=stampid, ID=jobid)
def create_checkpoint(self, stampid, vmid, name, description):
entry, checkpoint = create_entry()
add_property(checkpoint, "StampId", stampid)
add_property(checkpoint, "VMId", vmid)
if name:
add_property(checkpoint, "Name", name)
if description:
add_property(checkpoint, "Description", description)
print(etree.tostring(entry, pretty_print=True))
result = Entry(self._do_request(self._format_url("VMCheckPoints"),
method="POST",
reqdata=etree.tostring(entry)), self)
return result
def delete_checkpoint(self, stampid, _id):
self.delete_from_collection("VMCheckPoints", StampId=stampid, ID=_id)
def restore_checkpoint(self, stampid, _id):
self.update_entry("VMCheckPoints", stampid, _id, VMCheckPointAction="Restore")
def get_config():
cfg = SafeConfigParser()
......
......@@ -8,7 +8,7 @@ requires = [
]
setup(name='scvmm-client-py',
version='0.13',
version='0.14',
description='',
author='',
author_email='',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment