Update tag to be more generic
[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": "/openoapi/multivim/v1/",
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                         "in": "body",
98                         "name": "body",
99                         "description": "get a list of vim volumes request param",
100                         "required": false,
101                         "schema": {
102                             "$ref": "#/definitions/ListVimVolumes"
103                         }
104                     }
105                 ],
106                 "responses": {
107                     "200": {
108                         "description": "successful operation",
109                         "schema": {
110                             "$ref": "#/definitions/VimVolumesInfo"
111                         }
112                     },
113                     "404": {
114                         "description": "the vim id or tenant UUID is wrong"
115                     },
116                     "500": {
117                         "description": "the vim volume is not accessable"
118                     }
119                 }
120             }
121         },
122         "/{vimid}/{tenantid}/volumes/{volumeid}": {
123             "delete": {
124                 "tags": [
125                     "vim volumes"
126                  ],
127                  "summary": "delete specific vim volume",
128                 "description": "delete specific vim volume",
129                 "operationId": "delete_vim_volume",
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": "volumeid",
153                         "in": "path",
154                         "description": "vim volume 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 volume is not accessable"
168                     }
169                 }
170             },
171             "get": {
172                 "tags": [
173                     "vim volumes"
174                 ],
175                 "summary": "query specific vim volume",
176                 "description": "query specific vim volume",
177                 "operationId": "query_vim_volume",
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": "volumeid",
201                         "in": "path",
202                         "description": "vim volume id",
203                         "required": true,
204                         "type": "string"
205                     }
206                 ],
207                 "responses": {
208                     "200": {
209                         "description": "successful operation",
210                         "schema": {
211                             "$ref": "#/definitions/VimVolumeInfo"
212                         }
213                     },
214                     "404": {
215                         "description": "the vim id or tenant UUID is wrong"
216                     },
217                     "500": {
218                         "description": "the vim volume is not accessable"
219                     }
220                 }
221             }
222         }
223     },
224     "definitions": {
225         "CreateVimVolume": {
226             "type": "object",
227             "required": [
228                 "name",
229                 "volumeSize"
230             ],
231             "properties": {
232                 "name": {
233                     "type": "string",
234                     "description": "volume name"
235                 },
236                 "volumeSize": {
237                     "type": "integer",
238                     "description": "volume size"
239                 },
240                 "imageName": {
241                     "type": "string",
242                     "description": "image name to create volume"
243                 },
244                 "volumeType": {
245                     "type": "string",
246                     "description": "volume type"
247                 },
248                 "availabilityZone": {
249                     "type": "integer",
250                     "description": "available zone for volume"
251                 }
252             }
253         },
254         "ListVimVolumes": {
255             "type": "object",
256             "properties": {
257                 "name": {
258                     "type": "string",
259                     "description": "volume name to filter volume list"
260                 },
261                 "limit": {
262                     "type": "integer",
263                     "description": "Requests a page size of items"
264                 },
265                 "marker": {
266                     "type": "string",
267                     "description": "volume ID of the last-seen item"
268                 }
269             }
270         },
271         "VimVolumesInfo": {
272             "type": "object",
273             "required": [
274                 "vimId",
275                 "tenantId",
276                 "volumes"
277             ],
278             "properties": {
279                 "vimId": {
280                     "type": "string"
281                 },
282                 "vimName": {
283                     "type": "string"
284                 },
285                 "tenantId": {
286                     "type": "string",
287                     "description": "tenant UUID"
288                 },
289                 "volumes": {
290                     "type": "array",
291                     "description": "volume list information",
292                     "items": {
293                        "$ref": "#/definitions/VimVolumeInfo"
294                     }
295                 }
296             }
297         },
298         "VimVolumeInfo": {
299             "type": "object",
300             "required": [
301                 "name",
302                 "id",
303                 "status"
304             ],
305             "properties": {
306                 "name": {
307                     "type": "string",
308                     "description": "volume name"
309                 },
310                 "id": {
311                     "type": "string",
312                     "description": "volume UUID"
313                 },
314                 "createTime": {
315                     "type": "string",
316                     "description": "created time"
317                 },
318                 "volumeSize": {
319                     "type": "integer",
320                     "description": "volume size"
321                 },
322                 "volumeType": {
323                     "type": "string",
324                     "description": "volume type"
325                 },
326                 "availabilityZone": {
327                     "type": "integer",
328                     "description": "available zone for volume"
329                 },
330                 "attachments": {
331                     "type": "array",
332                     "description": "attachment list information",
333                     "items": {
334                        "$ref": "#/definitions/VimVolumeAttachmentInfo"
335                     }
336                 },
337                 "vimId": {
338                     "type": "string"
339                 },
340                 "vimName": {
341                     "type": "string"
342                 },
343                 "tenantId": {
344                     "type": "string",
345                     "description": "tenant UUID"
346                 },
347                 "returnCode": {
348                     "type": "integer",
349                     "description": "return code: 0: Already exist 1: Newly created"
350                 }
351             }
352         },
353         "VimVolumeAttachmentInfo": {
354             "type": "object",
355             "properties": {
356                 "id": {
357                     "type": "string",
358                     "description": "attachment UUID"
359                 },
360                 "serverId": {
361                     "type": "string",
362                     "description": "server UUID"
363                 },
364                 "volumeId": {
365                     "type": "string",
366                     "description": "volume UUID"
367                 },
368                 "deviceId": {
369                     "type": "string",
370                     "description": "device UUID"
371                 },
372                 "hostName": {
373                     "type": "string",
374                     "description": "host name"
375                 }
376             }
377         }
378     }
379 }