Add Grafana API path

This commit is contained in:
2022-04-23 13:23:54 +03:00
parent eaf82a5063
commit cfc98f7b9d

View File

@@ -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()