summaryrefslogtreecommitdiffstats
path: root/cli/cli.py
diff options
context:
space:
mode:
authorRoberto Hueso Gómez <rhueso@soleta.eu>2020-07-03 14:27:29 +0200
committerRoberto Hueso Gómez <rhueso@soleta.eu>2020-07-06 13:32:02 +0200
commit8961937329940e41219f0a32c4aec0aad9d81636 (patch)
tree5be63b67bbede2f22ec88320f7d0c7c6a8cda816 /cli/cli.py
parent4dddd359e73d96eba4c472138ea70064d0f39616 (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.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/cli/cli.py b/cli/cli.py
index 01e15eb..49b3930 100644
--- a/cli/cli.py
+++ b/cli/cli.py
@@ -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:])