From 73a6e07b83b76f9677494502bc6e32a7bf48cfd7 Mon Sep 17 00:00:00 2001 From: Roberto Hueso Gómez Date: Thu, 3 Sep 2020 11:50:58 +0200 Subject: Add reboot action This action handles reboot on one or multiple scopes. --- ogcp/templates/scopes.html | 2 ++ ogcp/views.py | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/ogcp/templates/scopes.html b/ogcp/templates/scopes.html index 7abba81..4603f04 100644 --- a/ogcp/templates/scopes.html +++ b/ogcp/templates/scopes.html @@ -33,6 +33,8 @@ diff --git a/ogcp/views.py b/ogcp/views.py index 4874ffe..9d44b55 100644 --- a/ogcp/views.py +++ b/ogcp/views.py @@ -48,3 +48,10 @@ def action_poweroff(): payload = {'clients': list(ips)} g.server.post('/poweroff', payload) return make_response("200 OK", 200) + +@app.route('/action/reboot', methods=['POST']) +def action_reboot(): + ips = parse_ips(request.form.to_dict()) + payload = {'clients': list(ips)} + g.server.post('/reboot', payload) + return make_response("200 OK", 200) -- cgit v1.2.3-18-g5258