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