Fix script syntax error
[multicloud/framework.git] / multivimbroker / multivimbroker / swagger / multivim.vport.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}/ports": {
15             "post": {
16                 "tags": [
17                     "vim virtual ports"
18                 ],
19                 "summary": "create a virtual port",
20                 "description": "create a virtual port",
21                 "operationId": "create_vim_port",
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 virtual port request param",
47                         "required": true,
48                         "schema": {
49                             "$ref": "#/definitions/CreateVimPort"
50                         }
51                     }
52                 ],
53                 "responses": {
54                     "200": {
55                         "description": "successful operation",
56                         "schema": {
57                             "$ref": "#/definitions/VimPortInfo"
58                         }
59                     },
60                     "404": {
61                         "description": "the vim id or tenant UUID is wrong"
62                     },
63                     "500": {
64                         "description": "the vim virtual port is not accessable"
65                     }
66                 }
67             },
68             "get": {
69                 "tags": [
70                     "vim virtual ports"
71                 ],
72                 "summary": "query vim ports list",
73                 "description": "query vim ports list",
74                 "operationId": "query_vim_ports",
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": "virtual port name to filter list",
100                         "required": false,
101                         "type": "string"
102                     }
103                 ],
104                 "responses": {
105                     "200": {
106                         "description": "successful operation",
107                         "schema": {
108                             "$ref": "#/definitions/VimPortsInfo"
109                         }
110                     },
111                     "404": {
112                         "description": "the vim id or tenant UUID is wrong"
113                     },
114                     "500": {
115                         "description": "the vim virtual port is not accessable"
116                     }
117                 }
118             }
119         },
120         "/{vimid}/{tenantid}/ports/{portid}": {
121             "delete": {
122                 "tags": [
123                     "vim virtual ports"
124                  ],
125                  "summary": "delete specific vim virtual port",
126                 "description": "delete specific vim virtual port",
127                 "operationId": "delete_vim_port",
128                 "consumes": [
129                     "application/json"
130                 ],
131                 "produces": [
132                     "application/json"
133                 ],
134                 "parameters": [
135                     {
136                         "name": "vimid",
137                         "in": "path",
138                         "description": "vim instance id",
139                         "required": true,
140                         "type": "string"
141                     },
142                     {
143                         "name": "tenantid",
144                         "in": "path",
145                         "description": "tenant UUID",
146                         "required": true,
147                         "type": "string"
148                     },
149                     {
150                         "name": "portid",
151                         "in": "path",
152                         "description": "vim virtual port id",
153                         "required": true,
154                         "type": "string"
155                     }
156                 ],
157                 "responses": {
158                     "204": {
159                         "description": "successful operation"
160                     },
161                     "404": {
162                         "description": "the vim id or tenant UUID is wrong"
163                     },
164                     "500": {
165                         "description": "the virtual port is not accessable"
166                     }
167                 }
168             },
169             "get": {
170                 "tags": [
171                     "vim virtual ports"
172                 ],
173                 "summary": "query specific vim virtual port",
174                 "description": "query specific vim virtual port",
175                 "operationId": "query_vim_port",
176                 "consumes": [
177                     "application/json"
178                 ],
179                 "produces": [
180                     "application/json"
181                 ],
182                 "parameters": [
183                     {
184                         "name": "vimid",
185                         "in": "path",
186                         "description": "vim instance id",
187                         "required": true,
188                         "type": "string"
189                     },
190                     {
191                         "name": "tenantid",
192                         "in": "path",
193                         "description": "tenant UUID",
194                         "required": true,
195                         "type": "string"
196                     },
197                     {
198                         "name": "portid",
199                         "in": "path",
200                         "description": "vim virtual port id",
201                         "required": true,
202                         "type": "string"
203                     }
204                 ],
205                 "responses": {
206                     "200": {
207                         "description": "successful operation",
208                         "schema": {
209                             "$ref": "#/definitions/VimPortInfo"
210                         }
211                     },
212                     "404": {
213                         "description": "the vim id or tenant UUID is wrong"
214                     },
215                     "500": {
216                         "description": "the vim virtual port id is not accessable"
217                     }
218                 }
219             }
220         }
221     },
222     "definitions": {
223         "CreateVimPort": {
224             "type": "object",
225             "required": [
226                 "networkId",
227                 "name"
228             ],
229             "properties": {
230                 "networkId": {
231                     "type": "string",
232                     "description": "network UUID"
233                 },
234                 "subnetId": {
235                     "type": "string",
236                     "description": "subnet UUID"
237                 },
238                 "name": {
239                     "type": "string",
240                     "description": "virtual port name"
241                 },
242                 "ip": {
243                     "type": "string",
244                     "description": "virtual port fixed IP"
245                 },
246                 "macAddress": {
247                     "type": "string",
248                     "description": "virtual port MAC address"
249                 },
250                 "vnicType": {
251                     "type": "string",
252                     "description": "vnicType: normal,direct,macvtap"
253                 },
254                 "securityGroups": {
255                     "type": "array",
256                     "description": "List of security group names",
257                     "items": {
258                        "type": "string"
259                     }
260                 }
261             }
262         },
263         "VimPortsInfo": {
264             "type": "object",
265             "required": [
266                 "vimId",
267                 "tenantId",
268                 "ports"
269             ],
270             "properties": {
271                 "vimId": {
272                     "type": "string"
273                 },
274                 "vimName": {
275                     "type": "string"
276                 },
277                 "tenantId": {
278                     "type": "string",
279                     "description": "tenant UUID"
280                 },
281                 "ports": {
282                     "type": "array",
283                     "description": "ports information",
284                     "items": {
285                        "$ref": "#/definitions/VimPortInfo"
286                     }
287                 }
288             }
289         },
290         "VimPortInfo": {
291             "type": "object",
292             "required": [
293                 "name",
294                 "status",
295                 "id",
296                 "networkId"
297             ],
298             "properties": {
299                 "name": {
300                     "type": "string",
301                     "description": "virtual port name"
302                 },
303                 "id": {
304                     "type": "string",
305                     "description": "virtual port UUID"
306                 },
307                 "status": {
308                     "type": "string",
309                     "description": "subnet status"
310                 },
311                 "networkId": {
312                     "type": "string",
313                     "description": "network UUID"
314                 },
315                 "networkName": {
316                     "type": "string",
317                     "description": "network name"
318                 },
319                 "subnetName": {
320                     "type": "string",
321                     "description": "subnet name"
322                 },
323                 "subnetId": {
324                     "type": "string",
325                     "description": "subnet UUID"
326                 },
327                 "ip": {
328                     "type": "string",
329                     "description": "virtual port fixed IP"
330                 },
331                 "macAddress": {
332                     "type": "string",
333                     "description": "virtual port MAC address"
334                 },
335                 "vnicType": {
336                     "type": "string",
337                     "description": "vnicType: normal,direct,macvtap"
338                 },
339                 "securityGroups": {
340                     "type": "array",
341                     "description": "list of securityGroups names",
342                     "items": {
343                        "type": "string"
344                     }
345                 },
346                 "vimId": {
347                     "type": "string"
348                 },
349                 "vimName": {
350                     "type": "string"
351                 },
352                 "tenantId": {
353                     "type": "string",
354                     "description": "tenant UUID"
355                 },
356                 "returnCode": {
357                     "type": "integer",
358                     "description": "0: Already exist 1: Newly created"
359                 }
360             }
361         }
362     }
363 }