diff --git a/inventory_provider/routes/classifier.py b/inventory_provider/routes/classifier.py index f1bb72de10ed59d583d59be31d8ff2268b3ad1c7..fe738c93cf03872f341a45d6794f5e0388957df5 100644 --- a/inventory_provider/routes/classifier.py +++ b/inventory_provider/routes/classifier.py @@ -561,6 +561,71 @@ def get_bgp_peer_info(address): return Response(result, mimetype='application/json') +@routes.route("/mtc-element-info/<node>/<interface>", methods=['GET', 'POST']) +@common.require_accepts_json +def get_mtc_interface_info(node, interface): + """ + Handler for /classifier/mtc-interface-info that + returns metadata for as MTC port. + + The response will be formatted according to the following schema: + + .. asjson:: + inventory_provider.routes.classifier_schema.MTC_INTERFACE_INFO_RESPONSE_SCHEMA + + :param node: + :param element: + :return: element info + """ + dummy_response = { + "contacts": [ + "NOC-RENATER@NOC.RENATER.FR", + "NOC@GEANT.ORG", + "NOC@RESTENA.LU", + "OC@GEANT.ORG", + "SUPPORT@OC.GEANT.NET" + ], + "locations": [ + { + "a": { + "abbreviation": "LON", + "equipment": node, + "name": "LONDON" + } + } + ], + "related-services": [ + { + "circuit_type": "service", + "name": "RENATER_AP2_CLS", + "project": "RENATER", + "status": "operational" + } + ], + "services": [ + { + "card_id": "", + "circuit_type": "circuit", + "equipment": node, + "id": 669120, + "logical_unit": "", + "name": "AMS-LON_EEX_ESNET_1424", + "other_end_equipment": "", + "other_end_pop_abbreviation": "", + "other_end_pop_name": "", + "other_end_port": "", + "pop_abbreviation": "LON", + "pop_name": "LONDON", + "port": interface, + "project": "RENATER", + "service_type": "ETHERNET", + "status": "operational" + } + ] + } + return Response(json.dumps(dummy_response), mimetype='application/json') + + @routes.route("/infinera-lambda-info/" "<source_equipment>/<interface>/<circuit_id>", methods=['GET', 'POST']) @@ -568,7 +633,7 @@ def get_bgp_peer_info(address): def get_infinera_lambda_info(source_equipment, interface, circuit_id): """ Handler for /classifier/infinera-lambda-info that - returns metadata for as DTNX port. + returns metadata for a DTNX port. The response will be formatted according to the following schema: diff --git a/inventory_provider/routes/classifier_schema.py b/inventory_provider/routes/classifier_schema.py index 3d2ca9e1fd986318e751fc95bbe69629f7700059..76fae43b4ee2d952690fe36bf7b531ab1e778325 100644 --- a/inventory_provider/routes/classifier_schema.py +++ b/inventory_provider/routes/classifier_schema.py @@ -439,6 +439,8 @@ INFINERA_LAMBDA_INFO_RESPONSE_SCHEMA = { "additionalProperties": False } +MTC_INTERFACE_INFO_RESPONSE_SCHEMA = INFINERA_LAMBDA_INFO_RESPONSE_SCHEMA + CORIANT_INFO_RESPONSE_SCHEMA = { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object",