summaryrefslogtreecommitdiffstats
path: root/cli/objects
diff options
context:
space:
mode:
Diffstat (limited to 'cli/objects')
-rw-r--r--cli/objects/live.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/cli/objects/live.py b/cli/objects/live.py
index ca8824a..0664c01 100644
--- a/cli/objects/live.py
+++ b/cli/objects/live.py
@@ -286,3 +286,25 @@ class OgLive():
print(f'Error: no directory found for {live_name}')
return 0
+
+ @staticmethod
+ def set_live(rest, args):
+ parser = argparse.ArgumentParser(prog='ogcli set live')
+ parser.add_argument('--default',
+ action='store_true',
+ required=True,
+ help='set the default live image')
+ parser.add_argument('--name',
+ nargs='?',
+ required=True,
+ help='Name of the live')
+ parsed_args = parser.parse_args(args)
+ live_name = parsed_args.name
+
+ payload = {'name': live_name}
+ res = rest.post('/oglive/default', payload=payload)
+
+ if not res:
+ return 1
+
+ return 0