diff options
author | Roberto Hueso Gómez <rhueso@soleta.eu> | 2020-07-03 14:27:29 +0200 |
---|---|---|
committer | Roberto Hueso Gómez <rhueso@soleta.eu> | 2020-07-06 13:32:02 +0200 |
commit | 8961937329940e41219f0a32c4aec0aad9d81636 (patch) | |
tree | 5be63b67bbede2f22ec88320f7d0c7c6a8cda816 /cli/cli.py | |
parent | 4dddd359e73d96eba4c472138ea70064d0f39616 (diff) |
Add ogcli set mode command
This requests POST /modes and changes a scope mode by calling something like:
ogcli set modes --scope-id=1 --scope-type=computer --mode=pxe
Diffstat (limited to 'cli/cli.py')
-rw-r--r-- | cli/cli.py | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -58,3 +58,12 @@ class OgCLI(): OgModes.list_available_modes(self.rest) elif args.item == 'scopes': OgScope.list_scopes(self.rest) + + def set(self, args): + choices = ['modes'] + parser = argparse.ArgumentParser() + parser.add_argument('item', choices=choices) + parsed_args = parser.parse_args([args[0]]) + + if parsed_args.item == 'modes': + OgModes.set_modes(self.rest, args[1:]) |