summaryrefslogtreecommitdiffstats
path: root/cli/cli.py
diff options
context:
space:
mode:
authorJose M. Guisado <jguisado@soleta.eu>2021-03-30 13:36:42 +0200
committerOpenGnSys Support Team <soporte-og@soleta.eu>2021-03-30 14:01:39 +0200
commit6fd3cb7a251c3c0e6b98947f420c3d5f3146e582 (patch)
tree56f9054878557b55ac18eb4767fce3d3675a44b9 /cli/cli.py
parent5abe86222892be4c21fe0d041d2e05d07ddcd7bb (diff)
Add 'restore image' command
Adds cli capability to send image restore commands to the ogServer. It has the following options: --id To specify image id --disk Target disk --part Target partition --type To specify type of restore to send. UNICAST-DIRECT or UNICAST-CACHE are supported as of this patch. --repo Optional argument to specify image repo to fetch the image. This applies for UNICAST-DIRECT cases. (not restoring from a cache partition). If not specified it will default to rest.URL ip (ie. ogServer ip) --client-ip, --room-id and --center-id Target client args
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 18fd36c..fa5b164 100644
--- a/cli/cli.py
+++ b/cli/cli.py
@@ -86,3 +86,12 @@ class OgCLI():
if parsed_args.send_obj == 'wol':
OgWol.send_wol(self.rest, args[1:])
+
+ def restore(self, args):
+ choices = ['image']
+ parser = argparse.ArgumentParser(prog='ogcli restore')
+ parser.add_argument('send_obj', choices=choices)
+ parsed_args = parser.parse_args([args[0]])
+
+ if parsed_args.send_obj == 'image':
+ OgImage.restore_image(self.rest, args[1:])