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

Device Driver Transport API:

- Improved endpoint type definition
parent 32e1a14f
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -47,7 +47,15 @@ def config_getter(root_url, resource_key, timeout):
            elif 'context' in context:
                context = context['context']
            for sip in context['service-interface-point']:
                endpoint_type = sip.get('layer-protocol-name', '10Gbps')
                layer_protocol_name = sip.get('layer-protocol-name', '?')
                supportable_spectrum = sip.get('tapi-photonic-media:media-channel-service-interface-point-spec', {})
                supportable_spectrum = supportable_spectrum.get('mc-pool', {})
                supportable_spectrum = supportable_spectrum.get('supportable-spectrum', [])
                supportable_spectrum = supportable_spectrum[0] if len(supportable_spectrum) == 1 else {}
                grid_type = supportable_spectrum.get('frequency-constraint', {}).get('grid-type')
                granularity = supportable_spectrum.get('frequency-constraint', {}).get('adjustment-granularity')
                direction = sip.get('direction', '?')
                endpoint_type = ':'.join([layer_protocol_name, grid_type, granularity, direction])
                endpoint_url = '/endpoints/endpoint[{:s}]'.format(sip['uuid'])
                endpoint_data = {'uuid': sip['uuid'], 'type': endpoint_type}
                result.append((endpoint_url, endpoint_data))