mirror of https://git.48k.eu/ogcli/
parent
7483cb76a2
commit
f41b5f8f9d
|
@ -0,0 +1,6 @@
|
||||||
|
class OgModes():
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def list_available_modes(rest):
|
||||||
|
r = rest.get('/modes')
|
||||||
|
print(r.json())
|
|
@ -1,5 +1,6 @@
|
||||||
from ogcli.objects.og_client import OgClient
|
from ogcli.objects.og_client import OgClient
|
||||||
from ogcli.objects.og_scopes import OgScope
|
from ogcli.objects.og_scopes import OgScope
|
||||||
|
from ogcli.objects.modes import OgModes
|
||||||
import argparse
|
import argparse
|
||||||
import requests
|
import requests
|
||||||
import sys
|
import sys
|
||||||
|
@ -25,12 +26,14 @@ class OgCLI():
|
||||||
self.rest = OgREST(cfg['ip'], cfg['port'], cfg['api_token'])
|
self.rest = OgREST(cfg['ip'], cfg['port'], cfg['api_token'])
|
||||||
|
|
||||||
def list(self, args):
|
def list(self, args):
|
||||||
choices = ['clients', 'scopes']
|
choices = ['clients', 'scopes', 'modes']
|
||||||
parser = argparse.ArgumentParser()
|
parser = argparse.ArgumentParser()
|
||||||
parser.add_argument('item', choices=choices)
|
parser.add_argument('item', choices=choices)
|
||||||
args = parser.parse_args(args)
|
args = parser.parse_args(args)
|
||||||
|
|
||||||
if args.item == 'clients':
|
if args.item == 'clients':
|
||||||
OgClient.list_clients(self.rest)
|
OgClient.list_clients(self.rest)
|
||||||
|
elif args.item == 'modes':
|
||||||
|
OgModes.list_available_modes(self.rest)
|
||||||
elif args.item == 'scopes':
|
elif args.item == 'scopes':
|
||||||
OgScope.list_scopes(self.rest)
|
OgScope.list_scopes(self.rest)
|
||||||
|
|
Loading…
Reference in New Issue