Setup micro-service of multivim broker
[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": "/openoapi/multivim/v1/",
8     "tags": [
9         {
10             "name": "MultiVIM broker"
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                         "in": "body",
98                         "name": "body",
99                         "description": "get a list of vim virtual ports request param",
100                         "required": false,
101                         "schema": {
102                             "$ref": "#/definitions/ListVimPorts"
103                         }
104                     }
105                 ],
106                 "responses": {
107                     "200": {
108                         "description": "successful operation",
109                         "schema": {
110                             "$ref": "#/definitions/VimPortsInfo"
111                         }
112                     },
113                     "404": {
114                         "description": "the vim id or tenant UUID is wrong"
115                     },
116                     "500": {
117                         "description": "the vim virtual port is not accessable"
118                     }
119                 }
120             }
121         },
122         "/{vimid}/{tenantid}/ports/{portid}": {
123             "delete": {
124                 "tags": [
125                     "vim virtual ports"
126                  ],
127                  "summary": "delete specific vim virtual port",
128                 "description": "delete specific vim virtual port",
129                 "operationId": "delete_vim_port",
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": "portid",
153                         "in": "path",
154                         "description": "vim virtual port 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 virtual port is not accessable"
168                     }
169                 }
170             },
171             "get": {
172                 "tags": [
173                     "vim virtual ports"
174                 ],
175                 "summary": "query specific vim virtual port",
176                 "description": "query specific vim virtual port",
177                 "operationId": "query_vim_port",
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": "portid",
201                         "in": "path",
202                         "description": "vim virtual port id",
203                         "required": true,
204                         "type": "string"
205                     }
206                 ],
207                 "responses": {
208                     "200": {
209                         "description": "successful operation",
210                         "schema": {
211                             "$ref": "#/definitions/VimPortInfo"
212                         }
213                     },
214                     "404": {
215                         "description": "the vim id or tenant UUID is wrong"
216                     },
217                     "500": {
218                         "description": "the vim virtual port id is not accessable"
219                     }
220                 }
221             }
222         }
223     },
224     "definitions": {
225         "CreateVimPort": {
226             "type": "object",
227             "required": [
228                 "networkId",
229                 "subnetId",
230                 "name",
231                 "cidr",
232                 "ipVersion"
233             ],
234             "properties": {
235                 "networkId": {
236                     "type": "string",
237                     "description": "network UUID"
238                 },
239                 "subnetId": {
240                     "type": "string",
241                     "description": "subnet UUID"
242                 },
243                 "name": {
244                     "type": "string",
245                     "description": "virtual port name"
246                 },
247                 "ip": {
248                     "type": "string",
249                     "description": "virtual port fixed IP"
250                 },
251                 "macAddress": {
252                     "type": "string",
253                     "description": "virtual port MAC address"
254                 },
255                 "vnicType": {
256                     "type": "string",
257                     "description": "vnicType: normal,direct,macvtap"
258                 },
259                 "securityGroups": {
260                     "type": "array",
261                     "description": "List of security group names",
262                     "items": {
263                        "type": "string"
264                     }
265                 }
266             }
267         },
268         "ListVimPorts": {
269             "type": "object",
270             "properties": {
271                 "name": {
272                     "type": "string",
273                     "description": "virtual port name"
274                 }
275             }
276         },
277         "VimPortsInfo": {
278             "type": "object",
279             "required": [
280                 "vimId",
281                 "tenantId",
282                 "ports"
283             ],
284             "properties": {
285                 "vimId": {
286                     "type": "string"
287                 },
288                 "vimName": {
289                     "type": "string"
290                 },
291                 "tenantId": {
292                     "type": "string",
293                     "description": "tenant UUID"
294                 },
295                 "ports": {
296                     "type": "array",
297                     "description": "ports information",
298                     "items": {
299                        "$ref": "#/definitions/VimPortInfo"
300                     }
301                 }
302             }
303         },
304         "VimPortInfo": {
305             "type": "object",
306             "required": [
307                 "name",
308                 "status",
309                 "id",
310                 "networkId",
311                 "subnetId"
312             ],
313             "properties": {
314                 "name": {
315                     "type": "string",
316                     "description": "virtual port name"
317                 },
318                 "id": {
319                     "type": "string",
320                     "description": "virtual port UUID"
321                 },
322                 "status": {
323                     "type": "string",
324                     "description": "subnet status"
325                 },
326                 "networkId": {
327                     "type": "string",
328                     "description": "network UUID"
329                 },
330                 "networkName": {
331                     "type": "string",
332                     "description": "network name"
333                 },
334                 "subnetName": {
335                     "type": "string",
336                     "description": "subnet name"
337                 },
338                 "subnetId": {
339                     "type": "string",
340                     "description": "subnet UUID"
341                 },
342                 "ip": {
343                     "type": "string",
344                     "description": "virtual port fixed IP"
345                 },
346                 "macAddress": {
347                     "type": "string",
348                     "description": "virtual port MAC address"
349                 },
350                 "vnicType": {
351                     "type": "string",
352                     "description": "vnicType: normal,direct,macvtap"
353                 },
354                 "securityGroups": {
355                     "type": "array",
356                     "description": "list of securityGroups names",
357                     "items": {
358                        "type": "string"
359                     }
360                 },
361                 "vimId": {
362                     "type": "string"
363                 },
364                 "vimName": {
365                     "type": "string"
366                 },
367                 "tenantId": {
368                     "type": "string",
369                     "description": "tenant UUID"
370                 },
371                 "returnCode": {
372                     "type": "integer",
373                     "description": "0: Already exist 1: Newly created"
374                 }
375             }
376         }
377     }
378 }