diff --git a/config/config.json b/config/config.json index 8914bc8d2231e6725857505eaea2753c8e74a2a1..084ec7bd69e0b8ff2e9eb741cad7869cc85c58a2 100644 --- a/config/config.json +++ b/config/config.json @@ -17,5 +17,25 @@ "capif_password": "echevapass", "APFs": "1", "AEFs": "1", - "debug_mode": "True" + "debug_mode": "True", + "discover_filter" : { + "api-name": "", + "api-version": "", + "comm-type": "", + "protocol": "", + "aef-id": "", + "data-format": "", + "api-cat": "", + "preferred-aef-loc": "", + "req-api-prov-name": "", + "supported-features": "", + "api-supported-features": "", + "ue-ip-addr": "", + "service-kpis": "" + }, + "publish_req" : { + "serviceApiId":"", + "publisherAPFid":"", + "publisherAEFsids":["","",""] + } } \ No newline at end of file diff --git a/sdk/sdk.py b/sdk/sdk.py index 2b4da2d0d2ad880e4eeb086f61de1756e637e9ab..61e17fcc0409fce52a8e03a768254bb25d0e14b5 100644 --- a/sdk/sdk.py +++ b/sdk/sdk.py @@ -798,12 +798,14 @@ class CAPIFProviderConnector: provider_details=self.__load_provider_api_details() publish_url=provider_details["publish_url"] - json_path = self.config_path + "publish.json" + json_path = self.config_path + "config.json" - # Leer el archivo publish.json + with open(json_path, 'r') as f: chosenAPFsandAEFs = json.load(f) + + chosenAPFsandAEFs=chosenAPFsandAEFs["publish_req"] APF_api_prov_func_id = chosenAPFsandAEFs["publisherAPFid"] AEFs_list = chosenAPFsandAEFs["publisherAEFsids"] @@ -926,9 +928,10 @@ class CAPIFProviderConnector: publish_url=provider_details["publish_url"] # Load provider details - json_path = self.config_path +"publish.json" + json_path = self.config_path +"config.json" with open(json_path, 'r') as f: publish = json.load(f) + publish=publish["publish_req"] api_id="/" + publish["serviceApiId"] APF_api_prov_func_id=publish["publisherAPFid"] AEFs_list = publish["publisherAEFsids"] @@ -1033,13 +1036,15 @@ class CAPIFProviderConnector: provider_details=self.__load_provider_api_details() publish_url=provider_details["publish_url"] - json_path = self.config_path + "publish.json" + json_path = self.config_path + "config.json" - # Leer el archivo publish.json + with open(json_path, 'r') as f: chosenAPFsandAEFs = json.load(f) + chosenAPFsandAEFs=chosenAPFsandAEFs["publish_req"] + APF_api_prov_func_id = chosenAPFsandAEFs["publisherAPFid"] api_id="/" +chosenAPFsandAEFs["serviceApiId"] @@ -1109,12 +1114,14 @@ class CAPIFProviderConnector: provider_details=self.__load_provider_api_details() publish_url=provider_details["publish_url"] - json_path = self.config_path + "publish.json" + json_path = self.config_path + "config.json" - # Leer el archivo publish.json + with open(json_path, 'r') as f: chosenAPFsandAEFs = json.load(f) + + chosenAPFsandAEFs=chosenAPFsandAEFs["publish_req"] APF_api_prov_func_id = chosenAPFsandAEFs["publisherAPFid"] @@ -1189,13 +1196,15 @@ class CAPIFProviderConnector: provider_details=self.__load_provider_api_details() publish_url=provider_details["publish_url"] - json_path = self.config_path + "publish.json" + json_path = self.config_path + "config.json" - # Leer el archivo publish.json + with open(json_path, 'r') as f: chosenAPFsandAEFs = json.load(f) + chosenAPFsandAEFs=chosenAPFsandAEFs["publish_req"] + APF_api_prov_func_id = chosenAPFsandAEFs["publisherAPFid"] AEFs_list = chosenAPFsandAEFs["publisherAEFsids"] @@ -1895,11 +1904,12 @@ class ServiceDiscoverer: """ # Cargar los parámetros desde el archivo JSON - json_path = self.config_path +"discover_filter.json" + json_path = self.config_path +"config.json" with open(json_path, 'r') as f: filters = json.load(f) # Filtrar parámetros que no sean vacÃos " + filters=filters["discover_filter"] query_params = {k: v for k, v in filters.items() if v } # Formar la URL con los parámetros de query