mirror of https://git.48k.eu/ogcli/
live: add command to list available live images
Add new command to display the available live images: # ogcli list livemaster
parent
76b4492fe6
commit
020592d6fc
|
@ -15,6 +15,7 @@ from cli.objects.poweroff import OgPoweroff
|
|||
from cli.objects.reboot import OgReboot
|
||||
from cli.objects.repo import OgRepo
|
||||
from cli.objects.server import OgServer
|
||||
from cli.objects.live import OgLive
|
||||
from cli.objects.center import OgCenter
|
||||
from cli.objects.room import OgRoom
|
||||
import argparse
|
||||
|
@ -72,7 +73,7 @@ class OgCLI():
|
|||
|
||||
def list(self, args):
|
||||
choices = ['clients', 'scopes', 'modes', 'hardware',
|
||||
'client', 'images', 'disks', 'servers', 'repos']
|
||||
'client', 'images', 'disks', 'servers', 'repos', 'live']
|
||||
parser = argparse.ArgumentParser(prog='ogcli list')
|
||||
parser.add_argument('item', choices=choices)
|
||||
|
||||
|
@ -100,6 +101,8 @@ class OgCLI():
|
|||
OgRepo.list_repos(self.rest)
|
||||
elif parsed_args.item == 'servers':
|
||||
OgServer.list_servers(self.rest)
|
||||
elif parsed_args.item == 'live':
|
||||
OgLive.list_live(self.rest)
|
||||
|
||||
def set(self, args):
|
||||
choices = ['modes', 'mode', 'server', 'repo']
|
||||
|
|
|
@ -0,0 +1,17 @@
|
|||
# Copyright (C) 2023-2024 Soleta Networks <info@soleta.eu>
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify it under
|
||||
# the terms of the GNU Affero General Public License as published by the
|
||||
# Free Software Foundation; either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
|
||||
import argparse
|
||||
|
||||
from cli.utils import *
|
||||
|
||||
class OgLive():
|
||||
|
||||
@staticmethod
|
||||
def list_live(rest):
|
||||
r = rest.get('/oglive/list')
|
||||
print_json(r.text)
|
Loading…
Reference in New Issue