Commit 77b4c658 authored by Davide Lagoa's avatar Davide Lagoa
Browse files

methods to get configurations added

parent 3787a339
......@@ -2,7 +2,6 @@
from flask import Flask, render_template, request, send_file, jsonify
from logging.handlers import TimedRotatingFileHandler
import FilesUtilities
import FilesUtilities
import os
import socket
import shutil
......@@ -272,6 +271,24 @@ def download(submissionID):
return send_file(RESULTS_PATH + submissionID + "/results.zip", as_attachment=True,
attachment_filename='results' + timestr + '.zip')
@app.route("/debug/configs")
def configsRetriever():
logger.info("Request to get configurations")
dic = {}
for key in CONFIGURATIONS.keys():
if "password" not in key:
dic[key] = CONFIGURATIONS[key]
return jsonify(dic), 200
@app.route("/debug/workers/addresses")
def retrieveWorkersAdresses():
logger.info("Request to get workers addresses")
workers = FilesUtilities.read_workers_conf_file('/configs/workers_addresses.conf')
return jsonify({"workers_addresses":workers}), 200
@app.route("/debug/logs/<level>")
def logsRetriever(level):
......@@ -426,4 +443,4 @@ logger.info('Server running!')
if __name__ == "__main__":
app.run(host=CONFIGURATIONS["flask_host"], port=int(CONFIGURATIONS["flask_port"]), threaded=True, debug=False)
app.config['SEND_FILE_MAX_AGE_DEFAULT'] = 0
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment