Updating ONAP A1PMS version & Change to OpenAPI-first
[nonrtric/plt/a1policymanagementservice.git] / docs / offeredapis / swagger / pms-api.yaml
1 #  ============LICENSE_START=======================================================
2 #  Copyright (C) 2020-2023 Nordix Foundation
3 #  Copyright (C) 2023-2024 OpenInfra Foundation Europe. All rights reserved.
4 #  Modifications Copyright (C) 2021 Pantheon.tech
5 #  Modifications Copyright (C) 2021 Bell Canada
6 #  ================================================================================
7 #  Licensed under the Apache License, Version 2.0 (the "License");
8 #  you may not use this file except in compliance with the License.
9 #  You may obtain a copy of the License at
10 #
11 #        http://www.apache.org/licenses/LICENSE-2.0
12 #
13 #  Unless required by applicable law or agreed to in writing, software
14 #  distributed under the License is distributed on an "AS IS" BASIS,
15 #  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 #  See the License for the specific language governing permissions and
17 #  limitations under the License.
18 #
19 #  SPDX-License-Identifier: Apache-2.0
20 #  ============LICENSE_END=========================================================
21
22 openapi: 3.0.3
23 info:
24   x-api-id: a31c510b-20e6-4a08-af16-368c44d7fba8
25   x-audience: external-public
26   description: "<h2>General</h2><p>The O-RAN Non-RT RIC Policy Management Service\
27     \ provides a REST API for managemecnt of A1 policies. <br/>The main tasks of the\
28     \ service are:</p><ul><li>A1 Policy creation, modification and deletion.</li><li>Monitoring\
29     \ and maintaining consistency of the SMO view of A1 policies and the Near-RT RICs</li><li>Maintaining\
30     \ a view of supported Near-RT RIC policy types</li><li>Supervision of using services\
31     \ (R-APPs). When a service is unavailable, its policies are removed.</li></ul><h2>APIs\
32     \ provided or defined by the service</h2><h3>A1 Policy Management</h3><p>This\
33     \ is an API for management of A1 Policies.</p><ul><li>A1 Policy retrieval, creation,\
34     \ modification and deletion.</li><li>Retrieval of supported A1 Policy types for\
35     \ a Near-RT RIC</li><li>Retrieval of status for existing A1 policies</li></ul><h3>Management\
36     \ of configuration</h3><p>API for updating and retrieval of the component configuration.\
37     \ Note that there other ways to maintain the configuration.</p><h3>Service callbacks</h3><p>These\
38     \ are endpoints that are invoked by this service. The callbacks are registered\
39     \ in this service at service registration.</p><h3>NearRT-RIC Repository</h3><p>This\
40     \ is an API that provides support for looking up a NearRT-RIC. Each A1 policy\
41     \ is targeted for one Near-RT RIC.</p><h3>Health Check</h3><p>API used for supervision\
42     \ of the PMS component.</p><h3>Service Registry and Supervision</h3><p>API used\
43     \ for registering services that uses PMS. Each A1 policy is optionally owned by\
44     \ a service. PMS can supervise each registered service by a heart-beat supervision\
45     \ and will automatically remove policies for unavailable services. Note that a\
46     \ service does not need to be registered in order to create A1 Policies. This\
47     \ is a feature that is optional to use.</p><h3>Authorization API</h3><p>API used\
48     \ for access control of A1 Policy access. If configured, an external authorization\
49     \ provider is requested to grant access to the A1 Policy type.</p><h3>Spring Boot\
50     \ Actuator</h3><p>Provides generic functions  used to monitor and manage the Spring\
51     \ web application.</p>"
52   license:
53     name: Copyright (C) 2020-2023 Nordix Foundation. Licensed under the Apache License.
54     url: http://www.apache.org/licenses/LICENSE-2.0
55   title: A1 Policy Management Service
56   version: 1.3.0
57   contact:
58     url: https://www.onap.org/
59     email: discuss-list@onap.com
60 servers:
61   - url: /
62 tags:
63   - name: A1 Policy Management
64     description: "API used to create polices, Policy Instances and get them as individual
65     using an ID or get all policies/Instances."
66   - name: NearRT-RIC Repository
67     description: "API used to get the NearRT-RIC for the managed element."
68   - name: Service Registry and Supervision
69     description: "API used to keep the service Alive with in the timeout period"
70   - name: Health Check
71     description: "API used to get the health status and statistics of this service"
72   - name: Service callbacks
73   - name: Authorization API
74     description: "API used for authorization of information A1 policy access (this is
75      provided by an authorization producer such as OPA). <br> Note that this API is called
76      by PMS, it is not provided."
77   - name: Configuration
78     description: "API used to create or fetch the application configuration."
79   - name: Actuator
80     description: Monitor and interact
81     externalDocs:
82       description: Spring Boot Actuator Web API Documentation
83       url: https://docs.spring.io/spring-boot/docs/current/actuator-api/html/
84 paths:
85   /a1-policy/v2/policy-instances:
86     get:
87       description: "Returns a list of A1 policies matching given search criteria.\
88         \ <br>If several query parameters are defined, the policies matching all conditions\
89         \ are returned."
90       operationId: getPolicyInstances
91       parameters:
92         - description: Select policies with a given type identity.
93           explode: true
94           in: query
95           name: policytype_id
96           required: false
97           schema:
98             type: string
99           style: form
100         - description: Select policies for a given Near-RT RIC identity.
101           explode: true
102           in: query
103           name: ric_id
104           required: false
105           schema:
106             type: string
107           style: form
108         - description: Select policies owned by a given service.
109           explode: true
110           in: query
111           name: service_id
112           required: false
113           schema:
114             type: string
115           style: form
116         - description: Select policies of a given type name (type identity has the format
117             <typename_version>)
118           explode: true
119           in: query
120           name: type_name
121           required: false
122           schema:
123             type: string
124           style: form
125       responses:
126         "200":
127           content:
128             application/json:
129               examples:
130                 policy_info_list:
131                   $ref: '#/components/examples/policy_info_list'
132               schema:
133                 $ref: '#/components/schemas/policy_info_list'
134           description: OK - Returns A1 Policies which matches the criteria
135         "404":
136           content:
137             application/json:
138               schema:
139                 $ref: '#/components/schemas/error_information'
140           description: "Not Found - Near-RT RIC, policy type or service not found"
141       summary: Query for A1 policy instances
142       tags:
143         - A1 Policy Management
144   /example-authz-check:
145     post:
146       description: The authorization function decides if access is granted.
147       operationId: performAccessControl
148       requestBody:
149         content:
150           application/json:
151             schema:
152               $ref: '#/components/schemas/policy_authorization'
153         required: true
154       responses:
155         "200":
156           content:
157             application/json:
158               schema:
159                 $ref: '#/components/schemas/authorization_result'
160           description: OK
161         "403":
162           $ref: '#/components/responses/Forbidden'
163       summary: Request for access authorization.
164       tags:
165         - Authorization API
166   /actuator/threaddump:
167     get:
168       x-internal: true
169       operationId: threaddump
170       responses:
171         "200":
172           content:
173             text/plain;charset=UTF-8:
174               schema:
175                 type: object
176             application/vnd.spring-boot.actuator.v3+json:
177               schema:
178                 type: object
179             application/json:
180               schema:
181                 type: object
182             application/vnd.spring-boot.actuator.v2+json:
183               schema:
184                 type: object
185           description: OK
186       summary: Actuator web endpoint 'threaddump'
187       tags:
188         - Actuator
189   /a1-policy/v2/status:
190     get:
191       operationId: getStatus
192       responses:
193         "200":
194           content:
195             application/json:
196               schema:
197                 $ref: '#/components/schemas/status_info'
198               examples:
199                 status_info:
200                   $ref: '#/components/examples/status_info'
201           description: OK- Service is living Ok
202       description: Returns status and statistics of this service
203       tags:
204         - Health Check
205   /actuator/loggers:
206     get:
207       x-internal: true
208       operationId: loggers
209       responses:
210         "200":
211           content:
212             application/vnd.spring-boot.actuator.v3+json:
213               schema:
214                 type: object
215             application/json:
216               schema:
217                 type: object
218             application/vnd.spring-boot.actuator.v2+json:
219               schema:
220                 type: object
221           description: OK
222       summary: Actuator web endpoint 'loggers'
223       tags:
224         - Actuator
225   /actuator/health/**:
226     get:
227       x-internal: true
228       operationId: health-path
229       responses:
230         "200":
231           content:
232             application/vnd.spring-boot.actuator.v3+json:
233               schema:
234                 type: object
235             application/json:
236               schema:
237                 type: object
238             application/vnd.spring-boot.actuator.v2+json:
239               schema:
240                 type: object
241           description: OK
242       summary: Actuator web endpoint 'health-path'
243       tags:
244         - Actuator
245   /a1-policy/v2/rics/ric:
246     get:
247       description: Either a Near-RT RIC identity or a Managed Element identity can
248         be specified.<br>The intention with Managed Element identity is the ID used
249         in O1 for accessing the traffical element (such as the ID of CU).
250       operationId: getRic
251       parameters:
252         - description: "The identity of a Managed Element. If given, the Near-RT RIC\
253           \ managing the ME is returned."
254           explode: true
255           in: query
256           name: managed_element_id
257           required: false
258           schema:
259             type: string
260           style: form
261         - description: The identity of a Near-RT RIC to get information for.
262           explode: true
263           in: query
264           name: ric_id
265           required: false
266           schema:
267             type: string
268           style: form
269       responses:
270         "200":
271           content:
272             application/json:
273               schema:
274                 $ref: '#/components/schemas/ric_info'
275               examples:
276                 ric_info:
277                   $ref: '#/components/examples/ric_info'
278           description: OK - Near-RT RIC is found
279         "404":
280           $ref: '#/components/responses/NotFound'
281           description: NotFound - Requested NearRT-RIC Not Found
282       summary: Returns info of Near-RT RIC queried by the ric-id and managed-element-id
283       tags:
284         - NearRT-RIC Repository
285   /actuator/shutdown:
286     post:
287       x-internal: true
288       operationId: shutdown
289       responses:
290         "200":
291           content:
292             application/vnd.spring-boot.actuator.v3+json:
293               schema:
294                 type: object
295             application/json:
296               schema:
297                 type: object
298             application/vnd.spring-boot.actuator.v2+json:
299               schema:
300                 type: object
301           description: OK
302       summary: Actuator web endpoint 'shutdown'
303       tags:
304         - Actuator
305   /a1-policy/v2/policy-types:
306     get:
307       operationId: getPolicyTypes
308       parameters:
309         - description: Select types for the given Near-RT RIC identity.
310           explode: true
311           in: query
312           name: ric_id
313           required: false
314           schema:
315             type: string
316           style: form
317         - description: Select types with the given type name (type identity has the
318             format <typename_version>)
319           explode: true
320           in: query
321           name: type_name
322           required: false
323           schema:
324             type: string
325           style: form
326         - description: Select types that are compatible with the given version. This
327             parameter is only applicable in conjunction with type_name. As an example
328             version 1.9.1 is compatible with 1.0.0 but not the other way around. Matching
329             types will be returned sorted in ascending order.
330           explode: true
331           in: query
332           name: compatible_with_version
333           required: false
334           schema:
335             type: string
336           style: form
337       responses:
338         "200":
339           content:
340             application/json:
341               examples:
342                 policy_type_id_list:
343                   $ref: '#/components/examples/policy_type_id_list'
344               schema:
345                 $ref: '#/components/schemas/policy_type_id_list'
346           description: OK - Policy Type IDs Found
347         "404":
348           $ref: '#/components/responses/NotFound'
349           description: 'Not Found - Requested Policy Type IDs Not Found'
350       description: Query policy type identities
351       tags:
352         - A1 Policy Management
353   /a1-policy/v2/policies/{policy_id}:
354     delete:
355       description: Deleting the policy using the Policy's Policy ID.
356       operationId: deletePolicy
357       parameters:
358         - explode: false
359           in: path
360           name: policy_id
361           required: true
362           schema:
363             type: string
364           style: simple
365       responses:
366         "200":
367           content:
368             '*/*':
369               schema:
370                 $ref: '#/components/schemas/void'
371           description: OK - Policy deleted
372         "423":
373           $ref: '#/components/responses/Locked'
374           description: 'The requested policy using policy_id is Locked'
375       summary: Delete a policy
376       tags:
377         - A1 Policy Management
378     get:
379       operationId: getPolicy
380       parameters:
381         - explode: false
382           in: path
383           name: policy_id
384           required: true
385           schema:
386             type: string
387           style: simple
388       responses:
389         "200":
390           content:
391             application/json:
392               schema:
393                 $ref: '#/components/schemas/policy_info'
394               examples:
395                 policy_info:
396                   $ref: '#/components/examples/policy_info'
397           description: OK - Policy found
398         "404":
399           $ref: '#/components/responses/NotFound'
400           description: 'Not Found - Requested Policy using policy_id is not found'
401       description: Returns a policy
402       tags:
403         - A1 Policy Management
404   /actuator/metrics/{requiredMetricName}:
405     get:
406       x-internal: true
407       operationId: metrics-requiredMetricName
408       parameters:
409         - explode: false
410           in: path
411           name: requiredMetricName
412           required: true
413           schema:
414             type: string
415           style: simple
416       responses:
417         "200":
418           content:
419             application/vnd.spring-boot.actuator.v3+json:
420               schema:
421                 type: object
422             application/json:
423               schema:
424                 type: object
425             application/vnd.spring-boot.actuator.v2+json:
426               schema:
427                 type: object
428           description: OK
429       summary: Actuator web endpoint 'metrics-requiredMetricName'
430       tags:
431         - Actuator
432   /a1-policy/v2/configuration:
433     get:
434       x-internal: true
435       operationId: getConfiguration
436       responses:
437         "200":
438           content:
439             application/json:
440               schema:
441                 type: string
442           description: OK - Configuration
443         "404":
444           $ref: '#/components/responses/NotFound'
445           description: Not Found - Configuration is not found or readable
446       description: Returns the contents of the application configuration file
447       tags:
448         - Configuration
449     put:
450       x-internal: true
451       operationId: putConfiguration
452       requestBody:
453         content:
454           application/json:
455             schema:
456               type: object
457         required: true
458       responses:
459         "200":
460           content:
461             '*/*':
462               schema:
463                 $ref: '#/components/schemas/void'
464           description: OK - Configuration updated
465         "400":
466           $ref: '#/components/responses/BadRequest'
467       description: Replace the current configuration with the given configuration
468       tags:
469         - Configuration
470   /actuator:
471     get:
472       x-internal: true
473       operationId: links
474       responses:
475         "200":
476           content:
477             application/vnd.spring-boot.actuator.v3+json:
478               schema:
479                 additionalProperties:
480                   additionalProperties:
481                     $ref: '#/components/schemas/Link'
482                   type: object
483                 type: object
484             application/json:
485               schema:
486                 additionalProperties:
487                   additionalProperties:
488                     $ref: '#/components/schemas/Link'
489                   type: object
490                 type: object
491             application/vnd.spring-boot.actuator.v2+json:
492               schema:
493                 additionalProperties:
494                   additionalProperties:
495                     $ref: '#/components/schemas/Link'
496                   type: object
497                 type: object
498           description: OK
499       summary: Actuator root web endpoint
500       tags:
501         - Actuator
502   /actuator/loggers/{name}:
503     get:
504       x-internal: true
505       operationId: loggers-name
506       parameters:
507         - explode: false
508           in: path
509           name: name
510           required: true
511           schema:
512             type: string
513           style: simple
514       responses:
515         "200":
516           content:
517             application/vnd.spring-boot.actuator.v3+json:
518               schema:
519                 type: object
520             application/json:
521               schema:
522                 type: object
523             application/vnd.spring-boot.actuator.v2+json:
524               schema:
525                 type: object
526           description: OK
527       summary: Actuator web endpoint 'loggers-name'
528       tags:
529         - Actuator
530     post:
531       x-internal: true
532       operationId: loggers-name_2
533       parameters:
534         - explode: false
535           in: path
536           name: name
537           required: true
538           schema:
539             type: string
540           style: simple
541       requestBody:
542         content:
543           application/json:
544             schema:
545               enum:
546                 - TRACE
547                 - DEBUG
548                 - INFO
549                 - WARN
550                 - ERROR
551                 - FATAL
552                 - "OFF"
553               type: string
554       responses:
555         "200":
556           content:
557             '*/*':
558               schema:
559                 type: object
560           description: OK
561       summary: Actuator web endpoint 'loggers-name'
562       tags:
563         - Actuator
564   /a1-policy/v2/services/{service_id}/keepalive:
565     put:
566       description: A registered service should invoke this operation regularly to
567         indicate that it is still alive. If a registered service fails to invoke this
568         operation before the end of a timeout period the service will be deregistered
569         and all its A1 policies wil be removed. (This timeout can be set or disabled
570         when each service is initially registered)
571       operationId: keepAliveService
572       parameters:
573         - explode: false
574           in: path
575           name: service_id
576           required: true
577           schema:
578             type: string
579           style: simple
580       responses:
581         "200":
582           content:
583             '*/*':
584               schema:
585                 type: object
586           description: "OK - Service supervision timer refreshed, OK"
587         "404":
588           $ref: '#/components/responses/NotFound'
589       summary: Heartbeat indicates that the service is running
590       tags:
591         - Service Registry and Supervision
592   /actuator/metrics:
593     get:
594       x-internal: true
595       operationId: metrics
596       responses:
597         "200":
598           content:
599             application/vnd.spring-boot.actuator.v3+json:
600               schema:
601                 type: object
602             application/json:
603               schema:
604                 type: object
605             application/vnd.spring-boot.actuator.v2+json:
606               schema:
607                 type: object
608           description: OK
609       summary: Actuator web endpoint 'metrics'
610       tags:
611         - Actuator
612   /a1-policy/v2/rics:
613     get:
614       description: The call returns all Near-RT RICs that supports a given policy
615         type identity
616       operationId: getRics
617       parameters:
618         - description: "The identity of a policy type. If given, all Near-RT RICs supporting\
619           \ the policy type are returned"
620           explode: true
621           in: query
622           name: policytype_id
623           required: false
624           schema:
625             type: string
626           style: form
627       responses:
628         "200":
629           content:
630             application/json:
631               schema:
632                 $ref: '#/components/schemas/ric_info_list'
633               examples:
634                 ric_info_list:
635                   $ref: '#/components/examples/ric_info_list'
636           description: OK
637         "404":
638           $ref: '#/components/responses/NotFound'
639       summary: Query Near-RT RIC information
640       tags:
641         - NearRT-RIC Repository
642   /a1-policy/v2/services:
643     get:
644       description: Either information about a registered service with given identity
645         or all registered services are returned.
646       operationId: getServices
647       parameters:
648         - description: The identity of the service
649           explode: true
650           in: query
651           name: service_id
652           required: false
653           schema:
654             type: string
655           style: form
656       responses:
657         "200":
658           content:
659             application/json:
660               schema:
661                 $ref: '#/components/schemas/service_status_list'
662               examples:
663                 service_status_list:
664                   $ref: '#/components/examples/service_status_list'
665           description: OK
666         "404":
667           $ref: '#/components/responses/NotFound'
668       summary: Returns service information
669       tags:
670         - Service Registry and Supervision
671     put:
672       description: "Registering a service is needed to:<ul><li>Get callbacks about\
673         \ available NearRT RICs.</li><li>Activate supervision of the service. If a\
674         \ service is inactive, its policies will automatically be deleted.</li></ul>Policies\
675         \ can be created even if the service is not registerred. This is a feature\
676         \ which it is optional to use."
677       operationId: putService
678       requestBody:
679         content:
680           application/json:
681             schema:
682               $ref: '#/components/schemas/service_registration_info'
683         required: true
684       responses:
685         "200":
686           content:
687             '*/*':
688               schema:
689                 type: object
690           description: OK - Service updated
691         "201":
692           content:
693             '*/*':
694               schema:
695                 type: object
696           description: Created - Service created
697         "400":
698           $ref: '#/components/responses/BadRequest'
699       summary: Register a service
700       tags:
701         - Service Registry and Supervision
702       callbacks:
703         RICStatus:
704           "{$request.body#/callback_url}":
705             post:
706               description: The URL to this call is registered at Service registration.
707               operationId: serviceCallback
708               requestBody:
709                 content:
710                   application/json:
711                     schema:
712                       $ref: '#/components/schemas/service_callback_info_v2'
713                 required: true
714               responses:
715                 "200":
716                   content:
717                     application/json:
718                       schema:
719                         $ref: '#/components/schemas/void'
720                   description: OK
721                 "404":
722                   $ref: '#/components/responses/NotFound'
723               summary: Callback for Near-RT RIC status
724               tags:
725                 - Service callbacks
726   /actuator/info:
727     get:
728       x-internal: true
729       operationId: info
730       responses:
731         "200":
732           content:
733             application/vnd.spring-boot.actuator.v3+json:
734               schema:
735                 type: object
736             application/json:
737               schema:
738                 type: object
739             application/vnd.spring-boot.actuator.v2+json:
740               schema:
741                 type: object
742           description: OK
743       summary: Actuator web endpoint 'info'
744       tags:
745         - Actuator
746   /status:
747     get:
748       operationId: getStatusV1
749       responses:
750         "200":
751           content:
752             '*/*':
753               schema:
754                 type: string
755           description: OK -  Service is living
756       description: Returns status and statistics of this service
757       tags:
758         - Health Check
759   /a1-policy/v2/policy-types/{policytype_id}:
760     get:
761       operationId: getPolicyTypeDefinition
762       parameters:
763         - explode: false
764           in: path
765           name: policytype_id
766           required: true
767           schema:
768             type: string
769           style: simple
770       responses:
771         "200":
772           content:
773             application/json:
774               schema:
775                 $ref: '#/components/schemas/policy_type_definition'
776               examples:
777                 policy_type_definition:
778                   $ref: '#/components/examples/policy_type_definition'
779           description: OK - schema of the given policy type
780         "404":
781           $ref: '#/components/responses/NotFound'
782       description: Returns a policy type definition
783       tags:
784         - A1 Policy Management
785   /actuator/logfile:
786     get:
787       x-internal: true
788       operationId: logfile
789       responses:
790         "200":
791           content:
792             text/plain;charset=UTF-8:
793               schema:
794                 type: object
795           description: OK
796       summary: Actuator web endpoint 'logfile'
797       tags:
798         - Actuator
799   /actuator/health:
800     get:
801       x-internal: true
802       operationId: health
803       responses:
804         "200":
805           content:
806             application/vnd.spring-boot.actuator.v3+json:
807               schema:
808                 type: object
809             application/json:
810               schema:
811                 type: object
812             application/vnd.spring-boot.actuator.v2+json:
813               schema:
814                 type: object
815           description: OK
816       summary: Actuator web endpoint 'health'
817       tags:
818         - Actuator
819   /a1-policy/v2/policies:
820     get:
821       description: "Returns a list of A1 policies matching given search criteria.\
822         \ <br>If several query parameters are defined, the policies matching all conditions\
823         \ are returned."
824       operationId: getPolicyIds
825       parameters:
826         - description: Select policies of a given policy type identity.
827           explode: true
828           in: query
829           name: policytype_id
830           required: false
831           schema:
832             type: string
833           style: form
834         - description: Select policies of a given Near-RT RIC identity.
835           explode: true
836           in: query
837           name: ric_id
838           required: false
839           schema:
840             type: string
841           style: form
842         - description: Select policies owned by a given service.
843           explode: true
844           in: query
845           name: service_id
846           required: false
847           schema:
848             type: string
849           style: form
850         - description: Select policies of types with the given type name (type identity
851             has the format <typename_version>)
852           explode: true
853           in: query
854           name: type_name
855           required: false
856           schema:
857             type: string
858           style: form
859       responses:
860         "200":
861           content:
862             application/json:
863               examples:
864                 policy_id_list:
865                   $ref: '#/components/examples/policy_id_list'
866               schema:
867                 $ref: '#/components/schemas/policy_id_list'
868           description: OK - Policy identities
869         "404":
870           $ref: '#/components/responses/NotFound'
871       summary: Query policy identities
872       tags:
873         - A1 Policy Management
874     put:
875       operationId: putPolicy
876       requestBody:
877         content:
878           application/json:
879             schema:
880               $ref: '#/components/schemas/policy_info'
881         required: true
882       responses:
883         "200":
884           content:
885             application/json:
886               schema:
887                 $ref: '#/components/schemas/void'
888           description: OK - Policy updated
889         "201":
890           content:
891             application/json:
892               schema:
893                 $ref: '#/components/schemas/void'
894           description: Created - Policy created
895         "423":
896           $ref: '#/components/responses/Locked'
897       description: Create or update a policy
898       tags:
899         - A1 Policy Management
900   /a1-policy/v2/services/{service_id}:
901     delete:
902       operationId: deleteService
903       parameters:
904         - explode: false
905           in: path
906           name: service_id
907           required: true
908           schema:
909             type: string
910           style: simple
911       responses:
912         "204":
913           content:
914             '*/*':
915               schema:
916                 type: object
917           description: No Content - Service unregistered
918         "404":
919           $ref: '#/components/responses/NotFound'
920       description: Unregister a service
921       tags:
922         - Service Registry and Supervision
923   /actuator/heapdump:
924     get:
925       x-internal: true
926       operationId: heapdump
927       responses:
928         "200":
929           content:
930             application/octet-stream:
931               schema:
932                 type: object
933           description: OK
934       summary: Actuator web endpoint 'heapdump'
935       tags:
936         - Actuator
937   /a1-policy/v2/policies/{policy_id}/status:
938     get:
939       operationId: getPolicyStatus
940       parameters:
941         - explode: false
942           in: path
943           name: policy_id
944           required: true
945           schema:
946             type: string
947           style: simple
948       responses:
949         "200":
950           content:
951             application/json:
952               schema:
953                 $ref: '#/components/schemas/policy_status_info'
954               examples:
955                 policy_status_info:
956                   $ref: '#/components/examples/policy_status_info'
957           description: OK -  Policy status
958         "404":
959           $ref: '#/components/responses/NotFound'
960       description: Returns a policy status
961       tags:
962         - A1 Policy Management
963 components:
964   responses:
965     Locked:
966       description: "Locked - HTTP Status code which can be used when the state is Locked"
967       content:
968         application/problem+json:
969           schema:
970             $ref: '#/components/schemas/error_information'
971           example:
972             status: 423
973             title: Locked
974             detail: Requested resource is in a locked state.
975     BadRequest:
976       description: Bad Request
977       content:
978         application/problem+json:
979           schema:
980             $ref: '#/components/schemas/error_information'
981           example:
982             status: 400
983             title: Bad Request
984             detail: The provided request is not valid.
985     Forbidden:
986       description: Forbidden
987       content:
988         application/problem+json:
989           schema:
990             $ref: '#/components/schemas/error_information'
991           example:
992             status: 403
993             title: Forbidden
994             detail: Your role does not allow to perform this action. Contact System Administrator to change your access rights.
995     NotFound:
996       description: Not Found
997       content:
998         application/problem+json:
999           example:
1000             [ ]
1001
1002   examples:
1003     service_status:
1004       description: List of service information
1005       value:
1006         callback_url: callback_url
1007         service_id: service_id
1008         keep_alive_interval_seconds: 0
1009         time_since_last_activity_seconds: 6
1010
1011     service_status_list:
1012       description: List of service information
1013       value:
1014         service_list:
1015           - callback_url: callback_url
1016             service_id: service_id
1017             keep_alive_interval_seconds: 0
1018             time_since_last_activity_seconds: 6
1019           - callback_url: callback_url
1020             service_id: service_id
1021             keep_alive_interval_seconds: 0
1022             time_since_last_activity_seconds: 6
1023     policy_type_definition:
1024       description: Schema of the given Policy type
1025       value:
1026         policy_schema: "{}"
1027     policy_type_id_list:
1028       description: Array of policy type id's
1029       value:
1030         policy_type_id_list:
1031           - policytype_id
1032           - policytype_id
1033     policy_info:
1034       description: Policy information of one A1-P policy
1035       value:
1036         ric_id: ric_id
1037         policy_id: policy_id
1038         transient: false
1039         service_id: service_id
1040         policy_data: "{}"
1041         status_notification_uri: status_notification_uri
1042         policytype_id: policytype_id
1043     policy_info_list:
1044       description: List of policy information
1045       value:
1046         policies:
1047           - ric_id: ric_id
1048             policy_id: policy_id
1049             transient: false
1050             service_id: service_id
1051             policy_data: "{}"
1052             status_notification_uri: status_notification_uri
1053             policytype_id: policytype_id
1054           - ric_id: ric_id
1055             policy_id: policy_id
1056             transient: false
1057             service_id: service_id
1058             policy_data: "{}"
1059             status_notification_uri: status_notification_uri
1060             policytype_id: policytype_id
1061     policy_id_list:
1062       description: A list of policy identities
1063       value:
1064         policy_ids:
1065           - some_policy_id
1066           - some_policy_id
1067     policy_status_info:
1068       description: Status for one A1-P Policy
1069       value:
1070         last_modified: last_modified
1071         status:
1072           value:
1073             status: status
1074     status_info:
1075       value:
1076         status: status
1077     ric_info:
1078       value:
1079         ric_id: ric_id
1080         managed_element_ids:
1081           - some_managed_element_id
1082           - some_managed_element_id
1083         state: UNAVAILABLE
1084         policytype_ids:
1085           - some_policytype_id
1086           - some_policytype_id
1087     ric_info_list:
1088       value:
1089         rics:
1090           - ric_id: ric_id
1091             managed_element_ids:
1092               - some_managed_element_id
1093               - some_managed_element_id
1094             state: UNAVAILABLE
1095             policytype_ids:
1096               - policytype_id
1097               - policytype_id
1098           - ric_id: ric_id
1099             managed_element_ids:
1100               - managed_element_ids
1101               - managed_element_ids
1102             state: UNAVAILABLE
1103             policytype_ids:
1104               - policytype_ids
1105               - policytype_ids
1106
1107   schemas:
1108     policy_type_definition:
1109       description: Contains policy type schema definition
1110       type: object
1111       properties:
1112         policy_schema:
1113           description: Policy type json schema. The schema is a json object following
1114             http://json-schema.org/draft-07/schema
1115           type: object
1116     error_information:
1117       description: Problem as defined in https://tools.ietf.org/html/rfc7807
1118       properties:
1119         detail:
1120           description: ' A human-readable explanation specific to this occurrence
1121             of the problem.'
1122           example: Policy type not found
1123           type: string
1124         title:
1125           description: 'A specific error name'
1126           type: string
1127           example: Not Found
1128         status:
1129           description: 'The HTTP status code generated by the origin server for this
1130             occurrence of the problem. '
1131           example: 404
1132           format: int32
1133           type: integer
1134       type: object
1135     void:
1136       description: Void/empty
1137       type: object
1138     status_info:
1139       properties:
1140         status:
1141           description: status text
1142           type: string
1143       type: object
1144     authorization_result:
1145       description: Result of authorization
1146       example:
1147         result: true
1148       properties:
1149         result:
1150           description: "If true, the access is granted"
1151           type: boolean
1152       required:
1153         - result
1154       type: object
1155     ric_info:
1156       description: Information for a Near-RT RIC
1157       properties:
1158         ric_id:
1159           description: identity of the Near-RT RIC
1160           type: string
1161         managed_element_ids:
1162           description: O1 identities for managed entities
1163           items:
1164             description: O1 identities for managed entities
1165             type: string
1166           type: array
1167         state:
1168           description: Represents the states for a Near-RT RIC
1169           enum:
1170             - UNAVAILABLE
1171             - AVAILABLE
1172             - SYNCHRONIZING
1173             - CONSISTENCY_CHECK
1174           type: string
1175         policytype_ids:
1176           description: supported policy types
1177           items:
1178             description: supported policy types
1179             type: string
1180           type: array
1181       type: object
1182     service_registration_info:
1183       description: Information for one service
1184       properties:
1185         callback_url:
1186           description: callback for notifying of Near-RT RIC state changes
1187           type: string
1188         service_id:
1189           description: identity of the service
1190           type: string
1191         keep_alive_interval_seconds:
1192           description: "keep alive interval for the service. This is used to enable\
1193             \ optional heartbeat supervision of the service. If set (> 0) the registered\
1194             \ service should regularly invoke a 'keepalive' REST call. When a service\
1195             \ fails to invoke this 'keepalive' call within the configured time, the\
1196             \ service is considered unavailable. An unavailable service will be automatically\
1197             \ deregistered and its policies will be deleted. Value 0 means timeout\
1198             \ supervision is disabled."
1199           format: int64
1200           type: integer
1201       required:
1202         - service_id
1203       type: object
1204     policy_info_list:
1205       description: List of policy information
1206       properties:
1207         policies:
1208           description: List of policy information
1209           items:
1210             $ref: '#/components/schemas/policy_info'
1211           type: array
1212       type: object
1213     policy_status_info:
1214       description: Status for one A1-P Policy
1215       properties:
1216         last_modified:
1217           description: "timestamp, last modification time"
1218           type: string
1219         status:
1220           description: the Policy status
1221           type: object
1222       type: object
1223     service_status:
1224       properties:
1225         callback_url:
1226           description: callback for notifying of RIC synchronization
1227           type: string
1228         service_id:
1229           description: identity of the service
1230           type: string
1231         keep_alive_interval_seconds:
1232           description: policy keep alive timeout
1233           format: int64
1234           type: integer
1235         time_since_last_activity_seconds:
1236           description: time since last invocation by the service
1237           format: int64
1238           type: integer
1239       type: object
1240     ric_info_list:
1241       description: List of Near-RT RIC information
1242       properties:
1243         rics:
1244           description: List of Near-RT RIC information
1245           items:
1246             $ref: '#/components/schemas/ric_info'
1247           type: array
1248       type: object
1249     input:
1250       description: input
1251       properties:
1252         access_type:
1253           description: Access type
1254           enum:
1255             - READ
1256             - WRITE
1257             - DELETE
1258           type: string
1259         auth_token:
1260           description: Authorization token
1261           type: string
1262         policy_type_id:
1263           description: Policy type identifier
1264           type: string
1265       required:
1266         - access_type
1267         - auth_token
1268         - policy_type_id
1269       type: object
1270     policy_authorization:
1271       description: Authorization request for A1 policy requests
1272       properties:
1273         input:
1274           $ref: '#/components/schemas/input'
1275       required:
1276         - input
1277       type: object
1278     policy_type_id_list:
1279       description: Information about policy types
1280       properties:
1281         policytype_ids:
1282           description: Policy type identities
1283           items:
1284             description: Policy type identities
1285             type: string
1286           type: array
1287       type: object
1288     policy_info:
1289       description: Information for one A1-P Policy
1290       properties:
1291         ric_id:
1292           description: identity of the target Near-RT RIC
1293           type: string
1294         policy_id:
1295           description: identity of the policy
1296           type: string
1297         transient:
1298           default: false
1299           description: "if true, the policy is deleted at RIC restart. If false, its\
1300             \ value is maintained by this service until explicitly deleted. Default\
1301             \ false."
1302           example: false
1303           nullable: false
1304           type: boolean
1305         service_id:
1306           description: the identity of the service owning the policy. This can be
1307             used to group the policies (it is possible to get all policies associated
1308             to a service). Note that the service does not need to be registered.
1309           type: string
1310         policy_data:
1311           description: the configuration of the policy
1312           type: object
1313         status_notification_uri:
1314           description: Callback URI for policy status updates
1315           type: string
1316         policytype_id:
1317           description: identity of the policy type
1318           type: string
1319       required:
1320         - ric_id
1321         - policy_id
1322         - service_id
1323         - policy_data
1324         - policytype_id
1325       type: object
1326     policy_id_list:
1327       description: A list of policy identities
1328       example:
1329         policy_ids:
1330           - policy_ids
1331           - policy_ids
1332       properties:
1333         policy_ids:
1334           description: Policy identities
1335           items:
1336             description: Policy identities
1337             type: string
1338           type: array
1339       type: object
1340     service_status_list:
1341       properties:
1342         service_list:
1343           description: List of service information
1344           items:
1345             $ref: '#/components/schemas/service_status'
1346           type: array
1347       type: object
1348     service_callback_info_v2:
1349       description: Information transferred as in Service callbacks (callback_url)
1350       properties:
1351         ric_id:
1352           description: identity of a Near-RT RIC
1353           type: string
1354         event_type:
1355           description: "values:\nAVAILABLE: the  Near-RT RIC has become available\
1356             \ for A1 Policy management"
1357           enum:
1358             - AVAILABLE
1359           type: string
1360       required:
1361         - event_type
1362         - ric_id
1363       type: object
1364     Link:
1365       properties:
1366         templated:
1367           type: boolean
1368         href:
1369           type: string
1370       type: object