Add Http Response Code in A1 Controller Api
[nonrtric.git] / dashboard / a1-controller-client / src / main / resources / a1_controller_0.1.0.yaml
1 # ==================================================================================
2 #       Copyright (c) 2019 Nordix Foundation.
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.0
17 info:
18   version: 1.0.0
19   title: RIC A1
20 paths:
21   '/A1-ADAPTER-API:getNearRT-RICs':
22     post:
23       description: >
24         Get a list of all nearRT-RICs
25       tags:
26         - A1 Controller
27       operationId: a1.controller.get_all_nearrt_rics
28       responses:
29         '200':
30           description: >
31             Successfully got the response.
32           content:
33             application/json:
34               schema:
35                 "$ref": "#/components/schemas/output_NRRids_list_code_schema"
36
37   '/A1-ADAPTER-API:getHealthCheck':
38     post:
39       description: >
40         Get health status for a Near-RT-RIC. true - health ok, false - health is not ok.
41       tags:
42         - A1 Controller
43       operationId: a1.controller.get_healthcheck
44       requestBody:
45         required: true
46         content:
47           application/json:
48             schema:
49               "$ref": "#/components/schemas/input_NRRid_schema"
50       responses:
51         '200':
52           description: >
53             Successfully got the response.
54           content:
55             application/json:
56               schema:
57                 "$ref": "#/components/schemas/output_healthstatus_code_schema"
58
59   '/A1-ADAPTER-API:getPolicyTypes':
60     post:
61       description: >
62         Get a list of all registered policy-type-ids.
63       tags:
64         - A1 Controller
65       operationId: a1.controller.get_all_policy_types
66       requestBody:
67         required: true
68         content:
69           application/json:
70             schema:
71               "$ref": "#/components/schemas/input_NRRid_schema"
72       responses:
73         '200':
74           description: >
75             Successfully got the response.
76           content:
77             application/json:
78               schema:
79                 "$ref": "#/components/schemas/output_PTids_list_code_schema"
80
81   '/A1-ADAPTER-API:createPolicyType':
82     post:
83       description: >
84         Create a policy type.
85       tags:
86         - A1 Controller
87       operationId: a1.controller.create_policy_type
88       requestBody:
89         required: true
90         content:
91           application/json:
92             schema:
93               "$ref": "#/components/schemas/input_NRRid_PTid_desc_name_PT_schema"
94       responses:
95         '200':
96           description: >
97             Successfully got the response.
98           content:
99             application/json:
100               schema:
101                 "$ref": "#/components/schemas/output_code_schema"
102
103   '/A1-ADAPTER-API:getPolicyType':
104     post:
105       description: >
106         Get a policy type.
107       tags:
108         - A1 Controller
109       operationId: a1.controller.get_policy_type
110       requestBody:
111         required: true
112         content:
113           application/json:
114             schema:
115               "$ref": "#/components/schemas/input_NRRid_PTid_schema"
116       responses:
117         '200':
118           description: >
119             Successfully got the response.
120           content:
121             application/json:
122               schema:
123                 "$ref": "#/components/schemas/output_desc_name_PT_code_schema"
124
125   '/A1-ADAPTER-API:deletePolicyType':
126     post:
127       description: >
128         Delete a policy type.
129       tags:
130         - A1 Controller
131       operationId: a1.controller.delete_policy_type
132       requestBody:
133         required: true
134         content:
135           application/json:
136             schema:
137               "$ref": "#/components/schemas/input_NRRid_PTid_schema"
138       responses:
139         '200':
140           description: >
141             Successfully got the response.
142           content:
143             application/json:
144               schema:
145                 "$ref": "#/components/schemas/output_code_schema"
146
147   '/A1-ADAPTER-API:getPolicyInstances':
148     post:
149       description: >
150         Get a list of all policy-instance-ids for this policy-type-id.
151       tags:
152         - A1 Controller
153       operationId: a1.controller.get_all_instances_for_type
154       requestBody:
155         required: true
156         content:
157           application/json:
158             schema:
159               "$ref": "#/components/schemas/input_NRRid_PTid_schema"
160       responses:
161         '200':
162           description: >
163             Successfully got the response.
164           content:
165             application/json:
166               schema:
167                 "$ref": "#/components/schemas/output_PIids_list_code_schema"
168
169   '/A1-ADAPTER-API:createPolicyInstance':
170     post:
171       description: >
172         Create a policy instance.
173       tags:
174         - A1 Controller
175       operationId: a1.controller.create_policy_instance
176       requestBody:
177         required: true
178         content:
179           application/json:
180             schema:
181               "$ref": "#/components/schemas/input_NRRid_PTid_PIid_PI_schema"
182       responses:
183         '200':
184           description: >
185             Successfully got the response.
186           content:
187             application/json:
188               schema:
189                 "$ref": "#/components/schemas/output_code_schema"
190
191   '/A1-ADAPTER-API:getPolicyInstance':
192     post:
193       description: >
194         Get a policy instance.
195       tags:
196         - A1 Controller
197       operationId: a1.controller.get_policy_instance
198       requestBody:
199         required: true
200         content:
201           application/json:
202             schema:
203               "$ref": "#/components/schemas/input_NRRid_PTid_PIid_schema"
204       responses:
205         '200':
206           description: >
207             Successfully got the response.
208           content:
209             application/json:
210               schema:
211                 "$ref": "#/components/schemas/output_PI_code_schema"
212
213   '/A1-ADAPTER-API:deletePolicyInstance':
214     post:
215       description: >
216         Delete a policy instance.
217       tags:
218         - A1 Controller
219       operationId: a1.controller.delete_policy_instance
220       requestBody:
221         required: true
222         content:
223           application/json:
224             schema:
225               "$ref": "#/components/schemas/input_NRRid_PTid_PIid_schema"
226       responses:
227         '200':
228           description: >
229             Successfully got the response.
230           content:
231             application/json:
232               schema:
233                 "$ref": "#/components/schemas/output_code_schema"
234
235   '/A1-ADAPTER-API:getStatus':
236     post:
237       description: >
238         Get the status for a policy instance.
239       tags:
240         - A1 Controller
241       operationId: a1.controller.get_policy_instance_status
242       requestBody:
243         required: true
244         content:
245           application/json:
246             schema:
247               "$ref": "#/components/schemas/input_NRRid_PTid_PIid_schema"
248       responses:
249         '200':
250           description: >
251             Successfully got the response.
252           content:
253             application/json:
254               schema:
255                 "$ref": "#/components/schemas/output_status_code_schema"
256
257 components:
258   schemas:
259     input_NRRid_schema:
260       type: object
261       required:
262       - input
263       additionalProperties: false
264       properties:
265         input:
266           type: object
267           required:
268           - near-rt-ric-id
269           additionalProperties: false
270           properties:
271             near-rt-ric-id:
272               "$ref": "#/components/schemas/near_rt_ric_id"
273
274     input_NRRid_PTid_schema:
275       type: object
276       required:
277       - input
278       additionalProperties: false
279       properties:
280         input:
281           type: object
282           required:
283           - near-rt-ric-id
284           - policy-type-id
285           additionalProperties: false
286           properties:
287             near-rt-ric-id:
288               "$ref": "#/components/schemas/near_rt_ric_id"
289             policy-type-id:
290               "$ref": "#/components/schemas/policy_type_id"
291
292     input_NRRid_PTid_PIid_schema:
293       type: object
294       required:
295       - input
296       additionalProperties: false
297       properties:
298         input:
299           type: object
300           required:
301           - near-rt-ric-id
302           - policy-type-id
303           - policy-instance-id
304           additionalProperties: false
305           properties:
306             near-rt-ric-id:
307               "$ref": "#/components/schemas/near_rt_ric_id"
308             policy-type-id:
309               "$ref": "#/components/schemas/policy_type_id"
310             policy-instance-id:
311               "$ref": "#/components/schemas/policy_instance_id"
312
313     input_NRRid_PTid_PIid_PI_schema:
314       type: object
315       required:
316       - input
317       additionalProperties: false
318       properties:
319         input:
320           type: object
321           required:
322           - near-rt-ric-id
323           - policy-type-id
324           - policy-instance-id
325           - policy-instance
326           additionalProperties: false
327           properties:
328             near-rt-ric-id:
329               "$ref": "#/components/schemas/near_rt_ric_id"
330             policy-type-id:
331               "$ref": "#/components/schemas/policy_type_id"
332             policy-instance-id:
333               "$ref": "#/components/schemas/policy_instance_id"
334             policy-instance:
335               "$ref": "#/components/schemas/policy_instance"
336
337     input_NRRid_PTid_desc_name_PT_schema:
338       type: object
339       required:
340       - input
341       additionalProperties: false
342       properties:
343         input:
344           type: object
345           required:
346           - near-rt-ric-id
347           - policy-type-id
348           - description
349           - name
350           - policy-type
351           additionalProperties: false
352           properties:
353             near-rt-ric-id:
354               "$ref": "#/components/schemas/near_rt_ric_id"
355             policy-type-id:
356               "$ref": "#/components/schemas/policy_type_id"
357             description:
358               type: string
359             name:
360               type: string
361             policy-type:
362               "$ref": "#/components/schemas/policy_type"
363
364     output_NRRids_list_code_schema:
365       type: object
366       required:
367       - output
368       additionalProperties: false
369       properties:
370         output:
371           type: object
372           required:
373           - near-rt-ric-id-list
374           - code
375           additionalProperties: false
376           properties:
377             near-rt-ric-id-list:
378               type: array
379               items:
380                 "$ref": "#/components/schemas/near_rt_ric_id"
381             code:
382               type: string
383
384     output_healthstatus_code_schema:
385       type: object
386       required:
387       - output
388       additionalProperties: false
389       properties:
390         output:
391           type: object
392           required:
393           - health-status
394           - code
395           additionalProperties: false
396           properties:
397             health-status:
398               type: boolean
399             code:
400               type: string
401
402     output_desc_name_PT_code_schema:
403       type: object
404       required:
405       - output
406       additionalProperties: false
407       properties:
408         output:
409           type: object
410           required:
411           - description
412           - name
413           - policy_type
414           - code
415           additionalProperties: false
416           properties:
417             description:
418               type: string
419             name:
420               type: string
421             policy-type:
422               "$ref": "#/components/schemas/policy_type"
423             code:
424               type: string
425
426     output_PTids_list_code_schema:
427       type: object
428       required:
429       - output
430       additionalProperties: false
431       properties:
432         output:
433           type: object
434           required:
435           - policy-type-id-list
436           - code
437           additionalProperties: false
438           properties:
439             policy-type-id-list:
440               type: array
441               items:
442                 "$ref": "#/components/schemas/policy_type_id"
443             code:
444               type: string
445
446     output_PIids_list_code_schema:
447       type: object
448       required:
449       - output
450       additionalProperties: false
451       properties:
452         output:
453           type: object
454           required:
455           - policy-instance-id-list
456           - code
457           additionalProperties: false
458           properties:
459             policy-instance-id-list:
460               type: array
461               items:
462                 "$ref": "#/components/schemas/policy_instance_id"
463             code:
464               type: string
465
466     output_PI_code_schema:
467       type: object
468       required:
469       - output
470       additionalProperties: false
471       properties:
472         output:
473           type: object
474           required:
475           - policy-instance
476           - code
477           additionalProperties: false
478           properties:
479             policy-instance:
480               "$ref": "#/components/schemas/policy_instance"
481             code:
482               type: string
483
484     output_code_schema:
485       type: object
486       required:
487       - output
488       additionalProperties: false
489       properties:
490         output:
491           type: object
492           required:
493           - code
494           additionalProperties: false
495           properties:
496             code:
497               type: string
498
499     output_status_code_schema:
500       type: object
501       required:
502       - output
503       additionalProperties: false
504       properties:
505         output:
506           type: object
507           required:
508           - status
509           - code
510           additionalProperties: false
511           properties:
512             status:
513               type: string
514             code:
515               type: string
516
517     near_rt_ric_id:
518       description: >
519         represents a near RT RIC identifier. Currently this can be any string.
520       type: string
521       example: near-rt-ric-1
522
523     policy_type_id:
524       description: >
525         represents a policy type identifier. Currently this is an integer.
526       type: integer
527       example: 20000
528
529     policy_instance_id:
530       description: >
531         represents a policy instance identifier. UUIDs are advisable but can be any string
532       type: string
533       example: 3d2157af-6a8f-4a7c-810f-38c2f824bf12
534
535     policy_type:
536       description: >
537         represents a policy type. String is used for now to represent this
538       type: string
539       example:
540         "{type: A}"
541
542     policy_instance:
543       description: >
544         represents a policy instance. String is used for now to represent this
545       type: string
546       example:
547         "{slice_id: slice-1, priority_level: high}"
548
549   securitySchemes:
550     basicAuth:
551       type: http
552       scheme: basic
553
554 security:
555   - basicAuth: []