summaryrefslogtreecommitdiffstats
path: root/ogcli/ogcli.py
diff options
context:
space:
mode:
authorRoberto Hueso Gómez <rhueso@soleta.eu>2020-06-30 12:43:51 +0200
committerRoberto Hueso Gómez <rhueso@soleta.eu>2020-06-30 12:43:51 +0200
commitf41b5f8f9dd5672864b2dfe995e73f259741fa8b (patch)
tree8f1943d49dce79d6c0f4c106714b3ec6fb8a5320 /ogcli/ogcli.py
parent7483cb76a22abcd53562e1f44c9a55aba6b6d363 (diff)
Add list modes command
This is consistent with HTTP GET /modes
Diffstat (limited to 'ogcli/ogcli.py')
-rw-r--r--ogcli/ogcli.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/ogcli/ogcli.py b/ogcli/ogcli.py
index d628bfd..d8e66b7 100644
--- a/ogcli/ogcli.py
+++ b/ogcli/ogcli.py
@@ -1,5 +1,6 @@
from ogcli.objects.og_client import OgClient
from ogcli.objects.og_scopes import OgScope
+from ogcli.objects.modes import OgModes
import argparse
import requests
import sys
@@ -25,12 +26,14 @@ class OgCLI():
self.rest = OgREST(cfg['ip'], cfg['port'], cfg['api_token'])
def list(self, args):
- choices = ['clients', 'scopes']
+ choices = ['clients', 'scopes', 'modes']
parser = argparse.ArgumentParser()
parser.add_argument('item', choices=choices)
args = parser.parse_args(args)
if args.item == 'clients':
OgClient.list_clients(self.rest)
+ elif args.item == 'modes':
+ OgModes.list_available_modes(self.rest)
elif args.item == 'scopes':
OgScope.list_scopes(self.rest)