Setup micro-service of multivim broker
[multicloud/framework.git] / multivimbroker / multivimbroker / swagger / multivim.subnet.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}/subnets": {
15             "post": {
16                 "tags": [
17                     "vim subnets"
18                 ],
19                 "summary": "create a subnet",
20                 "description": "create a subnet",
21                 "operationId": "create_vim_subnet",
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 subnet request param",
47                         "required": true,
48                         "schema": {
49                             "$ref": "#/definitions/CreateVimSubnet"
50                         }
51                     }
52                 ],
53                 "responses": {
54                     "200": {
55                         "description": "successful operation",
56                         "schema": {
57                             "$ref": "#/definitions/VimSubnetInfo"
58                         }
59                     },
60                     "404": {
61                         "description": "the vim id or tenant UUID is wrong"
62                     },
63                     "500": {
64                         "description": "the vim subnet is not accessable"
65                     }
66                 }
67             },
68             "get": {
69                 "tags": [
70                     "vim subnets"
71                 ],
72                 "summary": "query vim subnets list",
73                 "description": "query vim subnets list",
74                 "operationId": "query_vim_subnets",
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 subnets request param",
100                         "required": false,
101                         "schema": {
102                             "$ref": "#/definitions/ListVimSubnets"
103                         }
104                     }
105                 ],
106                 "responses": {
107                     "200": {
108                         "description": "successful operation",
109                         "schema": {
110                             "$ref": "#/definitions/VimSubnetsInfo"
111                         }
112                     },
113                     "404": {
114                         "description": "the vim id or tenant UUID is wrong"
115                     },
116                     "500": {
117                         "description": "the vim subnet is not accessable"
118                     }
119                 }
120             }
121         },
122         "/{vimid}/{tenantid}/subnets/{subnetid}": {
123             "delete": {
124                 "tags": [
125                     "vim subnets"
126                  ],
127                  "summary": "delete specific vim subnet",
128                 "description": "delete specific vim subnet",
129                 "operationId": "delete_vim_subnet",
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": "subnetid",
153                         "in": "path",
154                         "description": "vim subnet 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 subnet is not accessable"
168                     }
169                 }
170             },
171             "get": {
172                 "tags": [
173                     "vim subnets"
174                 ],
175                 "summary": "query specific vim subnet",
176                 "description": "query specific vim subnet",
177                 "operationId": "query_vim_subnet",
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": "subnetid",
201                         "in": "path",
202                         "description": "vim subnet id",
203                         "required": true,
204                         "type": "string"
205                     }
206                 ],
207                 "responses": {
208                     "200": {
209                         "description": "successful operation",
210                         "schema": {
211                             "$ref": "#/definitions/VimSubnetInfo"
212                         }
213                     },
214                     "404": {
215                         "description": "the vim id or tenant UUID is wrong"
216                     },
217                     "500": {
218                         "description": "the vim subnet id is invalid"
219                     }
220                 }
221             }
222         }
223     },
224     "definitions": {
225         "CreateVimSubnet": {
226             "type": "object",
227             "required": [
228                 "networkId",
229                 "name",
230                 "cidr",
231                 "ipVersion"
232             ],
233             "properties": {
234                 "networkId": {
235                     "type": "string",
236                     "description": "network UUID"
237                 },
238                 "name": {
239                     "type": "string",
240                     "description": "subnet name"
241                 },
242                 "cidr": {
243                     "type": "string",
244                     "description": "subnet CIDR"
245                 },
246                 "ipVersion": {
247                     "type": "integer",
248                     "description": "IP version: 4 for IPv4, 6 for IPv6"
249                 },
250                 "enableDhcp": {
251                     "type": "boolean",
252                     "description": "Enable DHCP or not"
253                 },
254                 "gatewayIp": {
255                     "type": "string",
256                     "description": "gateway IP address"
257                 },
258                 "dnsNameservers": {
259                     "type": "array",
260                     "description": "DNS Nameservers",
261                     "items": {
262                        "type": "string"
263                     }
264                 },
265                 "hostRoutes": {
266                     "type": "array",
267                     "description": "Host route entries",
268                     "items": {
269                        "$ref": "#/definitions/VimHostRouteInfo"
270                     }
271                 },
272                 "allocationPools": {
273                     "type": "array",
274                     "description": "IP address allocation pools",
275                     "items": {
276                        "$ref": "#/definitions/VimIpAllocationPoolInfo"
277                     }
278                 }
279             }
280         },
281         "VimHostRouteInfo": {
282             "type": "object",
283             "properties": {
284                 "destination": {
285                     "type": "string",
286                     "description": "destination field of a route entry"
287                 },
288                 "nexthop ": {
289                     "type": "string",
290                     "description": "next hop of a route entry"
291                 }
292             }
293         },
294         "VimIpAllocationPoolInfo": {
295             "type": "object",
296             "properties": {
297                 "start": {
298                     "type": "string",
299                     "description": "start IP address of a pool"
300                 },
301                 "end ": {
302                     "type": "string",
303                     "description": "end IP address of a pool"
304                 }
305             }
306         },
307         "ListVimSubnets": {
308             "type": "object",
309             "properties": {
310                 "name": {
311                     "type": "string",
312                     "description": "subnet name"
313                 }
314             }
315         },
316         "VimSubnetsInfo": {
317             "type": "object",
318             "required": [
319                 "vimId",
320                 "tenantId",
321                 "subnets"
322             ],
323             "properties": {
324                 "vimId": {
325                     "type": "string"
326                 },
327                 "vimName": {
328                     "type": "string"
329                 },
330                 "tenantId": {
331                     "type": "string",
332                     "description": "tenant UUID"
333                 },
334                 "subnets": {
335                     "type": "array",
336                     "description": "subnets information",
337                     "items": {
338                        "$ref": "#/definitions/VimSubnetInfo"
339                     }
340                 }
341             }
342         },
343         "VimSubnetInfo": {
344             "type": "object",
345             "required": [
346                 "name",
347                 "status",
348                 "id",
349                 "networkId",
350                 "cidr",
351                 "ipVersion"
352             ],
353             "properties": {
354                 "name": {
355                     "type": "string",
356                     "description": "subnet name"
357                 },
358                 "id": {
359                     "type": "string",
360                     "description": "subnet UUID"
361                 },
362                 "status": {
363                     "type": "string",
364                     "description": "subnet status"
365                 },
366                 "networkId": {
367                     "type": "string",
368                     "description": "network UUID"
369                 },
370                 "networkName": {
371                     "type": "string",
372                     "description": "network name"
373                 },
374                 "cidr": {
375                     "type": "string",
376                     "description": "subnet CIDR"
377                 },
378                 "ipVersion": {
379                     "type": "integer",
380                     "description": "IP version: 4 for IPv4, 6 for IPv6"
381                 },
382                 "enableDhcp": {
383                     "type": "boolean",
384                     "description": "Enable DHCP or not"
385                 },
386                 "gatewayIp": {
387                     "type": "string",
388                     "description": "gateway IP address"
389                 },
390                 "dnsNameservers": {
391                     "type": "array",
392                     "description": "DNS Nameservers",
393                     "items": {
394                        "type": "string"
395                     }
396                 },
397                 "hostRoutes": {
398                     "type": "array",
399                     "description": "Host route entries",
400                     "items": {
401                        "$ref": "#/definitions/VimHostRouteInfo"
402                     }
403                 },
404                 "allocationPools": {
405                     "type": "array",
406                     "description": "IP address allocation pools",
407                     "items": {
408                        "$ref": "#/definitions/VimIpAllocationPoolInfo"
409                     }
410                 },
411                 "vimId": {
412                     "type": "string"
413                 },
414                 "vimName": {
415                     "type": "string"
416                 },
417                 "tenantId": {
418                     "type": "string",
419                     "description": "tenant UUID"
420                 },
421                 "returnCode": {
422                     "type": "integer",
423                     "description": "0: Already exist 1: Newly created"
424                 }
425             }
426         }
427     }
428 }