Commit 2402151a authored by JorgeEcheva26's avatar JorgeEcheva26
Browse files

Documentation changes and cleaning configuration files

parent 8d9a0058
Loading
Loading
Loading
Loading
+16 −10
Original line number Diff line number Diff line
@@ -17,17 +17,17 @@ This document serves as the [main bootstrap reference](#networkapp-developer-pat
 1. [Repository structure](#repository-structure) 
 2. [Network App developers](#network-app-developers)
 3. [OpenCAPIF SDK summary](#opencapif-sdk-summary)
 4. [OpenCAPIF SDK requirements](#opencapif-sdk-requirements)
 5. [OpenCAPIF SDK data schema](#opencapif-sdk-data-schema)
 6. [OpenCAPIF SDK Configuration](./doc/sdk_configuration.md)
 7. [Network App developer path](#network-app-developer-path)
 4. [OpenCAPIF SDK data schema](#opencapif-sdk-data-schema)
 5. [OpenCAPIF SDK requirements](#opencapif-sdk-requirements)
 6. [OpenCAPIF SDK installation](./doc/sdk_developers.md)
 7. [OpenCAPIF SDK Configuration](./doc/sdk_configuration.md)
 8. [Network App developer path](#network-app-developer-path)
    1. [Provider Network App](#provider-network-app)
        * [Provider Network App sample](#provider-network-app-sample)
    2. [Invoker Network App](#invoker-network-app)
        * [Provider Network App sample](#provider-network-app-sample)
 8. [**OpenCAPIF SDK full documentation**](./doc/sdk_full_documentation.md)
 9. [OpenCAPIF SDK known issues](#opencapif-sdk-known-issues)
 10. [OpenCAPIF SDK developers](./doc/sdk_developers.md)
 9. [**OpenCAPIF SDK full documentation**](./doc/sdk_full_documentation.md)
 10. [OpenCAPIF SDK known issues](#opencapif-sdk-known-issues)


# Repository structure
@@ -136,10 +136,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.

```python
  from sdk import capif_provider_connector
  provider = capif_provider_connector(config_file="path/to/the/capif_sdk_config.json")
  from sdk import capif_provider_connector,api_schema_translator

  provider = capif_provider_connector(config_file="path/to/capif_sdk_config.json")
  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"]

@@ -169,6 +173,8 @@ Code is next explained step by step:

    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`.

    The `provider_capif_ids` variable is a dictionary which contains key-values of all the APFs and AEFs stored as name: ID.
+3 −0
Original line number Diff line number Diff line
@@ -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.

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.

## Descriptions of `capif_sdk_config` Fields
+2 −2
Original line number Diff line number Diff line
@@ -3,11 +3,11 @@

Currently, the OpenCAPIF SDK is only available by downloading this repository and performing a manual installation. In the future, an OpenCAPIF SDK package will be released for easier installation.

Before proceeding, ensure you have fulfilled the necessary [requirements](../README.md).
Before proceeding, ensure you have fulfilled the necessary [requirements](../README.md#opencapif-sdk-requirements).

Follow the steps below to install the OpenCAPIF SDK for development purposes:

## Prerequisites
## Requisites

- Developers must have the following tools installed:
  - **pyenv**
+19 −0
Original line number Diff line number Diff line
@@ -48,6 +48,7 @@ As outlined in the [Network App developers section](../README.md), the OpenCAPIF
    - [Check authentication](#check-authentication)
    - [Update and Offboard Invoker](#update-and-offboard-invoker)
- [Other Features](#other-features)
    - [Openapi translation](#openapi-translation)
    - [CAPIF Registration and Login](#capif-registration-and-login)
    - [CAPIF Deregistration and Logout](#capif-registration-and-login)

@@ -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.

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. 

**Required SDK inputs**:
- publisher_apf_id
- publisher_aefs_ids
- api_description_path

### Service Deletion

@@ -230,6 +237,18 @@ Onboarding is required before utilizing these functions.

## 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

OpenCAPIF SDK reference:
+19 −19
Original line number Diff line number Diff line
{
  "capif_host": "capif-prev.mobilesandbox.cloud",
  "register_host": "registercapif-prev.mobilesandbox.cloud",
  "capif_https_port": "36212",
  "capif_register_port": "36211",
  "capif_username": "echeva_0",
  "capif_password": "echevapass",
  "debug_mode": "True",
  "capif_host": "",
  "register_host": "",
  "capif_https_port": "",
  "capif_register_port": "",
  "capif_username": "",
  "capif_password": "",
  "debug_mode": "",
  "invoker":{
    "invoker_folder": "/Users/IDB0128/Documents/OpenCapif/test_invoker_certificate_folder",
    "capif_callback_url": "http://localhost:5000",
    "supported_features":"fffffff",
    "invoker_folder": "",
    "capif_callback_url": "",
    "supported_features":"",
    "check_authentication_data":{
      "ip":"",
      "port":""
    },
    "cert_generation":{
      "csr_common_name": "invoker",
      "csr_organizational_unit": "test_app_ou",
      "csr_organization": "test_app_o",
      "crs_locality": "Madrid",
      "csr_state_or_province_name": "Madrid",
      "csr_country_name": "ES",
      "csr_email_address": "test@example.com"
      "csr_common_name": "",
      "csr_organizational_unit": "",
      "csr_organization": "",
      "crs_locality": "",
      "csr_state_or_province_name": "",
      "csr_country_name": "",
      "csr_email_address": ""
    },
    "discover_filter": {
      "api-name": "",
@@ -41,8 +41,8 @@
  },
  "provider":{
    "provider_folder": "",
    "apfs": 1,
    "aefs": 3,
    "apfs": "",
    "aefs": "",
    "publish_req": {
      "service_api_id": "",
      "publisher_apf_id": "",
Loading