From: Guillaume Abrioux Date: Fri, 16 Jun 2023 11:04:56 +0000 (+0200) Subject: node-proxy: drop old server.py X-Git-Tag: v19.3.0~102^2~85 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=8c1036374008d1422e2f3485012231a3d1da77b8;p=ceph.git node-proxy: drop old server.py 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 --- diff --git a/src/cephadm/node-proxy/server.py b/src/cephadm/node-proxy/server.py deleted file mode 100644 index f450f052395..00000000000 --- a/src/cephadm/node-proxy/server.py +++ /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)