Setup micro-service of multivim broker
[multicloud/framework.git] / multivimbroker / multivimbroker / swagger / multivim.flavor.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 broker"
11         }
12     ],
13     "paths": {
14         "/{vimid}/{tenantid}/flavors": {
15             "post": {
16                 "tags": [
17                     "vim flavors"
18                 ],
19                 "summary": "create a flavor",
20                 "description": "create a flavor",
21                 "operationId": "create_vim_flavor",
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 flavor request param",
47                         "required": true,
48                         "schema": {
49                             "$ref": "#/definitions/CreateVimFlavor"
50                         }
51                     }
52                 ],
53                 "responses": {
54                     "200": {
55                         "description": "successful operation",
56                         "schema": {
57                             "$ref": "#/definitions/VimFlavorInfo"
58                         }
59                     },
60                     "404": {
61                         "description": "the vim id or tenant UUID is wrong"
62                     },
63                     "500": {
64                         "description": "the vim flavor is not accessable"
65                     }
66                 }
67             },
68             "get": {
69                 "tags": [
70                     "vim flavors"
71                 ],
72                 "summary": "query vim flavors list",
73                 "description": "query vim flavors list",
74                 "operationId": "query_vim_flavors",
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 flavors request param",
100                         "required": false,
101                         "schema": {
102                             "$ref": "#/definitions/ListVimFlavors"
103                         }
104                     }
105                 ],
106                 "responses": {
107                     "200": {
108                         "description": "successful operation",
109                         "schema": {
110                             "$ref": "#/definitions/VimFlavorsInfo"
111                         }
112                     },
113                     "404": {
114                         "description": "the vim id or tenant UUID is wrong"
115                     },
116                     "500": {
117                         "description": "the vim flavor is not accessable"
118                     }
119                 }
120             }
121         },
122         "/{vimid}/{tenantid}/flavors/{flavorid}": {
123             "delete": {
124                 "tags": [
125                     "vim flavors"
126                  ],
127                  "summary": "delete specific vim flavor",
128                 "description": "delete specific vim flavor",
129                 "operationId": "delete_vim_flavor",
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": "flavorid",
153                         "in": "path",
154                         "description": "vim flavor 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 flavor is not accessable"
168                     }
169                 }
170             },
171             "get": {
172                 "tags": [
173                     "vim flavors"
174                 ],
175                 "summary": "query specific vim flavor",
176                 "description": "query specific vim flavor",
177                 "operationId": "query_vim_flavor",
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": "flavorid",
201                         "in": "path",
202                         "description": "vim flavor id",
203                         "required": true,
204                         "type": "string"
205                     }
206                 ],
207                 "responses": {
208                     "200": {
209                         "description": "successful operation",
210                         "schema": {
211                             "$ref": "#/definitions/VimFlavorInfo"
212                         }
213                     },
214                     "404": {
215                         "description": "the vim id or tenant UUID is wrong"
216                     },
217                     "500": {
218                         "description": "the vim flavor is not accessable"
219                     }
220                 }
221             }
222         }
223     },
224     "definitions": {
225         "CreateVimFlavor": {
226             "type": "object",
227             "required": [
228                 "vcpu",
229                 "name",
230                 "memory",
231                 "disk"
232             ],
233             "properties": {
234                 "name": {
235                     "type": "string",
236                     "description": "flavor name"
237                 },
238                 "vcpu": {
239                     "type": "integer",
240                     "description": "virtual cpu number"
241                 },
242                 "memory": {
243                     "type": "integer",
244                     "description": "memory size"
245                 },
246                 "disk": {
247                     "type": "integer",
248                     "description": "The size of the root disk"
249                 },
250                 "ephemeral": {
251                     "type": "integer",
252                     "description": "The size of the ephemeral disk"
253                 },
254                 "swap": {
255                     "type": "integer",
256                     "description": "The size of the swap disk"
257                 },
258                 "isPublic": {
259                     "type": "boolean",
260                     "description": "whether the flavor is public"
261                 },
262                 "extraSpecs": {
263                     "type": "array",
264                     "description": "list of extra specs",
265                     "items": {
266                        "$ref": "#/definitions/VimFlavorExtraSpecInfo"
267                     }
268                 }
269             }
270         },
271         "VimFlavorExtraSpecInfo": {
272             "type": "object",
273             "properties": {
274                 "keyName": {
275                     "type": "string",
276                     "description": "extra spec key"
277                 },
278                 "value": {
279                     "type": "string",
280                     "description": "extra spec value"
281                 }
282             }
283         },
284         "ListVimFlavors": {
285             "type": "object",
286             "properties": {
287                 "name": {
288                     "type": "string",
289                     "description": "flavor name to filter flavor list"
290                 },
291                 "limit": {
292                     "type": "integer",
293                     "description": "Requests a page size of items"
294                 },
295                 "marker": {
296                     "type": "string",
297                     "description": "flavor ID of the last-seen item"
298                 }
299             }
300         },
301         "VimFlavorsInfo": {
302             "type": "object",
303             "required": [
304                 "vimId",
305                 "tenantId",
306                 "flavors"
307             ],
308             "properties": {
309                 "vimId": {
310                     "type": "string"
311                 },
312                 "vimName": {
313                     "type": "string"
314                 },
315                 "tenantId": {
316                     "type": "string",
317                     "description": "tenant UUID"
318                 },
319                 "flavors": {
320                     "type": "array",
321                     "description": "flavor list information",
322                     "items": {
323                        "$ref": "#/definitions/VimFlavorInfo"
324                     }
325                 }
326             }
327         },
328         "VimFlavorInfo": {
329             "type": "object",
330             "required": [
331                 "name",
332                 "id",
333                 "vcpu",
334                 "memory",
335                 "disk",
336                 "ephemeral",
337                 "swap",
338                 "isPublic"
339             ],
340             "properties": {
341                 "name": {
342                     "type": "string",
343                     "description": "flavor name"
344                 },
345                 "id": {
346                     "type": "string",
347                     "description": "flavor UUID"
348                 },
349                 "vcpu": {
350                     "type": "integer",
351                     "description": "virtual cpu number"
352                 },
353                 "memory": {
354                     "type": "integer",
355                     "description": "memory size"
356                 },
357                 "disk": {
358                     "type": "integer",
359                     "description": "The size of the root disk"
360                 },
361                 "ephemeral": {
362                     "type": "integer",
363                     "description": "The size of the ephemeral disk"
364                 },
365                 "swap": {
366                     "type": "integer",
367                     "description": "The size of the swap disk"
368                 },
369                 "isPublic": {
370                     "type": "boolean",
371                     "description": "whether the flavor is public"
372                 },
373                 "extraSpecs": {
374                     "type": "array",
375                     "description": "list of extra specs",
376                     "items": {
377                        "$ref": "#/definitions/VimFlavorExtraSpecInfo"
378                     }
379                 },
380                 "vimId": {
381                     "type": "string"
382                 },
383                 "vimName": {
384                     "type": "string"
385                 },
386                 "tenantId": {
387                     "type": "string",
388                     "description": "tenant UUID"
389                 },
390                 "returnCode": {
391                     "type": "integer",
392                     "description": "0: Already exist 1: Newly created"
393                 }
394             }
395         }
396     }
397 }