Skip to content
Snippets Groups Projects
Commit a30e2cd7 authored by Daniel García's avatar Daniel García
Browse files

Update README

parent b30c8849
No related branches found
No related tags found
1 merge request!1Sdk v0.1 (#1)
...@@ -18,11 +18,14 @@ Current version of OpenCAPIF SDK is compatible with following publicly available ...@@ -18,11 +18,14 @@ Current version of OpenCAPIF SDK is compatible with following publicly available
3. [OpenCAPIF SDK Installation](#OpenCAPIF-SDK-Installation) 3. [OpenCAPIF SDK Installation](#OpenCAPIF-SDK-Installation)
4. [How to use OpenCAPIF SDK](#How-to-use-OpenCAPIF-SDK) 4. [How to use OpenCAPIF SDK](#How-to-use-OpenCAPIF-SDK)
5. [OpenCAPIF SDK known issues](#OpenCAPIF-SDK-known-issues) 5. [OpenCAPIF SDK known issues](#OpenCAPIF-SDK-known-issues)
6. [DEV ENVIRONMENT] (/doc/sdk-dev-env.md)
# OpenCAPIF SDK usage # OpenCAPIF SDK usage
OpenCAPIF SDK implements this set of features to easily integrate an application with CAPIF NF either manually or integrating SDK library directly within app code. OpenCAPIF SDK implements this set of features to easily integrate an application with CAPIF NF either manually or integrating SDK library directly within app code.
[GENERAL CAPIF USAGE FLOW]
This repository includes 2 different modes to test OpenCAPIF SDK: This repository includes 2 different modes to test OpenCAPIF SDK:
- **Manual usage**: use a set of python scripts to test step by step all implemented procedures. All of them are provided at scripts folder, - **Manual usage**: use a set of python scripts to test step by step all implemented procedures. All of them are provided at scripts folder,
[IMAGE OF ARCH APP ----> CAPIF WITH SCRIPTS] [IMAGE OF ARCH APP ----> CAPIF WITH SCRIPTS]
...@@ -30,7 +33,27 @@ This repository includes 2 different modes to test OpenCAPIF SDK: ...@@ -30,7 +33,27 @@ This repository includes 2 different modes to test OpenCAPIF SDK:
- **Development usage**: import SDK in your code and start ... Within nf-sample folder, it is provided a sample application leveraging - **Development usage**: import SDK in your code and start ... Within nf-sample folder, it is provided a sample application leveraging
[IMAGE OF ARCH APP ----> CAPIF WITH SDK INTEGRATION] [IMAGE OF ARCH APP ----> CAPIF WITH SDK INTEGRATION]
# OpenCAPIF SDK Features # OpenCAPIF SDK Features
LO QUE HE IMPLEMENTADO DE OPENCAPIF == RELEASE NOTES
# OpenCAPIF SDK scripts
This repository provides manual scripts to validate and demonstrate the integration to OpenCAPIF. Next are listed the behaviour of all of them available at /sctipts folder:
1.
2.
3.
4.
Additional requests to CAPIF:
- Publisher: addionally a devoloper could retrieve data from ...
1.
2.
- Events: blah blah
- Explore API directory:
- **Invoker CAPIF connector**: Simplifies the process of onboarding for Invoker users, - **Invoker CAPIF connector**: Simplifies the process of onboarding for Invoker users,
- **Provider CAPIF connector**: Simplifies the process of onboarding for Provider users,also has the capability to register several APF's and AEF's if its necesary, - **Provider CAPIF connector**: Simplifies the process of onboarding for Provider users,also has the capability to register several APF's and AEF's if its necesary,
...@@ -44,6 +67,8 @@ This repository includes 2 different modes to test OpenCAPIF SDK: ...@@ -44,6 +67,8 @@ This repository includes 2 different modes to test OpenCAPIF SDK:
- **Invoker CAPIF connector offboarding**: Simplifies the process of offboarding for Invoker users, - **Invoker CAPIF connector offboarding**: Simplifies the process of offboarding for Invoker users,
- **Provider CAPIF connector offboarding**: Simplifies the process of offboarding for Provider users. - **Provider CAPIF connector offboarding**: Simplifies the process of offboarding for Provider users.
[OPENCAPIF SDK CODE STRUCTURE]
![Descripción de la imagen](./doc/images/Flujo%20completo-OPENCAPIF%20ACTUAL.jpg) ![Descripción de la imagen](./doc/images/Flujo%20completo-OPENCAPIF%20ACTUAL.jpg)
...@@ -56,68 +81,50 @@ Apart from the SDK core, there are available different functionalities for devel ...@@ -56,68 +81,50 @@ Apart from the SDK core, there are available different functionalities for devel
![Descripción de la imagen](./doc/images/Flujo%20completo-SDK%20ACTUAL%20CON%20REGISTER.jpg) ![Descripción de la imagen](./doc/images/Flujo%20completo-SDK%20ACTUAL%20CON%20REGISTER.jpg)
# How to use OpenCAPIF SDK
# OpenCAPIF SDK Installation (dev environment??) 1 - First it is required to complete the utilities file with the absolute paths of target environment in order to complete the configuration of the SDK:
- NOTE register file is not needed for the use of the SDK,
Follow next steps to perform OpenCAPIF SDK installation: - NOTE provider_exposer_get_sample_api_description_path is mandatory if publish functionalities are required.
1 - Create an enviroment with pyenv
```console
#Commands to install the Python environment
pyenv install 3.12
pyenv virtualenv 3.12 pesp_sdk_env
#Activate your enviroment
source your/path/to/.pyenv/versions/pesp_sdk_env/bin/activate
```
OPTIONAL step: sometimes Apple Mac shells raise issues while finding the shell path. If this happens, try this command: 2 - Then it is needed to fill out config files depending on the features required to be used from the SDK.
```console ## OpenCAPIF SDK prerequisites
export PATH="$HOME/.pyenv/bin:$PATH"
eval "$(pyenv init --path)"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
```
2 - Clone GitHub repository:
```console IMPORTANT: In order to leverage OpenCAPIF SDK it is required to have registered a user in the target CAPIF instance, so contact administrator to have required predefined credentials (username and password).
git clone -b sdk_v0.1 --single-branch https://github.com/Telefonica/pesp_capif_sdk.git
```
```console ## OpenCAPIF SDK configuration
#Then move to the pesp_capif_sdk folder
cd /your/path/to/pesp_capif_sdk ### 1. Configuration via Config.json
```
3 - Install the Python requirements listed in requirements.txt file: This configuration could also be fullfilled by enviroment variables (EXAMPLE)
```console Mandatory fields no matter the target role to be onboarded, either invoker or provider:
cd installation
python -m pip install --upgrade pip - capif_host
- register_host
- capif_https_port
- capif_register_port
- capif_username
- capif_password
- debug_mode
pip install -r requirements.txt If you want to use SDK as an **Invoker** you need to fill out these fields
```
**Congratulations!** You have finalized the installation of OpenCAPIF SDK. - invoker_folder
- capif_callback_url
- csr_information(csr_common_name,csr_country_name...)
If you want to use SDK as a **Provider** you need to fill out these fields
# How to use OpenCAPIF SDK - provider_folder
- APFs
- AEFs
1 - First it is required to complete the utilities file with the absolute paths of target environment in order to complete the configuration of the SDK:
- NOTE register file is not needed for the use of the SDK,
- NOTE provider_exposer_get_sample_api_description_path is mandatory if publish functionalities are required.
2 - Then it is needed to fill out config files depending on the features required to be used from the SDK.
## Prerequisites
IMPORTANT: In order to leverage OpenCAPIF SDK it is required to have registered a user in the target CAPIF instance, so contact administrator to have required predefined credentials (username and password).
## Configuration via Config.json
"invoker_folder": String | The path (relative or absolute) of the folder you want to store your invoker information "invoker_folder": String | The path (relative or absolute) of the folder you want to store your invoker information
...@@ -157,33 +164,7 @@ IMPORTANT: In order to leverage OpenCAPIF SDK it is required to have registered ...@@ -157,33 +164,7 @@ IMPORTANT: In order to leverage OpenCAPIF SDK it is required to have registered
"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-S6G Example:True/False
This configuration could also be fullfilled by enviroment variables ### 2. Configuration of Publish.json
Mandatory fields no matter the target role to be onboarded, either invoker or provider:
- Capif_host
- register_host
- capif_https_port
- capif_register_port
- capif_username
- capif_password
- debug_mode
If you want to use SDK as an Invoker you need to fill out these fields
- invoker_folder
- capif_callback_url
- csr_information(csr_common_name,csr_country_name...)
If you want to use SDK as a Provider you need to fill out these fields
- provider_folder
- APFs
- AEFs
## Configuration of Publish.json
"serviceApiId": String | The Api id we want to use Example "02eff6e1b3a8f7c8044a92ee8a30bd" "serviceApiId": String | The Api id we want to use Example "02eff6e1b3a8f7c8044a92ee8a30bd"
"publisherAPFid": String | APF id we chose to use Example : "APFa165364a379035d14311deadc04332" "publisherAPFid": String | APF id we chose to use Example : "APFa165364a379035d14311deadc04332"
...@@ -214,7 +195,7 @@ You won't need to fill out the aefIds fields from aefProfiles array because you ...@@ -214,7 +195,7 @@ You won't need to fill out the aefIds fields from aefProfiles array because you
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 you will recieve an error
### Important information for Provider users ### Important information for Provider consumer
In the provider_folder, you will find several folders with each capif_username you have onboarded as a provider, for each folder you could find: In the provider_folder, you will find several folders with each capif_username you have onboarded as a provider, for each folder you could find:
...@@ -223,14 +204,14 @@ In the provider_folder, you will find several folders with each capif_username y ...@@ -223,14 +204,14 @@ In the provider_folder, you will find several folders with each capif_username y
- Service_received.json : If you already used the get an api or get all apis functionality, you will find the response to your request. - Service_received.json : If you already used the get an api or get all apis functionality, you will find the response to your request.
- Published-Apis.json : Constains the currently published APIs with their ApiId - Published-Apis.json : Constains the currently published APIs with their ApiId
## Discover_filter.json #### Configuration of Discover_filter.json
This file follows the parameters schema from the GET petition of [Discover Services API](https://github.com/jdegre/5GC_APIs/blob/Rel-18/TS29222_CAPIF_Discover_Service_API.yaml) This file follows the parameters schema from the GET petition of [Discover Services API](https://github.com/jdegre/5GC_APIs/blob/Rel-18/TS29222_CAPIF_Discover_Service_API.yaml)
To use this feature you must complete the file with the parameters you want to be filtered and then run the Invoker Service Discovery Functionality. To use this feature you must complete the file with the parameters you want to be filtered and then run the Invoker Service Discovery Functionality.
To run the Invoker Service Discovery Functionality you must have onboarded as an Invoker before. To run the Invoker Service Discovery Functionality you must have onboarded as an Invoker before.
### Important information for Invoker users ### Important information for Invoker consumer
In the `invoker_folder`, you will find several folders with each `capif_username` you have onboarded as a provider. For each folder, you could find: In the `invoker_folder`, you will find several folders with each `capif_username` you have onboarded as a provider. For each folder, you could find:
...@@ -246,7 +227,7 @@ By default, the Service Get Token will get the access token for using all the AP ...@@ -246,7 +227,7 @@ By default, the Service Get Token will get the access token for using all the AP
2. Use the Service Discovery Functionality. 2. Use the Service Discovery Functionality.
3. Use the Service Get Token Functionality. 3. Use the Service Get Token Functionality.
## Register.json #### Configuration of Register.json
"register_host": String | The domain name of your register host "register_host": String | The domain name of your register host
......
{ {
"invoker_folder": "/Users/IDB0128/Documents/OpenCapif/test_invoker_certificate_folder",
"invoker_folder": "/Users/IDB0128/Documents/OpenCapif/test_invoker_certificate_folder", "provider_folder": "/Users/IDB0128/Documents/OpenCapif/test_provider_certificate_folder",
"capif_host": "capif-prev.mobilesandbox.cloud",
"provider_folder": "/Users/IDB0128/Documents/OpenCapif/test_provider_certificate_folder", "register_host": "registercapif-prev.mobilesandbox.cloud",
"capif_https_port": "36212",
"capif_host": "capif-prev.mobilesandbox.cloud", "capif_register_port": "36211",
"capif_callback_url": "http://localhost:5000",
"register_host": "registercapif-prev.mobilesandbox.cloud", "csr_common_name": "test03",
"csr_organizational_unit": "test_app_ou",
"capif_https_port": "36212", "csr_organization": "test_app_o",
"crs_locality": "Madrid",
"capif_register_port": "36211", "csr_state_or_province_name": "Madrid",
"csr_country_name": "ES",
"capif_callback_url": "http://localhost:5000", "csr_email_address": "test@example.com",
"capif_username": "echeva_0",
"csr_common_name": "test03", "capif_password": "echevapass",
"APFs": "1",
"csr_organizational_unit": "test_app_ou", "AEFs": "1",
"debug_mode": "True"
"csr_organization": "test_app_o", }
\ No newline at end of file
"crs_locality": "Madrid",
"csr_state_or_province_name": "Madrid",
"csr_country_name": "ES",
"csr_email_address": "test@example.com",
"capif_username": "echeva_0",
"capif_password": "echevapass",
"APFs":"1",
"AEFs":"1",
"debug_mode": "True"
}
# OpenCAPIF SDK development environment installation
Follow next steps to perform OpenCAPIF SDK installation:
1 - Create an enviroment with pyenv
```console
#Commands to install the Python environment
pyenv install 3.12
pyenv virtualenv 3.12 pesp_sdk_env
#Activate your enviroment
source your/path/to/.pyenv/versions/pesp_sdk_env/bin/activate
```
OPTIONAL step: sometimes Apple Mac shells raise issues while finding the shell path. If this happens, try this command:
```console
export PATH="$HOME/.pyenv/bin:$PATH"
eval "$(pyenv init --path)"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
```
2 - Clone GitHub repository:
```console
git clone -b sdk_v0.1 --single-branch https://github.com/Telefonica/pesp_capif_sdk.git
```
```console
#Then move to the pesp_capif_sdk folder
cd /your/path/to/pesp_capif_sdk
```
3 - Install the Python requirements listed in requirements.txt file:
```console
cd installation
python -m pip install --upgrade pip
pip install -r requirements.txt
```
**Congratulations!** You have finalized the installation of OpenCAPIF SDK.
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment