From 7e8258dae07ad19641dd88eb97625791b1e61e29 Mon Sep 17 00:00:00 2001 From: JorgeEcheva26 Date: Mon, 23 Sep 2024 12:31:05 +0200 Subject: [PATCH] details --- doc/sdk-configuration.md | 11 ++++------- doc/sdk-installation.md | 2 +- doc/sdk-usage.md | 10 ++++++++-- scripts/provider_publish_api.py | 2 +- scripts/register_and_login.py | 16 ---------------- scripts/utilities.py | 2 +- 6 files changed, 15 insertions(+), 28 deletions(-) diff --git a/doc/sdk-configuration.md b/doc/sdk-configuration.md index 16c66fe..c06f60d 100644 --- a/doc/sdk-configuration.md +++ b/doc/sdk-configuration.md @@ -5,9 +5,9 @@ Before configuration it's needed to have completed the [prerequirements](./sdk-p This configuration could also be fullfilled by enviroment variables (EXAMPLE) - - invoker_folder: The path (relative or absolute) of the folder you want to store your invoker information +- invoker_folder: The path (relative or absolute) of the folder you want to store your invoker information -- provider_folder:The path (relative or absolute) of the folder you want to store your invoker information +- provider_folder:The path (relative or absolute) of the folder you want to store your provider information - capif_host:The domain name of your capif host @@ -29,7 +29,7 @@ This configuration could also be fullfilled by enviroment variables (EXAMPLE) - AEFs: Number of AEF's you want to onboard as a provider Example:2 -- debug_mode: Boolean | If you want to recieve logs from SDK-S6G Example:True/False +- debug_mode: Boolean | If you want to recieve logs from SDK Example:True/False Mandatory fields no matter the target role to be onboarded, either invoker or provider: @@ -66,7 +66,7 @@ For using the Publish Api function or the Update function the provider_api_descr **AefIds fields won't need to fill out the from aefProfiles** array because you would already be configurating this fields by completing publisherAEFsids parameter -**If the publisherAEFsids parameter don't match with the aefProfiles you will recieve an error** +**If the publisherAEFsids parameter don't match with the aefProfiles in your [Api description](../api-samples/provider_api_description_sample.json) you will recieve an error** @@ -78,9 +78,6 @@ To use this feature it has to be completed `Discover_filter.json` with the param To run the Invoker Service Discovery Functionality it has to be onboarded as an Invoker before the CAPIF user. - - - #### **Configuration of Register.json** In order to use this SDK in a Local enviroment and creating and removing users, its mandatory to fullfill this fields. diff --git a/doc/sdk-installation.md b/doc/sdk-installation.md index 78bfb70..1082c48 100644 --- a/doc/sdk-installation.md +++ b/doc/sdk-installation.md @@ -1,7 +1,7 @@ # OpenCAPIF SDK installation -Before installation it's needed to have completed the prerequirements section. +Before installation it's needed to have completed the [prerequirements](sdk-prerequirements.md) section. ## OpenCAPIF SDK consumer installation diff --git a/doc/sdk-usage.md b/doc/sdk-usage.md index b27a116..bd907d6 100644 --- a/doc/sdk-usage.md +++ b/doc/sdk-usage.md @@ -139,8 +139,14 @@ In the `provider_folder`, it will be located several folders with each `capif_us Apart from the SDK core, there are available different functionalities for development purposes: -- **Register and login**: Facilitates the logging process for admin users and creates a CAPIF user, -- **Deregister and login**: Facilitates the logging process for admin users and eliminates a CAPIF user. +- Script register_and_login.py + +Facilitates the logging process for admin users and creates a CAPIF user, + + +- Script deregister_and_login.py + +Facilitates the logging process for admin users and eliminates a CAPIF user. ![Descripción de la imagen](./images/Flujo%20completo-SDK%20ACTUAL%20CON%20REGISTER.jpg) diff --git a/scripts/provider_publish_api.py b/scripts/provider_publish_api.py index 68af744..e447c8a 100644 --- a/scripts/provider_publish_api.py +++ b/scripts/provider_publish_api.py @@ -16,7 +16,7 @@ def showcase_capif_nef_connector(): capif_connector = CAPIFProviderConnector(config_file=utilities.get_config_file()) capif_connector.publish_services( - service_api_description_json_full_path=utilities.provider_exposer_get_sample_api_description_path()) + service_api_description_json_full_path=utilities.provider_exposer_get_api_description_path()) print("COMPLETED") if __name__ == "__main__": diff --git a/scripts/register_and_login.py b/scripts/register_and_login.py index fdc0cc4..7cb9e2c 100644 --- a/scripts/register_and_login.py +++ b/scripts/register_and_login.py @@ -24,7 +24,6 @@ def main(): admintoken = log_result["access_token"] postcreation = __create_user(admintoken,variables) uuid = postcreation["uuid"] - __write_to_file(uuid,variables) logger.info(uuid) def __log_to_capif(variables): @@ -88,21 +87,6 @@ def __load_config_file(config_file: str): logger.warning(f"Configuration file {config_file} not found. Using defaults or environment variables.") return {} -def __write_to_file(uuid, variables): - logger.info("Saving uuid in config.json") - - # Abrimos el archivo y leemos su contenido - with open(variables["config_path"] + "config.json", "r") as infile: - data = json.load(infile) - - # Modificamos el contenido del archivo para incluir el nuevo UUID - data["uuid"] = uuid - - # Escribimos el contenido actualizado de nuevo en el archivo - with open(variables["config_path"] + "config.json", "w") as outfile: - json.dump(data, outfile, indent=4) - - logger.info("Data saved") if __name__ == "__main__": logger = logging.getLogger("CAPIF Register") diff --git a/scripts/utilities.py b/scripts/utilities.py index 02924f2..911c8ad 100755 --- a/scripts/utilities.py +++ b/scripts/utilities.py @@ -6,6 +6,6 @@ def get_config_file()-> str : def get_register_file()-> str : return "/Users/IDB0128/git_repos/pesp_capif_sdk/config/register.json" -def provider_exposer_get_sample_api_description_path() -> str: +def provider_exposer_get_api_description_path() -> str: return "/Users/IDB0128/git_repos/pesp_capif_sdk/api-samples/provider_api_description_sample.json" -- GitLab