28b48f924c84f75314ed2488972f4b9d4dd56a80
[it/dev.git] / 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       - xapp_name
244       type: object
245       properties:
246         xapp_name:
247           type: string
248           description: Name of the xApp chart
249         version:
250           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-]+)*))?$
251           type: string
252           description: Version of the xApp chart
253     error_message:
254       required:
255       - error_message
256       - error_source
257       - status
258       type: object
259       properties:
260         error_source:
261           type: string
262           description: source of the error
263         error_message:
264           type: string
265           description: source of the error
266         status:
267           type: string
268           description: http response message
269     status:
270       required:
271       - status
272       type: object
273       properties:
274         status:
275           type: string
276           description: status of the service
277     descriptor_remote:
278       required:
279       - config-file.json_url
280       type: object
281       properties:
282         config-file.json_url:
283           type: string
284           description: URL to download the config-file.json file
285         controls-schema.json_url:
286           type: string
287           description: URL to download the controls schema.json file
288   responses:
289     MaskError:
290       description: When any error occurs on mask
291       content:
292         application/json:
293           schema:
294             type: object
295     ParseError:
296       description: When a mask can't be parsed
297       content:
298         application/json:
299           schema:
300             type: object