Add Event Service to diagrams
[nonrtric/plt/sme.git] / capifcore / docs / diagrams / classdiagram.plantuml
1 @startuml Information in rApp registration
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     }
10     note right of APIProviderEnrolmentDetails::apiProvDomId
11         Id provided by CAPIF Core
12     end note
13     struct APIProviderFunctionDetails {
14         string apiProvFuncId
15         string apiProvFuncInfo
16         ApiProviderFuncRole apiProviderFuncRole (required)
17         RegistrationInformation regInfo (required)
18     }
19     note right of APIProviderFunctionDetails::apiProvFuncId
20         Id provided by CAPIF Core
21     end note
22     enum ApiProviderFuncRole {
23         AEF: API provider function is API Exposing Function.
24         APF: API provider function is API Publishing Function.
25         AMF: API Provider function is API Management Function.
26     }
27     struct RegistrationInformation {
28         string apiProvCert
29         string apiProvPubKey (required)
30     }
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 ' Publish Service
37 package "Publish Service" as publishservice #lightblue {
38     struct ServiceAPIDescription {
39         string apiId
40         string apiName (required)
41         string description
42         []AefProfile aefProfiles
43     }
44     note left of ServiceAPIDescription::apiId
45         Id provided by CAPIF Core
46     end note
47     note "apfId matching\n APIProviderFunctionDetails::apiProvFuncId\n must be provided when publishing" as publishProviderRel
48     ServiceAPIDescription .. publishProviderRel
49     publishProviderRel .. APIProviderFunctionDetails::apiProvFuncId
50     struct AefProfile {
51         string aefId (required)
52         DataFormat dataFormat
53         string domainName
54         []InterfaceDescription interfaceDescriptions
55         Protocol protocol
56         []SecurityMethod securityMethods
57         []Version versions (required)
58     }
59     enum DataFormat {
60         JSON
61     }
62     enum Protocol {
63         HTTP_1_1
64         HTTP_2
65     }
66     note "AefProfile::aefId should match\n APIProviderFunctionDetails::apiProvFuncId" as aefIdRel
67     APIProviderFunctionDetails::apiProvFuncId .. aefIdRel
68     aefIdRel .. AefProfile::aefId
69     struct InterfaceDescription {
70         string ipv4Address
71         string ipv6Address
72         int port
73         []SecurityMethod securityMethods
74     }
75     note left of InterfaceDescription::securityMethods
76         Security methods supported by the interface,
77         it take precedence over the security methods
78         provided in AefProfile, for this specific interface.
79     end note
80     struct Version {
81         []CustomOperation custOperations
82         DateTime expiry
83         []Resource resources
84         string apiVersion (required)
85     }
86     struct CustomOperation {
87         CommunicationType commType (required)
88         string custOpName (required)
89         string description
90         []Operation operations
91     }
92     enum Operation {
93         GET
94         POST
95         PUT
96         PATCH
97         DELETE
98     }
99     enum SecurityMethod {
100         PSK
101         PKI
102         OAUTH
103     }
104     struct Resource {
105         string resourceName (required)
106         string uri (required)
107         CommunicationType commType (required)
108         string description
109     }
110     enum CommunicationType {
111         REQUEST_RESPONSE
112         SUBSCRIBE_NOTIFY
113     }
114 }
115 ServiceAPIDescription::aefProfiles "1" o-- "1..N" AefProfile
116 AefProfile::interfaceDescriptions "1" o-- "1..N" InterfaceDescription
117 AefProfile::protocol "0..1" o-- "0..1" Protocol
118 AefProfile::securityMethods "1" o-- "1..N" SecurityMethod
119 AefProfile::dataFormat "0..1" o-- "0..N" DataFormat
120 InterfaceDescription::securityMethods "1" o-- "1..N" SecurityMethod
121 AefProfile::versions "1" o-- "1..N" Version
122 Version::resources "1..N" o-- "1..N" Resource
123 Version::custOperations "0..1" o-- "0..N" CustomOperation
124 CustomOperation::CommunicationType "1" o-- "1" CommunicationType
125 CustomOperation::operations "0..N" o-- "0..N" Operation
126 Resource::commType "1" o-- "1" CommunicationType
127
128 ' Invoker Management
129 package "Invoker Management" #coral {
130     struct APIInvokerEnrolmentDetails {
131         string apiInvokerId
132         string apiInvokerInformation
133         APIList apiList
134         OnboardingInformation onboardingInformation (required)
135     }
136     struct OnboardingInformation {
137         string apiInvokerCertificate
138         string ApiInvokerPublicKey (required)
139         string onboardingSecret
140     }
141 }
142 note right of APIInvokerEnrolmentDetails::apiInvokerId
143     Id provided by CAPIF Core
144 end note
145 note right of OnboardingInformation::onboardingSecret
146     Secret provided by CAPIF Core
147 end note
148 APIInvokerEnrolmentDetails::apiList "1" o-- "1..N" ServiceAPIDescription : APIList containing services\n available for the invoker.\n Provided by capifcore
149 APIInvokerEnrolmentDetails::onboardingInformation "1" o-- "1" OnboardingInformation
150
151 ' Discover Service
152 package "Discover Service"  #Yellow {
153     struct DiscoveredAPIs {
154         []ServiceAPIDescription serviceAPIDescriptions
155     }
156 }
157 DiscoveredAPIs::serviceAPIDescriptions "0..N" o-- "0..N" ServiceAPIDescription
158 note "Services can only be discovered\n for an onboarded invoker through\n APIInvokerEnrolmentDetails::apiInvokerId" as invokerDiscoverRel
159 DiscoveredAPIs .. invokerDiscoverRel
160 invokerDiscoverRel .. APIInvokerEnrolmentDetails::apiInvokerId
161
162 ' Security Service
163 package "Security Service" #Pink {
164     struct AccessTokenReq {
165         string grant_type (required)
166         string client_id (required)
167         string client_secret
168         string scope
169     }
170     struct AccessTokenRsp {
171         string access_token (required)
172         string token_type (required)
173         DurationSec expires_in (required)
174         string scope
175     }
176 }
177 note "AccessTokenReq::client_id and\n AccessTokenReq::client_secret\n must match registered invoker" as accessInvokerRel
178 AccessTokenReq::client_id .. accessInvokerRel
179 accessInvokerRel .. APIInvokerEnrolmentDetails::apiInvokerId
180 note "Function provided in\n AccessTokenReq:scope\n must be registered for a provider" as accessProviderRel
181 AccessTokenReq::scope .. accessProviderRel
182 accessProviderRel .. APIProviderFunctionDetails::apiProvFuncId
183 note "API provided in\n AccessTokenReq:scope\n must be published" as accessPublishRel
184 AccessTokenReq::scope .. accessPublishRel
185 accessPublishRel .. AefProfile::aefId
186
187 ' Event Service
188 package "Event Service" as eventservice #Orange {
189     struct EventSubscription {
190         []CAPIFEvent events (required)
191         Uri notificationDestination (required)
192         ReportingInformation eventReq
193         []CAPIFEventFilter eventFilters
194     }
195     struct CAPIFEventFilter {
196         []string aefIds
197         []string apiIds
198         []string apiInvokerIds
199     }
200     enum CAPIFEvent {
201         SERVICE_API_AVAILABLE
202         SERVICE_API_UNAVAILABLE
203         SERVICE_API_UPDATE
204         API_INVOKER_ONBOARDED
205         API_INVOKER_OFFBOARDED
206         SERVICE_API_INVOCATION_SUCCESS
207         SERVICE_API_INVOCATION_FAILURE
208         ACCESS_CONTROL_POLICY_UPDATE
209         ACCESS_CONTROL_POLICY_UNAVAILABLE
210         API_INVOKER_AUTHORIZATION_REVOKED
211         API_INVOKER_UPDATED
212         API_TOPOLOGY_HIDING_CREATED
213         API_TOPOLOGY_HIDING_REVOKED
214     }
215     struct ReportingInformation {
216         DurationSec grpRepTime
217         bool immRep
218         Uinteger maxReportNbr
219         NotificationFlag notifFlag
220         NotificationMethod notifMethod
221         PartitioningCriteria partitionCriteria
222         DurationSec repPeriod
223         SamplingRation sampRatio
224     }
225     struct CAPIFEventDetail {
226         AccessControlPolicyListExt accCtrlPolList
227         []string apiIds
228         []string apiInvokerIds
229         []ServiceAPIDescription serviceAPIDescriptions
230     }
231     struct AccessControlPolicyListExt {
232         AccessControlPolicyList accessControlPolicyList
233         string apiId
234     }
235 }
236 EventSubscription::eventFilters "0..N" o-- "0..N" CAPIFEventFilter
237 EventSubscription::events "1" o-- "1..N" CAPIFEvent
238 EventSubscription::eventReq "0..N" o-- "0..N" ReportingInformation
239 CAPIFEventDetail::serviceAPIDescriptions "0..N" o-- "0..N" ServiceAPIDescription
240 CAPIFEventFilter::aefIds .. APIProviderFunctionDetails::apiProvFuncId
241 CAPIFEventFilter::apiIds .. ServiceAPIDescription::apiId
242 CAPIFEventFilter::apiInvokerIds .. APIInvokerEnrolmentDetails::apiInvokerId
243 CAPIFEventDetail::apiIds .. ServiceAPIDescription::apiId
244 CAPIFEventDetail::apiInvokerIds .. APIInvokerEnrolmentDetails::apiInvokerId
245 CAPIFEventDetail::accCtrlPolList "0..N" o-- "0..N" AccessControlPolicyListExt
246 AccessControlPolicyListExt::apiId .. ServiceAPIDescription::apiId
247
248 ' Access Control Policy
249 package "Access Control Policy" #LightCyan {
250     struct AccessControlPolicyList {
251         []ApiInvokerPolicy apiInvokerPolicies
252     }
253     struct ApiInvokerPolicy {
254         []TimeRangeList allowedInvocationTimeRangeList
255         int allowedInvocationsPerSecond
256         int allowedTotalInvocations
257         string apiInvokerId (required)
258     }
259     struct TimeRangeList {
260         DateTime startTime
261         DateTime stopTime
262     }
263 }
264 AccessControlPolicyList::apiInvokerPolicies "0..N" o-- "0..N" ApiInvokerPolicy
265 ApiInvokerPolicy::allowedInvocationTimeRangeList "0..N" o-- "0..N" TimeRangeList
266 AccessControlPolicyListExt::accessControlPolicyList "0..N" o-- "0..N" AccessControlPolicyList
267 ApiInvokerPolicy::apiInvokerId .. APIInvokerEnrolmentDetails::apiInvokerId
268 ApiInvokerPolicy::apiInvokerId .. APIInvokerEnrolmentDetails::apiInvokerId
269 @enduml