Commit 50844afe authored by Боярский Андрей Олегович's avatar Боярский Андрей Олегович
Browse files

new requests added

No related merge requests found
Showing with 124 additions and 21 deletions
+124 -21
{"default": "1", "default_cam": "-1", "ports": {"first": "8001", "last": "8008"}, "remote_controller": {"1": {"1": {"ip": "172.18.191.193", "port": "8000", "streamuri": "rtsp://audi.proxy/studio/4"}, "2": {"ip": "172.18.191.194", "port": "2000", "streamuri": "rtsp://audi.proxy/studio/5"}, "3": {"ip": "172.18.191.195", "port": "2000", "streamuri": "rtsp://audi.proxy/studio/6"}, "4": {"ip": "172.18.191.196", "port": "80", "streamuri": "rtsp://audi.proxy/studio/7"}, "5": {"ip": "172.18.191.197", "port": "8080", "streamuri": "rtsp://audi.proxy/505/3"}}, "2": {"1": {"ip": "172.18.191.93", "port": "9000", "streamuri": "rtsp://audi.proxy/504/3"}, "2": {"ip": "172.18.191.94", "port": "80", "streamuri": "rtsp://audi.proxy/504/4"}, "3": {"ip": "172.18.191.95", "port": "80", "streamuri": "rtsp://audi.proxy/504/5"}, "4": {"ip": "172.18.191.96", "port": "80", "streamuri": "rtsp://audi.proxy/504/6"}, "5": {"ip": "172.18.191.53", "port": "80", "streamuri": "rtsp://audi.proxy/305/3"}, "6": {"ip": "172.18.191.54", "port": "80", "streamuri": "rtsp://audi.proxy/305/4"}, "7": {"ip": "172.18.191.55", "port": "80", "streamuri": "rtsp://audi.proxy/305/5"}}, "3": {"2": {"ip": "172.18.191.104", "port": "80", "streamuri": "rtsp://audi.proxy/506/4"}, "3": {"ip": "172.18.191.105", "port": "80", "streamuri": "rtsp://audi.proxy/506/5"}, "4": {"ip": "172.18.191.106", "port": "80", "streamuri": "rtsp://audi.proxy/506/6"}, "5": {"ip": "172.18.191.63", "port": "80", "streamuri": "rtsp://audi.proxy/306/3"}, "6": {"ip": "172.18.191.64", "port": "80", "streamuri": "rtsp://audi.proxy/306/4"}, "7": {"ip": "172.18.191.65", "port": "80", "streamuri": "rtsp://audi.proxy/306/5"}}, "4": {"1": {"ip": "172.18.191.83", "port": "80", "streamuri": "rtsp://audi.proxy/308/3"}, "2": {"ip": "172.18.191.84", "port": "80", "streamuri": "rtsp://audi.proxy/308/4"}, "3": {"ip": "172.18.191.85", "port": "80", "streamuri": "rtsp://audi.proxy/308/5"}, "4": {"ip": "172.18.191.86", "port": "80", "streamuri": "rtsp://audi.proxy/308/6"}, "5": {"ip": "172.18.191.73", "port": "80", "streamuri": "rtsp://audi.proxy/307/3"}, "6": {"ip": "172.18.191.74", "port": "80", "streamuri": "rtsp://audi.proxy/307/4"}, "7": {"ip": "172.18.191.75", "port": "80", "streamuri": "rtsp://audi.proxy/307/5"}}, "5": {"1": {"ip": "172.18.191.113", "port": "80", "streamuri": "rtsp://audi.proxy/00A/3"}, "2": {"ip": "172.18.191.114", "port": "80", "streamuri": "rtsp://audi.proxy/00A/4"}, "3": {"ip": "172.18.191.115", "port": "80", "streamuri": "rtsp://audi.proxy/00A/5"}, "4": {"ip": "172.18.191.116", "port": "80", "streamuri": "rtsp://audi.proxy/00A/6"}, "5": {"ip": "172.18.191.117", "port": "80", "streamuri": "rtsp://audi.proxy/00A/7"}, "6": {"ip": "172.18.191.118", "port": "80", "streamuri": "rtsp://audi.proxy/00A/8"}}, "6": {"1": {"ip": "172.18.191.123", "port": "9000", "streamuri": "rtsp://audi.proxy/00A/3"}, "2": {"ip": "172.18.191.124", "port": "8899", "streamuri": "rtsp://audi.proxy/00A/4"}, "3": {"ip": "172.18.191.125", "port": "80", "streamuri": "rtsp://audi.proxy/00A/5"}}, "7": {}, "8": {"2": {"ip": "172.18.191.184", "port": "80", "streamuri": "rtsp://audi.proxy/00A/4"}, "3": {"ip": "172.18.191.185", "port": "2000", "streamuri": "rtsp://audi.proxy/00A/5"}}}, "auditories": {"305": {"51": {"ip": "172.18.191.51", "port": "80", "streamuri": "rtsp://audi.proxy/305/1"}, "52": {"ip": "172.18.191.52", "port": "8999", "streamuri": "rtsp://audi.proxy/305/2"}, "53": {"ip": "172.18.191.53", "port": "80", "streamuri": "rtsp://audi.proxy/305/3"}, "54": {"ip": "172.18.191.54", "port": "80", "streamuri": "rtsp://audi.proxy/305/4"}, "55": {"ip": "172.18.191.55", "port": "80", "streamuri": "rtsp://audi.proxy/305/5"}}, "306": {"61": {"ip": "172.18.191.61", "port": "80", "streamuri": "rtsp://audi.proxy/306/1"}, "62": {"ip": "172.18.191.62", "port": "80", "streamuri": "rtsp://audi.proxy/306/2"}, "63": {"ip": "172.18.191.63", "port": "80", "streamuri": "rtsp://audi.proxy/306/3"}, "64": {"ip": "172.18.191.64", "port": "80", "streamuri": "rtsp://audi.proxy/306/4"}, "65": {"ip": "172.18.191.65", "port": "80", "streamuri": "rtsp://audi.proxy/306/5"}}, "307": {"71": {"ip": "172.18.191.71", "port": "80", "streamuri": "rtsp://audi.proxy/307/1"}, "72": {"ip": "172.18.191.72", "port": "80", "streamuri": "rtsp://audi.proxy/307/2"}, "73": {"ip": "172.18.191.73", "port": "80", "streamuri": "rtsp://audi.proxy/307/3"}, "74": {"ip": "172.18.191.74", "port": "80", "streamuri": "rtsp://audi.proxy/307/4"}, "75": {"ip": "172.18.191.75", "port": "80", "streamuri": "rtsp://audi.proxy/307/5"}}, "308": {"81": {"ip": "172.18.191.81", "port": "80", "streamuri": "rtsp://audi.proxy/308/1"}, "83": {"ip": "172.18.191.83", "port": "80", "streamuri": "rtsp://audi.proxy/308/3"}, "84": {"ip": "172.18.191.84", "port": "80", "streamuri": "rtsp://audi.proxy/308/4"}, "85": {"ip": "172.18.191.85", "port": "80", "streamuri": "rtsp://audi.proxy/308/5"}, "86": {"ip": "172.18.191.86", "port": "80", "streamuri": "rtsp://audi.proxy/308/6"}}, "435": {"15": {"ip": "172.18.212.15", "port": "80", "streamuri": "rtsp://audi.proxy/435/4"}, "16": {"ip": "172.18.212.16", "port": "8080", "streamuri": "rtsp://audi.proxy/435/5"}, "212": {"ip": "172.18.190.212", "port": "8899", "streamuri": "rtsp://audi.proxy/435/8"}}, "504": {"91": {"ip": "172.18.191.91", "port": "80", "streamuri": "rtsp://audi.proxy/504/1"}, "92": {"ip": "172.18.191.92", "port": "80", "streamuri": "rtsp://audi.proxy/504/2"}, "93": {"ip": "172.18.191.93", "port": "9000", "streamuri": "rtsp://audi.proxy/504/3"}, "94": {"ip": "172.18.191.94", "port": "80", "streamuri": "rtsp://audi.proxy/504/4"}, "95": {"ip": "172.18.191.95", "port": "80", "streamuri": "rtsp://audi.proxy/504/5"}, "96": {"ip": "172.18.191.96", "port": "80", "streamuri": "rtsp://audi.proxy/504/6"}}, "505": {"137": {"ip": "172.18.191.137", "port": "8899", "streamuri": "rtsp://audi.proxy/505/2"}, "192": {"ip": "172.18.191.192", "port": "8000", "streamuri": "rtsp://audi.proxy/studio/3"}, "193": {"ip": "172.18.191.193", "port": "8000", "streamuri": "rtsp://audi.proxy/studio/4"}, "194": {"ip": "172.18.191.194", "port": "2000", "streamuri": "rtsp://audi.proxy/studio/5"}, "195": {"ip": "172.18.191.195", "port": "2000", "streamuri": "rtsp://audi.proxy/studio/6"}, "196": {"ip": "172.18.191.196", "port": "80", "streamuri": "rtsp://audi.proxy/studio/7"}, "200": {"ip": "172.18.191.200", "port": "8899", "streamuri": "rtsp://audi.proxy/studio/8"}, "201": {"ip": "172.18.191.201", "port": "8899", "streamuri": "rtsp://audi.proxy/505/8"}}, "506": {"101": {"ip": "172.18.191.101", "port": "80", "streamuri": "rtsp://audi.proxy/506/1"}, "103": {"ip": "172.18.191.103", "port": "80", "streamuri": "rtsp://audi.proxy/506/3"}, "104": {"ip": "172.18.191.104", "port": "9000", "streamuri": "rtsp://audi.proxy/506/4"}, "105": {"ip": "172.18.191.105", "port": "80", "streamuri": "rtsp://audi.proxy/506/5"}, "106": {"ip": "172.18.191.106", "port": "80", "streamuri": "rtsp://audi.proxy/506/6"}}, "505a": {"197": {"ip": "172.18.191.197", "port": "8080", "streamuri": "rtsp://audi.proxy/505/3"}}, "00A": {"112": {"ip": "172.18.191.112", "port": "80", "streamuri": "rtsp://audi.proxy/00A/2"}, "113": {"ip": "172.18.191.113", "port": "80", "streamuri": "rtsp://audi.proxy/00A/3"}, "114": {"ip": "172.18.191.114", "port": "80", "streamuri": "rtsp://audi.proxy/00A/4"}, "115": {"ip": "172.18.191.115", "port": "80", "streamuri": "rtsp://audi.proxy/00A/5"}, "116": {"ip": "172.18.191.116", "port": "80", "streamuri": "rtsp://audi.proxy/00A/6"}, "117": {"ip": "172.18.191.117", "port": "80", "streamuri": "rtsp://audi.proxy/00A/7"}, "118": {"ip": "172.18.191.118", "port": "80", "streamuri": "rtsp://audi.proxy/00A/8"}}, "00B": {"122": {"ip": "172.18.191.122", "port": "80", "streamuri": "rtsp://audi.proxy/00A/2"}, "123": {"ip": "172.18.191.123", "port": "9000", "streamuri": "rtsp://audi.proxy/00A/3"}, "124": {"ip": "172.18.191.124", "port": "8899", "streamuri": "rtsp://audi.proxy/00A/4"}, "125": {"ip": "172.18.191.125", "port": "80", "streamuri": "rtsp://audi.proxy/00A/5"}}}}
\ No newline at end of file
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
"default": "1", "default": "1",
"default_cam": "-1", "default_cam": "-1",
"ports": { "ports": {
"f": "9001", "first": "9001",
"l": "9028" "last": "9028"
}, },
"remote_controller": { "remote_controller": {
"1": { "1": {
......
{"default": "8", "default_cam": "-1", "ports": {"f": "8001", "l": "8008"}, "remote_controller": {"1": {"1": {"ip": "172.18.191.193", "port": "8000", "streamuri": "rtsp://audi.proxy/studio/4"}, "2": {"ip": "172.18.191.194", "port": "2000", "streamuri": "rtsp://audi.proxy/studio/5"}, "3": {"ip": "172.18.191.195", "port": "2000", "streamuri": "rtsp://audi.proxy/studio/6"}, "4": {"ip": "172.18.191.196", "port": "80", "streamuri": "rtsp://audi.proxy/studio/7"}, "5": {"ip": "172.18.191.197", "port": "8080", "streamuri": "rtsp://audi.proxy/505/3"}}, "2": {"1": {"ip": "172.18.191.93", "port": "9000", "streamuri": "rtsp://audi.proxy/504/3"}, "2": {"ip": "172.18.191.94", "port": "80", "streamuri": "rtsp://audi.proxy/504/4"}, "3": {"ip": "172.18.191.95", "port": "80", "streamuri": "rtsp://audi.proxy/504/5"}, "4": {"ip": "172.18.191.96", "port": "80", "streamuri": "rtsp://audi.proxy/504/6"}, "5": {"ip": "172.18.191.53", "port": "80", "streamuri": "rtsp://audi.proxy/305/3"}, "6": {"ip": "172.18.191.54", "port": "80", "streamuri": "rtsp://audi.proxy/305/4"}, "7": {"ip": "172.18.191.55", "port": "80", "streamuri": "rtsp://audi.proxy/305/5"}}, "3": {"2": {"ip": "172.18.191.104", "port": "80", "streamuri": "rtsp://audi.proxy/506/4"}, "3": {"ip": "172.18.191.105", "port": "80", "streamuri": "rtsp://audi.proxy/506/5"}, "4": {"ip": "172.18.191.106", "port": "80", "streamuri": "rtsp://audi.proxy/506/6"}, "5": {"ip": "172.18.191.63", "port": "80", "streamuri": "rtsp://audi.proxy/306/3"}, "6": {"ip": "172.18.191.64", "port": "80", "streamuri": "rtsp://audi.proxy/306/4"}, "7": {"ip": "172.18.191.65", "port": "80", "streamuri": "rtsp://audi.proxy/306/5"}}, "4": {"1": {"ip": "172.18.191.83", "port": "80", "streamuri": "rtsp://audi.proxy/308/3"}, "2": {"ip": "172.18.191.84", "port": "80", "streamuri": "rtsp://audi.proxy/308/4"}, "3": {"ip": "172.18.191.85", "port": "80", "streamuri": "rtsp://audi.proxy/308/5"}, "4": {"ip": "172.18.191.86", "port": "80", "streamuri": "rtsp://audi.proxy/308/6"}, "5": {"ip": "172.18.191.73", "port": "80", "streamuri": "rtsp://audi.proxy/307/3"}, "6": {"ip": "172.18.191.74", "port": "80", "streamuri": "rtsp://audi.proxy/307/4"}, "7": {"ip": "172.18.191.75", "port": "80", "streamuri": "rtsp://audi.proxy/307/5"}}, "5": {"1": {"ip": "172.18.191.113", "port": "80", "streamuri": "rtsp://audi.proxy/00A/3"}, "2": {"ip": "172.18.191.114", "port": "80", "streamuri": "rtsp://audi.proxy/00A/4"}, "3": {"ip": "172.18.191.115", "port": "80", "streamuri": "rtsp://audi.proxy/00A/5"}, "4": {"ip": "172.18.191.116", "port": "80", "streamuri": "rtsp://audi.proxy/00A/6"}, "5": {"ip": "172.18.191.117", "port": "80", "streamuri": "rtsp://audi.proxy/00A/7"}, "6": {"ip": "172.18.191.118", "port": "80", "streamuri": "rtsp://audi.proxy/00A/8"}}, "6": {"1": {"ip": "172.18.191.123", "port": "9000", "streamuri": "rtsp://audi.proxy/00A/3"}, "2": {"ip": "172.18.191.124", "port": "8899", "streamuri": "rtsp://audi.proxy/00A/4"}, "3": {"ip": "172.18.191.125", "port": "80", "streamuri": "rtsp://audi.proxy/00A/5"}}, "7": {}, "8": {"2": {"ip": "172.18.191.184", "port": "80", "streamuri": "rtsp://audi.proxy/00A/4"}, "3": {"ip": "172.18.191.185", "port": "2000", "streamuri": "rtsp://audi.proxy/00A/5"}}}, "auditories": {"305": {"51": {"ip": "172.18.191.51", "port": "80", "streamuri": "rtsp://audi.proxy/305/1"}, "52": {"ip": "172.18.191.52", "port": "8999", "streamuri": "rtsp://audi.proxy/305/2"}, "53": {"ip": "172.18.191.53", "port": "80", "streamuri": "rtsp://audi.proxy/305/3"}, "54": {"ip": "172.18.191.54", "port": "80", "streamuri": "rtsp://audi.proxy/305/4"}, "55": {"ip": "172.18.191.55", "port": "80", "streamuri": "rtsp://audi.proxy/305/5"}}, "306": {"61": {"ip": "172.18.191.61", "port": "80", "streamuri": "rtsp://audi.proxy/306/1"}, "62": {"ip": "172.18.191.62", "port": "80", "streamuri": "rtsp://audi.proxy/306/2"}, "63": {"ip": "172.18.191.63", "port": "80", "streamuri": "rtsp://audi.proxy/306/3"}, "64": {"ip": "172.18.191.64", "port": "80", "streamuri": "rtsp://audi.proxy/306/4"}, "65": {"ip": "172.18.191.65", "port": "80", "streamuri": "rtsp://audi.proxy/306/5"}}, "307": {"71": {"ip": "172.18.191.71", "port": "80", "streamuri": "rtsp://audi.proxy/307/1"}, "72": {"ip": "172.18.191.72", "port": "80", "streamuri": "rtsp://audi.proxy/307/2"}, "73": {"ip": "172.18.191.73", "port": "80", "streamuri": "rtsp://audi.proxy/307/3"}, "74": {"ip": "172.18.191.74", "port": "80", "streamuri": "rtsp://audi.proxy/307/4"}, "75": {"ip": "172.18.191.75", "port": "80", "streamuri": "rtsp://audi.proxy/307/5"}}, "308": {"81": {"ip": "172.18.191.81", "port": "80", "streamuri": "rtsp://audi.proxy/308/1"}, "83": {"ip": "172.18.191.83", "port": "80", "streamuri": "rtsp://audi.proxy/308/3"}, "84": {"ip": "172.18.191.84", "port": "80", "streamuri": "rtsp://audi.proxy/308/4"}, "85": {"ip": "172.18.191.85", "port": "80", "streamuri": "rtsp://audi.proxy/308/5"}, "86": {"ip": "172.18.191.86", "port": "80", "streamuri": "rtsp://audi.proxy/308/6"}}, "435": {"15": {"ip": "172.18.212.15", "port": "80", "streamuri": "rtsp://audi.proxy/435/4"}, "16": {"ip": "172.18.212.16", "port": "8080", "streamuri": "rtsp://audi.proxy/435/5"}, "212": {"ip": "172.18.190.212", "port": "8899", "streamuri": "rtsp://audi.proxy/435/8"}}, "504": {"91": {"ip": "172.18.191.91", "port": "80", "streamuri": "rtsp://audi.proxy/504/1"}, "92": {"ip": "172.18.191.92", "port": "80", "streamuri": "rtsp://audi.proxy/504/2"}, "93": {"ip": "172.18.191.93", "port": "9000", "streamuri": "rtsp://audi.proxy/504/3"}, "94": {"ip": "172.18.191.94", "port": "80", "streamuri": "rtsp://audi.proxy/504/4"}, "95": {"ip": "172.18.191.95", "port": "80", "streamuri": "rtsp://audi.proxy/504/5"}, "96": {"ip": "172.18.191.96", "port": "80", "streamuri": "rtsp://audi.proxy/504/6"}}, "505": {"137": {"ip": "172.18.191.137", "port": "8899", "streamuri": "rtsp://audi.proxy/505/2"}, "192": {"ip": "172.18.191.192", "port": "8000", "streamuri": "rtsp://audi.proxy/studio/3"}, "193": {"ip": "172.18.191.193", "port": "8000", "streamuri": "rtsp://audi.proxy/studio/4"}, "194": {"ip": "172.18.191.194", "port": "2000", "streamuri": "rtsp://audi.proxy/studio/5"}, "195": {"ip": "172.18.191.195", "port": "2000", "streamuri": "rtsp://audi.proxy/studio/6"}, "196": {"ip": "172.18.191.196", "port": "80", "streamuri": "rtsp://audi.proxy/studio/7"}, "200": {"ip": "172.18.191.200", "port": "8899", "streamuri": "rtsp://audi.proxy/studio/8"}, "201": {"ip": "172.18.191.201", "port": "8899", "streamuri": "rtsp://audi.proxy/505/8"}}, "506": {"101": {"ip": "172.18.191.101", "port": "80", "streamuri": "rtsp://audi.proxy/506/1"}, "103": {"ip": "172.18.191.103", "port": "80", "streamuri": "rtsp://audi.proxy/506/3"}, "104": {"ip": "172.18.191.104", "port": "9000", "streamuri": "rtsp://audi.proxy/506/4"}, "105": {"ip": "172.18.191.105", "port": "80", "streamuri": "rtsp://audi.proxy/506/5"}, "106": {"ip": "172.18.191.106", "port": "80", "streamuri": "rtsp://audi.proxy/506/6"}}, "505a": {"197": {"ip": "172.18.191.197", "port": "8080", "streamuri": "rtsp://audi.proxy/505/3"}}, "00A": {"112": {"ip": "172.18.191.112", "port": "80", "streamuri": "rtsp://audi.proxy/00A/2"}, "113": {"ip": "172.18.191.113", "port": "80", "streamuri": "rtsp://audi.proxy/00A/3"}, "114": {"ip": "172.18.191.114", "port": "80", "streamuri": "rtsp://audi.proxy/00A/4"}, "115": {"ip": "172.18.191.115", "port": "80", "streamuri": "rtsp://audi.proxy/00A/5"}, "116": {"ip": "172.18.191.116", "port": "80", "streamuri": "rtsp://audi.proxy/00A/6"}, "117": {"ip": "172.18.191.117", "port": "80", "streamuri": "rtsp://audi.proxy/00A/7"}, "118": {"ip": "172.18.191.118", "port": "80", "streamuri": "rtsp://audi.proxy/00A/8"}}, "00B": {"122": {"ip": "172.18.191.122", "port": "80", "streamuri": "rtsp://audi.proxy/00A/2"}, "123": {"ip": "172.18.191.123", "port": "9000", "streamuri": "rtsp://audi.proxy/00A/3"}, "124": {"ip": "172.18.191.124", "port": "8899", "streamuri": "rtsp://audi.proxy/00A/4"}, "125": {"ip": "172.18.191.125", "port": "80", "streamuri": "rtsp://audi.proxy/00A/5"}}}}
\ No newline at end of file
...@@ -136,6 +136,16 @@ def replace_token(response, octet): ...@@ -136,6 +136,16 @@ def replace_token(response, octet):
def return_soap(response): def return_soap(response):
return Response(response, mimetype='application/soap+xml') return Response(response, mimetype='application/soap+xml')
def return_ports_and_presets(input):
output = {
"ports": input["ports"]
}
presets = {}
for i in list(input["remote_controller"].keys()):
presets[i] = list(input["remote_controller"][i].keys())
output["presets"] = presets
return output
HTTP_METHODS = ['GET', 'HEAD', 'POST', 'PUT', 'DELETE', 'CONNECT', 'OPTIONS', 'TRACE', 'PATCH'] HTTP_METHODS = ['GET', 'HEAD', 'POST', 'PUT', 'DELETE', 'CONNECT', 'OPTIONS', 'TRACE', 'PATCH']
#cameras = json.load(open(os.path.join(os.path.dirname(__file__), 'conf.json'))) #cameras = json.load(open(os.path.join(os.path.dirname(__file__), 'conf.json')))
...@@ -156,15 +166,26 @@ class Proccesser(): ...@@ -156,15 +166,26 @@ class Proccesser():
with open(os.path.join(os.path.dirname(os.path.realpath(__file__)), 'image', path), "rb") as f: with open(os.path.join(os.path.dirname(os.path.realpath(__file__)), 'image', path), "rb") as f:
return Response(f.read(), mimetype="image/jpeg") return Response(f.read(), mimetype="image/jpeg")
@self.app.route("/inconf/all", methods=HTTP_METHODS)
def return_all_conf_presets():
output = {}
confs_directory = os.path.join(os.path.dirname(os.path.dirname(os.path.realpath(__file__))), "confs")
for root, dirs, files in os.walk(os.path.abspath(confs_directory)):
for file in files:
output[file] = return_ports_and_presets(json.load(open(os.path.join(root, file))))
return jsonify(output)
@self.app.route("/inconf", methods=HTTP_METHODS)
def return_this_conf_presets():
return jsonify(return_ports_and_presets(self.cameras))
@self.app.route("/preset/total", methods=HTTP_METHODS) @self.app.route("/preset/total", methods=HTTP_METHODS)
@self.app.route("/preset/total/<preset>", methods=HTTP_METHODS) @self.app.route("/preset/total/<preset>", methods=HTTP_METHODS)
def return_total(preset = None): def return_total(preset = None):
if preset == None: if preset == None:
return Response(str(len(list(self.cameras["remote_controller"].keys()))).encode(), return jsonify({"number": len(list(self.cameras["remote_controller"].keys()))})
status=200)
else: else:
return Response(str(len(list(self.cameras["remote_controller"][preset].keys()))).encode(), return jsonify({"number": len(list(self.cameras["remote_controller"][preset].keys()))})
status=200)
@self.app.route("/ports", methods=HTTP_METHODS) @self.app.route("/ports", methods=HTTP_METHODS)
def return_ports(): def return_ports():
...@@ -178,8 +199,7 @@ class Proccesser(): ...@@ -178,8 +199,7 @@ class Proccesser():
self.cameras["default"] = preset self.cameras["default"] = preset
with open(self.conf_path, 'w') as j: with open(self.conf_path, 'w') as j:
json.dump(self.cameras, j) json.dump(self.cameras, j)
return Response(str(len(list(self.cameras["remote_controller"][self.cameras["default"]].keys()))).encode(), return jsonify({"number": len(list(self.cameras["remote_controller"][self.cameras["default"]].keys()))})
status = 200)
@self.app.route("/update", methods=HTTP_METHODS) @self.app.route("/update", methods=HTTP_METHODS)
def update_instance(): def update_instance():
self.cameras = json.load(open(self.conf_path)) self.cameras = json.load(open(self.conf_path))
......
...@@ -7,7 +7,7 @@ tags: ...@@ -7,7 +7,7 @@ tags:
- name: "Получение технической информации" - name: "Получение технической информации"
description: "Получение технической информации, нужной для работы пультов" description: "Получение технической информации, нужной для работы пультов"
- name: "Настройка" - name: "Настройка"
description: "Изменение настроек ONVOF-Proxy" description: "Изменение настроек ONVIF-Proxy"
schemes: schemes:
- "http" - "http"
paths: paths:
...@@ -20,10 +20,13 @@ paths: ...@@ -20,10 +20,13 @@ paths:
produces: produces:
- "application/json" - "application/json"
responses: responses:
"200": 200:
description: "Пресет изменен успешно, возвращено число камер в пресете" description: "Словарь из одного значения"
"400": schema:
description: "Нет такого пресета" type: "object"
properties:
number:
type: "integer"
/ports: /ports:
get: get:
tags: tags:
...@@ -33,13 +36,11 @@ paths: ...@@ -33,13 +36,11 @@ paths:
- "application/json" - "application/json"
responses: responses:
200: 200:
description: "Словарь из двух значений" description: "Словарь из одного значения"
schema: schema:
type: "object" type: "object"
properties: properties:
f: number:
type: "integer"
l:
type: "integer" type: "integer"
/preset/total: /preset/total:
get: get:
...@@ -50,10 +51,92 @@ paths: ...@@ -50,10 +51,92 @@ paths:
produces: produces:
- "text/plain" - "text/plain"
responses: responses:
"200": 200:
description: "Возвращено число пресетов" description: "Словарь из одного значения"
schema: schema:
type: "integer" type: "object"
properties:
number:
type: "integer"
/inconf:
get:
tags:
- "Получение технической информации"
summary: "Получение разбивки портов и занесенных камер в этом конфиге"
produces:
- "application/json"
responses:
200:
description: "Словарь из двух словарей: с портами и с занесенными камерами"
schema:
type: "object"
properties:
ports:
type: "object"
properties:
first:
type: "integer"
last:
type: "integer"
presets:
type: "object"
properties:
1:
type: "array"
example: ["1","2","5"]
2:
type: "array"
example: [ "1","3","4" ]
/inconf/all:
get:
tags:
- "Получение технической информации"
summary: "Получение разбивки портов и занесенных камер во всех конфигах"
produces:
- "application/json"
responses:
200:
description: "Словарь из словарей"
type: "object"
properties:
conf_name1:
type: "object"
properties:
ports:
type: "object"
properties:
first:
type: "integer"
last:
type: "integer"
presets:
type: "object"
properties:
1:
type: "array"
example: [ "1","2","5" ]
2:
type: "array"
example: [ "1","3","4" ]
conf_name2:
type: "object"
properties:
ports:
type: "object"
properties:
first:
type: "integer"
last:
type: "integer"
presets:
type: "object"
properties:
1:
type: "array"
example: [ "1","2","5" ]
2:
type: "array"
example: [ "1","3","4" ]
/preset/total/<preset>: /preset/total/<preset>:
get: get:
tags: tags:
......
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