Skip to content
Snippets Groups Projects
Commit 6a17e18a authored by Erik Reid's avatar Erik Reid
Browse files

commented some unused code

parent d2c3e6b1
No related branches found
No related tags found
No related merge requests found
......@@ -88,33 +88,36 @@ def bgp_configs(hostname):
return jsonify(routes)
@routes.route("/interfaces/status/<hostname>/<path:interface>",
methods=['GET', 'POST'])
@common.require_accepts_json
def interface_statuses(hostname, interface):
r = common.get_redis()
status = r.get(
'alarmsdb:interface_status:%s:%s'
% (hostname, interface))
if not status:
return Response(
response="no available info for {} {}".format(hostname, interface),
status=404,
mimetype="text/html")
return jsonify({"status": status.decode('utf-8')})
@routes.route("/services/<hostname>/<path:interface>",
methods=['GET', 'POST'])
@common.require_accepts_json
def services_for_interface(hostname, interface):
r = common.get_redis()
services = r.get(
'opsdb:interface_services:%s:%s'
% (hostname, interface))
if not services:
return Response(
response="no available info for {} {}".format(hostname, interface),
status=404,
mimetype="text/html")
return jsonify(json.loads(services.decode('utf-8')))
# TODO: remove all alarmsdb i/o, and then remove the following
# @routes.route("/interfaces/status/<hostname>/<path:interface>",
# methods=['GET', 'POST'])
# @common.require_accepts_json
# def interface_statuses(hostname, interface):
# r = common.get_redis()
# status = r.get(
# 'alarmsdb:interface_status:%s:%s'
# % (hostname, interface))
# if not status:
# return Response(
# response="no available info for {} {}".format(
# hostname, interface),
# status=404,
# mimetype="text/html")
# return jsonify({"status": status.decode('utf-8')})
#
#
# @routes.route("/services/<hostname>/<path:interface>",
# methods=['GET', 'POST'])
# @common.require_accepts_json
# def services_for_interface(hostname, interface):
# r = common.get_redis()
# services = r.get(
# 'opsdb:interface_services:%s:%s'
# % (hostname, interface))
# if not services:
# return Response(
# response="no available info for {} {}".format(
# hostname, interface),
# status=404,
# mimetype="text/html")
# return jsonify(json.loads(services.decode('utf-8')))
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment