Loading src/common/sdk_catalog.py +3 −7 Original line number Diff line number Diff line Loading @@ -49,7 +49,9 @@ class SdkClientCatalog: } @classmethod def get_client(cls, domain: str, client_name: str, base_url: str, **kwargs): def instantiate_and_retrieve_clients( cls, domain: str, client_name: str, base_url: str, **kwargs ): try: catalog = cls._domain_factories[domain] except KeyError: Loading @@ -57,9 +59,3 @@ class SdkClientCatalog: f"Unsupported domain '{domain}'. Supported: {list(cls._domain_factories)}" ) return catalog(client_name, base_url, **kwargs) if domain == "network": if "scs_as_id" not in kwargs: raise ValueError("Missing required 'scs_as_id' for network clients.") return catalog(client_name, base_url, kwargs["scs_as_id"]) else: return catalog(client_name, base_url) src/common/sdk_catalog_client.py +5 −3 Original line number Diff line number Diff line Loading @@ -5,7 +5,9 @@ from src.common.sdk_catalog import SdkClientCatalog class SdkCatalogClient: @staticmethod def create_clients(client_specs: Dict[str, Dict[str, str]]) -> Dict[str, object]: def create_clients_from( client_specs: Dict[str, Dict[str, str]], ) -> Dict[str, object]: """ Create and return a dictionary of instantiated edgecloud/network/o-ran clients based on the provided specifications. Loading Loading @@ -44,7 +46,7 @@ class SdkCatalogClient: >>> edgecloud_client.get_edge_cloud_zones() >>> network_client.get_qod_session(session_id="example_session_id") """ universal_client_catalog = SdkClientCatalog() sdk_client_catalog = SdkClientCatalog() clients = {} for domain, config in client_specs.items(): Loading @@ -56,7 +58,7 @@ class SdkCatalogClient: k: v for k, v in config.items() if k not in ("client_name", "base_url") } client = universal_client_catalog.get_client( client = sdk_client_catalog.instantiate_and_retrieve_clients( domain, client_name, base_url, **kwargs ) clients[domain] = client Loading Loading
src/common/sdk_catalog.py +3 −7 Original line number Diff line number Diff line Loading @@ -49,7 +49,9 @@ class SdkClientCatalog: } @classmethod def get_client(cls, domain: str, client_name: str, base_url: str, **kwargs): def instantiate_and_retrieve_clients( cls, domain: str, client_name: str, base_url: str, **kwargs ): try: catalog = cls._domain_factories[domain] except KeyError: Loading @@ -57,9 +59,3 @@ class SdkClientCatalog: f"Unsupported domain '{domain}'. Supported: {list(cls._domain_factories)}" ) return catalog(client_name, base_url, **kwargs) if domain == "network": if "scs_as_id" not in kwargs: raise ValueError("Missing required 'scs_as_id' for network clients.") return catalog(client_name, base_url, kwargs["scs_as_id"]) else: return catalog(client_name, base_url)
src/common/sdk_catalog_client.py +5 −3 Original line number Diff line number Diff line Loading @@ -5,7 +5,9 @@ from src.common.sdk_catalog import SdkClientCatalog class SdkCatalogClient: @staticmethod def create_clients(client_specs: Dict[str, Dict[str, str]]) -> Dict[str, object]: def create_clients_from( client_specs: Dict[str, Dict[str, str]], ) -> Dict[str, object]: """ Create and return a dictionary of instantiated edgecloud/network/o-ran clients based on the provided specifications. Loading Loading @@ -44,7 +46,7 @@ class SdkCatalogClient: >>> edgecloud_client.get_edge_cloud_zones() >>> network_client.get_qod_session(session_id="example_session_id") """ universal_client_catalog = SdkClientCatalog() sdk_client_catalog = SdkClientCatalog() clients = {} for domain, config in client_specs.items(): Loading @@ -56,7 +58,7 @@ class SdkCatalogClient: k: v for k, v in config.items() if k not in ("client_name", "base_url") } client = universal_client_catalog.get_client( client = sdk_client_catalog.instantiate_and_retrieve_clients( domain, client_name, base_url, **kwargs ) clients[domain] = client Loading