Update tag to be more generic
[multicloud/framework.git] / multivimbroker / multivimbroker / swagger / multivim.server.swagger.json
1 {
2     "swagger": "2.0",
3     "info": {
4         "version": "1.0.0",
5         "title": "MultiVIM Service rest API"
6     },
7     "basePath": "/openoapi/multivim/v1/",
8     "tags": [
9         {
10             "name": "MultiVIM services"
11         }
12     ],
13     "paths": {
14         "/{vimid}/{tenantid}/servers": {
15             "post": {
16                 "tags": [
17                     "vim servers"
18                 ],
19                 "summary": "create a server",
20                 "description": "create a server",
21                 "operationId": "create_vim_server",
22                 "consumes": [
23                     "application/json"
24                 ],
25                 "produces": [
26                     "application/json"
27                 ],
28                 "parameters": [
29                     {
30                         "name": "vimid",
31                         "in": "path",
32                         "description": "vim instance id",
33                         "required": true,
34                         "type": "string"
35                     },
36                     {
37                         "name": "tenantid",
38                         "in": "path",
39                         "description": "tenant UUID",
40                         "required": true,
41                         "type": "string"
42                     },
43                     {
44                         "in": "body",
45                         "name": "body",
46                         "description": "create vim server request param",
47                         "required": true,
48                         "schema": {
49                             "$ref": "#/definitions/CreateVimServer"
50                         }
51                     }
52                 ],
53                 "responses": {
54                     "200": {
55                         "description": "successful operation",
56                         "schema": {
57                             "$ref": "#/definitions/VimServerInfo"
58                         }
59                     },
60                     "404": {
61                         "description": "the vim id or tenant UUID is wrong"
62                     },
63                     "500": {
64                         "description": "the vim server is not accessable"
65                     }
66                 }
67             },
68             "get": {
69                 "tags": [
70                     "vim servers"
71                 ],
72                 "summary": "query vim servers list",
73                 "description": "query vim servers list",
74                 "operationId": "query_vim_servers",
75                 "consumes": [
76                     "application/json"
77                 ],
78                 "produces": [
79                     "application/json"
80                 ],
81                 "parameters": [
82                     {
83                         "name": "vimid",
84                         "in": "path",
85                         "description": "vim instance id",
86                         "required": true,
87                         "type": "string"
88                     },
89                     {
90                         "name": "tenantid",
91                         "in": "path",
92                         "description": "tenant UUID",
93                         "required": true,
94                         "type": "string"
95                     },
96                     {
97                         "in": "body",
98                         "name": "body",
99                         "description": "get a list of vim servers request param",
100                         "required": false,
101                         "schema": {
102                             "$ref": "#/definitions/ListVimServers"
103                         }
104                     }
105                 ],
106                 "responses": {
107                     "200": {
108                         "description": "successful operation",
109                         "schema": {
110                             "$ref": "#/definitions/VimServersInfo"
111                         }
112                     },
113                     "404": {
114                         "description": "the vim id or tenant UUID is wrong"
115                     },
116                     "500": {
117                         "description": "the vim server is not accessable"
118                     }
119                 }
120             }
121         },
122         "/{vimid}/{tenantid}/servers/{serverid}": {
123             "delete": {
124                 "tags": [
125                     "vim servers"
126                  ],
127                  "summary": "delete specific vim server",
128                 "description": "delete specific vim server",
129                 "operationId": "delete_vim_server",
130                 "consumes": [
131                     "application/json"
132                 ],
133                 "produces": [
134                     "application/json"
135                 ],
136                 "parameters": [
137                     {
138                         "name": "vimid",
139                         "in": "path",
140                         "description": "vim instance id",
141                         "required": true,
142                         "type": "string"
143                     },
144                     {
145                         "name": "tenantid",
146                         "in": "path",
147                         "description": "tenant UUID",
148                         "required": true,
149                         "type": "string"
150                     },
151                     {
152                         "name": "serverid",
153                         "in": "path",
154                         "description": "vim server id",
155                         "required": true,
156                         "type": "string"
157                     }
158                 ],
159                 "responses": {
160                     "204": {
161                         "description": "successful operation"
162                     },
163                     "404": {
164                         "description": "the vim id or tenant UUID is wrong"
165                     },
166                     "500": {
167                         "description": "the vim server is not accessable"
168                     }
169                 }
170             },
171             "get": {
172                 "tags": [
173                     "vim servers"
174                 ],
175                 "summary": "query specific vim server",
176                 "description": "query specific vim server",
177                 "operationId": "query_vim_server",
178                 "consumes": [
179                     "application/json"
180                 ],
181                 "produces": [
182                     "application/json"
183                 ],
184                 "parameters": [
185                     {
186                         "name": "vimid",
187                         "in": "path",
188                         "description": "vim instance id",
189                         "required": true,
190                         "type": "string"
191                     },
192                     {
193                         "name": "tenantid",
194                         "in": "path",
195                         "description": "tenant UUID",
196                         "required": true,
197                         "type": "string"
198                     },
199                     {
200                         "name": "serverid",
201                         "in": "path",
202                         "description": "vim server id",
203                         "required": true,
204                         "type": "string"
205                     }
206                 ],
207                 "responses": {
208                     "200": {
209                         "description": "successful operation",
210                         "schema": {
211                             "$ref": "#/definitions/VimServerInfo"
212                         }
213                     },
214                     "404": {
215                         "description": "the vim id or tenant UUID is wrong"
216                     },
217                     "500": {
218                         "description": "the vim server is not accessable"
219                     }
220                 }
221             }
222         }
223     },
224     "definitions": {
225         "CreateVimServer": {
226             "type": "object",
227             "required": [
228                 "name",
229                 "boot",
230                 "flavorId"
231             ],
232             "properties": {
233                 "name": {
234                     "type": "string",
235                     "description": "server name"
236                 },
237                 "boot": {
238                     "type": "object",
239                     "description": "Parameters to start a server",
240                     "properties": {
241                         "type": {
242                             "type": "integer",
243                             "description": "boot type: 1: boot from volume, 2: boot from image"
244                         },
245                         "volumeId": {
246                             "type": "string",
247                             "description": "volume UUID to boot server"
248                         },
249                         "imageId": {
250                             "type": "string",
251                             "description": "image UUID to boot server"
252                         }
253                     }
254                 },
255                 "flavorId": {
256                     "type": "string",
257                     "description": "flavor uuid to start server"
258                 },
259                 "contextArray": {
260                     "type": "array",
261                     "description": "list of injected files",
262                     "items": {
263                        "$ref": "#/definitions/VimServerContextInfo"
264                     }
265                 },
266                 "volumeArray": {
267                     "type": "array",
268                     "description": "list of volumes attached to a server",
269                     "items": {
270                        "$ref": "#/definitions/VimServerVolumeInfo"
271                     }
272                 },
273                 "nicArray": {
274                     "type": "array",
275                     "description": "list of volumes attached to a server",
276                     "items": {
277                        "$ref": "#/definitions/VimServerNicInfo"
278                     }
279                 },
280                 "availabilityZone": {
281                     "type": "string",
282                     "description": "The availability zone from which to launch the server."
283                 },
284                 "metadata": {
285                     "type": "array",
286                     "description": "list of key-value pairs for metadata to start a server",
287                     "items": {
288                        "$ref": "#/definitions/VimServerKeyValuePair"
289                     }                    
290                 },
291                 "userdata": {
292                     "type": "string",
293                     "description": "user data to start a aserver"
294                 },
295                 "securityGroups": {
296                     "type": "array",
297                     "description": "list of security groups for a server",
298                     "items": {
299                         "type": "string",
300                         "description": "name of security group"
301                     }
302                 },
303                 "serverGroup": {
304                     "type": "string",
305                     "description": "server group"
306                 }
307             }
308         },
309         "VimServerKeyValuePair": {
310             "type": "object",
311             "properties": {
312                 "keyName": {
313                     "type": "string",
314                     "description": "key name"
315                 },
316                 "value": {
317                     "type": "string",
318                     "description": "value "
319                 }
320             }
321         },
322         "VimServerContextInfo": {
323             "type": "object",
324             "properties": {
325                 "fileName": {
326                     "type": "string",
327                     "description": "Injected file name"
328                 },
329                 "fileData": {
330                     "type": "string",
331                     "description": "Injected file content "
332                 }
333             }
334         },
335         "VimServerVolumeInfo": {
336             "type": "object",
337             "properties": {
338                 "volumeId": {
339                     "type": "string",
340                     "description": "volume UUID"
341                 }
342             }
343         },
344         "VimServerNicInfo": {
345             "type": "object",
346             "properties": {
347                 "portId": {
348                     "type": "string",
349                     "description": "virtual port UUID to boot a server"
350                 }
351             }
352         },
353         "ListVimServers": {
354             "type": "object",
355             "properties": {
356                 "name": {
357                     "type": "string",
358                     "description": "server name to filter server list"
359                 },
360                 "limit": {
361                     "type": "integer",
362                     "description": "Requests a page size of items"
363                 },
364                 "marker": {
365                     "type": "string",
366                     "description": "server ID of the last-seen item"
367                 }
368             }
369         },
370         "VimServersInfo": {
371             "type": "object",
372             "required": [
373                 "vimId",
374                 "tenantId",
375                 "servers"
376             ],
377             "properties": {
378                 "vimId": {
379                     "type": "string"
380                 },
381                 "vimName": {
382                     "type": "string"
383                 },
384                 "tenantId": {
385                     "type": "string",
386                     "description": "tenant UUID"
387                 },
388                 "servers": {
389                     "type": "array",
390                     "description": "server list information",
391                     "items": {
392                        "$ref": "#/definitions/VimServerInfo"
393                     }
394                 }
395             }
396         },
397         "VimServerInfo": {
398             "type": "object",
399             "required": [
400                 "name",
401                 "status",
402                 "id"
403             ],
404             "properties": {
405                 "name": {
406                     "type": "string",
407                     "description": "server name"
408                 },
409                 "id": {
410                     "type": "string",
411                     "description": "server UUID"
412                 },
413                 "status": {
414                     "type": "string",
415                     "description": "server status,0:INACTIVE,1:ACTIVE,2:ERROR"
416                 },
417                 "boot": {
418                     "type": "object",
419                     "description": "Parameters to start a server",
420                     "properties": {
421                         "type": {
422                             "type": "integer",
423                             "description": "boot type: 1: boot from volume, 2: boot from image"
424                         },
425                         "volumeId": {
426                             "type": "string",
427                             "description": "volume UUID to boot server"
428                         },
429                         "ImageId": {
430                             "type": "string",
431                             "description": "image UUID to boot server"
432                         }
433                     }
434                 },
435                 "flavorId": {
436                     "type": "string",
437                     "description": "flavor uuid to start server"
438                 },
439                 "volumeArray": {
440                     "type": "array",
441                     "description": "list of volumes attached to a server",
442                     "items": {
443                        "$ref": "#/definitions/VimServerVolumeInfo"
444                     }
445                 },
446                 "nicArray": {
447                     "type": "array",
448                     "description": "list of volumes attached to a server",
449                     "items": {
450                        "$ref": "#/definitions/VimServerNicInfo"
451                     }
452                 },
453                 "availabilityZone": {
454                     "type": "string",
455                     "description": "available zone for a server"
456                 },
457                 "metadata": {
458                     "type": "array",
459                     "description": "list of key-value pairs for metadata to start a server",
460                     "items": {
461                        "$ref": "#/definitions/VimServerKeyValuePair"
462                     }                    
463                 },
464                 "securityGroups": {
465                     "type": "array",
466                     "description": "list of security groups for a server",
467                     "items": {
468                         "type": "string",
469                         "description": "name of security group"
470                     }
471                 },
472                 "serverGroup": {
473                     "type": "string",
474                     "description": "server group"
475                 },
476                 "vimId": {
477                     "type": "string"
478                 },
479                 "vimName": {
480                     "type": "string"
481                 },
482                 "tenantId": {
483                     "type": "string",
484                     "description": "tenant UUID"
485                 },
486                 "returnCode": {
487                     "type": "integer",
488                     "description": "0: Already exist 1: Newly created"
489                 }
490             }
491         }
492     }
493 }