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

added contacts to classifier response

parent dcf8be93
No related branches found
No related tags found
No related merge requests found
......@@ -157,7 +157,8 @@ def get_interface_services_and_loc(ims_source_equipment, ims_interface, redis):
'project', 'pop_name', 'pop_abbreviation', 'equipment',
'card_id', 'port', 'logical_unit', 'other_end_pop_name',
'other_end_pop_abbreviation', 'other_end_equipment',
'other_end_card_id', 'other_end_port', 'other_end_logical_unit'}
'other_end_card_id', 'other_end_port', 'other_end_logical_unit'
}
keys_to_remove = set(_s.keys()) - keys
for k in keys_to_remove:
_s.pop(k)
......@@ -166,8 +167,11 @@ def get_interface_services_and_loc(ims_source_equipment, ims_interface, redis):
result = {}
if raw_services:
result['services'] = json.loads(raw_services.decode('utf-8'))
contacts = set()
for s in result['services']:
contacts.update(set(s.pop('contacts', set())))
_format_service(s)
result['contacts'] = sorted(list(contacts))
result['related-services'] = list(
get_related_services(ims_source_equipment, ims_interface, redis))
if not result['services']:
......
......@@ -274,7 +274,11 @@ JUNIPER_LINK_RESPONSE_SCHEMA = {
"type": "array",
"items": {"$ref": "#/definitions/related-service-info"}
},
"locations": {"$ref": "#/definitions/locations-list"}
"locations": {"$ref": "#/definitions/locations-list"},
"contacts": {
"type": "array",
"items": {"type": "string"}
}
},
"required": ["interface", "locations"],
"additionalProperties": False
......@@ -622,6 +626,10 @@ CORIANT_INFO_RESPONSE_SCHEMA = {
"type": "array",
"items": {"$ref": "#/definitions/related-service-info"}
},
"contacts": {
"type": "array",
"items": {"type": "string"}
},
},
"required": ["equipment name", "card id", "port number"],
"additionalProperties": False
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment