f54b4817a2bf4144b85c2fc9d63dfb65ffd0c809
[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": "/api/multicloud/v0/",
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                         "name": "name",
98                         "in":  "query",
99                         "description": "server name to filter list",
100                         "required": false,
101                         "type": "string"
102                     },
103                     {
104                         "name": "limit",
105                         "in":  "query",
106                         "description": "Requests a page size of items",
107                         "required": false,
108                         "type": "string"
109                     },
110                     {
111                         "name": "marker",
112                         "in":  "query",
113                         "description": "image ID of the last-seen item",
114                         "required": false,
115                         "type": "string"
116                     }
117                 ],
118                 "responses": {
119                     "200": {
120                         "description": "successful operation",
121                         "schema": {
122                             "$ref": "#/definitions/VimServersInfo"
123                         }
124                     },
125                     "404": {
126                         "description": "the vim id or tenant UUID is wrong"
127                     },
128                     "500": {
129                         "description": "the vim server is not accessable"
130                     }
131                 }
132             }
133         },
134         "/{vimid}/{tenantid}/servers/{serverid}": {
135             "delete": {
136                 "tags": [
137                     "vim servers"
138                  ],
139                  "summary": "delete specific vim server",
140                 "description": "delete specific vim server",
141                 "operationId": "delete_vim_server",
142                 "consumes": [
143                     "application/json"
144                 ],
145                 "produces": [
146                     "application/json"
147                 ],
148                 "parameters": [
149                     {
150                         "name": "vimid",
151                         "in": "path",
152                         "description": "vim instance id",
153                         "required": true,
154                         "type": "string"
155                     },
156                     {
157                         "name": "tenantid",
158                         "in": "path",
159                         "description": "tenant UUID",
160                         "required": true,
161                         "type": "string"
162                     },
163                     {
164                         "name": "serverid",
165                         "in": "path",
166                         "description": "vim server id",
167                         "required": true,
168                         "type": "string"
169                     }
170                 ],
171                 "responses": {
172                     "204": {
173                         "description": "successful operation"
174                     },
175                     "404": {
176                         "description": "the vim id or tenant UUID is wrong"
177                     },
178                     "500": {
179                         "description": "the vim server is not accessable"
180                     }
181                 }
182             },
183             "get": {
184                 "tags": [
185                     "vim servers"
186                 ],
187                 "summary": "query specific vim server",
188                 "description": "query specific vim server",
189                 "operationId": "query_vim_server",
190                 "consumes": [
191                     "application/json"
192                 ],
193                 "produces": [
194                     "application/json"
195                 ],
196                 "parameters": [
197                     {
198                         "name": "vimid",
199                         "in": "path",
200                         "description": "vim instance id",
201                         "required": true,
202                         "type": "string"
203                     },
204                     {
205                         "name": "tenantid",
206                         "in": "path",
207                         "description": "tenant UUID",
208                         "required": true,
209                         "type": "string"
210                     },
211                     {
212                         "name": "serverid",
213                         "in": "path",
214                         "description": "vim server id",
215                         "required": true,
216                         "type": "string"
217                     }
218                 ],
219                 "responses": {
220                     "200": {
221                         "description": "successful operation",
222                         "schema": {
223                             "$ref": "#/definitions/VimServerInfo"
224                         }
225                     },
226                     "404": {
227                         "description": "the vim id or tenant UUID is wrong"
228                     },
229                     "500": {
230                         "description": "the vim server is not accessable"
231                     }
232                 }
233             }
234         }
235     },
236     "definitions": {
237         "CreateVimServer": {
238             "type": "object",
239             "required": [
240                 "name",
241                 "boot",
242                 "flavorId"
243             ],
244             "properties": {
245                 "name": {
246                     "type": "string",
247                     "description": "server name"
248                 },
249                 "boot": {
250                     "type": "object",
251                     "description": "Parameters to start a server",
252                     "properties": {
253                         "type": {
254                             "type": "integer",
255                             "description": "boot type: 1: boot from volume, 2: boot from image"
256                         },
257                         "volumeId": {
258                             "type": "string",
259                             "description": "volume UUID to boot server"
260                         },
261                         "imageId": {
262                             "type": "string",
263                             "description": "image UUID to boot server"
264                         }
265                     }
266                 },
267                 "flavorId": {
268                     "type": "string",
269                     "description": "flavor uuid to start server"
270                 },
271                 "contextArray": {
272                     "type": "array",
273                     "description": "list of injected files",
274                     "items": {
275                        "$ref": "#/definitions/VimServerContextInfo"
276                     }
277                 },
278                 "volumeArray": {
279                     "type": "array",
280                     "description": "list of volumes attached to a server",
281                     "items": {
282                        "$ref": "#/definitions/VimServerVolumeInfo"
283                     }
284                 },
285                 "nicArray": {
286                     "type": "array",
287                     "description": "list of volumes attached to a server",
288                     "items": {
289                        "$ref": "#/definitions/VimServerNicInfo"
290                     }
291                 },
292                 "availabilityZone": {
293                     "type": "string",
294                     "description": "The availability zone from which to launch the server."
295                 },
296                 "metadata": {
297                     "type": "array",
298                     "description": "list of key-value pairs for metadata to start a server",
299                     "items": {
300                        "$ref": "#/definitions/VimServerKeyValuePair"
301                     }                    
302                 },
303                 "userdata": {
304                     "type": "string",
305                     "description": "user data to start a aserver"
306                 },
307                 "securityGroups": {
308                     "type": "array",
309                     "description": "list of security groups for a server",
310                     "items": {
311                         "type": "string",
312                         "description": "name of security group"
313                     }
314                 },
315                 "serverGroup": {
316                     "type": "string",
317                     "description": "server group"
318                 }
319             }
320         },
321         "VimServerKeyValuePair": {
322             "type": "object",
323             "properties": {
324                 "keyName": {
325                     "type": "string",
326                     "description": "key name"
327                 },
328                 "value": {
329                     "type": "string",
330                     "description": "value "
331                 }
332             }
333         },
334         "VimServerContextInfo": {
335             "type": "object",
336             "properties": {
337                 "fileName": {
338                     "type": "string",
339                     "description": "Injected file name"
340                 },
341                 "fileData": {
342                     "type": "string",
343                     "description": "Injected file content "
344                 }
345             }
346         },
347         "VimServerVolumeInfo": {
348             "type": "object",
349             "properties": {
350                 "volumeId": {
351                     "type": "string",
352                     "description": "volume UUID"
353                 }
354             }
355         },
356         "VimServerNicInfo": {
357             "type": "object",
358             "properties": {
359                 "portId": {
360                     "type": "string",
361                     "description": "virtual port UUID to boot a server"
362                 }
363             }
364         },
365         "VimServersInfo": {
366             "type": "object",
367             "required": [
368                 "vimId",
369                 "tenantId",
370                 "servers"
371             ],
372             "properties": {
373                 "vimId": {
374                     "type": "string"
375                 },
376                 "vimName": {
377                     "type": "string"
378                 },
379                 "tenantId": {
380                     "type": "string",
381                     "description": "tenant UUID"
382                 },
383                 "servers": {
384                     "type": "array",
385                     "description": "server list information",
386                     "items": {
387                        "$ref": "#/definitions/VimServerInfo"
388                     }
389                 }
390             }
391         },
392         "VimServerInfo": {
393             "type": "object",
394             "required": [
395                 "name",
396                 "status",
397                 "id"
398             ],
399             "properties": {
400                 "name": {
401                     "type": "string",
402                     "description": "server name"
403                 },
404                 "id": {
405                     "type": "string",
406                     "description": "server UUID"
407                 },
408                 "status": {
409                     "type": "string",
410                     "description": "server status,0:INACTIVE,1:ACTIVE,2:ERROR"
411                 },
412                 "boot": {
413                     "type": "object",
414                     "description": "Parameters to start a server",
415                     "properties": {
416                         "type": {
417                             "type": "integer",
418                             "description": "boot type: 1: boot from volume, 2: boot from image"
419                         },
420                         "volumeId": {
421                             "type": "string",
422                             "description": "volume UUID to boot server"
423                         },
424                         "ImageId": {
425                             "type": "string",
426                             "description": "image UUID to boot server"
427                         }
428                     }
429                 },
430                 "flavorId": {
431                     "type": "string",
432                     "description": "flavor uuid to start server"
433                 },
434                 "volumeArray": {
435                     "type": "array",
436                     "description": "list of volumes attached to a server",
437                     "items": {
438                        "$ref": "#/definitions/VimServerVolumeInfo"
439                     }
440                 },
441                 "nicArray": {
442                     "type": "array",
443                     "description": "list of volumes attached to a server",
444                     "items": {
445                        "$ref": "#/definitions/VimServerNicInfo"
446                     }
447                 },
448                 "availabilityZone": {
449                     "type": "string",
450                     "description": "available zone for a server"
451                 },
452                 "metadata": {
453                     "type": "array",
454                     "description": "list of key-value pairs for metadata to start a server",
455                     "items": {
456                        "$ref": "#/definitions/VimServerKeyValuePair"
457                     }                    
458                 },
459                 "securityGroups": {
460                     "type": "array",
461                     "description": "list of security groups for a server",
462                     "items": {
463                         "type": "string",
464                         "description": "name of security group"
465                     }
466                 },
467                 "serverGroup": {
468                     "type": "string",
469                     "description": "server group"
470                 },
471                 "vimId": {
472                     "type": "string"
473                 },
474                 "vimName": {
475                     "type": "string"
476                 },
477                 "tenantId": {
478                     "type": "string",
479                     "description": "tenant UUID"
480                 },
481                 "returnCode": {
482                     "type": "integer",
483                     "description": "0: Already exist 1: Newly created"
484                 }
485             }
486         }
487     }
488 }