Support for transient policies not recreated at synchronization
[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 paths:
18   /policies:
19     get:
20       tags:
21         - A1 Policy Management
22       summary: Query policies
23       operationId: getPoliciesUsingGET
24       produces:
25         - '*/*'
26       parameters:
27         - name: ric
28           in: query
29           description: ric
30           required: false
31           type: string
32         - name: service
33           in: query
34           description: service
35           required: false
36           type: string
37         - name: type
38           in: query
39           description: type
40           required: false
41           type: string
42       responses:
43         '200':
44           description: Policies
45           schema:
46             type: array
47             items:
48               $ref: '#/definitions/PolicyInfo'
49         '401':
50           description: Unauthorized
51         '403':
52           description: Forbidden
53         '404':
54           description: RIC or type not found
55           schema:
56             type: string
57       deprecated: false
58   /policy:
59     get:
60       tags:
61         - A1 Policy Management
62       summary: Returns a policy configuration
63       operationId: getPolicyUsingGET
64       produces:
65         - '*/*'
66       parameters:
67         - name: id
68           in: query
69           description: id
70           required: true
71           type: string
72       responses:
73         '200':
74           description: Policy found
75           schema:
76             type: object
77         '401':
78           description: Unauthorized
79         '403':
80           description: Forbidden
81         '404':
82           description: Policy is not found
83       deprecated: false
84     put:
85       tags:
86         - A1 Policy Management
87       summary: Put a policy
88       operationId: putPolicyUsingPUT
89       consumes:
90         - application/json
91       produces:
92         - '*/*'
93       parameters:
94         - name: id
95           in: query
96           description: id
97           required: true
98           type: string
99         - in: body
100           name: jsonBody
101           description: jsonBody
102           required: true
103           schema:
104             type: object
105         - name: ric
106           in: query
107           description: ric
108           required: true
109           type: string
110         - name: service
111           in: query
112           description: service
113           required: true
114           type: string
115         - name: transient
116           in: query
117           description: transient
118           required: false
119           type: boolean
120           default: false
121         - name: type
122           in: query
123           description: type
124           required: false
125           type: string
126       responses:
127         '200':
128           description: Policy updated
129           schema:
130             type: object
131         '201':
132           description: Policy created
133           schema:
134             type: object
135         '401':
136           description: Unauthorized
137         '403':
138           description: Forbidden
139         '404':
140           description: RIC or policy type is not found
141           schema:
142             type: string
143         '423':
144           description: RIC is not operational
145           schema:
146             type: string
147       deprecated: false
148     delete:
149       tags:
150         - A1 Policy Management
151       summary: Delete a policy
152       operationId: deletePolicyUsingDELETE
153       produces:
154         - '*/*'
155       parameters:
156         - name: id
157           in: query
158           description: id
159           required: true
160           type: string
161       responses:
162         '200':
163           description: OK
164           schema:
165             type: object
166         '204':
167           description: Policy deleted
168           schema:
169             type: object
170         '401':
171           description: Unauthorized
172         '403':
173           description: Forbidden
174         '404':
175           description: Policy is not found
176           schema:
177             type: string
178         '423':
179           description: RIC is not operational
180           schema:
181             type: string
182       deprecated: false
183   /policy_ids:
184     get:
185       tags:
186         - A1 Policy Management
187       summary: 'Query policies, only IDs returned'
188       operationId: getPolicyIdsUsingGET
189       produces:
190         - '*/*'
191       parameters:
192         - name: ric
193           in: query
194           description: ric
195           required: false
196           type: string
197         - name: service
198           in: query
199           description: service
200           required: false
201           type: string
202         - name: type
203           in: query
204           description: type
205           required: false
206           type: string
207       responses:
208         '200':
209           description: Policy ids
210           schema:
211             type: array
212             items:
213               type: string
214         '401':
215           description: Unauthorized
216         '403':
217           description: Forbidden
218         '404':
219           description: RIC or type not found
220           schema:
221             type: string
222       deprecated: false
223   /policy_schema:
224     get:
225       tags:
226         - A1 Policy Management
227       summary: Returns one policy type schema definition
228       operationId: getPolicySchemaUsingGET
229       produces:
230         - '*/*'
231       parameters:
232         - name: id
233           in: query
234           description: id
235           required: true
236           type: string
237       responses:
238         '200':
239           description: Policy schema
240           schema:
241             type: object
242         '401':
243           description: Unauthorized
244         '403':
245           description: Forbidden
246         '404':
247           description: RIC is not found
248           schema:
249             type: string
250       deprecated: false
251   /policy_schemas:
252     get:
253       tags:
254         - A1 Policy Management
255       summary: Returns policy type schema definitions
256       operationId: getPolicySchemasUsingGET
257       produces:
258         - '*/*'
259       parameters:
260         - name: ric
261           in: query
262           description: ric
263           required: false
264           type: string
265       responses:
266         '200':
267           description: Policy schemas
268           schema:
269             type: array
270             items:
271               type: object
272         '401':
273           description: Unauthorized
274         '403':
275           description: Forbidden
276         '404':
277           description: RIC is not found
278           schema:
279             type: string
280       deprecated: false
281   /policy_status:
282     get:
283       tags:
284         - A1 Policy Management
285       summary: Returns a policy status
286       operationId: getPolicyStatusUsingGET
287       produces:
288         - '*/*'
289       parameters:
290         - name: id
291           in: query
292           description: id
293           required: true
294           type: string
295       responses:
296         '200':
297           description: Policy status
298           schema:
299             type: object
300         '401':
301           description: Unauthorized
302         '403':
303           description: Forbidden
304         '404':
305           description: Policy is not found
306           schema:
307             type: string
308       deprecated: false
309   /policy_types:
310     get:
311       tags:
312         - A1 Policy Management
313       summary: Query policy type names
314       operationId: getPolicyTypesUsingGET
315       produces:
316         - '*/*'
317       parameters:
318         - name: ric
319           in: query
320           description: ric
321           required: false
322           type: string
323       responses:
324         '200':
325           description: Policy type names
326           schema:
327             type: array
328             items:
329               type: string
330         '401':
331           description: Unauthorized
332         '403':
333           description: Forbidden
334         '404':
335           description: RIC is not found
336           schema:
337             type: string
338       deprecated: false
339   /ric:
340     get:
341       tags:
342         - RIC Repository
343       summary: Returns the name of a RIC managing one Mananged Element
344       operationId: getRicUsingGET
345       produces:
346         - '*/*'
347       parameters:
348         - name: managedElementId
349           in: query
350           description: managedElementId
351           required: true
352           type: string
353       responses:
354         '200':
355           description: RIC is found
356           schema:
357             type: string
358         '401':
359           description: Unauthorized
360         '403':
361           description: Forbidden
362         '404':
363           description: RIC is not found
364           schema:
365             type: string
366       deprecated: false
367   /rics:
368     get:
369       tags:
370         - RIC Repository
371       summary: Query Near-RT RIC information
372       operationId: getRicsUsingGET
373       produces:
374         - '*/*'
375       parameters:
376         - name: policyType
377           in: query
378           description: policyType
379           required: false
380           type: string
381       responses:
382         '200':
383           description: OK
384           schema:
385             type: array
386             items:
387               $ref: '#/definitions/RicInfo'
388         '401':
389           description: Unauthorized
390         '403':
391           description: Forbidden
392         '404':
393           description: Policy type is not found
394           schema:
395             type: string
396       deprecated: false
397   /service:
398     put:
399       tags:
400         - Service registry and supervision
401       summary: Register a service
402       operationId: putServiceUsingPUT
403       consumes:
404         - application/json
405       produces:
406         - '*/*'
407       parameters:
408         - in: body
409           name: registrationInfo
410           description: registrationInfo
411           required: true
412           schema:
413             $ref: '#/definitions/ServiceRegistrationInfo'
414       responses:
415         '200':
416           description: Service updated
417           schema:
418             type: string
419         '201':
420           description: Service created
421           schema:
422             type: string
423         '400':
424           description: The ServiceRegistrationInfo is not accepted
425           schema:
426             type: string
427         '401':
428           description: Unauthorized
429         '403':
430           description: Forbidden
431         '404':
432           description: Not Found
433       deprecated: false
434   /services:
435     get:
436       tags:
437         - Service registry and supervision
438       summary: Returns service information
439       operationId: getServicesUsingGET
440       produces:
441         - '*/*'
442       parameters:
443         - name: name
444           in: query
445           description: name
446           required: false
447           type: string
448       responses:
449         '200':
450           description: OK
451           schema:
452             type: array
453             items:
454               $ref: '#/definitions/ServiceStatus'
455         '401':
456           description: Unauthorized
457         '403':
458           description: Forbidden
459         '404':
460           description: Service is not found
461           schema:
462             type: string
463       deprecated: false
464     delete:
465       tags:
466         - Service registry and supervision
467       summary: Delete a service
468       operationId: deleteServiceUsingDELETE
469       produces:
470         - '*/*'
471       parameters:
472         - name: name
473           in: query
474           description: name
475           required: true
476           type: string
477       responses:
478         '200':
479           description: OK
480           schema:
481             type: string
482         '204':
483           description: OK
484           schema:
485             type: string
486         '401':
487           description: Unauthorized
488         '403':
489           description: Forbidden
490         '404':
491           description: Service not found
492           schema:
493             type: string
494       deprecated: false
495   /services/keepalive:
496     put:
497       tags:
498         - Service registry and supervision
499       summary: Heartbeat from a serice
500       operationId: keepAliveServiceUsingPUT
501       consumes:
502         - application/json
503       produces:
504         - '*/*'
505       parameters:
506         - name: name
507           in: query
508           description: name
509           required: true
510           type: string
511       responses:
512         '200':
513           description: 'Service supervision timer refreshed, OK'
514           schema:
515             type: string
516         '201':
517           description: Created
518         '401':
519           description: Unauthorized
520         '403':
521           description: Forbidden
522         '404':
523           description: 'The service is not found, needs re-registration'
524       deprecated: false
525   /status:
526     get:
527       tags:
528         - Health check
529       summary: Returns status and statistics of this service
530       operationId: getStatusUsingGET
531       produces:
532         - '*/*'
533       responses:
534         '200':
535           description: Service is living
536           schema:
537             type: string
538         '401':
539           description: Unauthorized
540         '403':
541           description: Forbidden
542         '404':
543           description: Not Found
544       deprecated: false
545 definitions:
546   Mono«ResponseEntity«object»»:
547     type: object
548     title: Mono«ResponseEntity«object»»
549   Mono«ResponseEntity«string»»:
550     type: object
551     title: Mono«ResponseEntity«string»»
552   PolicyInfo:
553     type: object
554     properties:
555       id:
556         type: string
557         description: identity of the policy
558       json:
559         type: object
560         description: the configuration of the policy
561       lastModified:
562         type: string
563         description: 'timestamp, last modification time'
564       ric:
565         type: string
566         description: identity of the target Near-RT RIC
567       service:
568         type: string
569         description: the name of the service owning the policy
570       type:
571         type: string
572         description: name of the policy type
573     title: PolicyInfo
574   RicInfo:
575     type: object
576     properties:
577       managedElementIds:
578         type: array
579         description: O1 identities for managed entities
580         items:
581           type: string
582       policyTypes:
583         type: array
584         description: supported policy types
585         items:
586           type: string
587       ricName:
588         type: string
589         description: identity of the ric
590       state:
591         type: string
592         description: state info
593     title: RicInfo
594   ServiceRegistrationInfo:
595     type: object
596     required:
597       - serviceName
598     properties:
599       callbackUrl:
600         type: string
601         description: callback for notifying of RIC synchronization
602       keepAliveIntervalSeconds:
603         type: integer
604         format: int64
605         description: 'keep alive interval for the service. This is a heartbeat supervision of the service, which in regular intevals must invoke a ''keepAlive'' REST call. When a service does not invoke this call within the given time, it is considered unavailble. An unavailable service will be automatically deregistered and its policies will be deleted. Value 0 means no timeout supervision.'
606       serviceName:
607         type: string
608         description: identity of the service
609     title: ServiceRegistrationInfo
610   ServiceStatus:
611     type: object
612     properties:
613       callbackUrl:
614         type: string
615         description: callback for notifying of RIC synchronization
616       keepAliveIntervalSeconds:
617         type: integer
618         format: int64
619         description: policy keep alive timeout
620       serviceName:
621         type: string
622         description: identity of the service
623       timeSinceLastActivitySeconds:
624         type: integer
625         format: int64
626         description: time since last invocation by the service
627     title: ServiceStatus
628