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