Newer
Older
# OpenCAPIF SDK usage
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.
[GENERAL CAPIF USAGE FLOW](./images/Flujo%20completo-OPENCAPIF%20ACTUAL.jpg)
This repository includes 2 different modes to test OpenCAPIF SDK:
- **Manual usage**: use a set of python scripts to test step by step all implemented procedures. All of them are provided at scripts folder,
- **Development usage**: import SDK in your code and start ... Within nf-sample folder, it is provided a sample application leveraging
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# 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:
- register_and_onboard_Invoker() // Script invoker_capif_connector.py

- discover() // Script invoker_service_discover.py
In this functionality it could be used [Discover_filter.json](./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

# As an provider
The common path to follow using CAPIF in order to publish an API is by following this steps:
- register_and_onboard_provider() // Script provider_capif_connector.py

[CAPIF_Publish_Service_API](https://github.com/jdegre/5GC_APIs/blob/Rel-18/TS29222_CAPIF_Publish_Service_API.yaml)
For using the Publish Service is mandatory to fullfill certain fields of the [Publish.json](./sdk-configuration.md) file
- publish_services(service_api_description_json_full_path) // Script provider_publish_api.py
Mandatory fields:
- PublisherAPFid
- PublisherAEFsids
- unpublish_service(service_api_description_json_full_path) // Script provider_unpublish_api.py
Mandatory fields:
- ServiceApiId
- PublisherAPFid
- PublisherAEFsids
- update_service(service_api_description_json_full_path) // Script provider_update_api.py
Mandatory fields:
- ServiceApiId
- PublisherAPFid
- PublisherAEFsids
- get_service() // Script provider_get_published_api.py
Mandatory fields:
- ServiceApiId
- PublisherAPFid
- get_all_services() // Script provider_get_all_published_api.py
Mandatory fields:
- PublisherAPFid

73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
# OpenCAPIF SDK scripts
This repository provides manual scripts to validate and demonstrate the integration to OpenCAPIF. Next are listed the behaviour of all of them available at /sctipts folder:
1.
2.
3.
4.
Additional requests to CAPIF:
- Publisher: addionally a devoloper could retrieve data from ...
1.
2.
- Events: blah blah
- Explore API directory:
- **Invoker CAPIF connector**: Simplifies the process of onboarding for Invoker users,
- **Provider CAPIF connector**: Simplifies the process of onboarding for Provider users,also has the capability to register several APF's and AEF's if its necesary,
- **Invoker Service Discovery**: Facilitates making a Discovery request to CAPIF, also stores the API services recieved and has an option to filter them,
- **Invoker Service Get token**: 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,
- **Provider Publish API**: 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,
- **Provider Unpublish API**: Simplifies the process of deleting an API,
- **Provider Update API**: 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,
- **Provider Get API**: Simplifies the process of recieving the information of One service published previously,
- **Provider Get all APIs**: Simplifies the process of recieving the information of all available services published previously,
- **Invoker CAPIF connector offboarding**: Simplifies the process of offboarding for Invoker users,
- **Provider CAPIF connector offboarding**: Simplifies the process of offboarding for Provider users.
[OPENCAPIF SDK CODE STRUCTURE]

## Other features
Apart from the SDK core, there are available different functionalities for development purposes:
- **Register and login**: Facilitates the logging process for admin users and creates a CAPIF user,
- **Deregister and login**: Facilitates the logging process for admin users and eliminates a CAPIF user.

# How to use OpenCAPIF SDK
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,
- NOTE provider_exposer_get_sample_api_description_path is mandatory if publish functionalities are required.
2 - Then it is needed to fill out config files depending on the features required to be used from the SDK.