update the namespace for multicloud/framework
[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": "/api/multicloud/v0/",
8     "tags": [
9         {
10             "name": "MultiVIM services"
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                         "name": "name",
98                         "in":  "query",
99                         "description": "subnet 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/VimSubnetsInfo"
109                         }
110                     },
111                     "404": {
112                         "description": "the vim id or tenant UUID is wrong"
113                     },
114                     "500": {
115                         "description": "the vim subnet is not accessable"
116                     }
117                 }
118             }
119         },
120         "/{vimid}/{tenantid}/subnets/{subnetid}": {
121             "delete": {
122                 "tags": [
123                     "vim subnets"
124                  ],
125                  "summary": "delete specific vim subnet",
126                 "description": "delete specific vim subnet",
127                 "operationId": "delete_vim_subnet",
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": "subnetid",
151                         "in": "path",
152                         "description": "vim subnet 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 subnet is not accessable"
166                     }
167                 }
168             },
169             "get": {
170                 "tags": [
171                     "vim subnets"
172                 ],
173                 "summary": "query specific vim subnet",
174                 "description": "query specific vim subnet",
175                 "operationId": "query_vim_subnet",
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": "subnetid",
199                         "in": "path",
200                         "description": "vim subnet id",
201                         "required": true,
202                         "type": "string"
203                     }
204                 ],
205                 "responses": {
206                     "200": {
207                         "description": "successful operation",
208                         "schema": {
209                             "$ref": "#/definitions/VimSubnetInfo"
210                         }
211                     },
212                     "404": {
213                         "description": "the vim id or tenant UUID is wrong"
214                     },
215                     "500": {
216                         "description": "the vim subnet id is invalid"
217                     }
218                 }
219             }
220         }
221     },
222     "definitions": {
223         "CreateVimSubnet": {
224             "type": "object",
225             "required": [
226                 "networkId",
227                 "name",
228                 "cidr",
229                 "ipVersion"
230             ],
231             "properties": {
232                 "networkId": {
233                     "type": "string",
234                     "description": "network UUID"
235                 },
236                 "name": {
237                     "type": "string",
238                     "description": "subnet name"
239                 },
240                 "cidr": {
241                     "type": "string",
242                     "description": "subnet CIDR"
243                 },
244                 "ipVersion": {
245                     "type": "integer",
246                     "description": "IP version: 4 for IPv4, 6 for IPv6"
247                 },
248                 "enableDhcp": {
249                     "type": "boolean",
250                     "description": "Enable DHCP or not"
251                 },
252                 "gatewayIp": {
253                     "type": "string",
254                     "description": "gateway IP address"
255                 },
256                 "dnsNameservers": {
257                     "type": "array",
258                     "description": "DNS Nameservers",
259                     "items": {
260                        "type": "string"
261                     }
262                 },
263                 "hostRoutes": {
264                     "type": "array",
265                     "description": "Host route entries",
266                     "items": {
267                        "$ref": "#/definitions/VimHostRouteInfo"
268                     }
269                 },
270                 "allocationPools": {
271                     "type": "array",
272                     "description": "IP address allocation pools",
273                     "items": {
274                        "$ref": "#/definitions/VimIpAllocationPoolInfo"
275                     }
276                 }
277             }
278         },
279         "VimHostRouteInfo": {
280             "type": "object",
281             "properties": {
282                 "destination": {
283                     "type": "string",
284                     "description": "destination field of a route entry"
285                 },
286                 "nexthop ": {
287                     "type": "string",
288                     "description": "next hop of a route entry"
289                 }
290             }
291         },
292         "VimIpAllocationPoolInfo": {
293             "type": "object",
294             "properties": {
295                 "start": {
296                     "type": "string",
297                     "description": "start IP address of a pool"
298                 },
299                 "end ": {
300                     "type": "string",
301                     "description": "end IP address of a pool"
302                 }
303             }
304         },
305         "VimSubnetsInfo": {
306             "type": "object",
307             "required": [
308                 "vimId",
309                 "tenantId",
310                 "subnets"
311             ],
312             "properties": {
313                 "vimId": {
314                     "type": "string"
315                 },
316                 "vimName": {
317                     "type": "string"
318                 },
319                 "tenantId": {
320                     "type": "string",
321                     "description": "tenant UUID"
322                 },
323                 "subnets": {
324                     "type": "array",
325                     "description": "subnets information",
326                     "items": {
327                        "$ref": "#/definitions/VimSubnetInfo"
328                     }
329                 }
330             }
331         },
332         "VimSubnetInfo": {
333             "type": "object",
334             "required": [
335                 "name",
336                 "status",
337                 "id",
338                 "networkId",
339                 "cidr",
340                 "ipVersion"
341             ],
342             "properties": {
343                 "name": {
344                     "type": "string",
345                     "description": "subnet name"
346                 },
347                 "id": {
348                     "type": "string",
349                     "description": "subnet UUID"
350                 },
351                 "status": {
352                     "type": "string",
353                     "description": "subnet status"
354                 },
355                 "networkId": {
356                     "type": "string",
357                     "description": "network UUID"
358                 },
359                 "networkName": {
360                     "type": "string",
361                     "description": "network name"
362                 },
363                 "cidr": {
364                     "type": "string",
365                     "description": "subnet CIDR"
366                 },
367                 "ipVersion": {
368                     "type": "integer",
369                     "description": "IP version: 4 for IPv4, 6 for IPv6"
370                 },
371                 "enableDhcp": {
372                     "type": "boolean",
373                     "description": "Enable DHCP or not"
374                 },
375                 "gatewayIp": {
376                     "type": "string",
377                     "description": "gateway IP address"
378                 },
379                 "dnsNameservers": {
380                     "type": "array",
381                     "description": "DNS Nameservers",
382                     "items": {
383                        "type": "string"
384                     }
385                 },
386                 "hostRoutes": {
387                     "type": "array",
388                     "description": "Host route entries",
389                     "items": {
390                        "$ref": "#/definitions/VimHostRouteInfo"
391                     }
392                 },
393                 "allocationPools": {
394                     "type": "array",
395                     "description": "IP address allocation pools",
396                     "items": {
397                        "$ref": "#/definitions/VimIpAllocationPoolInfo"
398                     }
399                 },
400                 "vimId": {
401                     "type": "string"
402                 },
403                 "vimName": {
404                     "type": "string"
405                 },
406                 "tenantId": {
407                     "type": "string",
408                     "description": "tenant UUID"
409                 },
410                 "returnCode": {
411                     "type": "integer",
412                     "description": "0: Already exist 1: Newly created"
413                 }
414             }
415         }
416     }
417 }