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