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

added path to coriant classification

parent ad6a82f9
Branches
Tags
No related merge requests found
...@@ -855,7 +855,8 @@ def get_coriant_info(equipment_name: str, entity_string: str) -> Response: ...@@ -855,7 +855,8 @@ def get_coriant_info(equipment_name: str, entity_string: str) -> Response:
interface_name, interface_name,
r r
)) ))
for s in result.get('services', []): services = result.get('services', [])
for s in services:
s.pop('card_id', None) s.pop('card_id', None)
s.pop('port', None) s.pop('port', None)
s.pop('logical_unit', None) s.pop('logical_unit', None)
...@@ -863,6 +864,41 @@ def get_coriant_info(equipment_name: str, entity_string: str) -> Response: ...@@ -863,6 +864,41 @@ def get_coriant_info(equipment_name: str, entity_string: str) -> Response:
s.pop('other_end_port', None) s.pop('other_end_port', None)
s.pop('other_end_logical_unit', None) s.pop('other_end_logical_unit', None)
p = {
'category': '',
'circuit_type': '',
'service_type': '',
'peering_type': '',
'status': '',
'name': '',
'a': {
'equipment name': '',
'card id': '',
'port number': '',
'pop': {
'name': '',
'city': '',
'country': '',
'abbreviation': '',
'longitude': 0,
'latitude': 0,
}
}
}
if services:
s = services[0]
p['status'] = s['status']
p['name'] = s['name']
p['a']['equipment name'] = ims_source_equipment
p['a']['card id'] = card_id
p['a']['port number'] = port
p['a']['pop']['name'] = s.get('pop_name', '')
p['a']['pop']['city'] = s.get('pop_name', '')
p['a']['pop']['abbreviation'] = s.get('pop_abbreviation', '')
p['b'] = p['a']
result['path'] = p
result['locations'] = _remove_duplicates_from_list(result['locations']) result['locations'] = _remove_duplicates_from_list(result['locations'])
result = json.dumps(result) result = json.dumps(result)
# cache this data for the next call # cache this data for the next call
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment