use XappMgrService to replace Catalog and Control
[portal/ric-dashboard.git] / xapp-mgr-client / src / main / resources / xapp_manager_rest_api_v0_1_2.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.2
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   - https
30   - http
31 paths:
32   /health:
33     get:
34       summary: Health check of xApp Manager
35       tags:
36         - health
37       operationId: getHealth
38       responses:
39         '200':
40           description: Status of xApp Manager is ok
41   /xapps:
42     post:
43       summary: Deploy a xapp
44       tags:
45         - xapp
46       operationId: deployXapp
47       consumes:
48         - application/json
49       produces:
50         - application/json
51       parameters:
52         - name: xAppInfo
53           in: body
54           description: xApp information
55           schema:
56             type: object
57             required:
58               - xAppName
59             properties:
60               xAppName:
61                 type: string
62                 description: Name of the xApp
63                 example: xapp-dummy
64       responses:
65         '201':
66           description: xApp successfully created
67           schema:
68             $ref: '#/definitions/Xapp'
69         '400':
70           description: Invalid input
71         '500':
72           description: Internal error
73     get:
74       summary: Returns the status of all xapps
75       tags:
76         - xapp
77       operationId: getAllXapps
78       produces:
79         - application/json
80       responses:
81         '200':
82           description: successful query of xApps
83           schema:
84             $ref: '#/definitions/AllXapps'
85         '500':
86           description: Internal error
87   '/xapps/{xAppName}':
88     get:
89       summary: Returns the status of a given xapp
90       tags:
91         - xapp
92       operationId: getXappByName
93       produces:
94         - application/json
95       parameters:
96         - name: xAppName
97           in: path
98           description: Name of xApp
99           required: true
100           type: string
101       responses:
102         '200':
103           description: successful operation
104           schema:
105             $ref: '#/definitions/Xapp'
106         '400':
107           description: Invalid ID supplied
108         '404':
109           description: Xapp not found
110         '500':
111           description: Internal error
112     delete:
113       summary: Undeploy an existing xapp
114       tags:
115         - xapp
116       operationId: undeployXapp
117       parameters:
118         - name: xAppName
119           in: path
120           description: Xapp to be undeployed
121           required: true
122           type: string
123       responses:
124         '204':
125           description: Successful deletion of xApp
126         '400':
127           description: Invalid xApp name supplied
128         '500':
129           description: Internal error
130   '/xapps/{xAppName}/instances/{xAppInstanceName}':
131     get:
132       summary: Returns the status of a given xapp
133       tags:
134         - xapp
135       operationId: getXappInstanceByName
136       produces:
137         - application/json
138       parameters:
139         - name: xAppName
140           in: path
141           description: Name of xApp
142           required: true
143           type: string
144         - name: xAppInstanceName
145           in: path
146           description: Name of xApp instance to get information
147           required: true
148           type: string
149       responses:
150         '200':
151           description: successful operation
152           schema:
153             $ref: '#/definitions/XappInstance'
154         '400':
155           description: Invalid name supplied
156         '404':
157           description: Xapp not found
158         '500':
159           description: Internal error
160   /config:
161     post:
162       summary: Create xApp config
163       tags:
164         - xapp
165       operationId: createXappConfig
166       consumes:
167         - application/json
168       produces:
169         - application/json
170       parameters:
171         - name: xAppConfig
172           in: body
173           description: xApp config
174           schema:
175             $ref: '#/definitions/xAppConfig'
176       responses:
177         '201':
178           description: xApp config successfully created
179           schema:
180             $ref: '#/definitions/xAppConfig'
181         '400':
182           description: Invalid input
183         '422':
184           description: Validation of configuration failed
185         '500':
186           description: Internal error
187     put:
188       summary: Modify xApp config
189       tags:
190         - xapp
191       operationId: ModifyXappConfig
192       consumes:
193         - application/json
194       produces:
195         - application/json
196       parameters:
197         - name: xAppConfig
198           in: body
199           description: xApp config
200           schema:
201             $ref: '#/definitions/xAppConfig'
202       responses:
203         '200':
204           description: xApp config successfully modified
205           schema:
206             $ref: '#/definitions/xAppConfig'
207         '400':
208           description: Invalid input
209         '422':
210           description: Validation of configuration failed
211         '500':
212           description: Internal error
213     get:
214       summary: Returns the configuration of all xapps
215       tags:
216         - xapp
217       operationId: getAllXappConfig
218       produces:
219         - application/json
220       responses:
221         '200':
222           description: successful query of xApp config
223           schema:
224             $ref: '#/definitions/AllXappConfig'
225         '500':
226           description: Internal error
227     delete:
228       summary: Delete xApp configuration
229       tags:
230         - xapp
231       operationId: deleteXappConfig
232       parameters:
233         - name: xAppConfigInfo
234           in: body
235           description: xApp configuration information
236           schema:
237             $ref: '#/definitions/xAppConfigInfo'
238       responses:
239         '204':
240           description: Successful deletion of xApp
241         '400':
242           description: Invalid parameters supplied
243         '500':
244           description: Internal error
245   /subscriptions:
246     post:
247       summary: Subscribe event
248       tags:
249         - xapp
250         - subscriptions
251       operationId: addSubscription
252       consumes:
253         - application/json
254       produces:
255         - application/json
256       parameters:
257         - name: subscriptionRequest
258           in: body
259           description: New subscription
260           required: true
261           schema:
262             $ref: '#/definitions/subscriptionRequest'
263       responses:
264         '200':
265           description: Subscription successful
266           schema:
267             $ref: '#/definitions/subscriptionResponse'
268         '400':
269           description: Invalid input
270     get:
271       summary: Returns all subscriptions
272       tags:
273         - xapp
274         - subscriptions
275       operationId: getSubscriptions
276       produces:
277         - application/json
278       responses:
279         '200':
280           description: successful query of subscriptions
281           schema:
282             $ref: '#/definitions/allSubscriptions'
283   '/subscriptions/{subscriptionId}':
284     get:
285       summary: Returns the information of subscription
286       tags:
287         - xapp
288         - subscriptions
289       operationId: getSubscriptionById
290       produces:
291         - application/json
292       parameters:
293         - name: subscriptionId
294           in: path
295           description: ID of subscription
296           required: true
297           type: integer
298       responses:
299         '200':
300           description: successful operation
301           schema:
302             $ref: '#/definitions/subscription'
303         '400':
304           description: Invalid ID supplied
305         '404':
306           description: Subscription not found
307     put:
308       summary: Modify event subscription
309       tags:
310         - xapp
311         - subscriptions
312       operationId: modifySubscription
313       consumes:
314         - application/json
315       produces:
316         - application/json
317       parameters:
318         - name: subscriptionId
319           in: path
320           description: ID of subscription
321           required: true
322           type: integer
323         - in: body
324           name: subscriptionRequest
325           description: Modified subscription
326           required: true
327           schema:
328             $ref: '#/definitions/subscriptionRequest'
329       responses:
330         '200':
331           description: Subscription modification successful
332           schema:
333             $ref: '#/definitions/subscriptionResponse'
334         '400':
335           description: Invalid input
336     delete:
337       summary: Unsubscribe event
338       tags:
339         - xapp
340         - subscriptions
341       description: ''
342       operationId: deleteSubscription
343       parameters:
344         - name: subscriptionId
345           in: path
346           description: ID of subscription
347           required: true
348           type: integer
349       responses:
350         '204':
351           description: Successful deletion of subscription
352         '400':
353           description: Invalid subscription supplied
354 definitions:
355   AllXapps:
356     type: array
357     items:
358       $ref: '#/definitions/Xapp'
359   Xapp:
360     type: object
361     required:
362       - name
363     properties:
364       name:
365         type: string
366         example: xapp-dummy
367       status:
368         type: string
369         description: xapp status in the RIC
370         enum:
371           - unknown
372           - deployed
373           - deleted
374           - superseded
375           - failed
376           - deleting
377       version:
378         type: string
379         example: 1.2.3
380       instances:
381         type: array
382         items:
383           $ref: '#/definitions/XappInstance'
384   XappInstance:
385     type: object
386     required:
387       - name
388     properties:
389       name:
390         type: string
391         example: xapp-dummy-6cd577d9-4v255
392       status:
393         type: string
394         description: xapp instance status
395         enum:
396           - pending
397           - running
398           - succeeded
399           - failed
400           - unknown
401           - completed
402           - crashLoopBackOff
403       ip:
404         type: string
405         example: 192.168.0.1
406       port:
407         type: integer
408         example: 32300
409       txMessages:
410         type: array
411         items:
412           type: string
413           example: ControlIndication
414       rxMessages:
415         type: array
416         items:
417           type: string
418           example: LoadIndication
419   xAppConfigInfo:
420     type: object
421     required:
422       - xAppName
423       - configMapName
424       - namespace
425     properties:
426       xAppName:
427         type: string
428         description: Name of the xApp
429         example: xapp-dummy
430       configMapName:
431         type: string
432         description: Name of the config map
433         example: xapp-dummy-config-map
434       namespace:
435         type: string
436         description: Name of the namespace
437         example: ricxapp
438   xAppConfig:
439     type: object
440     required:
441       - xAppConfigInfo
442       - configSchema
443       - configMap
444     properties:
445       xAppConfigInfo:
446         $ref: '#/definitions/xAppConfigInfo'
447       configSchema:
448         type: object
449         description: Schema of configuration in JSON format
450       configMap:
451         type: object
452         description: Configuration in JSON format
453   AllXappConfig:
454     type: array
455     items:
456       $ref: '#/definitions/xAppConfig'
457   subscriptionRequest:
458     type: object
459     required:
460       - targetUrl
461       - eventType
462       - maxRetries
463       - retryTimer
464     properties:
465       targetUrl:
466         type: string
467         example: 'http://localhost:11111/apps/webhook/'
468       eventType:
469         type: string
470         description: Event which is subscribed
471         enum:
472           - created
473           - deleted
474           - all
475       maxRetries:
476         type: integer
477         description: Maximum number of retries
478         example: 11
479       retryTimer:
480         type: integer
481         description: Time in seconds to wait before next retry
482         example: 22
483   subscriptionResponse:
484     type: object
485     properties:
486       id:
487         type: string
488         example: 1ILBltYYzEGzWRrVPZKmuUmhwcc
489       version:
490         type: integer
491         example: 2
492       eventType:
493         type: string
494         description: Event which is subscribed
495         enum:
496           - created
497           - deleted
498           - updated
499           - all
500   allSubscriptions:
501     type: array
502     items:
503       $ref: '#/definitions/subscription'
504   subscription:
505     type: object
506     properties:
507       id:
508         type: string
509         example: 1ILBltYYzEGzWRrVPZKmuUmhwcc
510       targetUrl:
511         type: string
512         example: 'http://localhost:11111/apps/webhook/'
513       eventType:
514         type: string
515         description: Event which is subscribed
516         enum:
517           - created
518           - deleted
519           - updated
520           - all
521       maxRetries:
522         type: integer
523         description: Maximum number of retries
524         example: 11
525       retryTimer:
526         type: integer
527         description: Time in seconds to wait before next retry
528         example: 22
529   subscriptionNotification:
530     type: object
531     properties:
532       id:
533         type: string
534         example: 1ILBltYYzEGzWRrVPZKmuUmhwcc
535       version:
536         type: integer
537         example: 2
538       eventType:
539         type: string
540         description: Event to be notified
541         enum:
542           - created
543           - deleted
544           - updated
545       xApps:
546         $ref: '#/definitions/AllXapps'