Commit f0a2eb51 authored by Sebastian Miller's avatar Sebastian Miller
Browse files

API endpoint URL now parametrized

parent 739905eb
......@@ -28,7 +28,7 @@ logging.info("Initializing Flask app.")
app = Flask(__name__)
logging.info("Successfully initialized the Flask app. Waiting for PO requests.")
@app.route("/predict", methods=['POST'])
@app.route(p['api-endpoint'], methods=['POST'])
def predict():
logging.info("Received an ensembling request.")
req_json = request.json
......
---
# Codes and messages associated with various errors.
# Codes and messages associated with various errors
errors:
no-adequate-model-code: 512
no-adequate-model-msg: "None of the currently trained models is suitable for ensembling such predictions."
# The URL of the ensembling request endpoint exposed by the component
api-endpoint: /predict
# Params for connecting to InfluxDB and ActiveMQ
components:
influxdb:
......@@ -15,7 +18,7 @@ components:
username: admin
password: admin
destination: /topic/start_ensembler
id: ensemble_settings # Internal id of the topic subscription. Unimportant
id: ensemble_settings # Internal id of the topic subscription. Insignificant
reconnect_attempts_max: -1 # -1 means that stomp.py will attempt to reconnect indefinitely
reconnect_sleep_initial: 10 # Time between consecutive reconnect attempts
......
---
# Codes and messages associated with various errors.
# Codes and messages associated with various errors
errors:
no-adequate-model-code: 512
no-adequate-model-msg: "None of the currently trained models is suitable for ensembling such predictions."
# The URL of the ensembling request endpoint exposed by the component
api-endpoint: /predict
# Params for connecting to InfluxDB and ActiveMQ
components:
influxdb:
......@@ -15,7 +18,7 @@ components:
username: admin
password: admin
destination: /topic/start_ensembler
id: ensemble_settings # Internal id of the topic subscription. Unimportant
id: ensemble_settings # Internal id of the topic subscription. Insignificant
reconnect_attempts_max: -1 # -1 means that stomp.py will attempt to reconnect indefinitely
reconnect_sleep_initial: 10 # Time between consecutive reconnect attempts
......
......@@ -39,7 +39,7 @@ USERNAME = properties["components"]["stomp"]["username"]
PASSWORD = properties["components"]["stomp"]["password"]
STOMP_PORT = properties["components"]["stomp"]["port"]
MQ_TOPIC = properties["components"]["stomp"]["destination"]
ROUTE = "http://" + HOST_IP + ":" + PORT + "/predict"
ROUTE = "http://" + HOST_IP + ":" + PORT + properties['api-endpoint']
METRIC = "MinCPULoad"
......
Supports Markdown
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