diff --git a/src/app.py b/src/app.py index b06bace..1d965c5 100644 --- a/src/app.py +++ b/src/app.py @@ -15,7 +15,7 @@ path = environ.get('ROUTER_PATH') or '/ws' @app.route('/', methods=['POST']) def result(): - print(request.values) + print(request.json) return 'Received request, printing to console!' @app.route('/safe', methods=['POST']) @@ -54,3 +54,8 @@ def force(): return 'Error: Something went wrong while rebooting router!' return 'Success: Rebooted router!' + +@app.route('/grafana', methods=['POST']) +def grafana(): + if request.json['state'] == 'alerting': + safe()