Add the rest of the apis to the diagrams
[nonrtric/plt/sme.git] / capifcore / docs / diagrams / classdiagram.plantuml
1 @startuml Information model for CAPIF
2 ' Provider Service
3 package "Provider Service" #palegreen {
4     struct APIProviderEnrolmentDetails {
5         string apiProvDomId
6         string apiProvDomInfo
7         []APIProviderFunctionDetails apiProvFuncs
8         string regSec (required)
9         SupportedFeatures suppFeats
10     }
11     note right of APIProviderEnrolmentDetails::apiProvDomId
12         Id provided by CAPIF Core
13     end note
14     struct APIProviderFunctionDetails {
15         string apiProvFuncId
16         string apiProvFuncInfo
17         ApiProviderFuncRole apiProviderFuncRole (required)
18         RegistrationInformation regInfo (required)
19     }
20     note right of APIProviderFunctionDetails::apiProvFuncId
21         Id provided by CAPIF Core
22     end note
23     enum ApiProviderFuncRole {
24         AEF: API provider function is API Exposing Function.
25         APF: API provider function is API Publishing Function.
26         AMF: API Provider function is API Management Function.
27     }
28     struct RegistrationInformation {
29         string apiProvCert
30         string apiProvPubKey (required)
31     }
32     APIProviderEnrolmentDetails::apiProvFuncs "1" o-- "1..N" APIProviderFunctionDetails
33     APIProviderFunctionDetails::regInfo "1" o-- "1" RegistrationInformation
34     APIProviderFunctionDetails::apiProviderFuncRole "1" o-- "1" ApiProviderFuncRole
35 }
36
37 ' Publish Service
38 package "Publish Service" #lightblue {
39     struct ServiceAPIDescription {
40         string apiId
41         string apiName (required)
42         string description
43         []AefProfile aefProfiles
44         SupportedFeatures apiSuppFeat
45         SupportedFeatures supportedFeatures
46     }
47     note left of ServiceAPIDescription::apiId
48         Id provided by CAPIF Core
49     end note
50     note "apfId matching\n APIProviderFunctionDetails::apiProvFuncId\n must be provided when publishing" as publishProviderRel
51     ServiceAPIDescription .. publishProviderRel
52     publishProviderRel .. APIProviderFunctionDetails::apiProvFuncId
53     struct AefProfile {
54         string aefId (required)
55         DataFormat dataFormat
56         string domainName
57         []InterfaceDescription interfaceDescriptions
58         Protocol protocol
59         []SecurityMethod securityMethods
60         []Version versions (required)
61     }
62     enum DataFormat {
63         JSON
64     }
65     enum Protocol {
66         HTTP_1_1
67         HTTP_2
68     }
69     note "AefProfile::aefId should match\n APIProviderFunctionDetails::apiProvFuncId" as aefIdRel
70     APIProviderFunctionDetails::apiProvFuncId .. aefIdRel
71     aefIdRel .. AefProfile::aefId
72     struct InterfaceDescription {
73         string ipv4Address
74         string ipv6Address
75         int port
76         []SecurityMethod securityMethods
77     }
78     note left of InterfaceDescription::securityMethods
79         Security methods supported by the interface,
80         it take precedence over the security methods
81         provided in AefProfile, for this specific interface.
82     end note
83     struct Version {
84         []CustomOperation custOperations
85         DateTime expiry
86         []Resource resources
87         string apiVersion (required)
88     }
89     struct CustomOperation {
90         CommunicationType commType (required)
91         string custOpName (required)
92         string description
93         []Operation operations
94     }
95     enum Operation {
96         GET
97         POST
98         PUT
99         PATCH
100         DELETE
101     }
102     enum SecurityMethod {
103         PSK
104         PKI
105         OAUTH
106     }
107     struct Resource {
108         string resourceName (required)
109         string uri (required)
110         CommunicationType commType (required)
111         string description
112     }
113     enum CommunicationType {
114         REQUEST_RESPONSE
115         SUBSCRIBE_NOTIFY
116     }
117     ServiceAPIDescription::aefProfiles "1" o-- "1..N" AefProfile
118     AefProfile::interfaceDescriptions "1" o-- "1..N" InterfaceDescription
119     AefProfile::protocol "0..1" o-- "0..1" Protocol
120     AefProfile::securityMethods "1" o-- "1..N" SecurityMethod
121     AefProfile::dataFormat "0..1" o-- "0..N" DataFormat
122     InterfaceDescription::securityMethods "1" o-- "1..N" SecurityMethod
123     AefProfile::versions "1" o-- "1..N" Version
124     Version::resources "1..N" o-- "1..N" Resource
125     Version::custOperations "0..1" o-- "0..N" CustomOperation
126     CustomOperation::CommunicationType "1" o-- "1" CommunicationType
127     CustomOperation::operations "0..N" o-- "0..N" Operation
128     Resource::commType "1" o-- "1" CommunicationType
129 }
130
131 ' Invoker Management
132 package "Invoker Management" #coral {
133     struct APIInvokerEnrolmentDetails {
134         string apiInvokerId
135         string apiInvokerInformation
136         APIList apiList
137         OnboardingInformation onboardingInformation (required)
138         SupportedFeatures supportedFeatures
139     }
140     note right of APIInvokerEnrolmentDetails::apiInvokerId
141         Id provided by
142         CAPIF Core
143     end note
144     struct OnboardingInformation {
145         string apiInvokerCertificate
146         string ApiInvokerPublicKey (required)
147         string onboardingSecret
148     }
149     note right of OnboardingInformation::Secret
150         Secret provided
151         by CAPIF Core
152     end note
153     APIInvokerEnrolmentDetails::apiList "1" o-- "1..N" ServiceAPIDescription
154     APIInvokerEnrolmentDetails::onboardingInformation "1" o-- "1" OnboardingInformation
155 }
156 note "APIList containing services\n available for the invoker.\n Provided by capifcore" as invServiceRel
157 APIInvokerEnrolmentDetails::apiList .. invServiceRel
158 invServiceRel .. ServiceAPIDescription
159
160 ' Discover Service
161 package "Discover Service"  #Yellow {
162     struct DiscoveredAPIs {
163         []ServiceAPIDescription serviceAPIDescriptions
164     }
165 }
166 DiscoveredAPIs::serviceAPIDescriptions "0..N" o-- "0..N" ServiceAPIDescription
167 note "Services can only be discovered\n for an onboarded invoker through\n APIInvokerEnrolmentDetails::apiInvokerId" as invokerDiscoverRel
168 DiscoveredAPIs .. invokerDiscoverRel
169 invokerDiscoverRel .. APIInvokerEnrolmentDetails::apiInvokerId
170
171 ' Security Service
172 package "Security Service" #Pink {
173     struct AccessTokenReq {
174         string grant_type (required)
175         string client_id (required)
176         string client_secret
177         string scope
178     }
179     struct AccessTokenRsp {
180         string access_token (required)
181         string token_type (required)
182         DurationSec expires_in (required)
183         string scope
184     }
185     struct ServiceSecurity {
186         []SecurityInformation securityInfo (required)
187         SupportedFeatures supportedFeatures
188     }
189     struct SecurityInformation {
190         string aefId
191         string apiId
192         string authenticationInfo
193         string authorizationInfo
194         InterfaceDescription interfaceDetails
195         []SecurityMethod prefSecurityMethods
196         []SecurityMethod selSecurityMethods
197     }
198     ServiceSecurity::securityInfo "1" o-- "1..N" SecurityInformation
199     SecurityInformation::interfaceDetails "0..1" o-- "0..N" InterfaceDescription
200     SecurityInformation::prefSecurityMethods "1" o-- "1..N" SecurityMethod
201     SecurityInformation::selSecurityMethods "0..1" o-- "0..N" SecurityMethod
202 }
203 SecurityInformation::aefId .. APIProviderFunctionDetails::apiProvFuncId
204 SecurityInformation::apiId .. ServiceAPIDescription::apiId
205 note "AccessTokenReq::client_id and\n AccessTokenReq::client_secret\n must match registered invoker" as accessInvokerRel
206 AccessTokenReq::client_id .. accessInvokerRel
207 accessInvokerRel .. APIInvokerEnrolmentDetails::apiInvokerId
208 note "Function provided in\n AccessTokenReq:scope\n must be registered for a provider" as accessProviderRel
209 AccessTokenReq::scope .. accessProviderRel
210 accessProviderRel .. APIProviderFunctionDetails::apiProvFuncId
211 note "API provided in\n AccessTokenReq:scope\n must be published" as accessPublishRel
212 AccessTokenReq::scope .. accessPublishRel
213 accessPublishRel .. AefProfile::aefId
214
215 ' Event Service
216 package "Event Service" #Orange {
217     struct EventSubscription {
218         []CAPIFEvent events (required)
219         Uri notificationDestination (required)
220         ReportingInformation eventReq
221         []CAPIFEventFilter eventFilters
222         SupportedFeatures supportedFeatures
223     }
224     struct CAPIFEventFilter {
225         []string aefIds
226         []string apiIds
227         []string apiInvokerIds
228     }
229     enum CAPIFEvent {
230         SERVICE_API_AVAILABLE
231         SERVICE_API_UNAVAILABLE
232         SERVICE_API_UPDATE
233         API_INVOKER_ONBOARDED
234         API_INVOKER_OFFBOARDED
235         SERVICE_API_INVOCATION_SUCCESS
236         SERVICE_API_INVOCATION_FAILURE
237         ACCESS_CONTROL_POLICY_UPDATE
238         ACCESS_CONTROL_POLICY_UNAVAILABLE
239         API_INVOKER_AUTHORIZATION_REVOKED
240         API_INVOKER_UPDATED
241         API_TOPOLOGY_HIDING_CREATED
242         API_TOPOLOGY_HIDING_REVOKED
243     }
244     struct ReportingInformation {
245         DurationSec grpRepTime
246         bool immRep
247         Uinteger maxReportNbr
248         NotificationFlag notifFlag
249         NotificationMethod notifMethod
250         PartitioningCriteria partitionCriteria
251         DurationSec repPeriod
252         SamplingRation sampRatio
253     }
254     struct CAPIFEventDetail {
255         AccessControlPolicyListExt accCtrlPolList
256         []string apiIds
257         []string apiInvokerIds
258         []ServiceAPIDescription serviceAPIDescriptions
259     }
260     struct AccessControlPolicyListExt {
261         AccessControlPolicyList accessControlPolicyList
262         string apiId
263     }
264 }
265 EventSubscription::eventFilters "0..N" o-- "0..N" CAPIFEventFilter
266 EventSubscription::events "1" o-- "1..N" CAPIFEvent
267 EventSubscription::eventReq "0..N" o-- "0..N" ReportingInformation
268 CAPIFEventDetail::serviceAPIDescriptions "0..N" o-- "0..N" ServiceAPIDescription
269 CAPIFEventFilter::aefIds .. APIProviderFunctionDetails::apiProvFuncId
270 CAPIFEventFilter::apiIds .. ServiceAPIDescription::apiId
271 CAPIFEventFilter::apiInvokerIds .. APIInvokerEnrolmentDetails::apiInvokerId
272 CAPIFEventDetail::apiIds .. ServiceAPIDescription::apiId
273 CAPIFEventDetail::apiInvokerIds .. APIInvokerEnrolmentDetails::apiInvokerId
274 CAPIFEventDetail::accCtrlPolList "0..N" o-- "0..N" AccessControlPolicyListExt
275 AccessControlPolicyListExt::apiId .. ServiceAPIDescription::apiId
276
277 ' Access Control Policy
278 package "Access Control Policy" #LightCyan {
279     struct AccessControlPolicyList {
280         []ApiInvokerPolicy apiInvokerPolicies
281     }
282     struct ApiInvokerPolicy {
283         []TimeRangeList allowedInvocationTimeRangeList
284         int allowedInvocationsPerSecond
285         int allowedTotalInvocations
286         string apiInvokerId (required)
287     }
288     struct TimeRangeList {
289         DateTime startTime
290         DateTime stopTime
291     }
292 }
293 AccessControlPolicyList::apiInvokerPolicies "0..N" o-- "0..N" ApiInvokerPolicy
294 ApiInvokerPolicy::allowedInvocationTimeRangeList "0..N" o-- "0..N" TimeRangeList
295 AccessControlPolicyListExt::accessControlPolicyList "0..N" o-- "0..N" AccessControlPolicyList
296 ApiInvokerPolicy::apiInvokerId .. APIInvokerEnrolmentDetails::apiInvokerId
297
298 ' Logging Service
299 package "Logging Service" #Silver {
300     struct InvocationLog {
301         string aefId (required)
302         string apiInvokerId (required)
303         []Log logs (required)
304         SupportedFeatures supportedFeatures
305     }
306     struct Log {
307         string apiId (required)
308         string apiName (required)
309         string apiVersion (required)
310         InterfaceDescription destInterface
311         string fwdInterface
312         interface inputParameters
313         DurationMs invocationLatency
314         DateTime invocationTime
315         Operation operation
316         interface outputParameters
317         Protocol protocol (required)
318         string resourceName (required)
319         string result (required)
320         InterfaceDescription srcInterface
321         Uri uri
322     }
323 }
324 InvocationLog::logs "1" o-- "1..N" Log
325 InvocationLog::aefId .. APIProviderFunctionDetails::apiProvFuncId
326 InvocationLog::apiInvokerId .. APIInvokerEnrolmentDetails::apiInvokerId
327 Log::apiId .. ServiceAPIDescription::apiId
328 Log::destInterface "0..1" o-- "0..N" InterfaceDescription
329 Log::srcInterface "0..1" o-- "0..N" InterfaceDescription
330 Log::protocol "0..1" o-- "0..N" Protocol
331 Log::operation "0..1" o-- "0..N" Operation
332
333 ' Auditing Service
334 package "Auditing Servive" #PaleVioletRed {
335     struct GetApiInvocationLogsParams {
336         string aefId
337         string apiInvokerId
338         DateTime timeRangeStart
339         DateTime timeRangeEnd
340         string apiId
341         string apiName
342         string apiVersion
343         Protocol protocol
344         Operation operation
345         string result
346         string resourceName
347         InterfaceDescription srcInterface
348     }
349 }
350 GetApiInvocationLogsParams::aefId .. APIProviderFunctionDetails::apiProvFuncId
351 GetApiInvocationLogsParams::apiInvokerId .. APIInvokerEnrolmentDetails::apiInvokerId
352 GetApiInvocationLogsParams::apiId .. ServiceAPIDescription::apiId
353 GetApiInvocationLogsParams::protocol "0..1" o-- "0..1" Protocol
354 GetApiInvocationLogsParams::operation "0..1" o-- "0..1" Operation
355 GetApiInvocationLogsParams::srcInterface "0..1" o-- "0..1" InterfaceDescription
356 note "A call with\n GetApiInvocationLogsParams\n returns an InvocationLog" as auditLogRel
357 GetApiInvocationLogsParams .. auditLogRel
358 auditLogRel .. InvocationLog
359
360 ' Routing Service
361 package "Routing Service" {
362     struct RoutingInfo {
363         []RoutingRule routingRules (required)
364     }
365     struct RoutingRule {
366         AefProfile aefProfile (required)
367         []Ipv4AddressRange ipv4AddrRanges
368         []Ipv6AddressRange ipv6AddrRanges
369     }
370     struct GetServiceApisServiceApiIdParams {
371         string aefId (required)
372         SupportedFeatures suppFeat
373     }
374     RoutingInfo::routingRules "1" o-- "1..N" RoutingRule
375     RoutingRule::aefProfile "1" o-- "1" AefProfile
376     GetServiceApisServiceApiIdParams::aefId .. APIProviderFunctionDetails::apiProvFuncId
377     note "A call with\n GetServiceApisServiceApiIdParams\n returns a RoutingRule" as routingRel
378     GetServiceApisServiceApiIdParams .. routingRel
379     routingRel .. RoutingInfo
380 }
381 @enduml