Skip to content
Snippets Groups Projects
Commit e71fc095 authored by Robert Latta's avatar Robert Latta
Browse files

added circuit_id to end-point, used it to populate 'geant-lambda' key (no longer plural)

parent 12582a6f
No related branches found
No related tags found
No related merge requests found
......@@ -238,10 +238,11 @@ def peer_info(address):
return Response(result, mimetype="application/json")
@routes.route("/infinera-lambda-info/<source_equipment>/<path:interface>",
@routes.route("/infinera-lambda-info/"
"<source_equipment>/<interface>/<circuit_id>",
methods=['GET', 'POST'])
@common.require_accepts_json
def get_trap_metadata(source_equipment, interface):
def get_trap_metadata(source_equipment, interface, circuit_id):
r = common.get_redis()
cache_key = 'classifier-cache:infinera:%s:%s' % (
......@@ -257,16 +258,12 @@ def get_trap_metadata(source_equipment, interface):
'opsdb:interface_services:%s:%s' % (source_equipment, interface))
if services:
result['services'] = json.loads(services.decode('utf=8'))
geant_lambdas = []
for s in result['services']:
gl = r.get('opsdb:geant_lambdas:%s' % s['name'])
if gl:
t_gl = json.loads(gl.decode('utf=8'))
t_gl['status'] = t_gl['status'].lower()
geant_lambdas.append(t_gl)
if geant_lambdas:
result['geant-lambdas'] = geant_lambdas
gl = r.get('opsdb:geant_lambdas:%s' % circuit_id.lower())
if gl:
t_gl = json.loads(gl.decode('utf=8'))
t_gl['status'] = t_gl['status'].lower()
result['geant-lambda'] = t_gl
if not result:
return Response(
......
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