]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
node-proxy: add a /shutdown endpoint
authorGuillaume Abrioux <gabrioux@ibm.com>
Wed, 5 Apr 2023 12:16:29 +0000 (14:16 +0200)
committerGuillaume Abrioux <gabrioux@ibm.com>
Thu, 25 Jan 2024 14:48:48 +0000 (14:48 +0000)
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)

src/cephadm/node-proxy/server.py

index 582a5e61575826174a68fe1dffe3c9dd83794109..b2fef2845f23a63c10c142699e688b7650baef65 100644 (file)
@@ -19,6 +19,12 @@ reporter_agent = Reporter(system, "http://127.0.0.1:8000")
 
 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()})