From 101c70cfdaa5e5ce801f4413848a4f8381221b1c Mon Sep 17 00:00:00 2001 From: Robert Latta <robert.latta@geant.org> Date: Fri, 26 Mar 2021 14:46:37 +0000 Subject: [PATCH] added IMS based MSR data/route/test --- inventory_provider/routes/msr.py | 54 +++++++++++++---------------- inventory_provider/tasks/worker.py | 38 +++++++++++++++----- test/data/router-info.json | Bin 73406239 -> 73429819 bytes test/test_msr_routes.py | 15 ++++---- 4 files changed, 61 insertions(+), 46 deletions(-) diff --git a/inventory_provider/routes/msr.py b/inventory_provider/routes/msr.py index 9e128ba4..cead3b83 100644 --- a/inventory_provider/routes/msr.py +++ b/inventory_provider/routes/msr.py @@ -94,38 +94,32 @@ def access_services(): .. asjson:: inventory_provider.routes.msr.ACCESS_SERVICES_LIST_SCHEMA - :param name: :return: """ - # todo - replace with IMS implementation - return Response( - response='no access services found', - status=404, - mimetype="text/html") - # redis = common.get_current_redis() - # - # def _services(): - # for k in redis.scan_iter('opsdb:access_services:*'): - # service = redis.get(k.decode('utf-8')).decode('utf-8') - # yield json.loads(service) - # - # cache_key = 'classifier-cache:msr:access-services' - # result = redis.get(cache_key) - # - # if result: - # result = json.loads(result.decode('utf-8')) - # else: - # result = list(_services()) - # # cache this data for the next call - # redis.set(cache_key, json.dumps(result).encode('utf-8')) - # - # if not result: - # return Response( - # response='no access services found', - # status=404, - # mimetype="text/html") - # - # return jsonify(result) + redis = common.get_current_redis() + + def _services(): + for k in redis.scan_iter('ims:access_services:*'): + service = redis.get(k.decode('utf-8')).decode('utf-8') + yield json.loads(service) + + cache_key = 'classifier-cache:msr:access-services' + result = redis.get(cache_key) + + if result: + result = json.loads(result.decode('utf-8')) + else: + result = list(_services()) + # cache this data for the next call + redis.set(cache_key, json.dumps(result).encode('utf-8')) + + if not result: + return Response( + response='no access services found', + status=404, + mimetype="text/html") + + return jsonify(result) def _handle_peering_group_request(name, cache_key, group_key_base): diff --git a/inventory_provider/tasks/worker.py b/inventory_provider/tasks/worker.py index 02f93249..c87da938 100644 --- a/inventory_provider/tasks/worker.py +++ b/inventory_provider/tasks/worker.py @@ -408,7 +408,7 @@ def launch_refresh_cache_all(config): monitor.clear_joblog(get_current_redis(config)) - # first batch of subtasks: refresh cached IMS data + # first batch of subtasks: refresh cached IMS location data subtasks = [ update_neteng_managed_device_list.apply_async(), update_equipment_locations.apply_async(), @@ -431,13 +431,10 @@ def launch_refresh_cache_all(config): @log_task_entry_and_exit def internal_refresh_phase_2(self): # second batch of subtasks: - # alarms db status cache - # juniper netconf & snmp data + # ims circuit information try: subtasks = [ - # update_circuit_hierarchy.apply_async(), - # update_interfaces_to_services.apply_async() update_circuit_hierarchy_and_port_id_services.apply_async() ] @@ -475,12 +472,11 @@ def update_circuit_hierarchy_and_port_id_services(self, use_current=False): locations = {k: v for k, v in ims_data.get_node_locations(ds1)} tls_names = list(ims_data.get_service_types(ds1)) - # logger.debug(json.dumps(locations['TS1.GEN.CH'], indent=2)) - # return hierarchy = None port_id_details = defaultdict(list) port_id_services = defaultdict(list) interface_services = defaultdict(list) + access_services = {} def _convert_to_bits(value, unit): unit = unit.lower() @@ -494,6 +490,8 @@ def update_circuit_hierarchy_and_port_id_services(self, use_current=False): def _get_speed(circuit_id): c = hierarchy[circuit_id] + if c['status'] != 'operational': + return 0 pattern = re.compile(r'^(\d+)([a-zA-z]+)$') m = pattern.match(c['speed']) if m: @@ -522,7 +520,6 @@ def update_circuit_hierarchy_and_port_id_services(self, use_current=False): for x in ims_data.get_port_details(ds2): pd = port_id_details[x['port_id']] pd.append(x) - # port_id_details = list(ims_data.get_port_details(ds2)) logger.debug("Port details complete") def _populate_circuit_info(): @@ -634,6 +631,9 @@ def update_circuit_hierarchy_and_port_id_services(self, use_current=False): circ['calculated-speed'] = _get_speed(circ['id']) _format_service(circ) + if circ['service_type'].lower() == 'geant ip': + access_services[circ['id']] = circ + interface_services[k].extend(circuits) if use_current: @@ -643,10 +643,16 @@ def update_circuit_hierarchy_and_port_id_services(self, use_current=False): rp = r.pipeline() for k in r.scan_iter('ims:circuit_hierarchy:*', count=1000): rp.delete(k) + rp.execute() + rp = r.pipeline() for k in r.scan_iter('ims:interface_services:*', count=1000): rp.delete(k) rp.execute() rp = r.pipeline() + for k in r.scan_iter('ims:access_services:*', count=1000): + rp.delete(k) + rp.execute() + rp = r.pipeline() for circ in hierarchy.values(): rp.set(f'ims:circuit_hierarchy:{circ["id"]}', json.dumps([circ])) rp.execute() @@ -656,6 +662,22 @@ def update_circuit_hierarchy_and_port_id_services(self, use_current=False): f'ims:interface_services:{k}', json.dumps(v)) rp.execute() + rp = r.pipeline() + + for v in access_services.values(): + rp.set( + f'ims:access_services:{v["name"]}', + json.dumps({ + 'id': v['id'], + 'name': v['name'], + 'pop_name': v['pop_name'], + 'other_end_pop_name': v['other_end_pop_name'], + 'equipment': v['equipment'], + 'other_end_equipment': v['other_end_equipment'], + 'speed_value': v['calculated-speed'], + 'speed_unit': 'n/a' + })) + rp.execute() @app.task(base=InventoryTask, bind=True, name='update_equipment_locations') diff --git a/test/data/router-info.json b/test/data/router-info.json index e3bed7251440eab498899defb87d58b686c1073a..d8bbbe465c13622414e10a0614b0e74c2c70ba70 100644 GIT binary patch delta 15995 zcmc&)d6><0^nT7cANw{4A<T@jFN3mWyE6t8W}mE?nWR$E2&ILnqf~E<(q8Up-_$5A zwu~i&7%H;Gq(vf28x{TT_}=gL-oDR|t~>Ml<qwZ%cs%cO-uJxcJ?HcFzBRS+lJBN9 zo~op*qDISTSuLmKwSrdEN?KW~XjQGI5n5eqXidF9YiVt*qZevjt*7<%B5j}zwUI_@ zltyb~y;v{NCfZb+X>)C%Ewz=l);8K!W3-*N*A9BAUZx$jlXliF+Ep*tZrWXYXix2> z9*xyF?XB_JNBe3&P0%Z}zYfrWny5*dtSOqRX_~GXdZiB1!8$~T>M$LySLq1N)GW=` zt97Jaqoed%y-u&!(Rzd4sAKdd9jiBMj*in?bi7W`iF&Kvrjzt`y+iNRyL7Tn(Ytl3 zPSbnzUR9m0_v!sQLm$u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Tj3|sOj4F&Sj46yQ zj4O;UOejn&Oe#z+Oest)Oe;(;%qYw(%qq+-%qh$*%qz?<EGR52EGjH6EGaB4EGsN8 StSGE3tSVbpmllm&b<O|7-g*lF diff --git a/test/test_msr_routes.py b/test/test_msr_routes.py index d328b847..40332106 100644 --- a/test/test_msr_routes.py +++ b/test/test_msr_routes.py @@ -4,7 +4,7 @@ import jsonschema import pytest from inventory_provider.routes.msr import PEERING_LIST_SCHEMA, \ - PEERING_GROUP_LIST_SCHEMA + PEERING_GROUP_LIST_SCHEMA, ACCESS_SERVICES_LIST_SCHEMA DEFAULT_REQUEST_HEADERS = { "Content-type": "application/json", @@ -19,13 +19,12 @@ def test_access_services(client): rv = client.get( '/msr/access-services', headers=DEFAULT_REQUEST_HEADERS) - assert rv.status_code == 404 - # assert rv.status_code == 200 - # assert rv.is_json - # response_data = json.loads(rv.data.decode('utf-8')) - # jsonschema.validate(response_data, ACCESS_SERVICES_LIST_SCHEMA) - # - # assert response_data # test data is non-empty + assert rv.status_code == 200 + assert rv.is_json + response_data = json.loads(rv.data.decode('utf-8')) + jsonschema.validate(response_data, ACCESS_SERVICES_LIST_SCHEMA) + + assert response_data # test data is non-empty def test_logical_system_peerings_all(client): -- GitLab