Merge "Add installation mode to use snapshot image"
[nonrtric/plt/rappmanager.git] / openapi / rappmanager / rappmanager-spec.json
1 {
2   "openapi": "3.0.1",
3   "info": {
4     "title": "rApp Manager",
5     "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.",
6     "license": {
7       "name": "Copyright (C) 2023 OpenInfra Foundation Europe. Licensed under the Apache License.",
8       "url": "http://www.apache.org/licenses/LICENSE-2.0"
9     },
10     "version": "1.0"
11   },
12   "servers": [
13     {
14       "url": "/"
15     }
16   ],
17   "tags": [
18     {
19       "name": "rApp",
20       "description": "API for rApps"
21     },
22     {
23       "name": "rApp Instance",
24       "description": "API for rApp Instances"
25     }
26   ],
27   "paths": {
28     "/rapps/{rapp_id}": {
29       "get": {
30         "tags": [
31           "rApp"
32         ],
33         "summary": "Get specific rApp details",
34         "operationId": "getRapp",
35         "parameters": [
36           {
37             "name": "rapp_id",
38             "in": "path",
39             "required": true,
40             "schema": {
41               "type": "string"
42             }
43           }
44         ],
45         "responses": {
46           "200": {
47             "description": "OK",
48             "content": {
49               "*/*": {
50                 "schema": {
51                   "$ref": "#/components/schemas/Rapp"
52                 }
53               }
54             }
55           },
56           "404": {
57             "description": "Not found"
58           }
59         }
60       },
61       "put": {
62         "tags": [
63           "rApp"
64         ],
65         "summary": "Prime/Deprime rApp",
66         "operationId": "primeRapp",
67         "parameters": [
68           {
69             "name": "rapp_id",
70             "in": "path",
71             "required": true,
72             "schema": {
73               "type": "string"
74             }
75           }
76         ],
77         "requestBody": {
78           "content": {
79             "application/json": {
80               "schema": {
81                 "$ref": "#/components/schemas/RappPrimeOrder"
82               }
83             }
84           },
85           "required": true
86         },
87         "responses": {
88           "200": {
89             "description": "OK"
90           },
91           "400": {
92             "description": "Bad Request"
93           },
94           "404": {
95             "description": "Not found"
96           },
97           "502": {
98             "description": "Bad Gateway"
99           }
100         }
101       },
102       "post": {
103         "tags": [
104           "rApp"
105         ],
106         "summary": "Create rApp",
107         "operationId": "createRapp",
108         "parameters": [
109           {
110             "name": "rapp_id",
111             "in": "path",
112             "required": true,
113             "schema": {
114               "type": "string"
115             }
116           }
117         ],
118         "requestBody": {
119           "content": {
120             "multipart/form-data": {
121               "schema": {
122                 "type": "object",
123                 "properties": {
124                   "file": {
125                     "type": "string",
126                     "format": "binary"
127                   }
128                 }
129               }
130             }
131           },
132           "required": true
133         },
134         "responses": {
135           "202": {
136             "description": "Accepted"
137           },
138           "400": {
139             "description": "Bad Request"
140           }
141         }
142       },
143       "delete": {
144         "tags": [
145           "rApp"
146         ],
147         "summary": "Delete rApp",
148         "operationId": "deleteRapp",
149         "parameters": [
150           {
151             "name": "rapp_id",
152             "in": "path",
153             "required": true,
154             "schema": {
155               "type": "string"
156             }
157           }
158         ],
159         "responses": {
160           "200": {
161             "description": "OK"
162           },
163           "400": {
164             "description": "Bad Request"
165           },
166           "404": {
167             "description": "Not found"
168           }
169         }
170       }
171     },
172     "/rapps/{rapp_id}/instance/{rapp_instance_id}": {
173       "get": {
174         "tags": [
175           "rApp Instance"
176         ],
177         "summary": "Get specific rApp instance details",
178         "operationId": "getRappInstance",
179         "parameters": [
180           {
181             "name": "rapp_id",
182             "in": "path",
183             "required": true,
184             "schema": {
185               "type": "string"
186             }
187           },
188           {
189             "name": "rapp_instance_id",
190             "in": "path",
191             "required": true,
192             "schema": {
193               "type": "string",
194               "format": "uuid"
195             }
196           }
197         ],
198         "responses": {
199           "200": {
200             "description": "OK",
201             "content": {
202               "*/*": {
203                 "schema": {
204                   "$ref": "#/components/schemas/RappInstance"
205                 }
206               }
207             }
208           },
209           "404": {
210             "description": "Not found"
211           }
212         }
213       },
214       "put": {
215         "tags": [
216           "rApp Instance"
217         ],
218         "summary": "Deploy/Undeploy rApp instance",
219         "operationId": "deployRappInstance",
220         "parameters": [
221           {
222             "name": "rapp_id",
223             "in": "path",
224             "required": true,
225             "schema": {
226               "type": "string"
227             }
228           },
229           {
230             "name": "rapp_instance_id",
231             "in": "path",
232             "required": true,
233             "schema": {
234               "type": "string",
235               "format": "uuid"
236             }
237           }
238         ],
239         "requestBody": {
240           "content": {
241             "application/json": {
242               "schema": {
243                 "$ref": "#/components/schemas/RappInstanceDeployOrder"
244               }
245             }
246           },
247           "required": true
248         },
249         "responses": {
250           "200": {
251             "description": "OK"
252           },
253           "400": {
254             "description": "Bad Request"
255           },
256           "404": {
257             "description": "Not found"
258           },
259           "502": {
260             "description": "Bad Gateway"
261           }
262         }
263       },
264       "delete": {
265         "tags": [
266           "rApp Instance"
267         ],
268         "summary": "Delete rApp instance",
269         "operationId": "deleteRappInstance",
270         "parameters": [
271           {
272             "name": "rapp_id",
273             "in": "path",
274             "required": true,
275             "schema": {
276               "type": "string"
277             }
278           },
279           {
280             "name": "rapp_instance_id",
281             "in": "path",
282             "required": true,
283             "schema": {
284               "type": "string",
285               "format": "uuid"
286             }
287           }
288         ],
289         "responses": {
290           "200": {
291             "description": "OK"
292           },
293           "404": {
294             "description": "Not found"
295           }
296         }
297       }
298     },
299     "/rapps/{rapp_id}/instance": {
300       "get": {
301         "tags": [
302           "rApp Instance"
303         ],
304         "summary": "Get all instances of rApp",
305         "operationId": "getAllRappInstances",
306         "parameters": [
307           {
308             "name": "rapp_id",
309             "in": "path",
310             "required": true,
311             "schema": {
312               "type": "string"
313             }
314           }
315         ],
316         "responses": {
317           "200": {
318             "description": "OK",
319             "content": {
320               "*/*": {
321                 "schema": {
322                   "type": "object",
323                   "additionalProperties": {
324                     "$ref": "#/components/schemas/RappInstance"
325                   }
326                 }
327               }
328             }
329           },
330           "404": {
331             "description": "Not found"
332           }
333         }
334       },
335       "post": {
336         "tags": [
337           "rApp Instance"
338         ],
339         "summary": "Create rApp instance",
340         "operationId": "createRappInstance",
341         "parameters": [
342           {
343             "name": "rapp_id",
344             "in": "path",
345             "required": true,
346             "schema": {
347               "type": "string"
348             }
349           }
350         ],
351         "requestBody": {
352           "content": {
353             "application/json": {
354               "schema": {
355                 "$ref": "#/components/schemas/RappInstance"
356               }
357             }
358           },
359           "required": true
360         },
361         "responses": {
362           "200": {
363             "description": "OK",
364             "content": {
365               "*/*": {
366                 "schema": {
367                   "$ref": "#/components/schemas/RappInstance"
368                 }
369               }
370             }
371           },
372           "404": {
373             "description": "Not found"
374           }
375         }
376       }
377     },
378     "/rapps": {
379       "get": {
380         "tags": [
381           "rApp"
382         ],
383         "summary": "Get All rApps",
384         "operationId": "getRapps",
385         "responses": {
386           "200": {
387             "description": "OK",
388             "content": {
389               "*/*": {
390                 "schema": {
391                   "type": "array",
392                   "items": {
393                     "$ref": "#/components/schemas/Rapp"
394                   }
395                 }
396               }
397             }
398           }
399         }
400       }
401     }
402   },
403   "components": {
404     "schemas": {
405       "RappPrimeOrder": {
406         "type": "object",
407         "properties": {
408           "primeOrder": {
409             "type": "string",
410             "enum": [
411               "PRIME",
412               "DEPRIME"
413             ]
414           }
415         }
416       },
417       "RappInstanceDeployOrder": {
418         "type": "object",
419         "properties": {
420           "deployOrder": {
421             "type": "string",
422             "enum": [
423               "DEPLOY",
424               "UNDEPLOY"
425             ]
426           }
427         }
428       },
429       "ACMResources": {
430         "type": "object",
431         "properties": {
432           "compositionDefinitions": {
433             "type": "string"
434           },
435           "compositionInstances": {
436             "uniqueItems": true,
437             "type": "array",
438             "items": {
439               "type": "string"
440             }
441           }
442         }
443       },
444       "DMEResources": {
445         "type": "object",
446         "properties": {
447           "producerInfoTypes": {
448             "uniqueItems": true,
449             "type": "array",
450             "items": {
451               "type": "string"
452             }
453           },
454           "consumerInfoTypes": {
455             "uniqueItems": true,
456             "type": "array",
457             "items": {
458               "type": "string"
459             }
460           },
461           "infoProducers": {
462             "uniqueItems": true,
463             "type": "array",
464             "items": {
465               "type": "string"
466             }
467           },
468           "infoConsumers": {
469             "uniqueItems": true,
470             "type": "array",
471             "items": {
472               "type": "string"
473             }
474           }
475         }
476       },
477       "Rapp": {
478         "type": "object",
479         "properties": {
480           "rappId": {
481             "type": "string",
482             "format": "uuid"
483           },
484           "name": {
485             "type": "string"
486           },
487           "state": {
488             "type": "string",
489             "enum": [
490               "COMMISSIONED",
491               "PRIMING",
492               "PRIMED",
493               "DEPRIMING"
494             ]
495           },
496           "reason": {
497             "type": "string"
498           },
499           "packageLocation": {
500             "type": "string"
501           },
502           "packageName": {
503             "type": "string"
504           },
505           "rappResources": {
506             "$ref": "#/components/schemas/RappResources"
507           },
508           "rappInstances": {
509             "type": "object",
510             "additionalProperties": {
511               "$ref": "#/components/schemas/RappInstance"
512             }
513           },
514           "compositionId": {
515             "type": "string",
516             "format": "uuid"
517           }
518         }
519       },
520       "RappACMInstance": {
521         "type": "object",
522         "properties": {
523           "instance": {
524             "type": "string"
525           },
526           "acmInstanceId": {
527             "type": "string",
528             "format": "uuid"
529           }
530         }
531       },
532       "RappDMEInstance": {
533         "type": "object",
534         "properties": {
535           "infoTypesProducer": {
536             "uniqueItems": true,
537             "type": "array",
538             "items": {
539               "type": "string"
540             }
541           },
542           "infoProducer": {
543             "type": "string"
544           },
545           "infoTypeConsumer": {
546             "type": "string"
547           },
548           "infoConsumer": {
549             "type": "string"
550           }
551         }
552       },
553       "RappInstance": {
554         "type": "object",
555         "properties": {
556           "rappInstanceId": {
557             "type": "string",
558             "format": "uuid"
559           },
560           "state": {
561             "type": "string",
562             "enum": [
563               "DEPLOYED",
564               "DEPLOYING",
565               "UNDEPLOYED",
566               "UNDEPLOYING"
567             ]
568           },
569           "reason": {
570             "type": "string"
571           },
572           "acm": {
573             "$ref": "#/components/schemas/RappACMInstance"
574           },
575           "sme": {
576             "$ref": "#/components/schemas/RappSMEInstance"
577           },
578           "dme": {
579             "$ref": "#/components/schemas/RappDMEInstance"
580           }
581         }
582       },
583       "RappResources": {
584         "type": "object",
585         "properties": {
586           "acm": {
587             "$ref": "#/components/schemas/ACMResources"
588           },
589           "sme": {
590             "$ref": "#/components/schemas/SMEResources"
591           },
592           "dme": {
593             "$ref": "#/components/schemas/DMEResources"
594           }
595         }
596       },
597       "RappSMEInstance": {
598         "type": "object",
599         "properties": {
600           "providerFunction": {
601             "type": "string"
602           },
603           "providerFunctionIds": {
604             "type": "array",
605             "items": {
606               "type": "string"
607             }
608           },
609           "serviceApis": {
610             "type": "string"
611           },
612           "serviceApiIds": {
613             "type": "array",
614             "items": {
615               "type": "string"
616             }
617           },
618           "invokers": {
619             "type": "string"
620           },
621           "invokerIds": {
622             "type": "array",
623             "items": {
624               "type": "string"
625             }
626           },
627           "aefId": {
628             "type": "string"
629           },
630           "apfId": {
631             "type": "string"
632           }
633         }
634       },
635       "SMEResources": {
636         "type": "object",
637         "properties": {
638           "providerFunctions": {
639             "uniqueItems": true,
640             "type": "array",
641             "items": {
642               "type": "string"
643             }
644           },
645           "serviceApis": {
646             "uniqueItems": true,
647             "type": "array",
648             "items": {
649               "type": "string"
650             }
651           },
652           "invokers": {
653             "uniqueItems": true,
654             "type": "array",
655             "items": {
656               "type": "string"
657             }
658           }
659         }
660       }
661     }
662   }
663 }