Add API for custom onboard
[ric-plt/ricdms.git] / api / ric-dms-api-2.0.yaml
1 # ==================================================================================
2 #   Copyright (c) 2022 Samsung.
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 #
16 #   This source code is part of the near-RT RIC (RAN Intelligent Controller)
17 #   platform project (RICP).
18 # ==================================================================================
19
20 swagger: '2.0'
21 info:
22   description: APIs for RIC-DMS
23   title: RIC DMS
24   version: '1.0'
25 basePath: /api/v1
26 host: localhost:8000
27 schemes:
28   - http
29 paths:
30   /custom-onboard:
31     post:
32       summary: upload a file
33       consumes:
34         - multipart/form-data
35       parameters:
36         - in: formData
37           name: upfile
38           type: file
39           description: api to upload file
40       responses:
41         '200':
42           description: successfully uploaded
43       tags:
44         - experiment
45   /charts:
46     get:
47       produces:
48         - application/json
49       parameters: []
50       responses:
51         '200':
52           description: Get helm chart list
53           schema:
54             type: object
55         '500':
56           description: Get helm chart list failed
57           schema:
58             $ref: '#/definitions/error_message'
59       tags:
60         - charts
61       operationId: get_charts_list
62       summary: Returns the list of xApp helm charts that have been onboarded
63   '/charts/xApp/download/{xApp_name}/ver/{version}':
64     get:
65       produces:
66         - application/zip
67       parameters:
68         - in: path
69           name: xApp_name
70           required: true
71           type: string
72         - in: path
73           name: version
74           required: true
75           type: string
76       responses:
77         '200':
78           description: Download helm chart OK
79           schema:
80             type: file
81         '500':
82           description: Get helm chart values.yaml failed
83           schema:
84             $ref: '#/definitions/error_message'
85       tags:
86         - charts
87       description: Download helm chart.
88       operationId: download_helm_chart
89       summary: Download helm chart
90   '/charts/xApp/{xApp_name}':
91     get:
92       produces:
93         - application/json
94       parameters:
95         - in: path
96           name: xApp_name
97           required: true
98           type: string
99       responses:
100         '200':
101           description: Get helm chart
102           schema:
103             type: array
104             items:
105               type: object
106         '500':
107           description: Get helm chart failed
108           schema:
109             $ref: '#/definitions/error_message'
110       tags:
111         - charts
112       operationId: get_chart
113       summary: Returns the helm chart for the specified xApp
114   '/charts/xApp/{xApp_name}/ver/{version}':
115     delete:
116       produces:
117         - application/json
118         - application/gzip
119       parameters:
120         - in: path
121           name: xApp_name
122           required: true
123           type: string
124         - in: path
125           name: version
126           required: true
127           type: string
128       responses:
129         '200':
130           description: Deleted specified helm chart
131           schema:
132             type: object
133         '500':
134           description: Delete helm chart failed
135           schema:
136             $ref: '#/definitions/error_message'
137       tags:
138         - charts
139       operationId: delete_chart
140       summary: Delete helm chart for the specified xApp and version
141     get:
142       produces:
143         - application/json
144       parameters:
145         - in: path
146           name: xApp_name
147           required: true
148           type: string
149         - in: path
150           name: version
151           required: true
152           type: string
153       responses:
154         '200':
155           description: Get helm chart details OK
156           schema:
157             type: object
158         '500':
159           description: Get helm chart details failed
160           schema:
161             $ref: '#/definitions/error_message'
162       tags:
163         - charts
164       operationId: get_charts_fetcher
165       summary: get the helm chart for the specified xApp and version
166   '/charts/xApp/{xApp_name}/ver/{version}/values.yaml':
167     get:
168       produces:
169         - application/json
170         - text/json
171       parameters:
172         - in: path
173           name: xApp_name
174           required: true
175           type: string
176         - in: path
177           name: version
178           required: true
179           type: string
180       responses:
181         '200':
182           description: Get helm chart values.yaml OK
183           schema:
184             type: object
185         '500':
186           description: Get helm chart values.yaml failed
187           schema:
188             $ref: '#/definitions/error_message'
189       tags:
190         - charts
191       description: yaml file of the specified xApp and version.
192       operationId: get_values_yaml_fetcher
193       summary: Returns the helm values
194   /deploy:
195     delete:
196       consumes:
197         - application/json
198       produces:
199         - application/json
200       parameters:
201         - description: Input for the xApp deploy
202           in: body
203           name: body
204           required: true
205           schema:
206             $ref: '#/definitions/deleteDeploymentDesc'
207       responses:
208         '201':
209           description: successful un-deploy xApp
210           schema:
211             type: object
212         '500':
213           description: un-deployment failed
214           schema:
215             $ref: '#/definitions/error_message'
216       tags:
217         - deploy
218       summary: Undeploy xApp
219     post:
220       consumes:
221         - application/json
222       produces:
223         - application/json
224       parameters:
225         - description: Input for the xApp deployment
226           in: body
227           name: body
228           required: true
229           schema:
230             $ref: '#/definitions/deploymentDesc'
231       responses:
232         '201':
233           description: successful deployment of xApp
234           schema:
235             type: object
236         '500':
237           description: deployment failed
238           schema:
239             $ref: '#/definitions/error_message'
240       tags:
241         - deploy
242       summary: deploy xApp
243     put:
244       consumes:
245         - application/json
246       produces:
247         - application/json
248       parameters:
249         - description: Input for the xApp deploy
250           in: body
251           name: body
252           required: true
253           schema:
254             $ref: '#/definitions/updateDeploymentDesc'
255       responses:
256         '201':
257           description: successful updated xApp
258           schema:
259             type: object
260         '501':
261           description: un-deployment failed
262           schema:
263             $ref: '#/definitions/error_message'
264       tags:
265         - deploy
266       summary: update xApp
267   /health:
268     get:
269       produces:
270         - application/json
271       parameters: []
272       responses:
273         '200':
274           description: Health check OK
275           schema:
276             $ref: '#/definitions/status'
277         '500':
278           description: ric-dms is not ready
279           schema:
280             $ref: '#/definitions/error_message'
281       tags:
282         - health
283       operationId: get_health_check
284       summary: Returns the health condition of ric dms
285   '/healthcheck/xApp/{xApp_name}/namespace/{namespace}':
286     get:
287       produces:
288         - application/json
289       parameters:
290         - in: path
291           name: xApp_name
292           required: true
293           type: string
294         - in: path
295           name: namespace
296           required: true
297           type: string
298       responses:
299         '200':
300           description: Health check OK
301           schema:
302             $ref: '#/definitions/status'
303         '500':
304           description: xApp onboarder is not ready
305           schema:
306             $ref: '#/definitions/error_message'
307       tags:
308         - health
309       summary: Return status of xApp deployment
310   /onboarder:
311     delete:
312       consumes:
313         - application/json
314       produces:
315         - application/json
316       parameters:
317         - in: body
318           name: body
319           schema:
320             properties:
321               appname:
322                 type: string
323               version:
324                 type: string
325             required:
326               - appname
327             type: object
328       responses:
329         '201':
330           description: xApp onboard successfully.
331           schema:
332             $ref: '#/definitions/status'
333         '400':
334           description: xApp descriptor format error
335           schema:
336             $ref: '#/definitions/error_message'
337         '500':
338           description: xApp onboarder is not ready
339           schema:
340             $ref: '#/definitions/error_message'
341       tags:
342         - onboard
343       operationId: delete_onboardx_apps
344       summary: offload xApp using the xApp name and version
345       x-codegen-request-body-name: payload
346     post:
347       consumes:
348         - application/json
349       produces:
350         - application/json
351       parameters:
352         - in: body
353           name: body
354           required: true
355           schema:
356             $ref: '#/definitions/descriptor'
357       responses:
358         '201':
359           description: xApp onboard successfully.
360           schema:
361             $ref: '#/definitions/status'
362         '400':
363           description: xApp descriptor format error
364           schema:
365             $ref: '#/definitions/error_message'
366         '500':
367           description: xApp onboarder is not ready
368           schema:
369             $ref: '#/definitions/error_message'
370       tags:
371         - onboard
372       operationId: post_onboardx_apps
373       summary: >-
374         Onboard xApp using the xApp descriptor and schema or URL of descriptor
375         and schema.
376       x-codegen-request-body-name: payload
377 definitions:
378   deleteDeploymentDesc:
379     properties:
380       namespace:
381         description: namespace to deploy xApp
382         type: string
383       version:
384         type: string
385       xAppname:
386         type: string
387     required:
388       - xAppname
389       - version
390     type: object
391   deploymentDesc:
392     properties:
393       namespace:
394         description: namespace to deploy xApp
395         type: string
396       overridefile:
397         description: override file
398         type: string
399       version:
400         type: string
401       xAppname:
402         type: string
403     required:
404       - namespace
405     type: object
406   descriptor:
407     properties:
408       config:
409         description: represents content of config file for xApp onboarding.
410         type: object
411       config-file_url:
412         description: specify url of config-file.
413         type: string
414       schema:
415         description: represents conent of schema file for xApp onboarding.
416         type: object
417       schema-file_url:
418         description: specify url of schema-file.
419         type: string
420     type: object
421   error_message:
422     properties:
423       error_message:
424         description: source of the error
425         type: string
426       error_source:
427         description: source of the error
428         type: string
429       status:
430         description: http response message
431         type: string
432     required:
433       - error_message
434       - error_source
435       - status
436     type: object
437   name:
438     properties:
439       property:
440         type: integer
441     type: object
442   status:
443     properties:
444       status:
445         description: status of the service
446         type: string
447     required:
448       - status
449     type: object
450   updateDeploymentDesc:
451     properties:
452       namespace:
453         description: namespace to deploy xApp
454         type: string
455       newVersion:
456         type: string
457       oldVersion:
458         type: string
459       operation:
460         enum:
461           - rollback
462           - upgrade
463         type: string
464       xAppname:
465         type: string
466     required:
467       - namespace
468     type: object
469 tags:
470   - description: onboard xApps
471     name: onboard
472   - description: health check
473     name: health
474   - description: Managing helm charts
475     name: charts
476   - description: Managing deployment
477     name: deploy
478 x-components: {}