From 5abe86222892be4c21fe0d041d2e05d07ddcd7bb Mon Sep 17 00:00:00 2001 From: "Jose M. Guisado" Date: Tue, 30 Mar 2021 10:49:37 +0200 Subject: Add list images ogServer exposes a list of known partition images at /images, use it to implement 'list images' command. --- cli/cli.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'cli/cli.py') diff --git a/cli/cli.py b/cli/cli.py index 0e7c749..18fd36c 100644 --- a/cli/cli.py +++ b/cli/cli.py @@ -10,6 +10,7 @@ from cli.objects.client import OgClient from cli.objects.scopes import OgScope from cli.objects.modes import OgModes from cli.objects.wol import OgWol +from cli.objects.images import OgImage import argparse import requests import sys @@ -50,7 +51,7 @@ class OgCLI(): def list(self, args): choices = ['clients', 'scopes', 'modes', 'hardware', - 'client'] + 'client', 'images'] parser = argparse.ArgumentParser(prog='ogcli list') parser.add_argument('item', choices=choices) parsed_args = parser.parse_args([args[0]]) @@ -65,6 +66,8 @@ class OgCLI(): OgModes.list_available_modes(self.rest) elif parsed_args.item == 'scopes': OgScope.list_scopes(self.rest) + elif parsed_args.item == 'images': + OgImage.list_images(self.rest) def set(self, args): choices = ['modes'] -- cgit v1.2.3-18-g5258