REST error codes
[nonrtric.git] / policy-agent / docs / api.yaml
1 swagger: '2.0'
2 info:
3   description: This page lists all the rest apis for the service.
4   version: '1.0'
5   title: A1 Policy management service
6 host: 'localhost:8081'
7 basePath: /
8 tags:
9   - name: A1 Policy Management
10     description: Policy Controller
11   - name: Health check
12     description: Status Controller
13   - name: RIC Repository
14     description: Ric Repository Controller
15   - name: Service registry and supervision
16     description: Service Controller
17   - name: operation-handler
18     description: Operation Handler
19   - name: web-mvc-links-handler
20     description: Web Mvc Links Handler
21 paths:
22   /actuator:
23     get:
24       tags:
25         - web-mvc-links-handler
26       summary: links
27       operationId: linksUsingGET
28       produces:
29         - application/vnd.spring-boot.actuator.v3+json
30         - application/json
31         - application/vnd.spring-boot.actuator.v2+json
32       responses:
33         '200':
34           description: OK
35           schema:
36             type: object
37             additionalProperties:
38               type: object
39               additionalProperties:
40                 $ref: '#/definitions/Link'
41         '401':
42           description: Unauthorized
43         '403':
44           description: Forbidden
45         '404':
46           description: Not Found
47       deprecated: false
48   /actuator/health:
49     get:
50       tags:
51         - operation-handler
52       summary: handle
53       operationId: handleUsingGET_1
54       produces:
55         - application/vnd.spring-boot.actuator.v3+json
56         - application/json
57         - application/vnd.spring-boot.actuator.v2+json
58       parameters:
59         - in: body
60           name: body
61           description: body
62           required: false
63           schema:
64             type: object
65             additionalProperties:
66               type: string
67       responses:
68         '200':
69           description: OK
70           schema:
71             type: object
72         '401':
73           description: Unauthorized
74         '403':
75           description: Forbidden
76         '404':
77           description: Not Found
78       deprecated: false
79   /actuator/health/**:
80     get:
81       tags:
82         - operation-handler
83       summary: handle
84       operationId: handleUsingGET
85       produces:
86         - application/vnd.spring-boot.actuator.v3+json
87         - application/json
88         - application/vnd.spring-boot.actuator.v2+json
89       parameters:
90         - in: body
91           name: body
92           description: body
93           required: false
94           schema:
95             type: object
96             additionalProperties:
97               type: string
98       responses:
99         '200':
100           description: OK
101           schema:
102             type: object
103         '401':
104           description: Unauthorized
105         '403':
106           description: Forbidden
107         '404':
108           description: Not Found
109       deprecated: false
110   /actuator/info:
111     get:
112       tags:
113         - operation-handler
114       summary: handle
115       operationId: handleUsingGET_2
116       produces:
117         - application/vnd.spring-boot.actuator.v3+json
118         - application/json
119         - application/vnd.spring-boot.actuator.v2+json
120       parameters:
121         - in: body
122           name: body
123           description: body
124           required: false
125           schema:
126             type: object
127             additionalProperties:
128               type: string
129       responses:
130         '200':
131           description: OK
132           schema:
133             type: object
134         '401':
135           description: Unauthorized
136         '403':
137           description: Forbidden
138         '404':
139           description: Not Found
140       deprecated: false
141   /actuator/logfile:
142     get:
143       tags:
144         - operation-handler
145       summary: handle
146       operationId: handleUsingGET_3
147       produces:
148         - text/plain;charset=UTF-8
149       parameters:
150         - in: body
151           name: body
152           description: body
153           required: false
154           schema:
155             type: object
156             additionalProperties:
157               type: string
158       responses:
159         '200':
160           description: OK
161           schema:
162             type: object
163         '401':
164           description: Unauthorized
165         '403':
166           description: Forbidden
167         '404':
168           description: Not Found
169       deprecated: false
170   /actuator/loggers:
171     get:
172       tags:
173         - operation-handler
174       summary: handle
175       operationId: handleUsingGET_5
176       produces:
177         - application/vnd.spring-boot.actuator.v3+json
178         - application/json
179         - application/vnd.spring-boot.actuator.v2+json
180       parameters:
181         - in: body
182           name: body
183           description: body
184           required: false
185           schema:
186             type: object
187             additionalProperties:
188               type: string
189       responses:
190         '200':
191           description: OK
192           schema:
193             type: object
194         '401':
195           description: Unauthorized
196         '403':
197           description: Forbidden
198         '404':
199           description: Not Found
200       deprecated: false
201   '/actuator/loggers/{name}':
202     get:
203       tags:
204         - operation-handler
205       summary: handle
206       operationId: handleUsingGET_4
207       produces:
208         - application/vnd.spring-boot.actuator.v3+json
209         - application/json
210         - application/vnd.spring-boot.actuator.v2+json
211       parameters:
212         - in: body
213           name: body
214           description: body
215           required: false
216           schema:
217             type: object
218             additionalProperties:
219               type: string
220       responses:
221         '200':
222           description: OK
223           schema:
224             type: object
225         '401':
226           description: Unauthorized
227         '403':
228           description: Forbidden
229         '404':
230           description: Not Found
231       deprecated: false
232     post:
233       tags:
234         - operation-handler
235       summary: handle
236       operationId: handleUsingPOST
237       consumes:
238         - application/vnd.spring-boot.actuator.v3+json
239         - application/json
240         - application/vnd.spring-boot.actuator.v2+json
241       produces:
242         - '*/*'
243       parameters:
244         - in: body
245           name: body
246           description: body
247           required: false
248           schema:
249             type: object
250             additionalProperties:
251               type: string
252       responses:
253         '200':
254           description: OK
255           schema:
256             type: object
257         '201':
258           description: Created
259         '401':
260           description: Unauthorized
261         '403':
262           description: Forbidden
263         '404':
264           description: Not Found
265       deprecated: false
266   /actuator/metrics:
267     get:
268       tags:
269         - operation-handler
270       summary: handle
271       operationId: handleUsingGET_7
272       produces:
273         - application/vnd.spring-boot.actuator.v3+json
274         - application/json
275         - application/vnd.spring-boot.actuator.v2+json
276       parameters:
277         - in: body
278           name: body
279           description: body
280           required: false
281           schema:
282             type: object
283             additionalProperties:
284               type: string
285       responses:
286         '200':
287           description: OK
288           schema:
289             type: object
290         '401':
291           description: Unauthorized
292         '403':
293           description: Forbidden
294         '404':
295           description: Not Found
296       deprecated: false
297   '/actuator/metrics/{requiredMetricName}':
298     get:
299       tags:
300         - operation-handler
301       summary: handle
302       operationId: handleUsingGET_6
303       produces:
304         - application/vnd.spring-boot.actuator.v3+json
305         - application/json
306         - application/vnd.spring-boot.actuator.v2+json
307       parameters:
308         - in: body
309           name: body
310           description: body
311           required: false
312           schema:
313             type: object
314             additionalProperties:
315               type: string
316       responses:
317         '200':
318           description: OK
319           schema:
320             type: object
321         '401':
322           description: Unauthorized
323         '403':
324           description: Forbidden
325         '404':
326           description: Not Found
327       deprecated: false
328   /policies:
329     get:
330       tags:
331         - A1 Policy Management
332       summary: Query policies
333       operationId: getPoliciesUsingGET
334       produces:
335         - '*/*'
336       parameters:
337         - name: ric
338           in: query
339           description: ric
340           required: false
341           type: string
342         - name: service
343           in: query
344           description: service
345           required: false
346           type: string
347         - name: type
348           in: query
349           description: type
350           required: false
351           type: string
352       responses:
353         '200':
354           description: Policies
355           schema:
356             type: array
357             items:
358               $ref: '#/definitions/PolicyInfo'
359         '401':
360           description: Unauthorized
361         '403':
362           description: Forbidden
363         '404':
364           description: RIC or type not found
365           schema:
366             type: string
367       deprecated: false
368   /policy:
369     get:
370       tags:
371         - A1 Policy Management
372       summary: Returns a policy configuration
373       operationId: getPolicyUsingGET
374       produces:
375         - '*/*'
376       parameters:
377         - name: instance
378           in: query
379           description: instance
380           required: true
381           type: string
382       responses:
383         '200':
384           description: Policy found
385           schema:
386             type: object
387         '401':
388           description: Unauthorized
389         '403':
390           description: Forbidden
391         '404':
392           description: Policy is not found
393       deprecated: false
394     put:
395       tags:
396         - A1 Policy Management
397       summary: Put a policy
398       operationId: putPolicyUsingPUT
399       consumes:
400         - application/json
401       produces:
402         - '*/*'
403       parameters:
404         - name: instance
405           in: query
406           description: instance
407           required: true
408           type: string
409         - in: body
410           name: jsonBody
411           description: jsonBody
412           required: true
413           schema:
414             type: object
415         - name: ric
416           in: query
417           description: ric
418           required: true
419           type: string
420         - name: service
421           in: query
422           description: service
423           required: true
424           type: string
425         - name: type
426           in: query
427           description: type
428           required: true
429           type: string
430       responses:
431         '200':
432           description: Policy updated
433           schema:
434             type: string
435         '201':
436           description: Policy created
437           schema:
438             type: string
439         '401':
440           description: Unauthorized
441         '403':
442           description: Forbidden
443         '404':
444           description: RIC or policy type is not found
445           schema:
446             type: string
447         '405':
448           description: Change is not allowed
449           schema:
450             type: string
451         '423':
452           description: RIC is locked
453           schema:
454             type: string
455       deprecated: false
456     delete:
457       tags:
458         - A1 Policy Management
459       summary: Delete a policy
460       operationId: deletePolicyUsingDELETE
461       produces:
462         - '*/*'
463       parameters:
464         - name: instance
465           in: query
466           description: instance
467           required: true
468           type: string
469       responses:
470         '200':
471           description: OK
472           schema:
473             type: object
474         '204':
475           description: Policy deleted
476           schema:
477             type: object
478         '401':
479           description: Unauthorized
480         '403':
481           description: Forbidden
482         '404':
483           description: Policy is not found
484           schema:
485             type: string
486         '423':
487           description: RIC is locked
488           schema:
489             type: string
490       deprecated: false
491   /policy_schema:
492     get:
493       tags:
494         - A1 Policy Management
495       summary: Returns one policy type schema definition
496       operationId: getPolicySchemaUsingGET
497       produces:
498         - '*/*'
499       parameters:
500         - name: id
501           in: query
502           description: id
503           required: true
504           type: string
505       responses:
506         '200':
507           description: Policy schema
508           schema:
509             type: object
510         '401':
511           description: Unauthorized
512         '403':
513           description: Forbidden
514         '404':
515           description: RIC is not found
516           schema:
517             type: string
518       deprecated: false
519   /policy_schemas:
520     get:
521       tags:
522         - A1 Policy Management
523       summary: Returns policy type schema definitions
524       operationId: getPolicySchemasUsingGET
525       produces:
526         - '*/*'
527       parameters:
528         - name: ric
529           in: query
530           description: ric
531           required: false
532           type: string
533       responses:
534         '200':
535           description: Policy schemas
536           schema:
537             type: array
538             items:
539               type: object
540         '401':
541           description: Unauthorized
542         '403':
543           description: Forbidden
544         '404':
545           description: RIC is not found
546           schema:
547             type: string
548       deprecated: false
549   /policy_status:
550     get:
551       tags:
552         - A1 Policy Management
553       summary: Returns a policy status
554       operationId: getPolicyStatusUsingGET
555       produces:
556         - '*/*'
557       parameters:
558         - name: instance
559           in: query
560           description: instance
561           required: true
562           type: string
563       responses:
564         '200':
565           description: Policy status
566           schema:
567             type: object
568         '401':
569           description: Unauthorized
570         '403':
571           description: Forbidden
572         '404':
573           description: Policy is not found
574           schema:
575             type: string
576       deprecated: false
577   /policy_types:
578     get:
579       tags:
580         - A1 Policy Management
581       summary: Query policy type names
582       operationId: getPolicyTypesUsingGET
583       produces:
584         - '*/*'
585       parameters:
586         - name: ric
587           in: query
588           description: ric
589           required: false
590           type: string
591       responses:
592         '200':
593           description: Policy type names
594           schema:
595             type: array
596             items:
597               type: string
598         '401':
599           description: Unauthorized
600         '403':
601           description: Forbidden
602         '404':
603           description: RIC is not found
604           schema:
605             type: string
606       deprecated: false
607   /ric:
608     get:
609       tags:
610         - RIC Repository
611       summary: Returns the name of a RIC managing one Mananged Element
612       operationId: getRicUsingGET
613       produces:
614         - '*/*'
615       parameters:
616         - name: managedElementId
617           in: query
618           description: managedElementId
619           required: false
620           type: string
621       responses:
622         '200':
623           description: RIC is fond
624           schema:
625             type: string
626         '401':
627           description: Unauthorized
628         '403':
629           description: Forbidden
630         '404':
631           description: RIC is not fond
632           schema:
633             type: string
634       deprecated: false
635   /rics:
636     get:
637       tags:
638         - RIC Repository
639       summary: Query NearRT RIC information
640       operationId: getRicsUsingGET
641       produces:
642         - '*/*'
643       parameters:
644         - name: policyType
645           in: query
646           description: policyType
647           required: false
648           type: string
649       responses:
650         '200':
651           description: OK
652           schema:
653             type: array
654             items:
655               $ref: '#/definitions/RicInfo'
656         '401':
657           description: Unauthorized
658         '403':
659           description: Forbidden
660         '404':
661           description: Policy type is not found
662           schema:
663             type: string
664       deprecated: false
665   /service:
666     put:
667       tags:
668         - Service registry and supervision
669       summary: Register a service
670       operationId: putServiceUsingPUT
671       consumes:
672         - application/json
673       produces:
674         - '*/*'
675       parameters:
676         - in: body
677           name: registrationInfo
678           description: registrationInfo
679           required: true
680           schema:
681             $ref: '#/definitions/ServiceRegistrationInfo'
682       responses:
683         '200':
684           description: OK
685           schema:
686             type: string
687         '201':
688           description: Created
689         '400':
690           description: Cannot parse the ServiceRegistrationInfo
691           schema:
692             type: string
693         '401':
694           description: Unauthorized
695         '403':
696           description: Forbidden
697         '404':
698           description: Not Found
699       deprecated: false
700   /services:
701     get:
702       tags:
703         - Service registry and supervision
704       summary: Returns service information
705       operationId: getServicesUsingGET
706       produces:
707         - '*/*'
708       parameters:
709         - name: name
710           in: query
711           description: name
712           required: false
713           type: string
714       responses:
715         '200':
716           description: OK
717           schema:
718             type: array
719             items:
720               $ref: '#/definitions/ServiceStatus'
721         '401':
722           description: Unauthorized
723         '403':
724           description: Forbidden
725         '404':
726           description: Service is not found
727           schema:
728             type: string
729       deprecated: false
730     delete:
731       tags:
732         - Service registry and supervision
733       summary: Delete a service
734       operationId: deleteServiceUsingDELETE
735       produces:
736         - '*/*'
737       parameters:
738         - name: name
739           in: query
740           description: name
741           required: true
742           type: string
743       responses:
744         '200':
745           description: OK
746           schema:
747             type: string
748         '204':
749           description: OK
750           schema:
751             type: string
752         '401':
753           description: Unauthorized
754         '403':
755           description: Forbidden
756         '404':
757           description: Service not found
758           schema:
759             type: string
760       deprecated: false
761   /services/keepalive:
762     post:
763       tags:
764         - Service registry and supervision
765       summary: Keep the policies alive for a service
766       operationId: keepAliveServiceUsingPOST
767       consumes:
768         - application/json
769       produces:
770         - '*/*'
771       parameters:
772         - name: name
773           in: query
774           description: name
775           required: true
776           type: string
777       responses:
778         '200':
779           description: Policies timeout supervision refreshed
780           schema:
781             type: string
782         '201':
783           description: Created
784         '401':
785           description: Unauthorized
786         '403':
787           description: Forbidden
788         '404':
789           description: 'The service is not found, needs re-registration'
790       deprecated: false
791   /status:
792     get:
793       tags:
794         - Health check
795       summary: Returns status and statistics of this service
796       operationId: getStatusUsingGET
797       produces:
798         - '*/*'
799       responses:
800         '200':
801           description: Service is living
802           schema:
803             type: string
804         '401':
805           description: Unauthorized
806         '403':
807           description: Forbidden
808         '404':
809           description: Not Found
810       deprecated: false
811 definitions:
812   Link:
813     type: object
814     properties:
815       href:
816         type: string
817       templated:
818         type: boolean
819     title: Link
820   'Map«string,Link»':
821     type: object
822     title: 'Map«string,Link»'
823     additionalProperties:
824       $ref: '#/definitions/Link'
825   Mono«ResponseEntity«object»»:
826     type: object
827     title: Mono«ResponseEntity«object»»
828   Mono«ResponseEntity«string»»:
829     type: object
830     title: Mono«ResponseEntity«string»»
831   PolicyInfo:
832     type: object
833     properties:
834       id:
835         type: string
836         description: identity of the policy
837       json:
838         type: object
839         description: the configuration of the policy
840       lastModified:
841         type: string
842         description: 'timestamp, last modification time'
843       ric:
844         type: string
845         description: identity the target NearRT RIC
846       service:
847         type: string
848         description: the name of the service owning the policy
849       type:
850         type: string
851         description: name of the policy type
852     title: PolicyInfo
853   RicInfo:
854     type: object
855     properties:
856       managedElementIds:
857         type: array
858         description: O1 identities for managed entities
859         items:
860           type: string
861       policyTypes:
862         type: array
863         description: supported policy types
864         items:
865           type: string
866       ricName:
867         type: string
868         description: identity of the ric
869     title: RicInfo
870   ServiceRegistrationInfo:
871     type: object
872     properties:
873       callbackUrl:
874         type: string
875         description: callback for notifying of RIC recovery
876       keepAliveIntervalSeconds:
877         type: integer
878         format: int64
879         description: keep alive interval for policies owned by the service. 0 means no timeout supervision. Polcies that are not refreshed within this time are removed
880       serviceName:
881         type: string
882         description: identity of the service
883     title: ServiceRegistrationInfo
884   ServiceStatus:
885     type: object
886     properties:
887       callbackUrl:
888         type: string
889         description: callback for notifying of RIC recovery
890       keepAliveIntervalSeconds:
891         type: integer
892         format: int64
893         description: policy keep alive timeout
894       serviceName:
895         type: string
896         description: identity of the service
897       timeSincePingSeconds:
898         type: integer
899         format: int64
900         description: time since last invocation by the service
901     title: ServiceStatus
902