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