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

added sid to classifier response

parent d56de9ad
No related branches found
No related tags found
No related merge requests found
......@@ -156,7 +156,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',
'sid'
}
keys_to_remove = set(_s.keys()) - keys
for k in keys_to_remove:
......
......@@ -52,7 +52,8 @@ _common_schema_definitions = {
"enum": ["circuit", "service"]
},
"service_type": {"type": "string"},
"project": {"type": "string"}
"project": {"type": "string"},
"sid": {"type": "string"}
},
"additionalProperties": False
},
......@@ -179,6 +180,7 @@ _juniper_link_response_schema_definitions = {
"type": "object",
"properties": {
"id": {"type": "integer"},
"sid": {"type": "string"},
"name": {"type": "string"},
"status": {
"type": "string",
......@@ -251,7 +253,8 @@ _juniper_link_response_schema_definitions = {
"enum": ["path", "service", "l2circuit"]
},
"service_type": {"type": "string"},
"project": {"type": "string"}
"project": {"type": "string"},
"sid": {"type": "string"}
},
"required": [
"name", "status", "circuit_type", "service_type", "project"],
......@@ -445,6 +448,7 @@ _infinera_lambda_response_schema_definitions = {
"type": "object",
"properties": {
"id": {"type": "integer"},
"sid": {"type": "string"},
"name": {"type": "string"},
"status": {
"type": "string",
......@@ -503,7 +507,8 @@ _infinera_lambda_response_schema_definitions = {
"enum": ["path", "service", "l2circuit"]
},
"service_type": {"type": "string"},
"project": {"type": "string"}
"project": {"type": "string"},
"sid": {"type": "string"}
},
"required": [
"name", "status", "circuit_type", "service_type", "project"],
......
......@@ -923,6 +923,9 @@ def transform_ims_data(data):
else:
rs[c['id']]['status'] = 'non-monitored'
if c['id'] in circuit_ids_and_sids:
rs[c['id']]['sid'] = circuit_ids_and_sids[c['id']]
if c['sub-circuits']:
for sub in c['sub-circuits']:
temp_parents = \
......@@ -1017,6 +1020,7 @@ def transform_ims_data(data):
if circ['id'] in circuit_ids_and_sids \
and circ['status'] == 'operational':
sid = circuit_ids_and_sids[circ['id']]
circ['sid'] = sid
if circ['circuit_type'] == 'circuit':
logger.info(f'SID ({sid}) Circuit ({circ["id"]})'
f' Name ({circ["name"]}) not a service')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment