diff --git a/README.md b/README.md index 5f673bd2956cab859c7db4f97ef1bdf4707b4b39..5d9b2b669b73c481255bb57cc13603697defed29 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ Current version of OpenCAPIF SDK is compatible with following publicly available 1. [NetApp developers](#netapp-developers) 2. [OpenCAPIF SDK summary](#opencapif-sdk-summary) 3. [NetApp developer path](#netapp-developer-path) - 4. [OpenCAPIF SDK Prerequeriments](./doc/sdk-prerequirements.md) + 4. [OpenCAPIF SDK requirements](./doc/sdk-prerequirements.md) 5. [OpenCAPIF SDK Installation](./doc/sdk-installation.md) 6. [OpenCAPIF SDK Configuration](./doc/sdk-configuration.md) 7. [OpenCAPIF SDK Usage](./doc/sdk-usage.md) @@ -38,22 +38,22 @@ For that purpose NetApps play 2 different roles when interacting with CAPIF: OpenCAPIF SDK brings a set of functions to integrate with the 5G Core's function CAPIF, as defined in [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). This section shows the mapping between the Python functions available in this SDK and the CAPIF OpenAPI APIs defined the reference standard: -| **3GPP CAPIF API** | **OpenCAPIF SDK function** | **Description** | -|-------------------------------------------------|-------------------------------------------------------------|-------------------------------------------------------------| -| onboardedInvokers (POST) | onboard_invoker() | Registers a new invoker. | -| onboardedInvokers (PUT) | update_invoker() | Updates an existing invoker. | -| onboardedInvokers (DELETE) | offboard_invoker() | Deletes an invoker. | -| registrations (POST) | onboard_provider() | Registers a new service provider. | -| registrations (PUT) | update_provider() | Updates a service provider's registration. | -| registrations (DELETE) | offboard_provider() | Deletes a service provider's registration. | -| allServiceAPIs (GET) | discover() | Retrieves a list of all available service APIs. | -| trustedInvokers (PUT//POST) | discover() | Registers or updates trusted invokers. | -| securities/{securityId}/token (GET) | get_tokens() | Retrieves a security token for a specific `securityId`. This JWT token is used to query the targeted services. | -| service-apis (POST) | publish_services() | Registers a new service API into the system. | -| service-apis (DELETE) | unpublish_service() | Deletes a service API from the system. | -| service-apis (PUT) | update_service() | Updates the details of an existing service API. | -| service-apis (GET) | get_service() | Retrieves the details of a specific service API. | -| service-apis (GET) | get_all_services() | Retrieves a list of all available service APIs. | +| **3GPP CAPIF API** | **OpenCAPIF SDK function** | **Description** | +|-------------------------------------------------------|-------------------------------------------------------------|-------------------------------------------------------------| +| /onboardedInvokers (POST) | onboard_invoker() | Registers a new invoker. | +| /onboardedInvokers/{onboardingId} (PUT) | update_invoker() | Updates an existing invoker for a specific `onboardingId`. | +| /onboardedInvokers/{onboardingId} (DELETE) | offboard_invoker() | Deletes an invoker for a specific `onboardingId`. | +| registrations (POST) | onboard_provider() | Registers a new service provider. | +| /registrations/{registrationId} (PUT) | update_provider() | Updates a service provider's registration for a specific `registrationId`. | +| /registrations/{registrationId} (DELETE) | offboard_provider() | Deletes a service provider's registration for a specific `registrationId`. | +| /allServiceAPIs (GET) | discover() | Retrieves a list of all available service APIs. | +| /trustedInvokers (PUT//POST) | discover() | Registers or updates trusted invokers. | +| /securities/{securityId}/token (GET) | get_tokens() | Retrieves a security token for a specific `securityId`. This JWT token is used to query the targeted services. | +| /{apfId}/service-apis(POST) | publish_services() | Registers a new service API into the system. | +| /{apfId}/service-apis/{serviceApiId} (DELETE) | unpublish_service() | Deletes a service API from the system. | +| /{apfId}/service-apis/{serviceApiId} (PUT) | update_service() | Updates the details of an existing service API. | +| /{apfId}/service-apis (GET) | get_service() | Retrieves the details of a specific service API. | +| /{apfId}/service-apis/{serviceApiId} (GET) | get_all_services() | Retrieves a list of all available service APIs. | NOTE: Above mentioned CAPIF APIs are defined in these 3GPP references: @@ -101,6 +101,13 @@ A NetApp development running as an Invoker would usually follow this process ste ```python invoker.get_tokens() ``` +Then all information for using the available APIs would be at Capif_api_security_context_details.json + +This file would be placed in the invoker_folder path, more specifically in the folder that corresponds of the capif_username used in the config_file. + +Here is a sample of this [file](./samples/capif_api_security_context_details-sample.json) + +Here is a sample of the implementation of these [functionality](./netapp-samples/netapp-invoker-sample/netapp-invoker.py) This image highlights Invoker path using SDK code: @@ -139,6 +146,8 @@ A NetApp development running as a Provider would typically follow this process s provider.publish_services() ``` +Here is a sample of the implementation of these [functionality](./netapp-samples/netapp-provider-sample/netapp-provider.py) + This image highlights Provider path using SDK code:  \ No newline at end of file diff --git a/config/capif-sdk-config.json b/config/capif-sdk-config.json index f2564f0376a4318e53a9bab35c890ec6f2599400..4d2eb28fff084ba2c974f24736b04b494ec7de39 100644 --- a/config/capif-sdk-config.json +++ b/config/capif-sdk-config.json @@ -32,7 +32,7 @@ "api-supported-features": "", "ue-ip-addr": "", "service-kpis": "" - }, + }, "publish_req" : { "service_api_id":"6d3fbdcc138f81b36c7b1595229377", "publisher_apf_id":"APFdf22044ce6988b136b253a8c5b26f1", diff --git a/doc/sdk-configuration.md b/doc/sdk-configuration.md index f30c02e77cba680c6c00ea7bab984506fa8a6c98..346f24103368d08434e6e124032bbce64cf217a2 100644 --- a/doc/sdk-configuration.md +++ b/doc/sdk-configuration.md @@ -1,6 +1,6 @@ # OpenCAPIF SDK configuration -Before configuration it's needed to have completed the [prerequirements](./sdk-prerequirements.md) section and the [installation](./sdk-installation.md) section. +Before configuration it's needed to have completed the [requirements](./sdk-prerequirements.md) section and the [installation](./sdk-installation.md) section. diff --git a/doc/sdk-features.md b/doc/sdk-features.md deleted file mode 100644 index 8f3cd24b8e7d923baaed75b1606886a54905e04a..0000000000000000000000000000000000000000 --- a/doc/sdk-features.md +++ /dev/null @@ -1,34 +0,0 @@ -# OpenCAPIF SDK Features - -## CAPIF_API_Invoker_management API - -- Onboard_API_Invoker - -- Offboard_API_Invoker - -## CAPIF_API_Provider_Management_API - -- Onboard_API_Provider - -- Update_API_Provider - -- Offboard_API_Provider - -## CAPIF_Discover_Service_API - -- Discover_Service_API - -## CAPIF_Publish_Service_API - -- Publish_Service_API - -- Unpublish_Service_API - -- Update_Service_API - -- Get_Service_API - - - - - diff --git a/doc/sdk-installation.md b/doc/sdk-installation.md index 1082c486c57e78a2f892e44b89f7ed458a6e1e87..08c9ee75d986005f6123ea72b2a083422338203e 100644 --- a/doc/sdk-installation.md +++ b/doc/sdk-installation.md @@ -1,7 +1,7 @@ # OpenCAPIF SDK installation -Before installation it's needed to have completed the [prerequirements](sdk-prerequirements.md) section. +Before installation it's needed to have completed the [requirements](sdk-prerequirements.md) section. ## OpenCAPIF SDK consumer installation diff --git a/doc/sdk-prerequirements.md b/doc/sdk-prerequirements.md index 865b2adce2f3c6edecef297d91c3f0eeee99a752..58cb406592b2be31bbd3784cd9d236c6fffd0560 100644 --- a/doc/sdk-prerequirements.md +++ b/doc/sdk-prerequirements.md @@ -1,4 +1,4 @@ -## OpenCAPIF SDK prerequirement +## OpenCAPIF SDK requirements 1. 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). diff --git a/doc/sdk-usage.md b/doc/sdk-usage.md index 144dfbc447c04dd34eae2aa27adb9b82d8d76cab..2d745e0862926097617b8c72a4fe955b2e10f719 100644 --- a/doc/sdk-usage.md +++ b/doc/sdk-usage.md @@ -2,50 +2,70 @@ 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. -Before using it, it is required to have fullfiled the [prerequirements](./sdk-prerequirements.md) section, the [installation](./sdk-installation.md) section and the selected parts of the [configuration](./sdk-configuration.md) depending on the CAPIF role the NetApp is going to play. +Before using it, it is required to have fullfilled the [requirements](./sdk-prerequirements.md) section, the [installation](./sdk-installation.md) section and the selected parts of the [configuration](./sdk-configuration.md) depending on the CAPIF role the NetApp is going to play.  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](../netapp-samples/), it is provided a sample application leveraging -- **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](../scripts/) to test step by step all implemented procedures. All of them are provided at scripts folder -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, + - For Manual usage it is required to complete the utilities file with the absolute paths of target environment in order to complete the configuration of the SDK: -2 - Then it is needed to fill out config files depending on the features required to be used from the SDK. +**NOTE**:register file is not needed for the use of the SDK + +**IMPORTANT**:It is needed to fill out config files depending on the features required to be used from the SDK.Please if you didn't fullfil this file, go to the [Configuration Section](./sdk-configuration.md) + +# Table of contents CAPIF is designed to use using two different roles: -- [As an invoker](#as-an-invoker) -- [As an provider](#as-an-provider) -- [Other features](#other-features) + + +- [As an Invoker](#as-an-invoker) + - [Onboard Invoker](#onboard_invoker--script-invoker_capif_connectorpy) + - [Discover API](#discover--script-invoker_service_discoverpy) + - [Get Tokens](#get-tokens--script-invoker_service_get_tokenpy) + - [Update and Offboard Invoker](#update-and-offboard-invoker--scripts-invoker_capif_connector_updatepy-and-invoker_capif_connector_offboardingpy) + - [Important Information for Invoker](#important-information-for-invoker-consumer) +- [As a Provider](#as-a-provider) + - [Onboard Provider](#onboard-provider--script-provider_capif_connectorpy) + - [Publish Services](#publish-services--script-provider_publish_apipy) + - [Unpublish Services](#unpublish-services--script-provider_unpublish_apipy) + - [Update Services](#update-services--script-provider_update_apipy) + - [Get Published Services](#get-published-services--script-provider_get_published_apipy) + - [Get All Published Services](#get-all-published-services--script-provider_get_all_published_apipy) + - [Update and Offboard Provider](#update-and-offboard-provider--scripts-provider_capif_connector_updatepy-and-provider_capif_connector_offboardingpy) + - [Important Information for Provider](#important-information-for-provider-consumer) +- [Other Features](#other-features) + - [Register and Login](#script-register_and_loginpy) + - [Deregister and Login](#script-deregister_and_loginpy) # As an invoker The common path to follow using CAPIF in order to get an API token of the service it's wanted to use is by following this steps: -- onboard_invoker() // Script invoker_capif_connector.py +### onboard_invoker() // Script invoker_capif_connector.py Simplifies the process of onboarding for Invoker users  -- discover() // Script invoker_service_discover.py +### discover() // Script invoker_service_discover.py In this functionality it could be used [discover_filter](./sdk-configuration.md) to retrieve only the access of the API's it's wanted to access  -- get_tokens() // Script invoker_service_get_token.py +### get_tokens() // Script invoker_service_get_token.py After the Discovery, this functionality simplifies the way of getting created their propperly security context for each of the services and adquiring the access token to use the final APIs  -- update_invoker() and offboard_and_deregister_Invoker() // invoker_capif_connector_update.py and invoker_capif_connector_offboarding.py +### update_invoker() and offboard_and_deregister_Invoker() // invoker_capif_connector_update.py and invoker_capif_connector_offboarding.py For using this features we must have onboard as an invoker previusly. @@ -64,7 +84,7 @@ In the `invoker_folder`, it will be located several folders with each `capif_use # As an provider The common path to follow using CAPIF in order to publish an API is by following this steps: -- onboard_provider() // Script provider_capif_connector.py +### onboard_provider() // Script provider_capif_connector.py Simplifies the process of onboarding for Provider users,also has the capability to register several APF's and AEF's if its necesary @@ -74,7 +94,7 @@ Simplifies the process of onboarding for Provider users,also has the capability For using the Publish Service is mandatory to fullfill certain fields of the [Publish.json](./sdk-configuration.md) file -- publish_services() // Script provider_publish_api.py +### publish_services() // Script provider_publish_api.py Simplifies the process of publishing an API. Also has the capability to chose which APF and AEF's will be used to publish the API @@ -82,7 +102,7 @@ For using the Publish Service is mandatory to fullfill certain fields of the [Pu - PublisherAPFid - PublisherAEFsids -- unpublish_service() // Script provider_unpublish_api.py +### unpublish_service() // Script provider_unpublish_api.py Simplifies the process of deleting an API @@ -91,7 +111,7 @@ For using the Publish Service is mandatory to fullfill certain fields of the [Pu - PublisherAPFid - PublisherAEFsids -- update_service(service_api_description_json_full_path) // Script provider_update_api.py +### update_service(service_api_description_json_full_path) // Script provider_update_api.py Simplifies the process of updating an API. Also has the capability to chose which APF and AEF's will be used to update the API @@ -100,7 +120,7 @@ For using the Publish Service is mandatory to fullfill certain fields of the [Pu - PublisherAPFid - PublisherAEFsids -- get_service() // Script provider_get_published_api.py +### get_service() // Script provider_get_published_api.py Simplifies the process of recieving the information of One service published previously @@ -108,7 +128,7 @@ For using the Publish Service is mandatory to fullfill certain fields of the [Pu - ServiceApiId - PublisherAPFid -- get_all_services() // Script provider_get_all_published_api.py +### get_all_services() // Script provider_get_all_published_api.py Simplifies the process of recieving the information of all available services published previously @@ -117,7 +137,7 @@ For using the Publish Service is mandatory to fullfill certain fields of the [Pu  -- update_provider() and offboard_provider() // provider_capif_connector_update.py and provider_capif_connector_offboarding.py +### update_provider() and offboard_provider() // provider_capif_connector_update.py and provider_capif_connector_offboarding.py For using this features we must have onboard as a provider previusly. @@ -140,12 +160,12 @@ In the `provider_folder`, it will be located several folders with each `capif_us Apart from the SDK core, there are available different functionalities for development purposes: -- Script register_and_login.py +### Script register_and_login.py Facilitates the logging process for admin users and creates a CAPIF user, -- Script deregister_and_login.py +### Script deregister_and_login.py Facilitates the logging process for admin users and eliminates a CAPIF user. diff --git a/samples/capif_api_security_context_details-sample.json b/samples/capif_api_security_context_details-sample.json new file mode 100644 index 0000000000000000000000000000000000000000..454956f52de40eeb67da8fd0e5051cff2f350bca --- /dev/null +++ b/samples/capif_api_security_context_details-sample.json @@ -0,0 +1,216 @@ +{ + "user_name": "echeva_0", + "api_invoker_id": "INV7b06186b167af4b4d846490cd78066", + "discover_services_url": "service-apis/v1/allServiceAPIs?api-invoker-id=", + "registered_security_contexes": [ + { + "api_name": "Test66", + "api_id": "feb57d7c92dfd2b94da3f53ceadf33", + "aef_id": "AEF72e7f944a20fe072e9db263533b646", + "ip": "http://10.17.173.87", + "port": 8088, + "versions": [ + { + "apiVersion": "v1", + "expiry": "2025-08-27T09:16:41.278000+00:00", + "resources": [ + { + "resourceName": "dynamic-deployment", + "commType": "REQUEST_RESPONSE", + "uri": "/api/svc/v1/dynamic-deployment", + "custOpName": "string", + "operations": ["GET"], + "description": "Dynamic deployment" + } + ], + "custOperations": [ + { + "commType": "REQUEST_RESPONSE", + "custOpName": "string", + "operations": ["GET"], + "description": "string" + } + ] + } + ] + }, + { + "api_name": "Test77", + "api_id": "de766971736ca69b578642f9942447", + "aef_id": "AEF5608b606ab08cfd7111018e3936666", + "ip": "http://10.17.173.87", + "port": 8088, + "versions": [ + { + "apiVersion": "v1", + "expiry": "2025-08-27T09:17:30.918000+00:00", + "resources": [ + { + "resourceName": "dynamic-deployment", + "commType": "REQUEST_RESPONSE", + "uri": "/api/svc/v1/dynamic-deployment", + "custOpName": "string", + "operations": ["GET"], + "description": "Dynamic deployment" + } + ], + "custOperations": [ + { + "commType": "REQUEST_RESPONSE", + "custOpName": "string", + "operations": ["GET"], + "description": "string" + } + ] + } + ] + }, + { + "api_name": "Deployment", + "api_id": "aabc425680791995b1fbb93a01c7d1", + "aef_id": "AEFd836e9b49161673e3ee6632c409520", + "ip": "http://10.17.173.87", + "port": 8088, + "versions": [ + { + "apiVersion": "v1", + "expiry": "2025-08-28T08:00:21.178000+00:00", + "resources": [ + { + "resourceName": "dynamic-deployment", + "commType": "REQUEST_RESPONSE", + "uri": "/api/svc/v1/dynamic-deployment", + "custOpName": "string", + "operations": ["GET"], + "description": "Dynamic deployment" + } + ], + "custOperations": [ + { + "commType": "REQUEST_RESPONSE", + "custOpName": "string", + "operations": ["GET"], + "description": "string" + } + ] + } + ] + }, + { + "api_name": "Deployment1", + "api_id": "dd0b9f983eeb2286431ed45980a4ef", + "aef_id": "AEF4610c63fcb94052eb8847abd2c5ed7", + "ip": "http://10.17.173.87", + "port": 8088, + "versions": [ + { + "apiVersion": "v1", + "expiry": "2025-09-03T14:00:17.889000+00:00", + "resources": [ + { + "resourceName": "dynamic-deployment", + "commType": "REQUEST_RESPONSE", + "uri": "/api/svc/v1/dynamic-deployment", + "custOpName": "string", + "operations": ["GET"], + "description": "Dynamic deployment" + } + ], + "custOperations": [ + { + "commType": "REQUEST_RESPONSE", + "custOpName": "string", + "operations": ["GET"], + "description": "string" + } + ] + } + ] + }, + { + "api_name": "ks8500_gateway", + "api_id": "989df41e88ff855b4caa3e8604a63a", + "aef_id": "AEFe4d29061739c80aceb26904354203a", + "ip": "localhost", + "port": 8088, + "versions": [ + { + "apiVersion": "v1", + "expiry": "2025-11-30T10:32:02.004000+00:00", + "resources": [ + { + "resourceName": "schedule_run", + "commType": "REQUEST_RESPONSE", + "uri": "/runs/new", + "custOpName": "string", + "operations": ["POST"], + "description": "Endpoint to receive a welcome message" + } + ], + "custOperations": [ + { + "commType": "REQUEST_RESPONSE", + "custOpName": "string", + "operations": ["POST"], + "description": "string" + } + ] + } + ] + }, + { + "api_name": "ks8500_runner_test", + "api_id": "f7b310ec187da7b98f5e1ae04e7cf8", + "aef_id": "AEF245414674f715d15c0130f6e82c0ea", + "ip": "localhost", + "port": 8088, + "versions": [ + { + "apiVersion": "v1", + "expiry": "2025-11-30T10:32:02.004000+00:00", + "resources": [ + { + "resourceName": "hello-endpoint", + "commType": "REQUEST_RESPONSE", + "uri": "/hello", + "custOpName": "string", + "operations": ["POST"], + "description": "Endpoint to receive a welcome message" + } + ], + "custOperations": [ + { + "commType": "REQUEST_RESPONSE", + "custOpName": "string", + "operations": ["POST"], + "description": "string" + } + ] + } + ] + }, + { + "api_name": "ks8500_gateway_development", + "api_id": "8eb8d27d533731ae500e00acdab87a", + "aef_id": "AEF4ca2cfb9700f917b8cce1368599c60", + "ip": "localhost", + "port": 443, + "versions": [ + { + "apiVersion": "v1", + "resources": [ + { + "resourceName": "runs", + "commType": "REQUEST_RESPONSE", + "uri": "/runs", + "custOpName": "string", + "operations": ["POST"], + "description": "Schedule a campaign run" + } + ] + } + ] + } + ], + "access_token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJmcmVzaCI6ZmFsc2UsImlhdCI6MTcyNzMzNzA5MywianRpIjoiNTc3MzBkZjgtN2M4NS00NGQ2LTg0ZmEtNTQ0NjdmMTZlZWY0IiwidHlwZSI6ImFjY2VzcyIsInN1YiI6IklOVjdiMDYxODZiMTY3YWY0YjRkODQ2NDkwY2Q3ODA2NiIsIm5iZiI6MTcyNzMzNzA5MywiZXhwIjoxNzI3MzM3NjkzLCJpc3MiOiJJTlY3YjA2MTg2YjE2N2FmNGI0ZDg0NjQ5MGNkNzgwNjYiLCJzY29wZSI6IjNncHAjQUVGNzJlN2Y5NDRhMjBmZTA3MmU5ZGIyNjM1MzNiNjQ2OlRlc3Q2NjtBRUY1NjA4YjYwNmFiMDhjZmQ3MTExMDE4ZTM5MzY2NjY6VGVzdDc3O0FFRmQ4MzZlOWI0OTE2MTY3M2UzZWU2NjMyYzQwOTUyMDpEZXBsb3ltZW50O0FFRjQ2MTBjNjNmY2I5NDA1MmViODg0N2FiZDJjNWVkNzpEZXBsb3ltZW50MTtBRUZlNGQyOTA2MTczOWM4MGFjZWIyNjkwNDM1NDIwM2E6a3M4NTAwX2dhdGV3YXk7QUVGMjQ1NDE0Njc0ZjcxNWQxNWMwMTMwZjZlODJjMGVhOmtzODUwMF9ydW5uZXJfdGVzdDtBRUY0Y2EyY2ZiOTcwMGY5MTdiOGNjZTEzNjg1OTljNjA6a3M4NTAwX2dhdGV3YXlfZGV2ZWxvcG1lbnQifQ.AFFXCZ6IpqkPCYgTplF5YQphQPQH3LBe94YMTcM4ikp4aaoSyo4lyGVF9qWBWqql1rEVTHERM5nu7cf0C_pRwHb_p-iXDT3SUIBR-EajKh0sgc8LHE4qAT5wJ6ZQtz_gKTdcducu8pdUs3NPsmw_pqyubMZuC8nhuKCV8qSJJYjBvaH5DxvlxGKWsibVs0-K_LKQC6XTazv4UdBguz6YR_nP3TiVt731X0Y_EMQnILqY8Mi2IgBkkuyfV90BXvAluo17Z1NzVYZKupHjbQTD3VPO5zr0qjrPHNQAMFrV8gmygG-4TjcYvOy6xicZpqQzd_-yh1lgD4bi-kBkDJVhoQ" +} diff --git a/samples/enviroment-variables-sample.txt b/samples/enviroment-variables-sample.txt index 5226c790623516a0969cf14607e31c9c2a7fa662..cd3e361fa5b14fcf90ba178b013f824d8108d303 100644 --- a/samples/enviroment-variables-sample.txt +++ b/samples/enviroment-variables-sample.txt @@ -1,14 +1,10 @@ +export INVOKER_FOLDER="/Users/IDB0128/Documents/OpenCapif/test_invoker_certificate_folder" +export PROVIDER_FOLDER="/Users/IDB0128/Documents/OpenCapif/test_provider_certificate_folder" export CAPIF_HOST="capif-prev.mobilesandbox.cloud" export REGISTER_HOST="registercapif-prev.mobilesandbox.cloud" -export CAPIF_HTTP_PORT="8080" export CAPIF_HTTPS_PORT="36212" export CAPIF_REGISTER_PORT="36211" -export CAPIF_INVOKER_USERNAME="echeva_0" -export CAPIF_INVOKER_PASSWORD="echevapass" -export CAPIF_REGISTER_USERNAME="admin" -export CAPIF_REGISTER_PASSWORD="password123" export CAPIF_CALLBACK_URL="http://localhost:5000" -export DESCRIPTION="Dummy invoker" export CSR_COMMON_NAME="test03" export CSR_ORGANIZATIONAL_UNIT="test_app_ou" export CSR_ORGANIZATION="test_app_o" @@ -16,8 +12,28 @@ export CRS_LOCALITY="Madrid" export CSR_STATE_OR_PROVINCE_NAME="Madrid" export CSR_COUNTRY_NAME="ES" export CSR_EMAIL_ADDRESS="test@example.com" -export CAPIF_INVOKER_FOLDER="/Users/IDB0128/Documents/OpenCapif/test_invoker_certificate_folder" -export CAPIF_PROVIDER_FOLDER="/Users/IDB0128/Documents/OpenCapif/test_provider_certificate_folder" -export CAPIF_APFS="1" -export CAPIF_AEFS="1" +export CAPIF_USERNAME="echeva_0" +export CAPIF_PASSWORD="echevapass" +export APFS="1" +export AEFS="2" export DEBUG_MODE="True" + +export DISCOVER_FILTER_API_NAME="Deployment" +export DISCOVER_FILTER_API_VERSION="" +export DISCOVER_FILTER_COMM_TYPE="" +export DISCOVER_FILTER_PROTOCOL="" +export DISCOVER_FILTER_AEF_ID="" +export DISCOVER_FILTER_DATA_FORMAT="" +export DISCOVER_FILTER_API_CAT="" +export DISCOVER_FILTER_PREFERRED_AEF_LOC="" +export DISCOVER_FILTER_REQ_API_PROV_NAME="" +export DISCOVER_FILTER_SUPPORTED_FEATURES="" +export DISCOVER_FILTER_API_SUPPORTED_FEATURES="" +export DISCOVER_FILTER_UE_IP_ADDR="" +export DISCOVER_FILTER_SERVICE_KPIS="" + +export PUBLISH_REQ_SERVICE_API_ID="6d3fbdcc138f81b36c7b1595229377" +export PUBLISH_REQ_PUBLISHER_APF_ID="APFdf22044ce6988b136b253a8c5b26f1" +export PUBLISH_REQ_PUBLISHER_AEFS_IDS="AEF0f66526ff2fd8a1be721ace3506adb,AEF212b55c43b1b16116192043bab9e05" + +export API_DESCRIPTION_PATH="/Users/IDB0128/git_repos/pesp_capif_sdk/samples/provider_api_description_sample.json" diff --git a/sdk/CAPIFProviderConnector.py b/sdk/CAPIFProviderConnector.py index d90c5bd568ba1f361f8f8bbf6ca6e7fa6d95656f..2230c74dabe3c437f7da6a9916051c921b79bd99 100644 --- a/sdk/CAPIFProviderConnector.py +++ b/sdk/CAPIFProviderConnector.py @@ -136,9 +136,9 @@ class CAPIFProviderConnector: self.apfs = int(apfs) config = config["publish_req"] self.publish_req = { - "service_api_id": os.getenv('SERVICE_API_ID', config.get('service_api_id', '')).strip(), - "publisher_apf_id": os.getenv('PUBLISHER_APF_ID', config.get('publisher_apf_id', '')).strip(), - "publisher_aefs_ids": os.getenv('PUBLISHER_AEFS_IDS', config.get('publisher_aefs_ids', '')) + "service_api_id": os.getenv('PUBLISH_REQ_SERVICE_API_ID', config.get('service_api_id', '')).strip(), + "publisher_apf_id": os.getenv('PUBLISH_REQ_PUBLISHER_APF_ID', config.get('publisher_apf_id', '')).strip(), + "publisher_aefs_ids": os.getenv('PUBLISH_REQ_PUBLISHER_AEFS_IDS', config.get('publisher_aefs_ids', '')).split(',') } self.api_description_path = api_description_path diff --git a/sdk/ServiceDiscoverer.py b/sdk/ServiceDiscoverer.py index 5cd6a64df242519c3a3d78aabc720409c034d09f..f138221a0ea91897ea765f15d867a177b0d4abcd 100644 --- a/sdk/ServiceDiscoverer.py +++ b/sdk/ServiceDiscoverer.py @@ -73,21 +73,20 @@ class ServiceDiscoverer: config = config["discover_filter"] self.discover_filter = { - "api-name": os.getenv('API-NAME', config.get('api-name', '')).strip(), - "api-version": os.getenv('API-VERSION', config.get('api-version', '')).strip(), - "comm-type": os.getenv('COMM-TYPE', config.get('comm-type', '')).strip(), - "protocol": os.getenv('PROTOCOL', config.get('protocol', '')).strip(), - "aef-id": os.getenv('AEF-ID', config.get('aef-id', '')).strip(), - "data-format": os.getenv('DATA-FORMAT', config.get('data-format', '')).strip(), - "api-cat": os.getenv('API-CAT', config.get('api-cat', '')).strip(), - "preferred-aef-loc": os.getenv('PREFERRED-AEF-LOC', config.get('preferred-aef-loc', '')).strip(), - "req-api-prov-name": os.getenv('REQ-API-PROV-NAME', config.get('req-api-prov-name', '')).strip(), - "supported-features": os.getenv('SUPPORTED-FEATURES', config.get('supported-features', '')).strip(), - "api-supported-features": os.getenv('API-SUPPORTED-FEATURES', config.get('api-supported-features', '')).strip(), - "ue-ip-addr": os.getenv('UE-IP-ADDR', config.get('ue-ip-addr', '')).strip(), - "service-kpis": os.getenv('SERVICE-KPIS', config.get('service-kpis', '')).strip() + "api-name": os.getenv('DISCOVER_FILTER_API_NAME', config.get('api-name', '')).strip(), + "api-version": os.getenv('DISCOVER_FILTER_API_VERSION', config.get('api-version', '')).strip(), + "comm-type": os.getenv('DISCOVER_FILTER_COMM_TYPE', config.get('comm-type', '')).strip(), + "protocol": os.getenv('DISCOVER_FILTER_PROTOCOL', config.get('protocol', '')).strip(), + "aef-id": os.getenv('DISCOVER_FILTER_AEF_ID', config.get('aef-id', '')).strip(), + "data-format": os.getenv('DISCOVER_FILTER_DATA_FORMAT', config.get('data-format', '')).strip(), + "api-cat": os.getenv('DISCOVER_FILTER_API_CAT', config.get('api-cat', '')).strip(), + "preferred-aef-loc": os.getenv('DISCOVER_FILTER_PREFERRED_AEF_LOC', config.get('preferred-aef-loc', '')).strip(), + "req-api-prov-name": os.getenv('DISCOVER_FILTER_REQ_API_PROV_NAME', config.get('req-api-prov-name', '')).strip(), + "supported-features": os.getenv('DISCOVER_FILTER_SUPPORTED_FEATURES', config.get('supported-features', '')).strip(), + "api-supported-features": os.getenv('DISCOVER_FILTER_API_SUPPORTED_FEATURES', config.get('api-supported-features', '')).strip(), + "ue-ip-addr": os.getenv('DISCOVER_FILTER_UE_IP_ADDR', config.get('ue-ip-addr', '')).strip(), + "service-kpis": os.getenv('DISCOVER_FILTER_SERVICE_KPIS', config.get('service-kpis', '')).strip() } - self.capif_invoker_username = capif_invoker_username self.capif_host = capif_host self.capif_https_port = capif_https_port