Initial commit of RIC Dashboard webapp
[portal/ric-dashboard.git] / xapp-mgr-client / xapp_manager_rest_api_v0_0_10.json
1 {
2     "swagger": "2.0",
3     "info": {
4       "description": "This is a draft API for RIC xapp-manager",
5       "version": "0.0.10",
6       "title": "RIC xapp-manager"
7     },
8     "host": "hostname",
9     "basePath": "/ric/v1/xapps",
10     "schemes": [
11       "https",
12       "http"
13     ],
14     "paths": {
15       "/ric/v1/health": {
16         "get": {
17           "summary": "Health check of xApp Manager",
18           "operationId": "getHealth",
19           "responses": {
20             "200": {
21               "description": "Status of xApp Manager is ok"
22             }
23           }
24         }
25       },
26       "/ric/v1/xapps": {
27         "post": {
28           "summary": "Deploy a xapp",
29           "operationId": "deployXapp",
30           "consumes": [
31             "application/json"
32           ],
33           "produces": [
34             "application/json"
35           ],
36           "parameters": [
37             {
38               "name": "xAppInfo",
39               "in": "body",
40               "description": "xApp information",
41               "schema": {
42                 "type": "object",
43                 "required": [
44                   "xAppName"
45                 ],
46                 "properties": {
47                   "xAppName": {
48                     "type":"string",
49                     "description":"Name of the xApp",
50                     "example": "xapp-dummy"
51                   }
52                 }
53               }
54             }
55           ],
56           "responses": {
57             "201": {
58               "description": "xApp successfully created",
59               "schema": {
60                 "$ref": "#/definitions/Xapp"
61               }
62             },
63             "400": {
64               "description": "Invalid input"
65             },
66             "500": {
67               "description": "Internal error"
68             }
69           }
70         },
71         "get": {
72           "summary": "Returns the status of all xapps",
73           "operationId": "getAllXapps",
74           "produces": [
75             "application/json"
76           ],
77           "responses": {
78             "200": {
79               "description": "successful query of xApps",
80               "schema": {
81                 "$ref": "#/definitions/AllXapps"
82               }
83             },
84             "500": {
85               "description": "Internal error"
86             }
87           }
88         }
89       },
90       "/ric/v1/xapps/{xAppName}": {
91         "get": {
92           "summary": "Returns the status of a given xapp",
93           "operationId": "getXappByName",
94           "produces": [
95             "application/json"
96           ],
97           "parameters": [
98             {
99               "name": "xAppName",
100               "in": "path",
101               "description": "Name of xApp",
102               "required": true,
103               "type": "string"
104             }
105           ],
106           "responses": {
107             "200": {
108               "description": "successful operation",
109               "schema": {
110                 "$ref": "#/definitions/Xapp"
111               }
112             },
113             "400": {
114               "description": "Invalid ID supplied"
115             },
116             "404": {
117               "description": "Xapp not found"
118             },
119             "500": {
120               "description": "Internal error"
121             }
122           }
123         },
124         "delete": {
125           "summary": "Undeploy an existing xapp",
126           "operationId": "undeployXapp",
127           "parameters": [
128             {
129               "name": "xAppName",
130               "in": "path",
131               "description": "Xapp to be undeployed",
132               "required": true,
133               "type": "string"
134             }
135           ],
136           "responses": {
137             "204": {
138               "description": "Successful deletion of xApp"
139             },
140             "400": {
141               "description": "Invalid xApp name supplied"
142             },
143             "500": {
144               "description": "Internal error"
145             }
146           }
147         }
148       },
149       "/ric/v1/xapps/{xAppName}/instances/{xAppInstanceName}": {
150         "get": {
151           "summary": "Returns the status of a given xapp",
152           "operationId": "getXappInstanceByName",
153           "produces": [
154             "application/json"
155           ],
156           "parameters": [
157             {
158               "name": "xAppName",
159               "in": "path",
160               "description": "Name of xApp",
161               "required": true,
162               "type": "string"
163             },
164             {
165               "name": "xAppInstanceName",
166               "in": "path",
167               "description": "Name of xApp instance to get information",
168               "required": true,
169               "type": "string"
170             }
171           ],
172           "responses": {
173             "200": {
174               "description": "successful operation",
175               "schema": {
176                 "$ref": "#/definitions/XappInstance"
177               }
178             },
179             "400": {
180               "description": "Invalid name supplied"
181             },
182             "404": {
183               "description": "Xapp not found"
184             },
185             "500": {
186               "description": "Internal error"
187             }
188           }
189         }
190       },
191       "/ric/v1/subscriptions": {
192         "post": {
193           "summary": "Subscribe event",
194           "operationId": "addSubscription",
195           "consumes": [
196             "application/json"
197           ],
198           "produces": [
199             "application/json"
200           ],
201           "parameters": [
202             {
203               "name": "subscriptionRequest",
204               "in": "body",
205               "description": "New subscription",
206               "required": true,
207               "schema": {
208                 "$ref": "#/definitions/subscriptionRequest"
209               }
210             }
211           ],
212           "responses": {
213             "200": {
214               "description": "Subscription successful",
215               "schema": {
216                 "$ref": "#/definitions/subscriptionResponse"
217               }
218             },
219             "400": {
220               "description": "Invalid input"
221             }
222           }
223         },
224         "get": {
225           "summary": "Returns all subscriptions",
226           "operationId": "getSubscriptions",
227           "produces": [
228             "application/json"
229           ],
230           "responses": {
231             "200": {
232               "description": "successful query of subscriptions",
233               "schema": {
234                 "$ref": "#/definitions/allSubscriptions"
235               }
236             }
237           }
238         }
239       },
240       "/ric/v1/subscriptions/{subscriptionId}": {
241         "get": {
242           "summary": "Returns the information of subscription",
243           "operationId": "getSubscriptionById",
244           "produces": [
245             "application/json"
246           ],
247           "parameters": [
248             {
249               "name": "subscriptionId",
250               "in": "path",
251               "description": "ID of subscription",
252               "required": true,
253               "type": "integer"
254             }
255           ],
256           "responses": {
257             "200": {
258               "description": "successful operation",
259               "schema": {
260                 "$ref": "#/definitions/subscription"
261               }
262             },
263             "400": {
264               "description": "Invalid ID supplied"
265             },
266             "404": {
267               "description": "Subscription not found"
268             }
269           }
270         },
271         "put": {
272           "summary": "Modify event subscription",
273           "operationId": "modifySubscription",
274           "consumes": [
275             "application/json"
276           ],
277           "produces": [
278             "application/json"
279           ],
280           "parameters": [
281             {
282               "name": "subscriptionId",
283               "in": "path",
284               "description": "ID of subscription",
285               "required": true,
286               "type": "integer"
287             },
288             {
289               "in": "body",
290               "name": "subscriptionRequest",
291               "description": "Modified subscription",
292               "required": true,
293               "schema": {
294                 "$ref": "#/definitions/subscriptionRequest"
295               }
296             }
297           ],
298           "responses": {
299             "200": {
300               "description": "Subscription modification successful",
301               "schema": {
302                 "$ref": "#/definitions/subscriptionResponse"
303               }
304             },
305             "400": {
306               "description": "Invalid input"
307             }
308           }
309         },
310         "delete": {
311           "summary": "Unsubscribe event",
312           "description": "",
313           "operationId": "deleteSubscription",
314           "parameters": [
315             {
316               "name": "subscriptionId",
317               "in": "path",
318               "description": "ID of subscription",
319               "required": true,
320               "type": "integer"
321             }
322           ],
323           "responses": {
324             "204": {
325               "description": "Successful deletion of subscription"
326             },
327             "400": {
328               "description": "Invalid subscription supplied"
329             }
330           }
331         }
332       }
333     },
334     "definitions": {
335       "AllXapps": {
336         "type": "array",
337         "items": {
338           "$ref": "#/definitions/Xapp"
339         }
340       },
341       "Xapp": {
342         "type": "object",
343         "required": [
344           "name"
345         ],
346         "properties": {
347           "name": {
348             "type": "string",
349             "example": "xapp-dummy"
350           },
351           "status": {
352             "type": "string",
353             "description": "xapp status in the RIC",
354             "enum": [
355               "unknown",
356               "deployed",
357               "deleted",
358               "superseded",
359               "failed",
360               "deleting"
361             ]
362           },
363           "version": {
364             "type": "string",
365             "example": "1.2.3"
366           },
367           "instances": {
368             "type": "array",
369             "items": {
370               "$ref": "#/definitions/XappInstance"
371             }
372           }
373         }
374       },
375       "XappInstance": {
376         "type": "object",
377         "required": [
378           "name"
379         ],
380         "properties": {
381           "name": {
382             "type": "string",
383             "example": "xapp-dummy-6cd577d9-4v255"
384           },
385           "status": {
386             "type": "string",
387             "description": "xapp instance status",
388             "enum": [
389               "pending",
390               "running",
391               "succeeded",
392               "failed",
393               "unknown",
394               "completed",
395               "crashLoopBackOff"
396             ]
397           },
398           "ip": {
399             "type": "string",
400             "example": "192.168.0.1"
401           },
402           "port": {
403             "type": "integer",
404             "example": 32300
405           },
406           "txMessages" : {
407             "type": "array",
408             "items": {
409               "type" : "string",
410               "example" : "ControlIndication"
411             }
412           },
413           "rxMessages" : {
414             "type": "array",
415             "items": {
416               "type" : "string",
417               "example" : "LoadIndication"
418             }
419           }
420         }
421       },
422       "subscriptionRequest": {
423         "type": "object",
424         "required": [
425           "targetUrl",
426           "eventType",
427           "maxRetries",
428           "retryTimer"
429         ],
430         "properties": {
431           "targetUrl": {
432             "type": "string",
433             "example": "http://localhost:11111/apps/webhook/"
434           },
435           "eventType": {
436             "type": "string",
437             "description": "Event which is subscribed",
438             "enum": [
439               "created",
440               "deleted",
441               "all"
442             ]
443           },
444           "maxRetries": {
445             "type": "integer",
446             "description": "Maximum number of retries",
447             "example": 11
448           },
449           "retryTimer": {
450             "type": "integer",
451             "description": "Time in seconds to wait before next retry",
452             "example": 22
453           }
454         }
455       },
456       "subscriptionResponse": {
457         "type": "object",
458         "properties": {
459           "id": {
460             "type": "string",
461             "example": "1ILBltYYzEGzWRrVPZKmuUmhwcc"
462           },
463           "version": {
464             "type": "integer",
465             "example": 2
466           },
467           "eventType": {
468             "type": "string",
469             "description": "Event which is subscribed",
470             "enum": [
471               "created",
472               "deleted",
473               "all"
474             ]
475           }
476         }
477       },
478       "allSubscriptions": {
479         "type": "array",
480         "items": {
481           "$ref": "#/definitions/subscription"
482         }
483       },
484       "subscription": {
485         "type": "object",
486         "properties": {
487           "id": {
488             "type": "string",
489             "example": "1ILBltYYzEGzWRrVPZKmuUmhwcc"
490           },
491           "targetUrl": {
492             "type": "string",
493             "example": "http://localhost:11111/apps/webhook/"
494           },
495           "eventType": {
496             "type": "string",
497             "description": "Event which is subscribed",
498             "enum": [
499               "created",
500               "deleted",
501               "all"
502             ]
503           },
504           "maxRetries": {
505             "type": "integer",
506             "description": "Maximum number of retries",
507             "example": 11
508           },
509           "retryTimer": {
510             "type": "integer",
511             "description": "Time in seconds to wait before next retry",
512             "example": 22
513           }
514         }
515       },
516       "subscriptionNotification": {
517         "type": "object",
518         "properties": {
519           "id": {
520             "type": "string",
521             "example": "1ILBltYYzEGzWRrVPZKmuUmhwcc"
522           },
523           "version": {
524             "type": "integer",
525             "example": 2
526           },
527           "eventType": {
528             "type": "string",
529             "description": "Event to be notified",
530             "enum": [
531               "created",
532               "deleted"
533             ]
534           },
535           "xApps": {
536             "$ref": "#/definitions/AllXapps"
537           }
538         }
539       }
540     }
541   }