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

addcontacts to schema; added extra infinera endpoint checks

parent 15078e59
No related branches found
No related tags found
No related merge requests found
......@@ -618,9 +618,8 @@ def get_trap_metadata(source_equipment: str, interface: str, circuit_id: str) \
result = _ignore_cache_or_retrieve(request, cache_key, r)
if not result:
result = {
'locations': []
}
result = {}
result.update(get_interface_services_and_loc(
ims_source_equipment,
......@@ -628,6 +627,30 @@ def get_trap_metadata(source_equipment: str, interface: str, circuit_id: str) \
r
))
# rubbish hack to cope with Dashboard Classifier removing piece of
# interface name. Once Dashboard is fully driven by IMS we can remove that # noqa
# part of the classifier and then this
# As of 2021-04-21 the Dashboard line that will need removing is
# https://gitlab.geant.net/live-projects/dashboardv3/dashboard-v3-python/-/blob/develop/dashboard/classification/classifier.py#L207 # noqa
if not result or not result.get('services', []):
interface_parts = interface.split('-')
interface_parts[-2] = 'T' + interface_parts[-2]
t_interface = '-'.join(interface_parts)
result.update(get_interface_services_and_loc(
ims_source_equipment,
t_interface,
r
))
if not result or not result.get('services', []):
interface_parts = interface.split('-')
interface_parts[-1] = 'T' + interface_parts[-1]
t_interface = '-'.join(interface_parts)
result.update(get_interface_services_and_loc(
ims_source_equipment,
t_interface,
r
))
if not result:
return Response(
response="no available info for {} {}".format(
......
......@@ -541,7 +541,11 @@ INFINERA_LAMBDA_INFO_RESPONSE_SCHEMA = {
"geant-lambda": {
"$ref": "#/definitions/geant-lambda"
},
"locations": {"$ref": "#/definitions/locations-list"}
"locations": {"$ref": "#/definitions/locations-list"},
"contacts": {
"type": "array",
"items": {"type": "string"}
}
},
"additionalProperties": False
}
......
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