Add a '/shutdown' endpoint to force the client to logout and delete its current
session.
This is for devel puroposes and probably not intended to be kept.
Signed-off-by: Guillaume Abrioux <gabrioux@ibm.com>
(cherry picked from commit
e06e65b78bdf44d38a3d47ab2040dc88e5cd130f)
app = Flask(__name__)
+@app.route('/shutdown', methods=['POST'])
+def shutdown():
+ system.stop_update_loop()
+ system.client.logout()
+ return 'Server shutting down...\n'
+
@app.route('/system', methods=['GET'])
def get_system():
return jsonify({'system': system.get_system()})