Commit d45603d5 authored by Lluis Gifre Renom's avatar Lluis Gifre Renom
Browse files

Device component - IETF ACTN / NCE:

- Added propagation of underly endpoint settings while discovering
parent 5ecf7456
Loading
Loading
Loading
Loading
+18 −0
Original line number Diff line number Diff line
@@ -124,12 +124,30 @@ class NetworkTopologyHandler:
                    if 'name' in tpte:
                        tp_name = tpte['name']

                tp_ip_addr = '0.0.0.0'
                if 'ietf-te-topology:te-tp-id' in tp:
                    tp_ip_addr = tp['ietf-te-topology:te-tp-id']

                if node_name == 'O-PE1' and tp_name == '200':
                    site_location = 'access'
                elif node_name == 'O-PE2' and tp_name == '200':
                    site_location = 'cloud'
                else:
                    site_location = 'transport'

                endpoint_url = '/endpoints/endpoint[{:s}, {:s}]'.format(node_id, tp_id)
                endpoint_settings = {
                    'address_ip'    : tp_ip_addr,
                    'address_prefix': '24',
                    'mtu'           : '1500',
                    'site_location' : site_location,
                }
                endpoint_data = {
                    'device_uuid': node_id,
                    'uuid': tp_id,
                    'name': tp_name,
                    'type': endpoint_type,
                    'settings': endpoint_settings,
                }
                result.append((endpoint_url, endpoint_data))

+22 −0
Original line number Diff line number Diff line
@@ -124,12 +124,34 @@ class NetworkTopologyHandler:
                    if 'name' in tpte:
                        tp_name = tpte['name']

                tp_ip_addr = '0.0.0.0'
                if 'ietf-te-topology:te-tp-id' in tp:
                    tp_ip_addr = tp['ietf-te-topology:te-tp-id']

                if node_name.startswith('ONT') and tp_name == '200':
                    site_location = 'user'
                elif node_name.startswith('ONT') and tp_name == '500':
                    site_location = 'access'
                elif node_name == 'OLT' and tp_name in {'200', '201'}:
                    site_location = 'access'
                elif node_name == 'OLT' and tp_name in {'500', '501'}:
                    site_location = 'transport'
                else:
                    site_location = 'access'

                endpoint_url = '/endpoints/endpoint[{:s}, {:s}]'.format(node_id, tp_id)
                endpoint_settings = {
                    'address_ip'    : tp_ip_addr,
                    'address_prefix': '24',
                    'mtu'           : '1500',
                    'site_location' : site_location,
                }
                endpoint_data = {
                    'device_uuid': node_id,
                    'uuid': tp_id,
                    'name': tp_name,
                    'type': endpoint_type,
                    'settings': endpoint_settings,
                }
                result.append((endpoint_url, endpoint_data))