Commit 7b1044c8 authored by Sigmund Augdal's avatar Sigmund Augdal

Added support for updating an existing VMs settings

parent 3dc74066
...@@ -275,6 +275,15 @@ class VMMClient(Client): ...@@ -275,6 +275,15 @@ class VMMClient(Client):
def delete_vm(self, stampid, vmid): def delete_vm(self, stampid, vmid):
self.delete_from_collection("VirtualMachines", StampId=stampid, ID=vmid) self.delete_from_collection("VirtualMachines", StampId=stampid, ID=vmid)
def update_vm(self, stampid, vmid, **kw_args):
url = self._format_url("VirtualMachines", args={"StampId": stampid, "ID": vmid})
entry, vm = create_entry()
add_property(vm, "StampId", stampid)
add_property(vm, "ID", vmid)
for key, value in kw_args.items():
add_property(vm, key, value)
self._do_request(url, method="PATCH", reqdata=etree.tostring(entry))
def vm_operation(self, stampid, vmid, operation): def vm_operation(self, stampid, vmid, operation):
url = self._format_url("VirtualMachines", args={"StampId": stampid, "ID": vmid}) url = self._format_url("VirtualMachines", args={"StampId": stampid, "ID": vmid})
entry, vm = create_entry() entry, vm = create_entry()
......
...@@ -9,7 +9,7 @@ requires = [ ...@@ -9,7 +9,7 @@ requires = [
] ]
setup(name='scvmm-client-py', setup(name='scvmm-client-py',
version='0.1', version='0.2',
description='', description='',
author='', author='',
author_email='', 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