From 8d3637e3e9fd461c822818313642c0d19fd9f02d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Luttringer?= Date: Tue, 16 Jun 2015 16:47:21 +0200 Subject: [PATCH] Add reset command --- cloudcontrol/cli/commands/vm.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/cloudcontrol/cli/commands/vm.py b/cloudcontrol/cli/commands/vm.py index f42dff0..8beda7e 100644 --- a/cloudcontrol/cli/commands/vm.py +++ b/cloudcontrol/cli/commands/vm.py @@ -120,6 +120,25 @@ class Command_resume(TqlCommand): def remote_functions(self): return set(("resume",)) +class Command_reset(TqlCommand): + '''Reset a running vm''' + + def __init__(self, cli, argv0): + TqlCommand.__init__(self, cli, argv0) + self.tql_filter += "&r=vm&status=running" + + def __call__(self, argv): + # arg parse + self.parse_args(argv) + if len(self.args) != 1: + raise cmdBadArgument() + # rpc call + self.rpccall("reset", self.args[0]) + + def remote_functions(self): + return set(("reset",)) + + class Command_disablevirtiocache(TqlCommand): '''Set virtio cache to none on VMs disk devices''' -- GitLab