summaryrefslogtreecommitdiffstats
path: root/cli/cli.py
diff options
context:
space:
mode:
authorRoberto Hueso Gómez <rhueso@soleta.eu>2020-07-13 13:53:10 +0200
committerRoberto Hueso Gómez <rhueso@soleta.eu>2020-07-14 11:21:16 +0200
commit513308fe810ac56457e20778acc18d5a4455b98f (patch)
tree7ee22d5728d551dee1aad62437b117487a3e51be /cli/cli.py
parentf4e1bb767b98ef8370208c79123b6eafac5f4732 (diff)
Add ogcli list client command
This requests GET /client/properties by calling something like: ogcli list client --id=6 It is important to notice that 'id' must be a "computer" type scope id.
Diffstat (limited to 'cli/cli.py')
-rw-r--r--cli/cli.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/cli/cli.py b/cli/cli.py
index 47ede6b..c23564c 100644
--- a/cli/cli.py
+++ b/cli/cli.py
@@ -48,13 +48,16 @@ class OgCLI():
self.rest = OgREST(cfg['ip'], cfg['port'], cfg['api_token'])
def list(self, args):
- choices = ['clients', 'scopes', 'modes', 'hardware']
+ choices = ['clients', 'scopes', 'modes', 'hardware',
+ 'client']
parser = argparse.ArgumentParser()
parser.add_argument('item', choices=choices)
parsed_args = parser.parse_args([args[0]])
if parsed_args.item == 'clients':
OgClient.list_clients(self.rest)
+ elif parsed_args.item == 'client':
+ OgClient.get_client_properties(self.rest, args[1:])
elif parsed_args.item == 'hardware':
OgClient.list_client_hardware(self.rest, args[1:])
elif parsed_args.item == 'modes':