Loading src/service/service/service_handlers/__init__.py +2 −2 Original line number Diff line number Diff line Loading @@ -22,7 +22,7 @@ from .l3nm_gnmi_openconfig.L3NMGnmiOpenConfigServiceHandler import L3NMGnmiOpenC from .l3nm_ietfactn.L3NM_IETFACTN_ServiceHandler import L3NM_IETFACTN_ServiceHandler from .l3nm_ietfl3vpn.L3NM_IETFL3VPN_ServiceHandler import L3NM_IETFL3VPN_ServiceHandler from .l3nm_ietfslice.L3NM_IETFSlice_ServiceHandler import L3NM_IETFSlice_ServiceHandler from .l3nm_nce.L3NMNCEServiceHandler import L3NMNCEServiceHandler from .l3nm_ncefan.L3NM_NCEFAN_ServiceHandler import L3NM_NCEFAN_ServiceHandler from .l3nm_openconfig.L3NMOpenConfigServiceHandler import L3NMOpenConfigServiceHandler from .microwave.MicrowaveServiceHandler import MicrowaveServiceHandler from .p4_dummy_l1.p4_dummy_l1_service_handler import P4DummyL1ServiceHandler Loading Loading @@ -80,7 +80,7 @@ SERVICE_HANDLERS = [ FilterFieldEnum.DEVICE_DRIVER : DeviceDriverEnum.DEVICEDRIVER_IETF_L3VPN, } ]), (L3NMNCEServiceHandler, [ (L3NM_NCEFAN_ServiceHandler, [ { FilterFieldEnum.SERVICE_TYPE : ServiceTypeEnum.SERVICETYPE_L3NM, FilterFieldEnum.DEVICE_DRIVER : DeviceDriverEnum.DEVICEDRIVER_NCE, Loading src/service/service/service_handlers/l3nm_ncefan/DataStoreDelta.py 0 → 100644 +48 −0 Original line number Diff line number Diff line # Copyright 2022-2025 ETSI SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import json from deepdiff import DeepDiff from typing import Dict, Optional from common.proto.context_pb2 import Service RUNNING_RESOURCE_KEY = 'running_ietf_slice' CANDIDATE_RESOURCE_KEY = 'candidate_ietf_slice' class DataStoreDelta: def __init__(self, service : Service): self._service = service self._service_config = service.service_config self._candidate_data = self._get_datastore_data(CANDIDATE_RESOURCE_KEY) self._running_data = self._get_datastore_data(RUNNING_RESOURCE_KEY ) def _get_datastore_data(self, resource_key : str) -> Optional[Dict]: for cr in self._service_config.config_rules: if cr.WhichOneof('config_rule') != 'custom': continue if cr.custom.resource_key != resource_key: continue resource_value = json.loads(cr.custom.resource_value) return resource_value.get('network-slice-services', dict()).get('slice-service') return None @property def candidate_data(self): return self._candidate_data @property def running_data(self): return self._running_data def get_diff(self) -> Dict: return DeepDiff(self._running_data, self._candidate_data) src/service/service/service_handlers/l3nm_ncefan/L3NM_NCEFAN_ServiceHandler.py 0 → 100644 +559 −0 File added.Preview size limit exceeded, changes collapsed. Show changes src/service/service/service_handlers/l3nm_ncefan/Tools.py 0 → 100644 +31 −0 Original line number Diff line number Diff line # Copyright 2022-2025 ETSI SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. from common.proto.context_pb2 import Device def get_device_endpoint_name(device_obj : Device, endpoint_uuid : str) -> str: ''' Given a device object and an endpoint UUID, return the device endpoint name. Raises an exception if not found. ''' for d_ep in device_obj.device_endpoints: if d_ep.endpoint_id.endpoint_uuid.uuid == endpoint_uuid: return d_ep.name device_uuid = str(device_obj.device_id.device_uuid.uuid) device_name = str(device_obj.name) MSG = 'Device({:s},{:s})/Endpoint({:s}) not found' raise Exception(MSG.format(device_uuid, device_name, str(endpoint_uuid))) src/service/service/service_handlers/l3nm_nce/__init__.py→src/service/service/service_handlers/l3nm_ncefan/__init__.py +0 −0 File moved. View file Loading
src/service/service/service_handlers/__init__.py +2 −2 Original line number Diff line number Diff line Loading @@ -22,7 +22,7 @@ from .l3nm_gnmi_openconfig.L3NMGnmiOpenConfigServiceHandler import L3NMGnmiOpenC from .l3nm_ietfactn.L3NM_IETFACTN_ServiceHandler import L3NM_IETFACTN_ServiceHandler from .l3nm_ietfl3vpn.L3NM_IETFL3VPN_ServiceHandler import L3NM_IETFL3VPN_ServiceHandler from .l3nm_ietfslice.L3NM_IETFSlice_ServiceHandler import L3NM_IETFSlice_ServiceHandler from .l3nm_nce.L3NMNCEServiceHandler import L3NMNCEServiceHandler from .l3nm_ncefan.L3NM_NCEFAN_ServiceHandler import L3NM_NCEFAN_ServiceHandler from .l3nm_openconfig.L3NMOpenConfigServiceHandler import L3NMOpenConfigServiceHandler from .microwave.MicrowaveServiceHandler import MicrowaveServiceHandler from .p4_dummy_l1.p4_dummy_l1_service_handler import P4DummyL1ServiceHandler Loading Loading @@ -80,7 +80,7 @@ SERVICE_HANDLERS = [ FilterFieldEnum.DEVICE_DRIVER : DeviceDriverEnum.DEVICEDRIVER_IETF_L3VPN, } ]), (L3NMNCEServiceHandler, [ (L3NM_NCEFAN_ServiceHandler, [ { FilterFieldEnum.SERVICE_TYPE : ServiceTypeEnum.SERVICETYPE_L3NM, FilterFieldEnum.DEVICE_DRIVER : DeviceDriverEnum.DEVICEDRIVER_NCE, Loading
src/service/service/service_handlers/l3nm_ncefan/DataStoreDelta.py 0 → 100644 +48 −0 Original line number Diff line number Diff line # Copyright 2022-2025 ETSI SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import json from deepdiff import DeepDiff from typing import Dict, Optional from common.proto.context_pb2 import Service RUNNING_RESOURCE_KEY = 'running_ietf_slice' CANDIDATE_RESOURCE_KEY = 'candidate_ietf_slice' class DataStoreDelta: def __init__(self, service : Service): self._service = service self._service_config = service.service_config self._candidate_data = self._get_datastore_data(CANDIDATE_RESOURCE_KEY) self._running_data = self._get_datastore_data(RUNNING_RESOURCE_KEY ) def _get_datastore_data(self, resource_key : str) -> Optional[Dict]: for cr in self._service_config.config_rules: if cr.WhichOneof('config_rule') != 'custom': continue if cr.custom.resource_key != resource_key: continue resource_value = json.loads(cr.custom.resource_value) return resource_value.get('network-slice-services', dict()).get('slice-service') return None @property def candidate_data(self): return self._candidate_data @property def running_data(self): return self._running_data def get_diff(self) -> Dict: return DeepDiff(self._running_data, self._candidate_data)
src/service/service/service_handlers/l3nm_ncefan/L3NM_NCEFAN_ServiceHandler.py 0 → 100644 +559 −0 File added.Preview size limit exceeded, changes collapsed. Show changes
src/service/service/service_handlers/l3nm_ncefan/Tools.py 0 → 100644 +31 −0 Original line number Diff line number Diff line # Copyright 2022-2025 ETSI SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. from common.proto.context_pb2 import Device def get_device_endpoint_name(device_obj : Device, endpoint_uuid : str) -> str: ''' Given a device object and an endpoint UUID, return the device endpoint name. Raises an exception if not found. ''' for d_ep in device_obj.device_endpoints: if d_ep.endpoint_id.endpoint_uuid.uuid == endpoint_uuid: return d_ep.name device_uuid = str(device_obj.device_id.device_uuid.uuid) device_name = str(device_obj.name) MSG = 'Device({:s},{:s})/Endpoint({:s}) not found' raise Exception(MSG.format(device_uuid, device_name, str(endpoint_uuid)))
src/service/service/service_handlers/l3nm_nce/__init__.py→src/service/service/service_handlers/l3nm_ncefan/__init__.py +0 −0 File moved. View file