Taking RMR v4.5.2 to use
[ric-plt/rtmgr.git] / api / routing_manager.yaml
1 #==================================================================================
2 #   Copyright (c) 2019 AT&T Intellectual Property.
3 #   Copyright (c) 2019 Nokia
4 #
5 #   Licensed under the Apache License, Version 2.0 (the "License");
6 #   you may not use this file except in compliance with the License.
7 #   You may obtain a copy of the License at
8 #
9 #       http://www.apache.org/licenses/LICENSE-2.0
10 #
11 #   Unless required by applicable law or agreed to in writing, software
12 #   distributed under the License is distributed on an "AS IS" BASIS,
13 #   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 #   See the License for the specific language governing permissions and
15 #   limitations under the License.
16 #==================================================================================
17 #
18 #
19 #   Abstract:   Routing Manager's RESTful API definition
20 #   Date:       28 August 2019
21 #
22 swagger: "2.0"
23 info:
24   title: Routing Manager
25   description: "This is the Swagger/OpenAPI 2.0 definition of Routing Manager's Northbound API."
26   version: "0.4.0"
27   license:
28     name: "Apache 2.0"
29     url: "http://www.apache.org/licenses/LICENSE-2.0.html"
30 host: "rtmgr"
31 basePath: "/ric/v1"
32 tags:
33 - name: "handle"
34   description: "Available handles"
35 #  externalDocs:
36 #    description: "Find out more"
37 #    url: "http://127.0.0.1"
38 - name: "health"
39   description: "Health of the system"
40 - name: "debug"
41   description: "Debug Information"
42 schemes:
43 #- "https"
44 - "http"
45 paths:
46   /health:
47     get:
48       tags:
49       - "health"
50       summary: "Retrive the health of Routing Manager"
51       description: "By performing a GET method on the health resource, the API caller is able to retrieve the health of Routing Manager"
52       operationId: "get_health"
53       consumes:
54       - "application/json"
55 #      - "application/yaml"
56       produces:
57       - "application/json"
58 #      - "application/yaml"
59       responses:
60         200:
61           description: "The health of the system"
62           schema:
63             "$ref": "#/definitions/health-status"
64   /getdebuginfo:
65     get:
66       tags:
67       - "debug"
68       summary: "Get Information for debugging"
69       description: "By performing a GET method, API caller is able to get the dump of routes tables, subcription list and E2T's"
70       operationId: "get_debuginfo"
71       consumes:
72       - "application/json"
73       produces:
74       - "application/json"
75       responses:
76         200:
77           description: "Debug Info from routing manager"
78           schema:
79             "$ref": "#/definitions/debuginfo"
80         201:
81           description: "Error while fetching Debug data"    
82   /handles:
83     get:
84       tags:
85       - "handle"
86       summary: "Placeholder for further usage"
87       description: "Placeholder for further usage."
88       operationId: "get_handles"
89       consumes:
90       - "application/json"
91 #      - "application/yaml"
92       produces:
93       - "application/json"
94 #      - "application/yaml"
95       responses:
96         200:
97           description: "Dummy response"
98   /handles/xapp-handle:
99     post:
100       tags:
101       - "handle"
102       summary: "Provide callback"
103       description: "By performing a POST method on the xapp-handle resource, the API caller is able to perform a callback on Routing Manager."
104       operationId: "provide_xapp_handle"
105       consumes:
106       - "application/json"
107 #      - "application/yaml"
108       produces:
109       - "application/json"
110 #      - "application/yaml"
111       parameters:
112       - in: "body"
113         name: "xapp-callback-data"
114         description: "xApp related callback data"
115         required: true
116         schema:
117           $ref: "#/definitions/xapp-callback-data"
118       responses:
119         400:
120           description: "Invalid data"
121         201:
122           description: "Callback received"
123   /handles/xapp-subscription-handle:
124     post:
125       tags:
126       - "handle"
127       summary: "API for updating about new xapp subscription"
128       description: "By performing a POST method on the xapp-subscription-handle resource, the API caller is able to update the Routing manager about the creation of new subscription by an Xapp instance."
129       operationId: "provide_xapp_subscription_handle"
130       consumes:
131       - "application/json"
132 #      - "application/yaml"
133       produces:
134       - "application/json"
135 #      - "application/yaml"
136       parameters:
137       - in: "body"
138         name: "xapp-subscription-data"
139         description: "xApp related subscription data"
140         required: true
141         schema:
142           $ref: "#/definitions/xapp-subscription-data"
143       responses:
144         400:
145           description: "Invalid data"
146         201:
147           description: "Xapp Subscription data received"
148     delete:
149       tags:
150       - "handle"
151       summary: "API for deleting an xapp subscription"
152       description: "By performing the delete operation on xapp-subscription-handle resource, the API caller will be able to update routing manager about the deletion of an xapp's subscription"
153       operationId: "delete_xapp_subscription_handle"
154       consumes:
155       - "application/json"
156       parameters:
157       - in: "body"
158         name: "xapp-subscription-data"
159         description: "xApp related subscription data"
160         required: true
161         schema:
162           $ref: "#/definitions/xapp-subscription-data"
163       responses:
164         204:
165           description: "Content not found"
166         200:
167           description: "Xapp Subscription deleted"
168   /handles/xapp-subscription-handle/{subscription_id}:
169     put:
170       tags:
171       - "handle"
172       summary: "API for updating the subscriber xApp list"
173       description: "By performing a PUT method on a xapp-subscription-handle/{subscription_id} resource, the API caller is able to update the Routing manager about the list of subscriber xApps related to the subscription denoted by the {subsription_id}."
174       operationId: "update_xapp_subscription_handle"
175       consumes:
176       - "application/json"
177 #      - "application/yaml"
178       produces:
179       - "application/json"
180 #      - "application/yaml"
181       parameters:
182         - in: path
183           name: subscription_id
184           required: true
185           type: integer
186           format: "uint16"
187           description: "Subscription ID"
188         - in: body
189           name: xapp-list
190           description: "xApp list"
191           required: true
192           schema:
193            $ref: "#/definitions/xapp-list"
194       responses:
195         400:
196           description: "Invalid data"
197         201:
198           description: "Xapp list received"
199   /handles/e2t:
200     post:
201       tags:
202       - "handle"
203       summary: "API for establishing platform routes when a new e2t instance gets added to platform"
204       description: "E2T updates its FQDN to E2M  during its initialisation, hence after E2M informs routing manager about new E2T instances FQDN. At this point Routing Mgr would establish platform routes"
205       operationId: "create_new_e2t_handle"
206       consumes:
207       - "application/json"
208 #      - "application/yaml"
209       produces:
210       - "application/json"
211 #      - "application/yaml"
212       parameters:
213         - in: body
214           name: e2t-data
215           description: "FQDN of the newly joined E2T instance"
216           required: true
217           schema:
218            $ref: "#/definitions/e2t-data"
219       responses:
220         400:
221           description: "Invalid data"
222         201:
223           description: "new e2t instance is considered and platform routes are established"
224     delete:
225       tags:
226       - "handle"
227       summary: "API for clearing routes specific to a particular e2T instance"
228       description: "E2M would monitor E2T instances using its keep alive based mechanism during this time if an E2T instance is detected to be dead, E2M would distribute already associated ran's to other available/healthy E2T instances. Here E2M would share E2T instance address to be removed OR which is unhealthy and list of RAN instances to be dissociated and an association list which contains E2T FQDN and associated RAN names"
229       operationId: "delete_e2t_handle"
230       consumes:
231       - "application/json"
232 #      - "application/yaml"
233       produces:
234       - "application/json"
235 #      - "application/yaml"
236       parameters:
237         - in: body
238           name: e2t-data
239           description: "FQDN of the newly joined E2T instance"
240           required: true
241           schema:
242            $ref: "#/definitions/e2t-delete-data"
243       responses:
244         400:
245           description: "Invalid data"
246         201:
247           description: "new e2t instance is considered and platform routes are established"
248   /handles/associate-ran-to-e2t:
249     post:
250       tags:
251       - "handle"
252       summary: "API for associating a ran to e2t instance"
253       description: "By performing a POST method on rane2tmapping, the API caller is able to update the Routing manager about the ran to e2t mapping which would be finally used to distribute routes to corresponding xApp and E2T instance"
254       operationId: "associate_ran_to_e2t_handle"
255       consumes:
256       - "application/json"
257 #      - "application/yaml"
258       produces:
259       - "application/json"
260 #      - "application/yaml"
261       parameters:
262         - in: body
263           name: ran-e2t-list
264           description: "ran to e2t mapping"
265           required: true
266           schema:
267            $ref: "#/definitions/ran-e2t-map"
268       responses:
269         400:
270           description: "Invalid data"
271         201:
272           description: "e2t ran mapping recieved, platform routes"
273   /handles/dissociate-ran:
274     post:
275       tags:
276       - "handle"
277       summary: "API to dissociate ran from e2t"
278       description: "By performing a POST method on rane2tmapping, routing manager will dissociate ran name from e2t instance by updating or clearing routes"
279       operationId: "dissociate_ran"
280       consumes:
281       - "application/json"
282 #      - "application/yaml"
283       produces:
284       - "application/json"
285 #      - "application/yaml"
286       parameters:
287         - in: body
288           name: dissociate-list
289           description: "list of RAN to dissociate"
290           required: true
291           schema:
292            $ref: "#/definitions/ran-e2t-map"
293       responses:
294         400:
295           description: "Invalid data"
296         201:
297           description: "ran instances disociated"
298   /handles/addrmrroute:
299     post:
300       tags:
301       - "handle"
302       summary: "API to add RMR routes"
303       description: "By performing a POST method to add RMR routes"
304       operationId: "add_rmr_route"
305       consumes:
306       - "application/json"
307       produces:
308       - "application/json"
309       parameters:
310         - in: body
311           name: routes-list
312           description: "list of routes to add"
313           required: true
314           schema:
315            $ref: "#/definitions/routelist"
316       responses:
317         400:
318           description: "Invalid data"
319         201:
320           description: "rmr routes added"     
321           
322   /handles/delrmrroute:
323     delete:
324       tags:
325       - "handle"
326       summary: "API to delete RMR routes"
327       description: "By performing a DELETE method to add RMR routes"
328       operationId: "del_rmr_route"
329       consumes:
330       - "application/json"
331       produces:
332       - "application/json"
333       parameters:
334         - in: body
335           name: routes-list
336           description: "list of routes to delete"
337           required: true
338           schema:
339            $ref: "#/definitions/routelist"
340       responses:
341         400:
342           description: "Invalid data"
343         201:
344           description: "rmr routes added" 
345 definitions:
346   health-status:
347     type: "object"
348     properties:
349       status:
350         type: string
351         enum:
352         - healthy
353         - unhealthy
354   xapp-callback-data:
355     type: "object"
356     properties:
357       id:
358         type: "string"
359       event:
360         type: "string"
361       version:
362         type: "integer"
363         format: "int64"
364       xApps:
365         type: "string" #This should be a JSON object, array of xapps
366   xapp-subscription-data:
367     type: "object"
368     required:
369       - "address"
370       - "port"
371       - "subscription_id"
372     properties:
373       address:
374         type: "string" #This is the xapp instance hostname or ip address
375       port: #xapp instance port address
376         type: "integer"
377         format: "uint16"
378         minimum: 0
379         maximum: 65535
380       subscription_id: #subscription sequence number
381         type: "integer"
382         format: "int32"
383   xapp-list:
384     type: "array"
385     items:
386       $ref: '#/definitions/xapp-element'
387   xapp-element:
388     type: "object"
389     required:
390       - "address"
391       - "port"
392     properties:
393       address:
394         type: "string" #This is the xapp instance hostname or ip address
395       port: #xapp instance port address
396         type: "integer"
397         format: "uint16"
398         minimum: 0
399         maximum: 65535
400   ran-e2t-map:
401     type: "array"
402     items:
403       $ref: '#/definitions/ran-e2t-element'
404   ran-e2t-element:
405     type: "object"
406     required:
407       - "E2TAddress"
408     properties:
409       E2TAddress:
410         type: "string" #This is the ideally E2T FQDN or IP:PORT
411       ranNamelist: #list of RAN Names
412         $ref: '#/definitions/ranNamelist'
413   ranNamelist:
414     type: "array"
415     items:
416       type: "string" #This could be FQDN or this needs to be an object?
417   e2t-data:
418     type: "object"
419     required:
420       - "E2TAddress"
421     properties:
422       E2TAddress:
423         type: "string" #This is FQDN or IP of E2T instance
424       ranNamelist:
425         $ref: '#/definitions/ranNamelist'
426   e2t-delete-data:
427     type: "object"
428     required:
429       - "E2TAddress"
430     properties:
431       E2TAddress:
432         type: "string" #This E2T instances FQDN or 
433       ranNamelistTobeDissociated: #xapp instance port address
434         $ref: '#/definitions/ranNamelist'
435       ranAssocList:
436         $ref: "#/definitions/ran-e2t-map"
437   endpoint:
438     type: "object"
439     properties:
440       EndPointName:
441         type: "string"
442       EndPointFqdn:
443         type: "string"
444       EndPointPort:
445         type: "integer"
446         format: "uint16"
447         minimum: 0
448         maximum: 65535
449     
450   debuginfo:
451     type: "object"
452     required:
453       - "RouteTable"
454     properties:
455       RouteTable:
456         type: "array"
457         items:
458           type: "string"
459       RouteConfigs:
460         type: "string"
461
462   add-rmr-route:
463     type: "object"
464     required:
465       - "TargetEndPoint"
466       - "MessageType"
467     properties:
468       TargetEndPoint:
469         type: "string"
470       MessageType:
471         type: "integer"
472         format: "uint32"      
473       SenderEndPoint:
474         type: "string"
475       SubscriptionID:
476         type: "integer"
477         format: "int32"      
478   
479   routelist:
480     type: "array"
481     items:
482       $ref: '#/definitions/add-rmr-route'
483         
484 externalDocs:
485   description: "Routing Manager"
486   url: "http://placeholder"