From da8f8e8009741e92d5e5fd08b9a30bea96a385fb Mon Sep 17 00:00:00 2001 From: OpenGnSys Support Team Date: Thu, 30 Nov 2023 21:47:16 +0100 Subject: client: support for deleting clients Delete a client with command: $ ogcli delete client --ip 1.2.3.4 --- cli/objects/client.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'cli/objects') diff --git a/cli/objects/client.py b/cli/objects/client.py index d438742..58f8094 100644 --- a/cli/objects/client.py +++ b/cli/objects/client.py @@ -121,3 +121,17 @@ class OgClient(): 'livedir': 'ogLive' } rest.post('/client/add', payload=payload) + + @staticmethod + def delete_client(rest, args): + parser = argparse.ArgumentParser(prog='ogcli delete client') + parser.add_argument('--ip', + action='append', + default=[], + required=True, + help='Client IP') + parsed_args = parser.parse_args(args) + payload = { + 'clients': parsed_args.ip, + } + rest.post('/client/delete', payload=payload) -- cgit v1.2.3-18-g5258