Moving to ubuntu 18 and fixing UT's
[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 definitions:
299   health-status:
300     type: "object"
301     properties:
302       status:
303         type: string
304         enum:
305         - healthy
306         - unhealthy
307   xapp-callback-data:
308     type: "object"
309     properties:
310       id:
311         type: "string"
312       event:
313         type: "string"
314       version:
315         type: "integer"
316         format: "int64"
317       xApps:
318         type: "string" #This should be a JSON object, array of xapps
319   xapp-subscription-data:
320     type: "object"
321     required:
322       - "address"
323       - "port"
324       - "subscription_id"
325     properties:
326       address:
327         type: "string" #This is the xapp instance hostname or ip address
328       port: #xapp instance port address
329         type: "integer"
330         format: "uint16"
331         minimum: 0
332         maximum: 65535
333       subscription_id: #subscription sequence number
334         type: "integer"
335         format: "int32"
336   xapp-list:
337     type: "array"
338     items:
339       $ref: '#/definitions/xapp-element'
340   xapp-element:
341     type: "object"
342     required:
343       - "address"
344       - "port"
345     properties:
346       address:
347         type: "string" #This is the xapp instance hostname or ip address
348       port: #xapp instance port address
349         type: "integer"
350         format: "uint16"
351         minimum: 0
352         maximum: 65535
353   ran-e2t-map:
354     type: "array"
355     items:
356       $ref: '#/definitions/ran-e2t-element'
357   ran-e2t-element:
358     type: "object"
359     required:
360       - "E2TAddress"
361     properties:
362       E2TAddress:
363         type: "string" #This is the ideally E2T FQDN or IP:PORT
364       ranNamelist: #list of RAN Names
365         $ref: '#/definitions/ranNamelist'
366   ranNamelist:
367     type: "array"
368     items:
369       type: "string" #This could be FQDN or this needs to be an object?
370   e2t-data:
371     type: "object"
372     required:
373       - "E2TAddress"
374     properties:
375       E2TAddress:
376         type: "string" #This is FQDN or IP of E2T instance
377       ranNamelist:
378         $ref: '#/definitions/ranNamelist'
379   e2t-delete-data:
380     type: "object"
381     required:
382       - "E2TAddress"
383     properties:
384       E2TAddress:
385         type: "string" #This E2T instances FQDN or 
386       ranNamelistTobeDissociated: #xapp instance port address
387         $ref: '#/definitions/ranNamelist'
388       ranAssocList:
389         $ref: "#/definitions/ran-e2t-map"
390   endpoint:
391     type: "object"
392     properties:
393       EndPointName:
394         type: "string"
395       EndPointFqdn:
396         type: "string"
397       EndPointPort:
398         type: "integer"
399         format: "uint16"
400         minimum: 0
401         maximum: 65535
402     
403   debuginfo:
404     type: "object"
405     required:
406       - "RouteTable"
407     properties:
408       RouteTable:
409         type: "array"
410         items:
411           type: "string"
412       RouteConfigs:
413         type: "string"
414
415 externalDocs:
416   description: "Routing Manager"
417   url: "http://placeholder"