summaryrefslogtreecommitdiffstats
path: root/cli/objects/client.py
diff options
context:
space:
mode:
authorJose M. Guisado <jguisado@soleta.eu>2022-05-19 09:25:20 +0200
committerJose M. Guisado <jguisado@soleta.eu>2022-05-20 08:52:23 +0200
commit397663fd379d79778b660906b74003ee38e75e6b (patch)
tree499fea2f12d79f1562a53ad63cb28c2a678a8294 /cli/objects/client.py
parente7b302c8b8077952a04256084307a44670f69733 (diff)
send: add send refresh
Send refresh to a given client. $ ogcli send refresh --client-ip 192.168.56.11
Diffstat (limited to 'cli/objects/client.py')
-rw-r--r--cli/objects/client.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/cli/objects/client.py b/cli/objects/client.py
index c250470..4dc64fd 100644
--- a/cli/objects/client.py
+++ b/cli/objects/client.py
@@ -42,3 +42,16 @@ class OgClient():
payload = {'client': parsed_args.client_ip}
r = rest.get('/client/info', payload=payload)
print_json(r.text)
+
+ @staticmethod
+ def send_refresh(rest, args):
+ parser = argparse.ArgumentParser()
+ parser.add_argument('--client-ip',
+ action='append',
+ default=[],
+ required=True,
+ help='Client IP')
+ parsed_args = parser.parse_args(args)
+
+ payload = {'clients': parsed_args.client_ip}
+ rest.post('/refresh', payload=payload)