diff options
author | Roberto Hueso Gómez <rhueso@soleta.eu> | 2020-09-03 11:50:58 +0200 |
---|---|---|
committer | Roberto Hueso Gómez <rhueso@soleta.eu> | 2020-09-03 11:50:58 +0200 |
commit | 73a6e07b83b76f9677494502bc6e32a7bf48cfd7 (patch) | |
tree | e3aa2ee06bdad8052ba10b1a7461d9d3f88159d3 /ogcp/views.py | |
parent | ef609cf52a24f0b7a5475f247fdf1b0a0197b480 (diff) |
Add reboot action
This action handles reboot on one or multiple scopes.
Diffstat (limited to 'ogcp/views.py')
-rw-r--r-- | ogcp/views.py | 7 |
1 files changed, 7 insertions, 0 deletions
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) |