From c0e1517aa985117968982a475805b600658c2cd5 Mon Sep 17 00:00:00 2001 From: Antoine Millet Date: Fri, 4 Mar 2016 11:27:32 +0100 Subject: [PATCH] Added attachdisk and detachdisk cli handler --- cloudcontrol/server/clients/cli.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/cloudcontrol/server/clients/cli.py b/cloudcontrol/server/clients/cli.py index 0505c7a..a03e7d4 100644 --- a/cloudcontrol/server/clients/cli.py +++ b/cloudcontrol/server/clients/cli.py @@ -221,6 +221,22 @@ class CliHandler(RegisteredCCHandler): """ return self._vm_action(query, 'vm_set_autostart', flag) + @listed + def attachdisk(self, query, pool, volume, driver='virtio', bps=0, iops=0): + """ Attach a disk on a VM. + + :param query: tql query + """ + return self._vm_action(query, 'vm_attach_disk', pool, volume, driver, bps, iops) + + @listed + def detachdisk(self, query, pool, volume): + """ Detach a disk from a VM. + + :param query: tql query + """ + return self._vm_action(query, 'vm_detach_disk', pool, volume) + @listed def undefine(self, query, delete_storage=True): """ Undefine selected virtual machines. -- GitLab