Loading src/device/service/drivers/nce/Constants.py +1 −1 Original line number Diff line number Diff line # Copyright 2022-2024 ETSI OSG/SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/) # Copyright 2022-2025 ETSI OSG/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. Loading src/device/service/drivers/nce/Tools.py +1 −1 Original line number Diff line number Diff line # Copyright 2022-2024 ETSI OSG/SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/) # Copyright 2022-2025 ETSI OSG/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. Loading src/device/service/drivers/nce/__init__.py +1 −1 Original line number Diff line number Diff line # Copyright 2022-2024 ETSI OSG/SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/) # Copyright 2022-2025 ETSI OSG/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. Loading src/device/service/drivers/nce/driver.py +5 −6 Original line number Diff line number Diff line # Copyright 2022-2024 ETSI OSG/SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/) # Copyright 2022-2025 ETSI OSG/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. Loading Loading @@ -195,8 +195,10 @@ class NCEDriver(_Driver): self, resources: List[Tuple[str, Any]] ) -> List[Union[bool, Exception]]: results = [] if len(resources) == 0: return results with self.__lock: for resource in resources: resource_key, resource_value = resource Loading @@ -215,13 +217,14 @@ class NCEDriver(_Driver): try: resource_value = json.loads(resource_value) if operation_type == "create": self.nce.create_app_flow(resource_value) elif operation_type == "delete": app_flow_name = resource_value["huawei-nce-app-flow:app-flows"][ "app-flow" ][0]["app-name"] self.nce.delete_app_flow(app_flow_name) LOGGER.debug(f"app_flow_datamodel {resource_value}") results.append((resource_key, True)) except Exception as e: # pylint: disable=broad-except LOGGER.exception( Loading @@ -244,10 +247,6 @@ class NCEDriver(_Driver): LOGGER.info("resource = {:s}".format(str(resource))) resource_key, resource_value = resource try: # resource_value = json.loads(resource_value) # service_uuid = resource_value["uuid"] # if service_exists(self.__tfs_nbi_root, self.__auth, service_uuid): # self.tac.delete_connectivity_service(service_uuid) results.append((resource_key, True)) except Exception as e: # pylint: disable=broad-except LOGGER.exception( Loading src/device/service/drivers/nce/nce_fan_client.py +3 −1 Original line number Diff line number Diff line # Copyright 2022-2024 ETSI OSG/SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/) # Copyright 2022-2025 ETSI OSG/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. Loading Loading @@ -71,6 +71,7 @@ class NCEClient: app_url = self._nce_fan_url + "/app-flows/apps" LOGGER.info(f'Creating app: {app_data} URL: {app_url}') requests.post(app_url, json=app_data, headers=HEADERS) app_flow_data = { "app-flow": app_flow_data["huawei-nce-app-flow:app-flows"]["app-flow"] } Loading @@ -85,6 +86,7 @@ class NCEClient: app_url = self._nce_fan_url + f"/app-flows/apps/application={app_flow_name}" LOGGER.info(f'Deleting app: {app_flow_name} URL: {app_url}') requests.delete(app_url) app_flow_url = self._nce_fan_url + f"/app-flows/app-flow={app_flow_name}" LOGGER.info(f'Deleting app flow: {app_flow_name} URL: {app_flow_url}') requests.delete(app_flow_url) Loading Loading
src/device/service/drivers/nce/Constants.py +1 −1 Original line number Diff line number Diff line # Copyright 2022-2024 ETSI OSG/SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/) # Copyright 2022-2025 ETSI OSG/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. Loading
src/device/service/drivers/nce/Tools.py +1 −1 Original line number Diff line number Diff line # Copyright 2022-2024 ETSI OSG/SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/) # Copyright 2022-2025 ETSI OSG/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. Loading
src/device/service/drivers/nce/__init__.py +1 −1 Original line number Diff line number Diff line # Copyright 2022-2024 ETSI OSG/SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/) # Copyright 2022-2025 ETSI OSG/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. Loading
src/device/service/drivers/nce/driver.py +5 −6 Original line number Diff line number Diff line # Copyright 2022-2024 ETSI OSG/SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/) # Copyright 2022-2025 ETSI OSG/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. Loading Loading @@ -195,8 +195,10 @@ class NCEDriver(_Driver): self, resources: List[Tuple[str, Any]] ) -> List[Union[bool, Exception]]: results = [] if len(resources) == 0: return results with self.__lock: for resource in resources: resource_key, resource_value = resource Loading @@ -215,13 +217,14 @@ class NCEDriver(_Driver): try: resource_value = json.loads(resource_value) if operation_type == "create": self.nce.create_app_flow(resource_value) elif operation_type == "delete": app_flow_name = resource_value["huawei-nce-app-flow:app-flows"][ "app-flow" ][0]["app-name"] self.nce.delete_app_flow(app_flow_name) LOGGER.debug(f"app_flow_datamodel {resource_value}") results.append((resource_key, True)) except Exception as e: # pylint: disable=broad-except LOGGER.exception( Loading @@ -244,10 +247,6 @@ class NCEDriver(_Driver): LOGGER.info("resource = {:s}".format(str(resource))) resource_key, resource_value = resource try: # resource_value = json.loads(resource_value) # service_uuid = resource_value["uuid"] # if service_exists(self.__tfs_nbi_root, self.__auth, service_uuid): # self.tac.delete_connectivity_service(service_uuid) results.append((resource_key, True)) except Exception as e: # pylint: disable=broad-except LOGGER.exception( Loading
src/device/service/drivers/nce/nce_fan_client.py +3 −1 Original line number Diff line number Diff line # Copyright 2022-2024 ETSI OSG/SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/) # Copyright 2022-2025 ETSI OSG/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. Loading Loading @@ -71,6 +71,7 @@ class NCEClient: app_url = self._nce_fan_url + "/app-flows/apps" LOGGER.info(f'Creating app: {app_data} URL: {app_url}') requests.post(app_url, json=app_data, headers=HEADERS) app_flow_data = { "app-flow": app_flow_data["huawei-nce-app-flow:app-flows"]["app-flow"] } Loading @@ -85,6 +86,7 @@ class NCEClient: app_url = self._nce_fan_url + f"/app-flows/apps/application={app_flow_name}" LOGGER.info(f'Deleting app: {app_flow_name} URL: {app_url}') requests.delete(app_url) app_flow_url = self._nce_fan_url + f"/app-flows/app-flow={app_flow_name}" LOGGER.info(f'Deleting app flow: {app_flow_name} URL: {app_flow_url}') requests.delete(app_flow_url) Loading