Implement get the charts by name and version
[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       parameters:
132         - in: path
133           name: xApp_name
134           required: true
135           type: string
136         - in: path
137           name: version
138           required: true
139           type: string
140       responses:
141         '200':
142           description: Get helm chart details OK
143           schema:
144             type: object
145         '500':
146           description: Get helm chart details failed
147           schema:
148             $ref: '#/definitions/error_message'
149       tags:
150         - charts
151       operationId: get_charts_fetcher
152       summary: get the helm chart for the specified xApp and version
153   '/charts/xApp/{xApp_name}/ver/{version}/values.yaml':
154     get:
155       produces:
156         - application/json
157         - text/json
158       parameters:
159         - in: path
160           name: xApp_name
161           required: true
162           type: string
163         - in: path
164           name: version
165           required: true
166           type: string
167       responses:
168         '200':
169           description: Get helm chart values.yaml OK
170           schema:
171             type: object
172         '500':
173           description: Get helm chart values.yaml failed
174           schema:
175             $ref: '#/definitions/error_message'
176       tags:
177         - charts
178       description: yaml file of the specified xApp and version.
179       operationId: get_values_yaml_fetcher
180       summary: Returns the helm values
181   /deploy:
182     delete:
183       consumes:
184         - application/json
185       produces:
186         - application/json
187       parameters:
188         - description: Input for the xApp deploy
189           in: body
190           name: body
191           required: true
192           schema:
193             $ref: '#/definitions/deleteDeploymentDesc'
194       responses:
195         '201':
196           description: successful un-deploy xApp
197           schema:
198             type: object
199         '501':
200           description: un-deployment failed
201           schema:
202             $ref: '#/definitions/error_message'
203       tags:
204         - deploy
205       summary: Undeploy xApp
206     post:
207       consumes:
208         - application/json
209       produces:
210         - application/json
211       parameters:
212         - description: Input for the xApp deployment
213           in: body
214           name: body
215           required: true
216           schema:
217             $ref: '#/definitions/deploymentDesc'
218       responses:
219         '201':
220           description: successful deployment of xApp
221           schema:
222             type: object
223         '501':
224           description: deployment failed
225           schema:
226             $ref: '#/definitions/error_message'
227       tags:
228         - deploy
229       summary: deploy xApp
230     put:
231       consumes:
232         - application/json
233       produces:
234         - application/json
235       parameters:
236         - description: Input for the xApp deploy
237           in: body
238           name: body
239           required: true
240           schema:
241             $ref: '#/definitions/updateDeploymentDesc'
242       responses:
243         '201':
244           description: successful updated xApp
245           schema:
246             type: object
247         '501':
248           description: un-deployment failed
249           schema:
250             $ref: '#/definitions/error_message'
251       tags:
252         - deploy
253       summary: update xApp
254   /health:
255     get:
256       produces:
257         - application/json
258       parameters: []
259       responses:
260         '200':
261           description: Health check OK
262           schema:
263             $ref: '#/definitions/status'
264         '500':
265           description: ric-dms is not ready
266           schema:
267             $ref: '#/definitions/error_message'
268       tags:
269         - health
270       operationId: get_health_check
271       summary: Returns the health condition of ric dms
272   '/healthcheck/xApp/{xApp_name}/namespace/{namespace}':
273     get:
274       produces:
275         - application/json
276       parameters:
277         - in: path
278           name: xApp_name
279           required: true
280           type: string
281         - in: path
282           name: namespace
283           required: true
284           type: string
285       responses:
286         '200':
287           description: Health check OK
288           schema:
289             $ref: '#/definitions/status'
290         '500':
291           description: xApp onboarder is not ready
292           schema:
293             $ref: '#/definitions/error_message'
294       tags:
295         - health
296       summary: Return status of xApp deployment
297   /onboarder:
298     delete:
299       consumes:
300         - application/json
301       produces:
302         - application/json
303       parameters:
304         - in: body
305           name: body
306           schema:
307             properties:
308               appname:
309                 type: string
310               version:
311                 type: string
312             required:
313               - appname
314             type: object
315       responses:
316         '201':
317           description: xApp onboard successfully.
318           schema:
319             $ref: '#/definitions/status'
320         '400':
321           description: xApp descriptor format error
322           schema:
323             $ref: '#/definitions/error_message'
324         '500':
325           description: xApp onboarder is not ready
326           schema:
327             $ref: '#/definitions/error_message'
328       tags:
329         - onboard
330       operationId: delete_onboardx_apps
331       summary: offload xApp using the xApp name and version
332       x-codegen-request-body-name: payload
333     post:
334       consumes:
335         - application/json
336       produces:
337         - application/json
338       parameters:
339         - in: body
340           name: body
341           required: true
342           schema:
343             $ref: '#/definitions/descriptor'
344       responses:
345         '201':
346           description: xApp onboard successfully.
347           schema:
348             $ref: '#/definitions/status'
349         '400':
350           description: xApp descriptor format error
351           schema:
352             $ref: '#/definitions/error_message'
353         '500':
354           description: xApp onboarder is not ready
355           schema:
356             $ref: '#/definitions/error_message'
357       tags:
358         - onboard
359       operationId: post_onboardx_apps
360       summary: >-
361         Onboard xApp using the xApp descriptor and schema or URL of descriptor
362         and schema.
363       x-codegen-request-body-name: payload
364 definitions:
365   deleteDeploymentDesc:
366     properties:
367       namespace:
368         description: namespace to deploy xApp
369         type: string
370       version:
371         type: string
372       xAppname:
373         type: string
374     required:
375       - xAppname
376       - version
377     type: object
378   deploymentDesc:
379     properties:
380       namespace:
381         description: namespace to deploy xApp
382         type: string
383       overridefile:
384         description: override file
385         type: string
386       version:
387         type: string
388       xAppname:
389         type: string
390     required:
391       - namespace
392     type: object
393   descriptor:
394     properties:
395       config:
396         description: represents content of config file for xApp onboarding.
397         type: object
398       config-file_url:
399         description: specify url of config-file.
400         type: string
401       schema:
402         description: represents conent of schema file for xApp onboarding.
403         type: object
404       schema-file_url:
405         description: specify url of schema-file.
406         type: string
407     type: object
408   error_message:
409     properties:
410       error_message:
411         description: source of the error
412         type: string
413       error_source:
414         description: source of the error
415         type: string
416       status:
417         description: http response message
418         type: string
419     required:
420       - error_message
421       - error_source
422       - status
423     type: object
424   name:
425     properties:
426       property:
427         type: integer
428     type: object
429   status:
430     properties:
431       status:
432         description: status of the service
433         type: string
434     required:
435       - status
436     type: object
437   updateDeploymentDesc:
438     properties:
439       namespace:
440         description: namespace to deploy xApp
441         type: string
442       newVersion:
443         type: string
444       oldVersion:
445         type: string
446       operation:
447         enum:
448           - rollback
449           - upgrade
450         type: string
451       xAppname:
452         type: string
453     required:
454       - namespace
455     type: object
456 tags:
457   - description: onboard xApps
458     name: onboard
459   - description: health check
460     name: health
461   - description: Managing helm charts
462     name: charts
463   - description: Managing deployment
464     name: deploy
465 x-components: {}