]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
node-proxy: drop old server.py
authorGuillaume Abrioux <gabrioux@ibm.com>
Fri, 16 Jun 2023 11:04:56 +0000 (13:04 +0200)
committerGuillaume Abrioux <gabrioux@ibm.com>
Thu, 25 Jan 2024 14:43:30 +0000 (14:43 +0000)
This version relies on flask.
At the end, we decided to migrate to cherrypy given that
we already use it quite a lot in ceph/ceph

Signed-off-by: Guillaume Abrioux <gabrioux@ibm.com>
src/cephadm/node-proxy/server.py [deleted file]

diff --git a/src/cephadm/node-proxy/server.py b/src/cephadm/node-proxy/server.py
deleted file mode 100644 (file)
index f450f05..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-from flask import Flask, request, jsonify
-from system import System
-from redfish_dell import RedfishDell
-from reporter import Reporter
-from util import logger
-import time
-
-log = logger(__name__)
-
-# must be passed as arguments
-host = "https://x.x.x.x:8443"
-username = "myuser"
-password = "mypassword"
-
-# create the redfish system and the obsever
-log.info(f"Server initialization...")
-system = RedfishDell(host=host, username=username, password=password, system_endpoint='/Systems/System.Embedded.1')
-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()})
-
-@app.route('/system/memory', methods=['GET'])
-def get_system_memory():
-    return jsonify({'memory': system.get_memory()})
-
-@app.route('/system/network', methods=['GET'])
-def get_system_network():
-    return jsonify({'network': system.get_network()})
-
-@app.route('/system/processors', methods=['GET'])
-def get_system_processors():
-    return jsonify({'processors': system.get_processors()})
-
-@app.route('/system/storage', methods=['GET'])
-def get_system_storage():
-    return jsonify({'storage': system.get_storage()})
-
-@app.route('/system/status', methods=['GET'])
-def get_system_status():
-    return jsonify({'status': system.get_status()})
-
-@app.route('/system/actions/', methods=['POST'])
-def post_system():
-    pass
-
-@app.route('/system/actions/', methods=['PUT'])
-def put_system():
-    pass
-
-@app.route('/system/control/', methods=['DELETE'])
-def delete():
-    pass
-
-if __name__ == '__main__':
-    system.start_update_loop()
-    reporter_agent.run()
-    app.run(debug=True, use_reloader=False)