Add Grafana API path
This commit is contained in:
@@ -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()
|
||||
|
Reference in New Issue
Block a user