Skip to content
Snippets Groups Projects
Commit e5cd1c85 authored by JorgeEcheva26's avatar JorgeEcheva26
Browse files

Documentation changes and cleaning configuration files

	modificados:     README.md
	modificados:     doc/sdk_configuration.md
	modificados:     doc/sdk_developers.md
	modificados:     doc/sdk_full_documentation.md
	modificados:     network_app_samples/network_app_invoker_sample/capif_sdk_config_sample.json
	modificados:     network_app_samples/network_app_provider_sample/capif_sdk_config_sample.json
parent 174262f0
No related branches found
No related tags found
1 merge request!1Sdk v0.1 (#1)
...@@ -147,10 +147,14 @@ A Network App development running as a Provider would typically follow this proc ...@@ -147,10 +147,14 @@ A Network App development running as a Provider would typically follow this proc
Now, it is described in 4 simple steps how a Provider can be developed in just some code lines, below snippet. It describes the usual flow a Provider would follow to publish an API service. Now, it is described in 4 simple steps how a Provider can be developed in just some code lines, below snippet. It describes the usual flow a Provider would follow to publish an API service.
```python ```python
from sdk import capif_provider_connector from sdk import capif_provider_connector,api_schema_translator
provider = capif_provider_connector(config_file="path/to/the/capif_sdk_config.json")
provider = capif_provider_connector(config_file="path/to/capif_sdk_config.json")
provider.onboard_provider() provider.onboard_provider()
provider.api_description_path = "./nef_upf_vendor_1.json"
#translator = api_schema_translator("./path/to/openapi.yaml")
#translator.build("api_description_name",ip="0.0.0.0",port=9090)
provider.api_description_path = "./api_description_name.json"
APF = provider.provider_capif_ids["APF-1"] APF = provider.provider_capif_ids["APF-1"]
...@@ -179,6 +183,8 @@ Code is next explained step by step: ...@@ -179,6 +183,8 @@ Code is next explained step by step:
In the `provider_folder`, more specifically in the `capif_username` folder, it will be sotres the provider API details file. This file contains all the APFs and AEFs IDs that have already onboarded with this `capif_username`. In the `provider_folder`, more specifically in the `capif_username` folder, it will be sotres the provider API details file. This file contains all the APFs and AEFs IDs that have already onboarded with this `capif_username`.
It is also important to have previously prepared the **API schema description** file of the API to be published. **This file must follow the [CAPIF_Publish_Service_API](https://github.com/jdegre/5GC_APIs/blob/Rel-18/TS29222_CAPIF_Publish_Service_API.yaml) 3GPP specification.** It is also important to have previously prepared the **API schema description** file of the API to be published. **This file must follow the [CAPIF_Publish_Service_API](https://github.com/jdegre/5GC_APIs/blob/Rel-18/TS29222_CAPIF_Publish_Service_API.yaml) 3GPP specification.**
If the **API** is defined in an Openapi.yaml format, the sdk has a facility which creates automatically the **API schema description**.For using this functionality uncomment the translator lines. More information:[Translator functionality](./doc/sdk_full_documentation.md#openapi-translation)
Choose one APF and the AEF identifiers, and fulfill the `publish_req` structure and the `api_description_path`. Choose one APF and the AEF identifiers, and fulfill the `publish_req` structure and the `api_description_path`.
......
...@@ -69,6 +69,9 @@ This section is mandatory when using the [CAPIF Publish Service API](https://git ...@@ -69,6 +69,9 @@ This section is mandatory when using the [CAPIF Publish Service API](https://git
The `api_description_path` must point to the Publish API to be shared, and it should follow the [ServiceAPIDescription](https://github.com/jdegre/5GC_APIs/blob/Rel-18/TS29222_CAPIF_Publish_Service_API.yaml) schema. The `api_description_path` must point to the Publish API to be shared, and it should follow the [ServiceAPIDescription](https://github.com/jdegre/5GC_APIs/blob/Rel-18/TS29222_CAPIF_Publish_Service_API.yaml) schema.
To obtain this schema, opencapif_sdk has a facility to translate Openapi structures to ServiceAPIDescription schemas.
More information:[Translator functionality](./sdk_full_documentation.md#openapi-translation)
If the `publisher_aefs_ids` do not match the `aefProfiles` in the API description, an error will be raised by the SDK. If the `publisher_aefs_ids` do not match the `aefProfiles` in the API description, an error will be raised by the SDK.
## Descriptions of `capif_sdk_config` Fields ## Descriptions of `capif_sdk_config` Fields
......
...@@ -5,7 +5,7 @@ Before proceeding, ensure you have fulfilled the necessary [requirements](../REA ...@@ -5,7 +5,7 @@ Before proceeding, ensure you have fulfilled the necessary [requirements](../REA
Follow the steps below to install the OpenCAPIF SDK for development purposes: Follow the steps below to install the OpenCAPIF SDK for development purposes:
## Prerequisites ## Requisites
- Developers must have the following tools installed: - Developers must have the following tools installed:
- **pyenv** - **pyenv**
......
...@@ -48,6 +48,7 @@ As outlined in the [Network App developers section](../README.md), the OpenCAPIF ...@@ -48,6 +48,7 @@ As outlined in the [Network App developers section](../README.md), the OpenCAPIF
- [Check authentication](#check-authentication) - [Check authentication](#check-authentication)
- [Update and Offboard Invoker](#update-and-offboard-invoker) - [Update and Offboard Invoker](#update-and-offboard-invoker)
- [Other Features](#other-features) - [Other Features](#other-features)
- [Openapi translation](#openapi-translation)
- [CAPIF Registration and Login](#capif-registration-and-login) - [CAPIF Registration and Login](#capif-registration-and-login)
- [CAPIF Deregistration and Logout](#capif-registration-and-login) - [CAPIF Deregistration and Logout](#capif-registration-and-login)
...@@ -86,11 +87,17 @@ OpenCAPIF SDK references: ...@@ -86,11 +87,17 @@ OpenCAPIF SDK references:
The SDK streamlines API publishing with the option to select specific APFs and AEFs. A copy of the uploaded API is stored in `capif_<api_name>_<api_id>.json`, and the `provider_capif_ids.json` is updated with the API name and its ID. The SDK streamlines API publishing with the option to select specific APFs and AEFs. A copy of the uploaded API is stored in `capif_<api_name>_<api_id>.json`, and the `provider_capif_ids.json` is updated with the API name and its ID.
It is also important to have previously prepared the **API schema description** file of the API to be published. **This file must follow the [CAPIF_Publish_Service_API](https://github.com/jdegre/5GC_APIs/blob/Rel-18/TS29222_CAPIF_Publish_Service_API.yaml) 3GPP specification.**
To obtain this schema, opencapif_sdk has a facility to translate Openapi structures to ServiceAPIDescription schemas.
More information:[Translator functionality](#openapi-translation)
**Important**: The SDK will automatically add in the `custom operations`, within the API description path, the capabilities for exposing the [AEF_security](https://github.com/jdegre/5GC_APIs/blob/Rel-18/TS29222_AEF_Security_API.yaml) methods. The developer must code this API endpoints. **Important**: The SDK will automatically add in the `custom operations`, within the API description path, the capabilities for exposing the [AEF_security](https://github.com/jdegre/5GC_APIs/blob/Rel-18/TS29222_AEF_Security_API.yaml) methods. The developer must code this API endpoints.
**Required SDK inputs**: **Required SDK inputs**:
- publisher_apf_id - publisher_apf_id
- publisher_aefs_ids - publisher_aefs_ids
- api_description_path
### Service Deletion ### Service Deletion
...@@ -230,6 +237,18 @@ Onboarding is required before utilizing these functions. ...@@ -230,6 +237,18 @@ Onboarding is required before utilizing these functions.
## Other Features ## Other Features
### Openapi translation
The `api_description_path` must point to the Publish API to be shared, and it should follow the [ServiceAPIDescription](https://github.com/jdegre/5GC_APIs/blob/Rel-18/TS29222_CAPIF_Publish_Service_API.yaml) schema.
This schema could be obtained by applying this code.
```python
from sdk import api_schema_translator
translator = api_schema_translator("./path/to/openapi.yaml")
translator.build("api_description_name",ip="0.0.0.0",port=9090)
```
This code will read `openapi.yaml`, ensure the structure of it and translate the content into ServiceAPIDescription schema, then will create a .json named `api_description_name`. Also it is necessary to fill the ip and port fields to create correctly the schema.
### CAPIF Registration and Login ### CAPIF Registration and Login
OpenCAPIF SDK reference: OpenCAPIF SDK reference:
......
{ {
"capif_host": "capif-prev.mobilesandbox.cloud", "capif_host": "",
"register_host": "registercapif-prev.mobilesandbox.cloud", "register_host": "",
"capif_https_port": "36212", "capif_https_port": "",
"capif_register_port": "36211", "capif_register_port": "",
"capif_username": "echeva_0", "capif_username": "",
"capif_password": "echevapass", "capif_password": "",
"debug_mode": "True", "debug_mode": "",
"invoker":{ "invoker":{
"invoker_folder": "/Users/IDB0128/Documents/OpenCapif/test_invoker_certificate_folder", "invoker_folder": "",
"capif_callback_url": "http://localhost:5000", "capif_callback_url": "",
"supported_features":"fffffff", "supported_features":"",
"check_authentication_data":{ "check_authentication_data":{
"ip":"", "ip":"",
"port":"" "port":""
}, },
"cert_generation":{ "cert_generation":{
"csr_common_name": "invoker", "csr_common_name": "",
"csr_organizational_unit": "test_app_ou", "csr_organizational_unit": "",
"csr_organization": "test_app_o", "csr_organization": "",
"crs_locality": "Madrid", "crs_locality": "",
"csr_state_or_province_name": "Madrid", "csr_state_or_province_name": "",
"csr_country_name": "ES", "csr_country_name": "",
"csr_email_address": "test@example.com" "csr_email_address": ""
}, },
"discover_filter": { "discover_filter": {
"api-name": "", "api-name": "",
...@@ -41,8 +41,8 @@ ...@@ -41,8 +41,8 @@
}, },
"provider":{ "provider":{
"provider_folder": "", "provider_folder": "",
"apfs": 1, "apfs": "",
"aefs": 3, "aefs": "",
"publish_req": { "publish_req": {
"service_api_id": "", "service_api_id": "",
"publisher_apf_id": "", "publisher_apf_id": "",
......
{ {
"capif_host": "capif-prev.mobilesandbox.cloud", "capif_host": "",
"register_host": "registercapif-prev.mobilesandbox.cloud", "register_host": "",
"capif_https_port": "36212", "capif_https_port": "",
"capif_register_port": "36211", "capif_register_port": "",
"capif_username": "echeva_0", "capif_username": "",
"capif_password": "echevapass", "capif_password": "",
"debug_mode": "False", "debug_mode": "",
"invoker":{ "invoker":{
"invoker_folder": "", "invoker_folder": "",
"capif_callback_url": "", "capif_callback_url": "",
...@@ -39,15 +39,15 @@ ...@@ -39,15 +39,15 @@
} }
}, },
"provider":{ "provider":{
"provider_folder": "/Users/IDB0128/Documents/OpenCapif/test_provider_certificate_folder", "provider_folder": "",
"cert_generation":{ "cert_generation":{
"csr_common_name": "provider", "csr_common_name": "",
"csr_organizational_unit": "discovery", "csr_organizational_unit": "",
"csr_organization": "telefonica", "csr_organization": "",
"crs_locality": "madrid", "crs_locality": "",
"csr_state_or_province_name": "madrid", "csr_state_or_province_name": "",
"csr_country_name": "ES", "csr_country_name": "",
"csr_email_address": "hola@gmail.com" "csr_email_address": ""
}, },
"apfs": "2", "apfs": "2",
"aefs": "3", "aefs": "3",
......
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