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