update the namespace for multicloud/framework
[multicloud/framework.git] / multivimbroker / multivimbroker / swagger / multivim.volume.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}/volumes": {
15             "post": {
16                 "tags": [
17                     "vim volumes"
18                 ],
19                 "summary": "create a volume",
20                 "description": "create a volume",
21                 "operationId": "create_vim_volume",
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 volume request param",
47                         "required": true,
48                         "schema": {
49                             "$ref": "#/definitions/CreateVimVolume"
50                         }
51                     }
52                 ],
53                 "responses": {
54                     "200": {
55                         "description": "successful operation",
56                         "schema": {
57                             "$ref": "#/definitions/VimVolumeInfo"
58                         }
59                     },
60                     "404": {
61                         "description": "the vim id or tenant UUID is wrong"
62                     },
63                     "500": {
64                         "description": "the vim volume is not accessable"
65                     }
66                 }
67             },
68             "get": {
69                 "tags": [
70                     "vim volumes"
71                 ],
72                 "summary": "query vim volumes list",
73                 "description": "query vim volumes list",
74                 "operationId": "query_vim_volumes",
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": "volumn 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/VimVolumesInfo"
123                         }
124                     },
125                     "404": {
126                         "description": "the vim id or tenant UUID is wrong"
127                     },
128                     "500": {
129                         "description": "the vim volume is not accessable"
130                     }
131                 }
132             }
133         },
134         "/{vimid}/{tenantid}/volumes/{volumeid}": {
135             "delete": {
136                 "tags": [
137                     "vim volumes"
138                  ],
139                  "summary": "delete specific vim volume",
140                 "description": "delete specific vim volume",
141                 "operationId": "delete_vim_volume",
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": "volumeid",
165                         "in": "path",
166                         "description": "vim volume 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 volume is not accessable"
180                     }
181                 }
182             },
183             "get": {
184                 "tags": [
185                     "vim volumes"
186                 ],
187                 "summary": "query specific vim volume",
188                 "description": "query specific vim volume",
189                 "operationId": "query_vim_volume",
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": "volumeid",
213                         "in": "path",
214                         "description": "vim volume id",
215                         "required": true,
216                         "type": "string"
217                     }
218                 ],
219                 "responses": {
220                     "200": {
221                         "description": "successful operation",
222                         "schema": {
223                             "$ref": "#/definitions/VimVolumeInfo"
224                         }
225                     },
226                     "404": {
227                         "description": "the vim id or tenant UUID is wrong"
228                     },
229                     "500": {
230                         "description": "the vim volume is not accessable"
231                     }
232                 }
233             }
234         }
235     },
236     "definitions": {
237         "CreateVimVolume": {
238             "type": "object",
239             "required": [
240                 "name",
241                 "volumeSize"
242             ],
243             "properties": {
244                 "name": {
245                     "type": "string",
246                     "description": "volume name"
247                 },
248                 "volumeSize": {
249                     "type": "integer",
250                     "description": "volume size"
251                 },
252                 "imageId": {
253                     "type": "string",
254                     "description": "image UUID to create volume"
255                 },
256                 "volumeType": {
257                     "type": "string",
258                     "description": "volume type"
259                 },
260                 "availabilityZone": {
261                     "type": "integer",
262                     "description": "available zone for volume"
263                 }
264             }
265         },
266         "VimVolumesInfo": {
267             "type": "object",
268             "required": [
269                 "vimId",
270                 "tenantId",
271                 "volumes"
272             ],
273             "properties": {
274                 "vimId": {
275                     "type": "string"
276                 },
277                 "vimName": {
278                     "type": "string"
279                 },
280                 "tenantId": {
281                     "type": "string",
282                     "description": "tenant UUID"
283                 },
284                 "volumes": {
285                     "type": "array",
286                     "description": "volume list information",
287                     "items": {
288                        "$ref": "#/definitions/VimVolumeInfo"
289                     }
290                 }
291             }
292         },
293         "VimVolumeInfo": {
294             "type": "object",
295             "required": [
296                 "name",
297                 "id",
298                 "status"
299             ],
300             "properties": {
301                 "name": {
302                     "type": "string",
303                     "description": "volume name"
304                 },
305                 "id": {
306                     "type": "string",
307                     "description": "volume UUID"
308                 },
309                 "createTime": {
310                     "type": "string",
311                     "description": "created time"
312                 },
313                 "volumeSize": {
314                     "type": "integer",
315                     "description": "volume size"
316                 },
317                 "volumeType": {
318                     "type": "string",
319                     "description": "volume type"
320                 },
321                 "availabilityZone": {
322                     "type": "integer",
323                     "description": "available zone for volume"
324                 },
325                 "attachments": {
326                     "type": "array",
327                     "description": "attachment list information",
328                     "items": {
329                        "$ref": "#/definitions/VimVolumeAttachmentInfo"
330                     }
331                 },
332                 "status": {
333                     "type": "string",
334                     "description": "volume status"
335                 },
336                 "vimId": {
337                     "type": "string"
338                 },
339                 "vimName": {
340                     "type": "string"
341                 },
342                 "tenantId": {
343                     "type": "string",
344                     "description": "tenant UUID"
345                 },
346                 "returnCode": {
347                     "type": "integer",
348                     "description": "return code: 0: Already exist 1: Newly created"
349                 }
350             }
351         },
352         "VimVolumeAttachmentInfo": {
353             "type": "object",
354             "properties": {
355                 "id": {
356                     "type": "string",
357                     "description": "attachment UUID"
358                 },
359                 "serverId": {
360                     "type": "string",
361                     "description": "server UUID"
362                 },
363                 "volumeId": {
364                     "type": "string",
365                     "description": "volume UUID"
366                 },
367                 "device": {
368                     "type": "string",
369                     "description": "device to be attached"
370                 },
371                 "hostName": {
372                     "type": "string",
373                     "description": "host name"
374                 }
375             }
376         }
377     }
378 }