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

removed trap type from metadata request

parent 8478646f
No related branches found
No related tags found
No related merge requests found
......@@ -34,10 +34,10 @@ def juniper_addresses():
return jsonify([r['hostname'] for r in routers])
@routes.route("/trap-metadata/<trap_type>/<source_equipment>/<path:interface>",
@routes.route("/trap-metadata/<source_equipment>/<path:interface>",
methods=['GET', 'POST'])
@common.require_accepts_json
def get_trap_metadata(trap_type, source_equipment, interface):
def get_trap_metadata(source_equipment, interface):
# todo - Move this to config
interface_info_key = "interface_services"
r = common.get_redis()
......@@ -63,12 +63,12 @@ def get_trap_metadata(trap_type, source_equipment, interface):
# is just a list of services
vendor = interface_info[0]['manufacturer']
hostname = interface_info[0]['equipment']
# TODO: don't copy unecessary data into response (let client do this)
result = {
"vendor": vendor,
"equipment-name": hostname,
"interface-name": interface,
"services": interface_info,
"type": trap_type
"services": interface_info
}
return jsonify(result)
......@@ -62,7 +62,7 @@ def test_trap_metadata(client_with_mocked_data):
"type": "object"
}
rv = client_with_mocked_data.get(
'/classifier/trap-metadata/BGP/mx1.ams.nl.geant.net/ae15.1500',
'/classifier/trap-metadata/mx1.ams.nl.geant.net/ae15.1500',
headers=DEFAULT_REQUEST_HEADERS)
assert rv.status_code == 200
assert rv.is_json
......
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