Upgrade App Manager API spec to v0.1.7
[portal/ric-dashboard.git] / app-mgr-client / src / main / resources / api_appmgr_rest_api_0.1.7.yaml
1 # ========================LICENSE_START=================================
2 # O-RAN-SC
3 #
4 # Copyright (C) 2019 AT&T Intellectual Property and Nokia
5 #
6 # Licensed under the Apache License, Version 2.0 (the "License");
7 # you may not use this file except in compliance with the License.
8 # You may obtain a copy of the License at
9 #
10 #      http://www.apache.org/licenses/LICENSE-2.0
11 #
12 # Unless required by applicable law or agreed to in writing, software
13 # distributed under the License is distributed on an "AS IS" BASIS,
14 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 # See the License for the specific language governing permissions and
16 # limitations under the License.
17 # ========================LICENSE_END===================================
18 swagger: '2.0'
19 info:
20   description: This is a draft API for RIC appmgr
21   version: 0.1.7
22   title: RIC appmgr
23   license:
24     name: Apache 2.0
25     url: 'http://www.apache.org/licenses/LICENSE-2.0.html'
26 host: hostname
27 basePath: /ric/v1
28 schemes:
29   - http
30 paths:
31   /health/alive :
32     get :
33       summary     : Health check of xApp Manager - Liveness probe
34       tags        :
35         - health
36       operationId : getHealthAlive
37       responses   :
38         '200' :
39           description : Status of xApp Manager is ok
40   /health/ready :
41     get :
42       summary     : Readiness check of xApp Manager - Readiness probe
43       tags        :
44         - health
45       operationId : getHealthReady
46       responses   :
47         '200':
48           description : xApp Manager is ready for service
49         '503':
50           description: xApp Manager is not ready for service
51   /xapps:
52     post:
53       summary: Deploy a xapp
54       tags:
55         - xapp
56       operationId: deployXapp
57       consumes:
58         - application/json
59       produces:
60         - application/json
61       parameters:
62         - name: xAppInfo
63           in: body
64           description: xApp information
65           schema:
66             type: object
67             required:
68               - name
69             properties:
70               name:
71                 type: string
72                 description: Name of the xApp.
73                 example: xapp-dummy
74               configName:
75                 type: string
76                 description: Name of the xApp configmap. Overrides the value given in Helm chart value file.
77                 example: xapp-dummy-configmap
78               namespace:
79                 type: string
80                 description: Name of the namespace to which xApp is deployed. Overrides the value given in Helm chart value file.
81                 example: ricxapps
82               serviceName:
83                 type: string
84                 description: Name of the service xApp is providing. Overrides the value given in Helm chart value file.
85                 example: xapp-dummy-service
86               imageRepo:
87                 type: string
88                 description: Name of the docker repository xApp is located. Overrides the value given in Helm chart value file.
89                 example: xapprepo
90               hostname:
91                 type: string
92                 description: Hostname for the pod. Used by messaging library. Overrides the value given in Helm chart value file.
93                 example: xapp-dummy
94       responses:
95         '201':
96           description: xApp successfully created
97           schema:
98             $ref: '#/definitions/Xapp'
99         '400':
100           description: Invalid input
101         '500':
102           description: Internal error
103     get:
104       summary: Returns the status of all xapps
105       tags:
106         - xapp
107       operationId: getAllXapps
108       produces:
109         - application/json
110       responses:
111         '200':
112           description: successful query of xApps
113           schema:
114             $ref: '#/definitions/AllDeployedXapps'
115         '500':
116           description: Internal error
117   '/xapps/search':
118     get:
119       summary: Returns the list of all deployable xapps
120       tags:
121         - xapp
122       operationId: listAllDeployableXapps
123       produces:
124         - application/json
125       responses:
126         '200':
127           description: successful list of deployable xApps
128           schema:
129             $ref: '#/definitions/AllDeployableXapps'
130         '500':
131           description: Internal error
132   '/xapps/{xAppName}':
133     get:
134       summary: Returns the status of a given xapp
135       tags:
136         - xapp
137       operationId: getXappByName
138       produces:
139         - application/json
140       parameters:
141         - name: xAppName
142           in: path
143           description: Name of xApp
144           required: true
145           type: string
146       responses:
147         '200':
148           description: successful operation
149           schema:
150             $ref: '#/definitions/Xapp'
151         '400':
152           description: Invalid ID supplied
153         '404':
154           description: Xapp not found
155         '500':
156           description: Internal error
157     delete:
158       summary: Undeploy an existing xapp
159       tags:
160         - xapp
161       operationId: undeployXapp
162       parameters:
163         - name: xAppName
164           in: path
165           description: Xapp to be undeployed
166           required: true
167           type: string
168       responses:
169         '204':
170           description: Successful deletion of xApp
171         '400':
172           description: Invalid xApp name supplied
173         '500':
174           description: Internal error
175   '/xapps/{xAppName}/instances/{xAppInstanceName}':
176     get:
177       summary: Returns the status of a given xapp
178       tags:
179         - xapp
180       operationId: getXappInstanceByName
181       produces:
182         - application/json
183       parameters:
184         - name: xAppName
185           in: path
186           description: Name of xApp
187           required: true
188           type: string
189         - name: xAppInstanceName
190           in: path
191           description: Name of xApp instance to get information
192           required: true
193           type: string
194       responses:
195         '200':
196           description: successful operation
197           schema:
198             $ref: '#/definitions/XappInstance'
199         '400':
200           description: Invalid name supplied
201         '404':
202           description: Xapp not found
203         '500':
204           description: Internal error
205   /config:
206     post:
207       summary: Create xApp config
208       tags:
209         - xapp
210       operationId: createXappConfig
211       consumes:
212         - application/json
213       produces:
214         - application/json
215       parameters:
216         - name: XAppConfig
217           in: body
218           description: xApp config
219           schema:
220             $ref: '#/definitions/XAppConfig'
221       responses:
222         '201':
223           description: xApp config successfully created
224           schema:
225             $ref: '#/definitions/XAppConfig'
226         '400':
227           description: Invalid input
228         '422':
229           description: Validation of configuration failed
230         '500':
231           description: Internal error
232     put:
233       summary: Modify xApp config
234       tags:
235         - xapp
236       operationId: ModifyXappConfig
237       consumes:
238         - application/json
239       produces:
240         - application/json
241       parameters:
242         - name: XAppConfig
243           in: body
244           description: xApp config
245           schema:
246             $ref: '#/definitions/XAppConfig'
247       responses:
248         '200':
249           description: xApp config successfully modified
250           schema:
251             $ref: '#/definitions/XAppConfig'
252         '400':
253           description: Invalid input
254         '422':
255           description: Validation of configuration failed
256         '500':
257           description: Internal error
258     get:
259       summary: Returns the configuration of all xapps
260       tags:
261         - xapp
262       operationId: getAllXappConfig
263       produces:
264         - application/json
265       responses:
266         '200':
267           description: successful query of xApp config
268           schema:
269             $ref: '#/definitions/AllXappConfig'
270         '500':
271           description: Internal error
272     delete:
273       summary: Delete xApp configuration
274       tags:
275         - xapp
276       operationId: deleteXappConfig
277       parameters:
278         - name: ConfigMetadata
279           in: body
280           description: xApp configuration information
281           schema:
282             $ref: '#/definitions/ConfigMetadata'
283       responses:
284         '204':
285           description: Successful deletion of xApp config
286         '400':
287           description: Invalid parameters supplied
288         '500':
289           description: Internal error
290   /subscriptions:
291     post:
292       summary: Subscribe event
293       tags:
294         - xapp
295         - subscriptions
296       operationId: addSubscription
297       consumes:
298         - application/json
299       produces:
300         - application/json
301       parameters:
302         - name: subscriptionRequest
303           in: body
304           description: New subscription
305           required: true
306           schema:
307             $ref: '#/definitions/subscriptionRequest'
308       responses:
309         '201':
310           description: Subscription successfully created
311           schema:
312             $ref: '#/definitions/subscriptionResponse'
313         '400':
314           description: Invalid input
315     get:
316       summary: Returns all subscriptions
317       tags:
318         - xapp
319         - subscriptions
320       operationId: getSubscriptions
321       produces:
322         - application/json
323       responses:
324         '200':
325           description: successful query of subscriptions
326           schema:
327             $ref: '#/definitions/allSubscriptions'
328   '/subscriptions/{subscriptionId}':
329     get:
330       summary: Returns the information of subscription
331       tags:
332         - xapp
333         - subscriptions
334       operationId: getSubscriptionById
335       produces:
336         - application/json
337       parameters:
338         - name: subscriptionId
339           in: path
340           description: ID of subscription
341           required: true
342           type: string
343       responses:
344         '200':
345           description: successful operation
346           schema:
347             $ref: '#/definitions/subscription'
348         '400':
349           description: Invalid ID supplied
350         '404':
351           description: Subscription not found
352     put:
353       summary: Modify event subscription
354       tags:
355         - xapp
356         - subscriptions
357       operationId: modifySubscription
358       consumes:
359         - application/json
360       produces:
361         - application/json
362       parameters:
363         - name: subscriptionId
364           in: path
365           description: ID of subscription
366           required: true
367           type: string
368         - in: body
369           name: subscriptionRequest
370           description: Modified subscription
371           required: true
372           schema:
373             $ref: '#/definitions/subscriptionRequest'
374       responses:
375         '200':
376           description: Subscription modification successful
377           schema:
378             $ref: '#/definitions/subscriptionResponse'
379         '400':
380           description: Invalid input
381     delete:
382       summary: Unsubscribe event
383       tags:
384         - xapp
385         - subscriptions
386       description: ''
387       operationId: deleteSubscription
388       parameters:
389         - name: subscriptionId
390           in: path
391           description: ID of subscription
392           required: true
393           type: string
394       responses:
395         '204':
396           description: Successful deletion of subscription
397         '400':
398           description: Invalid subscription supplied
399 definitions:
400   AllDeployableXapps:
401     type: array
402     items:
403       type: string
404       example: "xapp-dummy"
405   AllDeployedXapps:
406     type: array
407     items:
408       $ref: '#/definitions/Xapp'
409   Xapp:
410     type: object
411     required:
412       - name
413     properties:
414       name:
415         type: string
416         example: xapp-dummy
417       status:
418         type: string
419         description: xapp status in the RIC
420         enum:
421           - unknown
422           - deployed
423           - deleted
424           - superseded
425           - failed
426           - deleting
427       version:
428         type: string
429         example: 1.2.3
430       instances:
431         type: array
432         items:
433           $ref: '#/definitions/XappInstance'
434   XappInstance:
435     type: object
436     required:
437       - name
438     properties:
439       name:
440         type: string
441         example: xapp-dummy-6cd577d9-4v255
442       status:
443         type: string
444         description: xapp instance status
445         enum:
446           - pending
447           - running
448           - succeeded
449           - failed
450           - unknown
451           - completed
452           - crashLoopBackOff
453       ip:
454         type: string
455         example: 192.168.0.1
456       port:
457         type: integer
458         example: 32300
459       txMessages:
460         type: array
461         items:
462           type: string
463           example: ControlIndication
464       rxMessages:
465         type: array
466         items:
467           type: string
468           example: LoadIndication
469   ConfigMetadata:
470     type: object
471     required:
472       - name
473       - configName
474       - namespace
475     properties:
476       name:
477         type: string
478         description: Name of the xApp
479         example: xapp-dummy
480       configName:
481         type: string
482         description: Name of the config map
483         example: xapp-dummy-config-map
484       namespace:
485         type: string
486         description: Name of the namespace
487         example: ricxapp
488   XAppConfig:
489     type: object
490     required:
491       - metadata
492       - descriptor
493       - config
494     properties:
495       metadata:
496         $ref: '#/definitions/ConfigMetadata'
497       descriptor:
498         type: object
499         description: Schema of configuration in JSON format
500       config:
501         type: object
502         description: Configuration in JSON format
503   AllXappConfig:
504     type: array
505     items:
506       $ref: '#/definitions/XAppConfig'
507   subscriptionRequest:
508     type: object
509     required:
510       - targetUrl
511       - eventType
512       - maxRetries
513       - retryTimer
514     properties:
515       targetUrl:
516         type: string
517         example: 'http://localhost:11111/apps/webhook/'
518       eventType:
519         type: string
520         description: Event which is subscribed
521         enum:
522           - created
523           - deleted
524           - all
525       maxRetries:
526         type: integer
527         description: Maximum number of retries
528         example: 11
529       retryTimer:
530         type: integer
531         description: Time in seconds to wait before next retry
532         example: 22
533   subscriptionResponse:
534     type: object
535     properties:
536       id:
537         type: string
538         example: 1ILBltYYzEGzWRrVPZKmuUmhwcc
539       version:
540         type: integer
541         example: 2
542       eventType:
543         type: string
544         description: Event which is subscribed
545         enum:
546           - created
547           - deleted
548           - updated
549           - all
550   allSubscriptions:
551     type: array
552     items:
553       $ref: '#/definitions/subscription'
554   subscription:
555     type: object
556     properties:
557       id:
558         type: string
559         example: 1ILBltYYzEGzWRrVPZKmuUmhwcc
560       targetUrl:
561         type: string
562         example: 'http://localhost:11111/apps/webhook/'
563       eventType:
564         type: string
565         description: Event which is subscribed
566         enum:
567           - created
568           - deleted
569           - updated
570           - all
571       maxRetries:
572         type: integer
573         description: Maximum number of retries
574         example: 11
575       retryTimer:
576         type: integer
577         description: Time in seconds to wait before next retry
578         example: 22
579   subscriptionNotification:
580     type: object
581     properties:
582       id:
583         type: string
584         example: 1ILBltYYzEGzWRrVPZKmuUmhwcc
585       version:
586         type: integer
587         example: 2
588       eventType:
589         type: string
590         description: Event to be notified
591         enum:
592           - created
593           - deleted
594           - updated
595       xApps:
596         $ref: '#/definitions/AllDeployedXapps'