RIC-769: Committing individual files rather than tar archive
[ric-plt/appmgr.git] / xapp_orchestrater / dev / xapp_onboarder / xapp_onboarder / xapp-onboarder-api.yaml
1 # ==================================================================================
2 #       Copyright (c) 2020 AT&T Intellectual Property.
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 openapi: 3.0.1
17 info:
18   title: RIC xApp onboarder API
19   description: APIs to manage the xApp helm charts
20   version: "1.0"
21 servers:
22 - url: /api/v1
23 tags:
24 - name: onboard
25   description: onboard xApps
26 - name: health
27   description: health check
28 - name: charts
29   description: Managing helm charts
30 paths:
31   /charts:
32     get:
33       tags:
34       - charts
35       summary: Returns the list of xApp helm charts that have been onboarded
36       operationId: get_charts_list
37       responses:
38         200:
39           description: Get helm chart list OK
40           content:
41             application/json:
42               schema:
43                 type: object
44         500:
45           description: Get helm chart list failed
46           content:
47             application/json:
48               schema:
49                 $ref: '#/components/schemas/error_message'
50
51   /charts/xapp/{xapp_chart_name}:
52     get:
53       tags:
54       - charts
55       summary: Returns the helm chart for the specified xApp
56       operationId: get_version_list
57       parameters:
58       - name: xapp_chart_name
59         in: path
60         required: true
61         schema:
62           type: string
63       responses:
64         200:
65           description: Get helm chart OK
66           content:
67             application/json:
68               schema:
69                 type: object
70         500:
71           description: Get helm chart failed
72           content:
73             application/json:
74               schema:
75                 $ref: '#/components/schemas/error_message'
76
77   /charts/xapp/{xapp_chart_name}/ver/{version}:
78     get:
79       tags:
80       - charts
81       summary: Returns the helm chart for the specified xApp and version
82       operationId: get_charts_fetcher
83       parameters:
84       - name: xapp_chart_name
85         in: path
86         required: true
87         schema:
88           type: string
89       - name: version
90         in: path
91         required: true
92         schema:
93           type: string
94       responses:
95         200:
96           description: Get helm chart package OK
97           content:
98             application/json:
99               schema:
100                 type: object
101         500:
102           description: Get helm chart package failed
103           content:
104             application/gzip:
105               schema:
106                 $ref: '#/components/schemas/error_message'
107
108   /charts/xapp/{xapp_chart_name}/ver/{version}/values.yaml:
109     get:
110       tags:
111       - charts
112       summary: Returns the helm values
113       description: yaml file of the specified xApp and version.
114       operationId: get_values_yaml_fetcher
115       parameters:
116       - name: xapp_chart_name
117         in: path
118         required: true
119         schema:
120           type: string
121       - name: version
122         in: path
123         required: true
124         schema:
125           type: string
126       responses:
127         200:
128           description: Get helm chart values.yaml OK
129           content:
130             application/json:
131               schema:
132                 type: object
133         500:
134           description: Get helm chart values.yaml failed
135           content:
136             text/x-yaml:
137               schema:
138                 $ref: '#/components/schemas/error_message'
139
140   /health:
141     get:
142       tags:
143       - health
144       summary: Returns the health condition of the xApp onboarder
145       operationId: get_health_check
146       responses:
147         200:
148           description: Health check OK
149           content:
150             application/json:
151               schema:
152                 $ref: '#/components/schemas/status'
153         500:
154           description: xApp onboarder is not ready
155           content:
156             application/json:
157               schema:
158                 $ref: '#/components/schemas/error_message'
159
160   /onboard:
161     post:
162       tags:
163       - onboard
164       summary: Onboard xApp using the xApp descriptor and schema in the request body
165       operationId: post_onboardx_apps
166       requestBody:
167         content:
168           application/json:
169             schema:
170               $ref: '#/components/schemas/descriptor'
171         required: true
172       responses:
173         201:
174           description: xApp onboard successfully.
175           content:
176             application/json:
177               schema:
178                 $ref: '#/components/schemas/status'
179         400:
180           description: xApp descriptor format error
181           content:
182             application/json:
183               schema:
184                 $ref: '#/components/schemas/error_message'
185         500:
186           description: xApp onboarder is not ready
187           content:
188             application/json:
189               schema:
190                 $ref: '#/components/schemas/error_message'
191       x-codegen-request-body-name: payload
192
193   /onboard/download:
194     post:
195       tags:
196       - onboard
197       summary: Onboard xApp after downloading the xApp descriptor and schema from
198         the URLs
199       operationId: post_onboardx_apps_download
200       requestBody:
201         content:
202           application/json:
203             schema:
204               $ref: '#/components/schemas/descriptor_remote'
205         required: true
206       responses:
207         201:
208           description: xApp onboard successfully.
209           content:
210             application/json:
211               schema:
212                 $ref: '#/components/schemas/status'
213         400:
214           description: xApp descriptor format error
215           content:
216             application/json:
217               schema:
218                 $ref: '#/components/schemas/error_message'
219         500:
220           description: xApp onboarder is not ready
221           content:
222             application/json:
223               schema:
224                 $ref: '#/components/schemas/error_message'
225       x-codegen-request-body-name: payload
226
227 components:
228   schemas:
229     descriptor:
230       required:
231       - config-file.json
232       type: object
233       properties:
234         config-file.json:
235           $ref: '#/components/schemas/config'
236         controls-schema.json:
237           type: object
238           properties: {}
239           description: Controls schema file body
240     config:
241       required:
242       - version
243       - name
244       - containers
245       type: object
246       properties:
247         name:
248           type: string
249           description: Name of the xApp chart
250         version:
251           pattern: ^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$
252           type: string
253           description: Version of the xApp chart
254         containers:
255           type: object
256           properties: {}
257           description: list of containers that the xApp will run
258         controls:
259           type: object
260           properties: {}
261           description: internal configuration of the xApp
262         metrics:
263           type: object
264           properties: {}
265           description: metrics provided by the xApp
266         messaging:
267           type: object
268           properties: {}
269           description: communication ports for each containers
270         livenessProbe:
271           type: object
272           properties: {}
273           description: liveness probe
274         readinessProbe:
275           type: object
276           properties: {}
277           description: readiness probe
278         rmr:
279           type: object
280           properties: {}
281           description: rmr info          
282     error_message:
283       required:
284       - error_message
285       - error_source
286       - status
287       type: object
288       properties:
289         error_source:
290           type: string
291           description: source of the error
292         error_message:
293           type: string
294           description: source of the error
295         status:
296           type: string
297           description: http response message
298     status:
299       required:
300       - status
301       type: object
302       properties:
303         status:
304           type: string
305           description: status of the service
306     descriptor_remote:
307       required:
308       - config-file.json_url
309       type: object
310       properties:
311         config-file.json_url:
312           type: string
313           description: URL to download the config-file.json file
314         controls-schema.json_url:
315           type: string
316           description: URL to download the controls schema.json file
317   responses:
318     MaskError:
319       description: When any error occurs on mask
320       content:
321         application/json:
322           schema:
323             type: object
324     ParseError:
325       description: When a mask can't be parsed
326       content:
327         application/json:
328           schema:
329             type: object