Commit c2c31964 authored by JorgeEcheva26's avatar JorgeEcheva26
Browse files

log tested

parent e66cc32c
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -96,6 +96,7 @@ OpenCAPIF SDK brings a set of functions to integrate with the 5G Core's function
| /{apfId}/service-apis/{serviceApiId} (GET)                           | [get_service()](./doc/sdk_full_documentation.md#get-services)                                               | Retrieves the details of a specific service API for a specific `apfId` and `serviceApiId`           |
| /{apfId}/service-apis (GET)            | [get_all_services()](./doc/sdk_full_documentation.md#get-all-services)                                          | Retrieves a list of all available service APIs for a specific `apfId`            |
| /aef-security/v1/check-authentication (POST)            | [check_authentication()](./doc/sdk_full_documentation.md#check_authentication)                                          | This custom operation allows the API invoker to confirm the `supported_features` from the API exposing function(AEF)            |
| /api-invocation-logs/v1/{aefId}/logs (POST)             | [create_logs( aefId, api_invoker_id)](./doc/sdk_full_documentation.md#create_logs) | This operation allows to the Provider to notice to the CCF about the query of an invoker for an especific `aefId`

NOTE: Above mentioned CAPIF APIs are defined in these 3GPP references:
- [CAPIF Invoker API specification](https://github.com/jdegre/5GC_APIs/blob/Rel-18/TS29222_CAPIF_API_Invoker_Management_API.yaml)
@@ -104,6 +105,7 @@ NOTE: Above mentioned CAPIF APIs are defined in these 3GPP references:
- [CAPIF Publish API specification](https://github.com/jdegre/5GC_APIs/blob/Rel-18/TS29222_CAPIF_Publish_Service_API.yaml) 
- [CAPIF Security API specification](https://github.com/jdegre/5GC_APIs/blob/Rel-18/TS29222_CAPIF_Security_API.yaml)
- [AEF Security API specification](https://github.com/jdegre/5GC_APIs/blob/Rel-18/TS29222_AEF_Security_API.yaml)
- [CAPIF Logging API management](https://github.com/jdegre/5GC_APIs/blob/Rel-18/TS29222_CAPIF_Logging_API_Invocation_API.yaml)

NOTE: In the [3GPP Technical Specification (TS) 29.222 V18.5.0 Common API Framework for 3GPP Northbound APIs](https://www.etsi.org/deliver/etsi_ts/129200_129299/129222/18.05.00_60/ts_129222v180500p.pdf) the `service` concept is understood as equal as the `API` concept.

@@ -316,7 +318,6 @@ There are some features which **are not currently available at latest OpenCAPIF
  - [CAPIF Access control policy management](https://github.com/jdegre/5GC_APIs/blob/Rel-18/TS29222_CAPIF_Access_Control_Policy_API.yaml)
  - [CAPIF Auditing API management](https://github.com/jdegre/5GC_APIs/blob/Rel-18/TS29222_CAPIF_Auditing_API.yaml)
  - [CAPIF Events API management](https://github.com/jdegre/5GC_APIs/blob/Rel-18/TS29222_CAPIF_Events_API.yaml)
  - [CAPIF Logging API management](https://github.com/jdegre/5GC_APIs/blob/Rel-18/TS29222_CAPIF_Logging_API_Invocation_API.yaml)
  - [CAPIF Routing info API management](https://github.com/jdegre/5GC_APIs/blob/Rel-18/TS29222_CAPIF_Routing_Info_API.yaml)
  - [CAPIF Security API management](https://github.com/jdegre/5GC_APIs/blob/Rel-18/TS29222_CAPIF_Security_API.yaml)
    - /trustedInvokers/{apiInvokerId}/delete (POST)
+1 −0
Original line number Diff line number Diff line
@@ -97,6 +97,7 @@ This file can also be populated using [environment variables](../samples/envirom
- [`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_data`: The `ip` and `port` of the target Provider's AEF to get their supported features from.
- `log`: The structure defined in the [Log schema](https://github.com/jdegre/5GC_APIs/blob/Rel-18/TS29222_CAPIF_Logging_API_Invocation_API.yaml), it is not needed to fulfill the `apiId` field.


## Configuration via `capif_sdk_register.json`
+14 −0
Original line number Diff line number Diff line
@@ -162,6 +162,20 @@ The provider must be onboarded before using these features.

![Provider_update-offboard](./images/flows_provider_update_offboard.jpg)

### Create logs

OpenCAPIF SDK references:
- **Function**: `create_logs(aefId, api_invoker_id)`

The provider notifies to the CCF that the published API has been used by certain invoker.

For leveraging this feature the Provider must have onboarded and published an API previously.

**Required SDK input**:
- aefId (Within the function)
- api_invoker_id (Within the function)
- log (Within [SDK configuration](./sdk_configuration.md) or object)

## Invoker Network App

The OpenCAPIF SDK enables efficient implementation of invoker functionality for Network App. This section details the SDK features related to CAPIF invokers.
+1 −1
Original line number Diff line number Diff line
@@ -7,7 +7,7 @@ with open(os.path.join(this_directory, "README_pipy.md"), encoding="utf-8") as f

setup(
    name="opencapif_sdk",
    version="0.1.17.3",
    version="0.1.17.5",
    author="JorgeEcheva, dgs-cgm",
    author_email="jorge.echevarriauribarri.practicas@telefonica.com, daniel.garciasanchez@telefonica.com",
    description=(
+5 −5
Original line number Diff line number Diff line
@@ -2,7 +2,7 @@
import json
# flake8: noqa

from opencapif_sdk import capif_invoker_connector, capif_provider_connector, service_discoverer,capif_logging_feature
from opencapif_sdk import capif_invoker_connector, capif_provider_connector, service_discoverer


capif_sdk_config_path = "./capif_sdk_config_sample_test.json"
@@ -120,7 +120,7 @@ if __name__ == "__main__":

        discoverer = service_discoverer(config_file=capif_sdk_config_path)
        
        discoverer.discover_filter["api-name"]= "Testtrece"
        discoverer.discover_filter["api-name"]= "safe-6g-resilience-function"

        discoverer.discover()

@@ -130,11 +130,11 @@ if __name__ == "__main__":

        print("SERVICE GET TOKENS COMPLETED")
        
        logger=capif_logging_feature(config_file=capif_sdk_config_path)
        # logger=capif_logging_feature(config_file=capif_sdk_config_path)
        
        invoker_id=discoverer.invoker_capif_details["api_invoker_id"]
        # invoker_id=discoverer.invoker_capif_details["api_invoker_id"]
        
        logger.create_logs(aefId=AEF1,api_invoker_id=invoker_id)
        # logger.create_logs(aefId=AEF1,api_invoker_id=invoker_id)
        
        capif_invoker_connector.update_invoker()