update the namespace for multicloud/framework
[multicloud/framework.git] / multivimbroker / multivimbroker / swagger / multivim.image.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}/images": {
15             "post": {
16                 "tags": [
17                     "vim images"
18                 ],
19                 "summary": "create a image",
20                 "description": "create a image",
21                 "operationId": "create_vim_image",
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 image request param",
47                         "required": true,
48                         "schema": {
49                             "$ref": "#/definitions/CreateVimImage"
50                         }
51                     }
52                 ],
53                 "responses": {
54                     "200": {
55                         "description": "successful operation",
56                         "schema": {
57                             "$ref": "#/definitions/VimImageInfo"
58                         }
59                     },
60                     "404": {
61                         "description": "the vim id or tenant UUID is wrong"
62                     },
63                     "500": {
64                         "description": "the vim image is not accessable"
65                     }
66                 }
67             },
68             "get": {
69                 "tags": [
70                     "vim images"
71                 ],
72                 "summary": "query vim images list",
73                 "description": "query vim images list",
74                 "operationId": "query_vim_images",
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": "images 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/VimImagesInfo"
123                         }
124                     },
125                     "404": {
126                         "description": "the vim id or tenant UUID is wrong"
127                     },
128                     "500": {
129                         "description": "the vim image is not accessable"
130                     }
131                 }
132             }
133         },
134         "/{vimid}/{tenantid}/images/{imageid}": {
135             "delete": {
136                 "tags": [
137                     "vim images"
138                  ],
139                  "summary": "delete specific vim image",
140                 "description": "delete specific vim image",
141                 "operationId": "delete_vim_image",
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": "imageid",
165                         "in": "path",
166                         "description": "vim image 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 image is not accessable"
180                     }
181                 }
182             },
183             "get": {
184                 "tags": [
185                     "vim images"
186                 ],
187                 "summary": "query specific vim image",
188                 "description": "query specific vim image",
189                 "operationId": "query_vim_image",
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": "imageid",
213                         "in": "path",
214                         "description": "vim image id",
215                         "required": true,
216                         "type": "string"
217                     }
218                 ],
219                 "responses": {
220                     "200": {
221                         "description": "successful operation",
222                         "schema": {
223                             "$ref": "#/definitions/VimImageInfo"
224                         }
225                     },
226                     "404": {
227                         "description": "the vim id or tenant UUID is wrong"
228                     },
229                     "500": {
230                         "description": "the vim image is not accessable"
231                     }
232                 }
233             }
234         }
235     },
236     "definitions": {
237         "CreateVimImage": {
238             "type": "object",
239             "required": [
240                 "imagePath",
241                 "name",
242                 "imageType",
243                 "containerFormat"
244             ],
245             "properties": {
246                 "name": {
247                     "type": "string",
248                     "description": "image name"
249                 },
250                 "imageType": {
251                     "type": "string",
252                     "description": "image type: ami, ari, aki, vhd, vhdx, vmdk, raw, qcow2, vdi, iso"
253                 },
254                 "imagePath": {
255                     "type": "string",
256                     "description": "image url to catalog"
257                 },
258                 "containerFormat": {
259                     "type": "string",
260                     "description": "image container format: ami, ari, aki, bare, ovf, ova,  docker"
261                 },
262                 "visibility": {
263                     "type": "string",
264                     "description": "public, private, shared, or community"
265                 }
266             }
267         },
268         "VimImagesInfo": {
269             "type": "object",
270             "required": [
271                 "vimId",
272                 "tenantId",
273                 "images"
274             ],
275             "properties": {
276                 "vimId": {
277                     "type": "string"
278                 },
279                 "vimName": {
280                     "type": "string"
281                 },
282                 "tenantId": {
283                     "type": "string",
284                     "description": "tenant UUID"
285                 },
286                 "images": {
287                     "type": "array",
288                     "description": "image list information",
289                     "items": {
290                        "$ref": "#/definitions/VimImageInfo"
291                     }
292                 }
293             }
294         },
295         "VimImageInfo": {
296             "type": "object",
297             "required": [
298                 "name",
299                 "status",
300                 "id"
301             ],
302             "properties": {
303                 "name": {
304                     "type": "string",
305                     "description": "image name"
306                 },
307                 "id": {
308                     "type": "string",
309                     "description": "image UUID"
310                 },
311                 "imageType": {
312                     "type": "string",
313                     "description": "image type: ami, ari, aki, vhd, vhdx, vmdk, raw, qcow2, vdi, iso"
314                 },
315                 "imagePath": {
316                     "type": "string",
317                     "description": "image url to catalog"
318                 },
319                 "containerFormat": {
320                     "type": "string",
321                     "description": "image container format: ami, ari, aki, bare, ovf, ova,  docker"
322                 },
323                 "visibility": {
324                     "type": "string",
325                     "description": "public, private, shared, or community"
326                 },
327                 "properties": {
328                     "type": "array",
329                     "description": "list of properties",
330                     "items": {
331                        "$ref": "#/definitions/VimImagePropertyInfo"
332                     }
333                 },
334                 "status": {
335                     "type": "string",
336                     "description": "image status"
337                 },
338                 "size": {
339                     "type": "string",
340                     "description": "image size"
341                 },
342                 "vimId": {
343                     "type": "string"
344                 },
345                 "vimName": {
346                     "type": "string"
347                 },
348                 "tenantId": {
349                     "type": "string",
350                     "description": "tenant UUID"
351                 },
352                 "returnCode": {
353                     "type": "integer",
354                     "description": "0: Already exist 1: Newly created"
355                 }
356             }
357         }
358     }
359 }