Commit 3786dfdf authored by Jorge Echevarria Uribarri's avatar Jorge Echevarria Uribarri Committed by GitHub
Browse files

Fix license apache2 (#8)



PR:
* SDK packaging in pypi repositories to install via pip opencapif_sdk atifact and simple import commands,
* OpenCAPIF SDK installation process clarified and updated,
* Pictures of OpenCAPIF flows adjusted,
* Updated scripts and test to new installation process,
* Updated general documentation,
* Small mistakes and typos fixed.

---------

Co-authored-by: default avatarDaniel García <daniel.garciasanchez@telefonica.com>
Co-authored-by: default avatarJorgeEcheva26 <jorge.echevarriauribarri.practicas@telefonica.es>
parent c3495d77
Loading
Loading
Loading
Loading
+19 −6
Original line number Diff line number Diff line
# OpenCAPIF SDK
[![PyPI version](https://img.shields.io/pypi/v/opencapif-sdk.svg)](https://pypi.org/project/opencapif-sdk/) [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) ![Python](https://img.shields.io/badge/python-v3.12+-blue.svg) [![PyPI - Downloads](https://img.shields.io/pypi/dm/opencapif-sdk)](https://pypi.org/project/opencapif-sdk/)

![OpenCAPIF icon](./doc/images/opencapif_icon.jpg)

@@ -18,16 +19,16 @@ This document serves as the [main bootstrap reference](#networkapp-developer-pat
 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)
 5. [OpenCAPIF sdk installation](#opencapif-sdk-installation)
 6. [OpenCAPIF SDK data schema](#opencapif-sdk-data-schema)
 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
@@ -113,6 +114,16 @@ To use the OpenCAPIF SDK, a registered user account within the target CAPIF inst

**Contact the administrator to obtain the required predefined credentials (CAPIF username and password).**

## OpenCAPIF SDK installation

To install the OpenCAPIF SDK source code for developing purposes there is an available section: [OpenCAPIF SDK developers](./doc/sdk_developers.md).

To use the SDK, binary installer for the latest version is available at the [Python Package Index (Pipy)](https://pypi.org/project/opencapif-sdk/)

```python
pip install opencapif_sdk
```

## OpenCAPIF SDK Data Schema

Here is a visual look on the variables of the CAPIF sdk referenced in:
@@ -136,6 +147,7 @@ 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")
  provider.onboard_provider()
  provider.api_description_path = "./nef_upf_vendor_1.json"
@@ -212,6 +224,7 @@ A Network App development running as an Invoker would typically follow this proc
Now, it is described in some simple steps how an Invoker can be developed in just some code lines. Find below the code snippet. It describes the usual flow an Invoker would follow to consume APIs from CAPIF.

```python
  from sdk import capif_invoker_connector,service_discoverer
  invoker = capif_invoker_connector(config_file="path/to/the/capif_sdk_config.json")
  invoker.onboard_invoker()
  service_discoverer = service_discoverer(config_file="path/to/the/capif_sdk_config.json")
+2 −2
Original line number Diff line number Diff line
@@ -36,7 +36,7 @@ When configuring the SDK as a **Network App Invoker**, the following fields must

**Optional:**
- `discover_filter`: useful to enable the discovery of specific APIs. Some fields under [`discover_filter`](#configuration-of-discover_filter) structure required to be configured when using discovery filters. Check devoted section below,
- `check_authentication`: useful to use `check_authentication()` function to validate features from a target provider, it will be required to fill up the `ip` and `port` parameters within the `check_authentication` variable.
- `check_authentication_data`: useful to use `check_authentication()` function to validate features from a target provider, it will be required to fill up the `ip` and `port` parameters within the `check_authentication_data` variable.

### Network App Provider

@@ -91,7 +91,7 @@ This file can also be populated using [environment variables](../samples/envirom
- [`discover_filter`](#configuration-of-discover_filter): Fields for configuring invoker service discovery.
- [`publish_req`](#configuration-of-publish_req): Fields required for API publishing.
- `api_description_path`: The path to the [ServiceAPIDescription](https://github.com/jdegre/5GC_APIs/blob/Rel-18/TS29222_CAPIF_Publish_Service_API.yaml) JSON file.
- `check_authentication`: The `ip` and `port` of the target Provider's AEF to get their supported features from.
- `check_authentication_data`: The `ip` and `port` of the target Provider's AEF to get their supported features from.


## Configuration via `capif_sdk_register.json`
+2 −6
Original line number Diff line number Diff line

# OpenCAPIF SDK Development Environment Installation

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

Follow the steps below to install the OpenCAPIF SDK for development purposes:
@@ -55,12 +53,10 @@ OPTIONAL step: For Arm64 architecture sometimes will appear this problem
This article explains how to solve it [here](https://laict.medium.com/install-python-on-macos-11-m1-apple-silicon-using-pyenv-12e0729427a9)  




2. Clone GitHub repository:

```console
git clone -b sdk_v0.1 --single-branch https://github.com/Telefonica/pesp_capif_sdk.git
git clone https://github.com/Telefonica/pesp_capif_sdk.git
```

```console
@@ -69,7 +65,7 @@ git clone -b sdk_v0.1 --single-branch https://github.com/Telefonica/pesp_capif_s
cd /the/path/to/pesp_capif_sdk
```

3. Install the Python requirements listed in requirements.txt file:
3. Install the Python requirements listed in [requirements.txt](../installation/requirements.txt) file:

```console
cd installation
+1 −1
Original line number Diff line number Diff line
@@ -214,7 +214,7 @@ The SDK allows the Network App Invoker to check the `supported_features` from th
It is mandatory to have obtained the [JWT token](#obtain-jwt-tokens) previously. 

**Required SDK inputs**:
- check_authentication
- check_authentication_data

![Invoker_check_authentication](./images/flows_invoker_check_authentication.jpg)

+2 −2
Original line number Diff line number Diff line
@@ -5,12 +5,12 @@
  "capif_register_port": "36211",
  "capif_username": "echeva_0",
  "capif_password": "echevapass",
  "debug_mode": "False",
  "debug_mode": "True",
  "invoker":{
    "invoker_folder": "/Users/IDB0128/Documents/OpenCapif/test_invoker_certificate_folder",
    "capif_callback_url": "http://localhost:5000",
    "supported_features":"fffffff",
    "check_authentication":{
    "check_authentication_data":{
      "ip":"",
      "port":""
    },
Loading