Merge "Adding new Simple consumer producer rapp packages"
[nonrtric/plt/rappmanager.git] / openapi / rappmanager / rappmanager-spec.yaml
1 #  ============LICENSE_START===============================================
2 #  Copyright (C) 2023 OpenInfra Foundation Europe. All rights reserved.
3 #  ========================================================================
4 #  Licensed under the Apache License, Version 2.0 (the "License");
5 #  you may not use this file except in compliance with the License.
6 #  You may obtain a copy of the License at
7 #
8 #       http://www.apache.org/licenses/LICENSE-2.0
9 #
10 #  Unless required by applicable law or agreed to in writing, software
11 #  distributed under the License is distributed on an "AS IS" BASIS,
12 #  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 #  See the License for the specific language governing permissions and
14 #  limitations under the License.
15 #  ============LICENSE_END=================================================
16 #
17
18 openapi: 3.0.1
19 info:
20   title: rApp Manager
21   description: The rApp Manager is a lifecycle management service for rApps. It gets the rApp as ASD formatted package and lifecycle manages it based on it instance configuration.
22   license:
23     name: Copyright (C) 2023 OpenInfra Foundation Europe. Licensed under the Apache License.
24     url: http://www.apache.org/licenses/LICENSE-2.0
25   version: "1.0"
26 servers:
27   - url: /
28 tags:
29 - name: rApp
30   description: API for rApps
31 - name: rApp Instance
32   description: API for rApp Instances
33
34 paths:
35   /rapps/{rapp_id}:
36     get:
37       tags:
38         - rApp
39       summary: Get specific rApp details
40       operationId: getRapp
41       parameters:
42         - name: rapp_id
43           in: path
44           required: true
45           schema:
46             type: string
47       responses:
48         '200':
49           description: OK
50           content:
51             '*/*':
52               schema:
53                 $ref: '#/components/schemas/Rapp'
54         '404':
55           description: Not found
56     put:
57       tags:
58         - rApp
59       summary: Prime/Deprime rApp
60       operationId: primeRapp
61       parameters:
62         - name: rapp_id
63           in: path
64           required: true
65           schema:
66             type: string
67       requestBody:
68         content:
69           application/json:
70             schema:
71               $ref: '#/components/schemas/RappPrimeOrder'
72         required: true
73       responses:
74         '200':
75           description: OK
76         '400':
77           description: Bad Request
78         '404':
79           description: Not found
80         '502':
81           description: Bad Gateway
82
83     post:
84       tags:
85         - rApp
86       summary: Create rApp
87       operationId: createRapp
88       parameters:
89         - name: rapp_id
90           in: path
91           required: true
92           schema:
93             type: string
94       requestBody:
95         content:
96           multipart/form-data:
97             schema:
98               type: object
99               properties:
100                 file:
101                   type: string
102                   format: binary
103         required: true
104       responses:
105         '202':
106           description: Accepted
107         '400':
108           description: Bad Request
109     delete:
110       tags:
111         - rApp
112       summary: Delete rApp
113       operationId: deleteRapp
114       parameters:
115         - name: rapp_id
116           in: path
117           required: true
118           schema:
119             type: string
120       responses:
121         '200':
122           description: OK
123         '400':
124           description: Bad Request
125         '404':
126           description: Not found
127   /rapps/{rapp_id}/instance/{rapp_instance_id}:
128     get:
129       tags:
130         - rApp Instance
131       summary: Get specific rApp instance details
132       operationId: getRappInstance
133       parameters:
134         - name: rapp_id
135           in: path
136           required: true
137           schema:
138             type: string
139         - name: rapp_instance_id
140           in: path
141           required: true
142           schema:
143             type: string
144             format: uuid
145       responses:
146         '200':
147           description: OK
148           content:
149             '*/*':
150               schema:
151                 $ref: '#/components/schemas/RappInstance'
152         '404':
153           description: Not found
154     put:
155       tags:
156         - rApp Instance
157       summary: Deploy/Undeploy rApp instance
158       operationId: deployRappInstance
159       parameters:
160         - name: rapp_id
161           in: path
162           required: true
163           schema:
164             type: string
165         - name: rapp_instance_id
166           in: path
167           required: true
168           schema:
169             type: string
170             format: uuid
171       requestBody:
172         content:
173           application/json:
174             schema:
175               $ref: '#/components/schemas/RappInstanceDeployOrder'
176         required: true
177       responses:
178         '200':
179           description: OK
180         '400':
181           description: Bad Request
182         '404':
183           description: Not found
184         '502':
185           description: Bad Gateway
186     delete:
187       tags:
188         - rApp Instance
189       summary: Delete rApp instance
190       operationId: deleteRappInstance
191       parameters:
192         - name: rapp_id
193           in: path
194           required: true
195           schema:
196             type: string
197         - name: rapp_instance_id
198           in: path
199           required: true
200           schema:
201             type: string
202             format: uuid
203       responses:
204         '200':
205           description: OK
206         '404':
207           description: Not found
208   /rapps/{rapp_id}/instance:
209     get:
210       tags:
211         - rApp Instance
212       summary: Get all instances of rApp
213       operationId: getAllRappInstances
214       parameters:
215         - name: rapp_id
216           in: path
217           required: true
218           schema:
219             type: string
220       responses:
221         '200':
222           description: OK
223           content:
224             '*/*':
225               schema:
226                 type: object
227                 additionalProperties:
228                   $ref: '#/components/schemas/RappInstance'
229         '404':
230           description: Not found
231     post:
232       tags:
233         - rApp Instance
234       summary: Create rApp instance
235       operationId: createRappInstance
236       parameters:
237         - name: rapp_id
238           in: path
239           required: true
240           schema:
241             type: string
242       requestBody:
243         content:
244           application/json:
245             schema:
246               $ref: '#/components/schemas/RappInstance'
247         required: true
248       responses:
249         '200':
250           description: OK
251           content:
252             '*/*':
253               schema:
254                 $ref: '#/components/schemas/RappInstance'
255         '404':
256           description: Not found
257   /rapps:
258     get:
259       tags:
260         - rApp
261       summary: Get All rApps
262       operationId: getRapps
263       responses:
264         '200':
265           description: OK
266           content:
267             '*/*':
268               schema:
269                 type: array
270                 items:
271                   $ref: '#/components/schemas/Rapp'
272 components:
273   schemas:
274     RappPrimeOrder:
275       type: object
276       properties:
277         primeOrder:
278           type: string
279           enum:
280             - PRIME
281             - DEPRIME
282     RappInstanceDeployOrder:
283       type: object
284       properties:
285         deployOrder:
286           type: string
287           enum:
288             - DEPLOY
289             - UNDEPLOY
290     ACMResources:
291       type: object
292       properties:
293         compositionDefinitions:
294           type: string
295         compositionInstances:
296           uniqueItems: true
297           type: array
298           items:
299             type: string
300     DMEResources:
301       type: object
302       properties:
303         producerInfoTypes:
304           uniqueItems: true
305           type: array
306           items:
307             type: string
308         consumerInfoTypes:
309           uniqueItems: true
310           type: array
311           items:
312             type: string
313         infoProducers:
314           uniqueItems: true
315           type: array
316           items:
317             type: string
318         infoConsumers:
319           uniqueItems: true
320           type: array
321           items:
322             type: string
323     Rapp:
324       type: object
325       properties:
326         rappId:
327           type: string
328           format: uuid
329         name:
330           type: string
331         state:
332           type: string
333           enum:
334             - COMMISSIONED
335             - PRIMING
336             - PRIMED
337             - DEPRIMING
338         reason:
339           type: string
340         packageLocation:
341           type: string
342         packageName:
343           type: string
344         rappResources:
345           $ref: '#/components/schemas/RappResources'
346         rappInstances:
347           type: object
348           additionalProperties:
349             $ref: '#/components/schemas/RappInstance'
350         compositionId:
351           type: string
352           format: uuid
353     RappACMInstance:
354       type: object
355       properties:
356         instance:
357           type: string
358         acmInstanceId:
359           type: string
360           format: uuid
361     RappDMEInstance:
362       type: object
363       properties:
364         infoTypesProducer:
365           uniqueItems: true
366           type: array
367           items:
368             type: string
369         infoProducer:
370           type: string
371         infoTypeConsumer:
372           type: string
373         infoConsumer:
374           type: string
375     RappInstance:
376       type: object
377       properties:
378         rappInstanceId:
379           type: string
380           format: uuid
381         state:
382           type: string
383           enum:
384             - DEPLOYED
385             - DEPLOYING
386             - UNDEPLOYED
387             - UNDEPLOYING
388         reason:
389           type: string
390         acm:
391           $ref: '#/components/schemas/RappACMInstance'
392         sme:
393           $ref: '#/components/schemas/RappSMEInstance'
394         dme:
395           $ref: '#/components/schemas/RappDMEInstance'
396     RappResources:
397       type: object
398       properties:
399         acm:
400           $ref: '#/components/schemas/ACMResources'
401         sme:
402           $ref: '#/components/schemas/SMEResources'
403         dme:
404           $ref: '#/components/schemas/DMEResources'
405     RappSMEInstance:
406       type: object
407       properties:
408         providerFunction:
409           type: string
410         providerFunctionIds:
411           type: array
412           items:
413             type: string
414         serviceApis:
415           type: string
416         serviceApiIds:
417           type: array
418           items:
419             type: string
420         invokers:
421           type: string
422         invokerIds:
423           type: array
424           items:
425             type: string
426         aefId:
427           type: string
428         apfId:
429           type: string
430     SMEResources:
431       type: object
432       properties:
433         providerFunctions:
434           uniqueItems: true
435           type: array
436           items:
437             type: string
438         serviceApis:
439           uniqueItems: true
440           type: array
441           items:
442             type: string
443         invokers:
444           uniqueItems: true
445           type: array
446           items:
447             type: string