mirror of https://github.com/D4-project/d4-core
fic: [Sensors monitoring] fix API
parent
2d358918c9
commit
3edf227cc1
|
@ -8,6 +8,7 @@
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
import sys
|
import sys
|
||||||
|
import json
|
||||||
import redis
|
import redis
|
||||||
|
|
||||||
sys.path.append(os.path.join(os.environ['D4_HOME'], 'lib'))
|
sys.path.append(os.path.join(os.environ['D4_HOME'], 'lib'))
|
||||||
|
@ -72,4 +73,4 @@ def delete_sensor_to_monitor():
|
||||||
@login_user_basic
|
@login_user_basic
|
||||||
def get_all_sensors_connection_errors():
|
def get_all_sensors_connection_errors():
|
||||||
res = Sensor.api_get_all_sensors_connection_errors()
|
res = Sensor.api_get_all_sensors_connection_errors()
|
||||||
return build_json_response(res[0], res[1])
|
return Response(json.dumps(res[0], indent=2, sort_keys=True), mimetype='application/json'), res[1]
|
||||||
|
|
|
@ -156,7 +156,7 @@ def add_sensor_register():
|
||||||
return Response(json.dumps(res[0], indent=2, sort_keys=True), mimetype='application/json'), res[1]
|
return Response(json.dumps(res[0], indent=2, sort_keys=True), mimetype='application/json'), res[1]
|
||||||
|
|
||||||
@restApi.route("/api/v1/sensors/monitoring/errors", methods=['GET'])
|
@restApi.route("/api/v1/sensors/monitoring/errors", methods=['GET'])
|
||||||
@token_required('login_user_basic')
|
@token_required('user')
|
||||||
def get_all_sensors_connection_errors():
|
def get_all_sensors_connection_errors():
|
||||||
res = Sensor.api_get_all_sensors_connection_errors()
|
res = Sensor.api_get_all_sensors_connection_errors()
|
||||||
return build_json_response(res[0], res[1])
|
return build_json_response(res[0], res[1])
|
||||||
|
|
Loading…
Reference in New Issue