diff --git a/cloudcontrol/cli/commands/vm.py b/cloudcontrol/cli/commands/vm.py index b9ecf579992c31294044131cb4c0aa8628455d34..f7d2961d47fd54aa4caf93acd8ffe0caef4f6b6c 100644 --- a/cloudcontrol/cli/commands/vm.py +++ b/cloudcontrol/cli/commands/vm.py @@ -331,6 +331,42 @@ class Command_unrescue(TqlCommand): def remote_functions(self): return set(("unrescue",)) +class Command_install(TqlCommand): + '''Switch VMs to install mode''' + + def __init__(self, cli, argv0): + TqlCommand.__init__(self, cli, argv0) + self.tql_filter += "&r=vm&status=stopped&mode=normal" + + def __call__(self, argv): + # arg parse + self.parse_args(argv) + if len(self.args) != 1: + raise cmdBadArgument() + # rpc call + self.rpccall("install", self.args[0]) + + def remote_functions(self): + return set(("install",)) + +class Command_uninstall(TqlCommand): + '''Switch VMs back from install mode''' + + def __init__(self, cli, argv0): + TqlCommand.__init__(self, cli, argv0) + self.tql_filter += "&r=vm&status=stopped&mode=install" + + def __call__(self, argv): + # arg parse + self.parse_args(argv) + if len(self.args) != 1: + raise cmdBadArgument() + # rpc call + self.rpccall("uninstall", self.args[0]) + + def remote_functions(self): + return set(("uninstall",)) + class Command_title(TqlCommand): '''Set a VM title'''