Add new test cases
[ric-plt/submgr.git] / api / routing_manager.yaml
1 #
2 #==================================================================================
3 #   Copyright (c) 2019 AT&T Intellectual Property.
4 #   Copyright (c) 2019 Nokia
5 #
6 #   Licensed under the Apache License, Version 2.0 (the "License");
7 #   you may not use this file except in compliance with the License.
8 #   You may obtain a copy of the License at
9 #
10 #       http://www.apache.org/licenses/LICENSE-2.0
11 #
12 #   Unless required by applicable law or agreed to in writing, software
13 #   distributed under the License is distributed on an "AS IS" BASIS,
14 #   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 #   See the License for the specific language governing permissions and
16 #   limitations under the License.
17 #==================================================================================
18 #
19 #
20 #   Abstract:   Routing Manager's RESTful API definition
21 #   Date:       28 August 2019
22 #
23 swagger: "2.0"
24 info:
25   title: Routing Manager
26   description: "This is the Swagger/OpenAPI 2.0 definition of Routing Manager's Northbound API."
27   version: "0.4.0"
28   license:
29     name: "Apache 2.0"
30     url: "http://www.apache.org/licenses/LICENSE-2.0.html"
31 host: "rtmgr"
32 basePath: "/ric/v1"
33 tags:
34 - name: "handle"
35   description: "Available handles"
36 #  externalDocs:
37 #    description: "Find out more"
38 #    url: "http://127.0.0.1"
39 - name: "health"
40   description: "Health of the system"
41 schemes:
42 #- "https"
43 - "http"
44 paths:
45   /health:
46     get:
47       tags:
48       - "health"
49       summary: "Retrive the health of Routing Manager"
50       description: "By performing a GET method on the health resource, the API caller is able to retrieve the health of Routing Manager"
51       operationId: "get_health"
52       consumes:
53       - "application/json"
54 #      - "application/yaml"
55       produces:
56       - "application/json"
57 #      - "application/yaml"
58       responses:
59         200:
60           description: "The health of the system"
61           schema:
62             "$ref": "#/definitions/health-status"
63   /handles:
64     get:
65       tags:
66       - "handle"
67       summary: "Placeholder for further usage"
68       description: "Placeholder for further usage."
69       operationId: "get_handles"
70       consumes:
71       - "application/json"
72 #      - "application/yaml"
73       produces:
74       - "application/json"
75 #      - "application/yaml"
76       responses:
77         200:
78           description: "Dummy response"
79   /handles/xapp-handle:
80     post:
81       tags:
82       - "handle"
83       summary: "Provide callback"
84       description: "By performing a POST method on the xapp-handle resource, the API caller is able to perform a callback on Routing Manager."
85       operationId: "provide_xapp_handle"
86       consumes:
87       - "application/json"
88 #      - "application/yaml"
89       produces:
90       - "application/json"
91 #      - "application/yaml"
92       parameters:
93       - in: "body"
94         name: "xapp-callback-data"
95         description: "xApp related callback data"
96         required: true
97         schema:
98           $ref: "#/definitions/xapp-callback-data"
99       responses:
100         400:
101           description: "Invalid data"
102         201:
103           description: "Callback received"
104   /handles/xapp-subscription-handle:
105     post:
106       tags:
107       - "handle"
108       summary: "API for updating about new xapp subscription"
109       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."
110       operationId: "provide_xapp_subscription_handle"
111       consumes:
112       - "application/json"
113 #      - "application/yaml"
114       produces:
115       - "application/json"
116 #      - "application/yaml"
117       parameters:
118       - in: "body"
119         name: "xapp-subscription-data"
120         description: "xApp related subscription data"
121         required: true
122         schema:
123           $ref: "#/definitions/xapp-subscription-data"
124       responses:
125         400:
126           description: "Invalid data"
127         201:
128           description: "Xapp Subscription data received"
129     delete:
130       tags:
131       - "handle"
132       summary: "API for deleting an xapp subscription"
133       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"
134       operationId: "delete_xapp_subscription_handle"
135       consumes:
136       - "application/json"
137       parameters:
138       - in: "body"
139         name: "xapp-subscription-data"
140         description: "xApp related subscription data"
141         required: true
142         schema:
143           $ref: "#/definitions/xapp-subscription-data"
144       responses:
145         204:
146           description: "Content not found"
147         200:
148           description: "Xapp Subscription deleted"
149   /handles/xapp-subscription-handle/{subscription_id}:
150     put:
151       tags:
152       - "handle"
153       summary: "API for updating the subscriber xApp list"
154       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}."
155       operationId: "update_xapp_subscription_handle"
156       consumes:
157       - "application/json"
158 #      - "application/yaml"
159       produces:
160       - "application/json"
161 #      - "application/yaml"
162       parameters:
163         - in: path
164           name: subscription_id
165           required: true
166           type: integer
167           format: "uint16"
168           description: "Subscription ID"
169         - in: body
170           name: xapp-list
171           description: "xApp list"
172           required: true
173           schema:
174            $ref: "#/definitions/xapp-list"
175       responses:
176         400:
177           description: "Invalid data"
178         201:
179           description: "Xapp list received"
180   /handles/e2t:
181     post:
182       tags:
183       - "handle"
184       summary: "API for establishing platform routes when a new e2t instance gets added to platform"
185       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"
186       operationId: "create_new_e2t_handle"
187       consumes:
188       - "application/json"
189 #      - "application/yaml"
190       produces:
191       - "application/json"
192 #      - "application/yaml"
193       parameters:
194         - in: body
195           name: e2t-data
196           description: "FQDN of the newly joined E2T instance"
197           required: true
198           schema:
199            $ref: "#/definitions/e2t-data"
200       responses:
201         400:
202           description: "Invalid data"
203         201:
204           description: "new e2t instance is considered and platform routes are established"
205     delete:
206       tags:
207       - "handle"
208       summary: "API for clearing routes specific to a particular e2T instance"
209       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"
210       operationId: "delete_e2t_handle"
211       consumes:
212       - "application/json"
213 #      - "application/yaml"
214       produces:
215       - "application/json"
216 #      - "application/yaml"
217       parameters:
218         - in: body
219           name: e2t-data
220           description: "FQDN of the newly joined E2T instance"
221           required: true
222           schema:
223            $ref: "#/definitions/e2t-delete-data"
224       responses:
225         400:
226           description: "Invalid data"
227         201:
228           description: "new e2t instance is considered and platform routes are established"
229   /handles/associate-ran-to-e2t:
230     post:
231       tags:
232       - "handle"
233       summary: "API for associating a ran to e2t instance"
234       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"
235       operationId: "associate_ran_to_e2t_handle"
236       consumes:
237       - "application/json"
238 #      - "application/yaml"
239       produces:
240       - "application/json"
241 #      - "application/yaml"
242       parameters:
243         - in: body
244           name: ran-e2t-list
245           description: "ran to e2t mapping"
246           required: true
247           schema:
248            $ref: "#/definitions/ran-e2t-map"
249       responses:
250         400:
251           description: "Invalid data"
252         201:
253           description: "e2t ran mapping recieved, platform routes"
254   /handles/dissociate-ran:
255     post:
256       tags:
257       - "handle"
258       summary: "API to dissociate ran from e2t"
259       description: "By performing a POST method on rane2tmapping, routing manager will dissociate ran name from e2t instance by updating or clearing routes"
260       operationId: "dissociate_ran"
261       consumes:
262       - "application/json"
263 #      - "application/yaml"
264       produces:
265       - "application/json"
266 #      - "application/yaml"
267       parameters:
268         - in: body
269           name: dissociate-list
270           description: "list of RAN to dissociate"
271           required: true
272           schema:
273            $ref: "#/definitions/ran-e2t-map"
274       responses:
275         400:
276           description: "Invalid data"
277         201:
278           description: "ran instances disociated"
279 definitions:
280   health-status:
281     type: "object"
282     properties:
283       status:
284         type: string
285         enum:
286         - healthy
287         - unhealthy
288   xapp-callback-data:
289     type: "object"
290     properties:
291       id:
292         type: "string"
293       event:
294         type: "string"
295       version:
296         type: "integer"
297         format: "int64"
298       xApps:
299         type: "string" #This should be a JSON object, array of xapps
300   xapp-subscription-data:
301     type: "object"
302     required:
303       - "address"
304       - "port"
305       - "subscription_id"
306     properties:
307       address:
308         type: "string" #This is the xapp instance hostname or ip address
309       port: #xapp instance port address
310         type: "integer"
311         format: "uint16"
312         minimum: 0
313         maximum: 65535
314       subscription_id: #subscription sequence number
315         type: "integer"
316         format: "int32"
317   xapp-list:
318     type: "array"
319     items:
320       $ref: '#/definitions/xapp-element'
321   xapp-element:
322     type: "object"
323     required:
324       - "address"
325       - "port"
326     properties:
327       address:
328         type: "string" #This is the xapp instance hostname or ip address
329       port: #xapp instance port address
330         type: "integer"
331         format: "uint16"
332         minimum: 0
333         maximum: 65535
334   ran-e2t-map:
335     type: "array"
336     items:
337       $ref: '#/definitions/ran-e2t-element'
338   ran-e2t-element:
339     type: "object"
340     required:
341       - "E2TAddress"
342     properties:
343       E2TAddress:
344         type: "string" #This is the ideally E2T FQDN or IP:PORT
345       ranNamelist: #list of RAN Names
346         $ref: '#/definitions/ranNamelist'
347   ranNamelist:
348     type: "array"
349     items:
350       type: "string" #This could be FQDN or this needs to be an object?
351   e2t-data:
352     type: "object"
353     required:
354       - "E2TAddress"
355     properties:
356       E2TAddress:
357         type: "string" #This is FQDN or IP of E2T instance
358       ranNamelist:
359         $ref: '#/definitions/ranNamelist'
360   e2t-delete-data:
361     type: "object"
362     required:
363       - "E2TAddress"
364     properties:
365       E2TAddress:
366         type: "string" #This E2T instances FQDN or 
367       ranNamelistTobeDissociated: #xapp instance port address
368         $ref: '#/definitions/ranNamelist'
369       ranAssocList:
370         $ref: "#/definitions/ran-e2t-map"
371           
372
373 externalDocs:
374   description: "Routing Manager"
375   url: "http://placeholder"
376
377