Loading src/sunrise6g_opensdk/edgecloud/adapters/aeros/client.py +23 −24 Original line number Diff line number Diff line Loading @@ -139,10 +139,10 @@ class EdgeApplicationManager(EdgeCloudManagementInterface): request=camara_response.request, ) except json.JSONDecodeError as e: self.logger.error("Invalid JSON in i2Edge response: %s", e) self.logger.error("Invalid JSON in aerOS response: %s", e) raise except KeyError as e: self.logger.error("Missing expected field in i2Edge data: %s", e) self.logger.error("Missing expected field in aerOS data: %s", e) raise except EdgeCloudPlatformError as e: self.logger.error("Error retrieving edge cloud zones: %s", e) Loading @@ -159,6 +159,7 @@ class EdgeApplicationManager(EdgeCloudManagementInterface): """ aeros_client = ContinuumClient(self.base_url) ngsild_params = f'format=simplified&type=InfrastructureElement&q=domain=="{zone_id}"' if config.DEBUG: self.logger.debug( "Querying infrastructure elements for zone %s with params: %s", zone_id, Loading @@ -172,6 +173,7 @@ class EdgeApplicationManager(EdgeCloudManagementInterface): # and return the details of the edge cloud zone camara_response = self.transform_infrastructure_elements( domain_ies=aeros_domain_ies, domain=zone_id) if config.DEBUG: self.logger.debug("Transformed response: %s", camara_response) # Return the transformed response return build_custom_http_response( Loading @@ -183,10 +185,10 @@ class EdgeApplicationManager(EdgeCloudManagementInterface): request=aeros_response.request, ) except json.JSONDecodeError as e: self.logger.error("Invalid JSON in i2Edge response: %s", e) self.logger.error("Invalid JSON in aerOS response: %s", e) raise except KeyError as e: self.logger.error("Missing expected field in i2Edge data: %s", e) self.logger.error("Missing expected field in aerOS data: %s", e) raise except EdgeCloudPlatformError as e: self.logger.error("Error retrieving edge cloud zones: %s", e) Loading Loading @@ -384,6 +386,7 @@ class EdgeApplicationManager(EdgeCloudManagementInterface): ] tosca_str = camara2aeros_converter.generate_tosca( app_manifest=app_manifest, app_zones=aeros_domain_ids) if config.DEBUG: self.logger.info("Generated TOSCA YAML:") self.logger.info(tosca_str) Loading Loading @@ -463,6 +466,7 @@ class EdgeApplicationManager(EdgeCloudManagementInterface): } self.logger.info("All app instances retrieved successfully") if config.DEBUG: self.logger.debug("Onboarded applications: %s", camara_response) return build_custom_http_response( status_code=200, Loading Loading @@ -491,16 +495,11 @@ class EdgeApplicationManager(EdgeCloudManagementInterface): raise InvalidArgumentError("app_instance_id is required") # Look up the instance in CAMARA storage (returns List[AppInstanceInfo]) self.logger.debug( "@@@@@@ Retrieving deployed app instance '%s' (app_id=%s, region=%s) @@@@@@", app_instance_id, app_id, region) matches = self.storage.find_deployments( app_id=app_id, app_instance_id=app_instance_id, region=region, ) self.logger.debug("@@@ Deployed app instance matches: %s @@@", matches) if not matches: # Be explicit in the error so callers know what was used to filter scope = [] Loading Loading @@ -626,10 +625,10 @@ class EdgeApplicationManager(EdgeCloudManagementInterface): request=aeros_response.request, ) except json.JSONDecodeError as e: self.logger.error("Invalid JSON in i2Edge response: %s", e) self.logger.error("Invalid JSON in aerOS response: %s", e) raise except KeyError as e: self.logger.error("Missing expected field in i2Edge data: %s", e) self.logger.error("Missing expected field in aerOS data: %s", e) raise except EdgeCloudPlatformError as e: self.logger.error("Error retrieving edge cloud zones: %s", e) Loading Loading @@ -674,10 +673,10 @@ class EdgeApplicationManager(EdgeCloudManagementInterface): request=aeros_response.request, ) except json.JSONDecodeError as e: self.logger.error("Invalid JSON in i2Edge response: %s", e) self.logger.error("Invalid JSON in aerOS response: %s", e) raise except KeyError as e: self.logger.error("Missing expected field in i2Edge data: %s", e) self.logger.error("Missing expected field in aerOS data: %s", e) raise except EdgeCloudPlatformError as e: self.logger.error("Error retrieving edge cloud zones: %s", e) Loading Loading @@ -719,10 +718,10 @@ class EdgeApplicationManager(EdgeCloudManagementInterface): request=aeros_response.request, ) except json.JSONDecodeError as e: self.logger.error("Invalid JSON in i2Edge response: %s", e) self.logger.error("Invalid JSON in aerOS response: %s", e) raise except KeyError as e: self.logger.error("Missing expected field in i2Edge data: %s", e) self.logger.error("Missing expected field in aerOS data: %s", e) raise except EdgeCloudPlatformError as e: self.logger.error("Error retrieving edge cloud zones: %s", e) Loading src/sunrise6g_opensdk/edgecloud/adapters/aeros/continuum_client.py +0 −1 Original line number Diff line number Diff line Loading @@ -127,7 +127,6 @@ class ContinuumClient: undeploy_url = f"{self.api_url}/hlo_fe/services/{service_id}" response = requests.delete(undeploy_url, headers=self.hlo_headers, timeout=15) if response is None: self.logger.debug("In NONE Undeploy service URL: %s", undeploy_url) return None else: self.logger.debug("In OK Undeploy and text: %s", response.text) Loading src/sunrise6g_opensdk/edgecloud/adapters/aeros/storageManagement/inMemoryStorage.py +0 −13 Original line number Diff line number Diff line Loading @@ -182,26 +182,13 @@ class InMemoryAppStorage(AppStorageManager, metaclass=SingletonMeta): if app_instance_id: for insts in self._deployed.values(): for inst in insts: self.logger.debug( "186: Checking deployed instance id='%s' against '%s'", str(inst.appInstanceId), app_instance_id) if str(inst.appInstanceId.root) == app_instance_id: if app_id and str(inst.appId) != app_id: self.logger.debug( "189: app_id mismatch: '%s' != '%s'", str(inst.appId), app_id) return [] if region is not None and getattr( inst, "region", None) != region: self.logger.debug( "193: region mismatch: '%s' != '%s'", getattr(inst, "region", None), region) return [] self.logger.debug( "197: Found matching instance: %s", inst) return [inst] self.logger.debug("200: No matching instance found for id='%s'", app_instance_id) return [] results: List[AppInstanceInfo] = [] Loading Loading
src/sunrise6g_opensdk/edgecloud/adapters/aeros/client.py +23 −24 Original line number Diff line number Diff line Loading @@ -139,10 +139,10 @@ class EdgeApplicationManager(EdgeCloudManagementInterface): request=camara_response.request, ) except json.JSONDecodeError as e: self.logger.error("Invalid JSON in i2Edge response: %s", e) self.logger.error("Invalid JSON in aerOS response: %s", e) raise except KeyError as e: self.logger.error("Missing expected field in i2Edge data: %s", e) self.logger.error("Missing expected field in aerOS data: %s", e) raise except EdgeCloudPlatformError as e: self.logger.error("Error retrieving edge cloud zones: %s", e) Loading @@ -159,6 +159,7 @@ class EdgeApplicationManager(EdgeCloudManagementInterface): """ aeros_client = ContinuumClient(self.base_url) ngsild_params = f'format=simplified&type=InfrastructureElement&q=domain=="{zone_id}"' if config.DEBUG: self.logger.debug( "Querying infrastructure elements for zone %s with params: %s", zone_id, Loading @@ -172,6 +173,7 @@ class EdgeApplicationManager(EdgeCloudManagementInterface): # and return the details of the edge cloud zone camara_response = self.transform_infrastructure_elements( domain_ies=aeros_domain_ies, domain=zone_id) if config.DEBUG: self.logger.debug("Transformed response: %s", camara_response) # Return the transformed response return build_custom_http_response( Loading @@ -183,10 +185,10 @@ class EdgeApplicationManager(EdgeCloudManagementInterface): request=aeros_response.request, ) except json.JSONDecodeError as e: self.logger.error("Invalid JSON in i2Edge response: %s", e) self.logger.error("Invalid JSON in aerOS response: %s", e) raise except KeyError as e: self.logger.error("Missing expected field in i2Edge data: %s", e) self.logger.error("Missing expected field in aerOS data: %s", e) raise except EdgeCloudPlatformError as e: self.logger.error("Error retrieving edge cloud zones: %s", e) Loading Loading @@ -384,6 +386,7 @@ class EdgeApplicationManager(EdgeCloudManagementInterface): ] tosca_str = camara2aeros_converter.generate_tosca( app_manifest=app_manifest, app_zones=aeros_domain_ids) if config.DEBUG: self.logger.info("Generated TOSCA YAML:") self.logger.info(tosca_str) Loading Loading @@ -463,6 +466,7 @@ class EdgeApplicationManager(EdgeCloudManagementInterface): } self.logger.info("All app instances retrieved successfully") if config.DEBUG: self.logger.debug("Onboarded applications: %s", camara_response) return build_custom_http_response( status_code=200, Loading Loading @@ -491,16 +495,11 @@ class EdgeApplicationManager(EdgeCloudManagementInterface): raise InvalidArgumentError("app_instance_id is required") # Look up the instance in CAMARA storage (returns List[AppInstanceInfo]) self.logger.debug( "@@@@@@ Retrieving deployed app instance '%s' (app_id=%s, region=%s) @@@@@@", app_instance_id, app_id, region) matches = self.storage.find_deployments( app_id=app_id, app_instance_id=app_instance_id, region=region, ) self.logger.debug("@@@ Deployed app instance matches: %s @@@", matches) if not matches: # Be explicit in the error so callers know what was used to filter scope = [] Loading Loading @@ -626,10 +625,10 @@ class EdgeApplicationManager(EdgeCloudManagementInterface): request=aeros_response.request, ) except json.JSONDecodeError as e: self.logger.error("Invalid JSON in i2Edge response: %s", e) self.logger.error("Invalid JSON in aerOS response: %s", e) raise except KeyError as e: self.logger.error("Missing expected field in i2Edge data: %s", e) self.logger.error("Missing expected field in aerOS data: %s", e) raise except EdgeCloudPlatformError as e: self.logger.error("Error retrieving edge cloud zones: %s", e) Loading Loading @@ -674,10 +673,10 @@ class EdgeApplicationManager(EdgeCloudManagementInterface): request=aeros_response.request, ) except json.JSONDecodeError as e: self.logger.error("Invalid JSON in i2Edge response: %s", e) self.logger.error("Invalid JSON in aerOS response: %s", e) raise except KeyError as e: self.logger.error("Missing expected field in i2Edge data: %s", e) self.logger.error("Missing expected field in aerOS data: %s", e) raise except EdgeCloudPlatformError as e: self.logger.error("Error retrieving edge cloud zones: %s", e) Loading Loading @@ -719,10 +718,10 @@ class EdgeApplicationManager(EdgeCloudManagementInterface): request=aeros_response.request, ) except json.JSONDecodeError as e: self.logger.error("Invalid JSON in i2Edge response: %s", e) self.logger.error("Invalid JSON in aerOS response: %s", e) raise except KeyError as e: self.logger.error("Missing expected field in i2Edge data: %s", e) self.logger.error("Missing expected field in aerOS data: %s", e) raise except EdgeCloudPlatformError as e: self.logger.error("Error retrieving edge cloud zones: %s", e) Loading
src/sunrise6g_opensdk/edgecloud/adapters/aeros/continuum_client.py +0 −1 Original line number Diff line number Diff line Loading @@ -127,7 +127,6 @@ class ContinuumClient: undeploy_url = f"{self.api_url}/hlo_fe/services/{service_id}" response = requests.delete(undeploy_url, headers=self.hlo_headers, timeout=15) if response is None: self.logger.debug("In NONE Undeploy service URL: %s", undeploy_url) return None else: self.logger.debug("In OK Undeploy and text: %s", response.text) Loading
src/sunrise6g_opensdk/edgecloud/adapters/aeros/storageManagement/inMemoryStorage.py +0 −13 Original line number Diff line number Diff line Loading @@ -182,26 +182,13 @@ class InMemoryAppStorage(AppStorageManager, metaclass=SingletonMeta): if app_instance_id: for insts in self._deployed.values(): for inst in insts: self.logger.debug( "186: Checking deployed instance id='%s' against '%s'", str(inst.appInstanceId), app_instance_id) if str(inst.appInstanceId.root) == app_instance_id: if app_id and str(inst.appId) != app_id: self.logger.debug( "189: app_id mismatch: '%s' != '%s'", str(inst.appId), app_id) return [] if region is not None and getattr( inst, "region", None) != region: self.logger.debug( "193: region mismatch: '%s' != '%s'", getattr(inst, "region", None), region) return [] self.logger.debug( "197: Found matching instance: %s", inst) return [inst] self.logger.debug("200: No matching instance found for id='%s'", app_instance_id) return [] results: List[AppInstanceInfo] = [] Loading