update the namespace for multicloud/framework
[multicloud/framework.git] / multivimbroker / multivimbroker / swagger / multivim.host.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}/hosts": {
15             "get": {
16                 "tags": [
17                     "vim hosts"
18                 ],
19                 "summary": "query vim hosts list",
20                 "description": "query vim hosts list",
21                 "operationId": "query_vim_hosts",
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                 "responses": {
45                     "200": {
46                         "description": "successful operation",
47                         "schema": {
48                             "$ref": "#/definitions/VimHostsInfo"
49                         }
50                     },
51                     "404": {
52                         "description": "the vim id or tenant UUID is wrong"
53                     },
54                     "500": {
55                         "description": "the vim host is not accessable"
56                     }
57                 }
58             }
59         },
60         "/{vimid}/{tenantid}/hosts/{hostname}": {
61             "get": {
62                 "tags": [
63                     "vim hosts"
64                 ],
65                 "summary": "query specific vim host",
66                 "description": "query specific vim host",
67                 "operationId": "query_vim_host",
68                 "consumes": [
69                     "application/json"
70                 ],
71                 "produces": [
72                     "application/json"
73                 ],
74                 "parameters": [
75                     {
76                         "name": "vimid",
77                         "in": "path",
78                         "description": "vim instance id",
79                         "required": true,
80                         "type": "string"
81                     },
82                     {
83                         "name": "tenantid",
84                         "in": "path",
85                         "description": "tenant UUID",
86                         "required": true,
87                         "type": "string"
88                     },
89                     {
90                         "name": "hostname",
91                         "in": "path",
92                         "description": "vim host name",
93                         "required": true,
94                         "type": "string"
95                     }
96                 ],
97                 "responses": {
98                     "200": {
99                         "description": "successful operation",
100                         "schema": {
101                             "$ref": "#/definitions/VimHostDetail"
102                         }
103                     },
104                     "404": {
105                         "description": "the vim id or tenant UUID is wrong"
106                     },
107                     "500": {
108                         "description": "the vim host is not accessable"
109                     }
110                 }
111             }
112         }
113     },
114     "definitions": {
115         "VimHostsInfo": {
116             "type": "object",
117             "required": [
118                 "vimId",
119                 "tenantId",
120                 "hosts"
121             ],
122             "properties": {
123                 "vimId": {
124                     "type": "string"
125                 },
126                 "vimName": {
127                     "type": "string"
128                 },
129                 "tenantId": {
130                     "type": "string",
131                     "description": "tenant UUID"
132                 },
133                 "hosts": {
134                     "type": "array",
135                     "description": "list of host information",
136                     "items": {
137                        "$ref": "#/definitions/VimHostInfo"
138                     }
139                 }
140             }
141         },
142         "VimHostInfo": {
143             "type": "object",
144             "required": [
145                 "name",
146                 "service"
147             ],
148             "properties": {
149                 "name": {
150                     "type": "string",
151                     "description": "host name"
152                 },
153                 "service": {
154                     "type": "string",
155                     "description": "service name running on the host"
156                 },
157                 "zone": {
158                     "type": "string",
159                     "description": "available zone name of the host"
160                 },
161                 "vimId": {
162                     "type": "string"
163                 },
164                 "vimName": {
165                     "type": "string"
166                 },
167                 "tenantId": {
168                     "type": "string",
169                     "description": "tenant UUID"
170                 }
171             }
172         },
173         "VimHostDetail": {
174             "type": "object",
175             "required": [
176                 "vimId",
177                 "tenantId",
178                 "host"
179             ],
180             "properties": {
181                 "host": {
182                     "type": "array",
183                     "description": "list of host information",
184                     "items": {
185                        "$ref": "#/definitions/VimHostResource"
186                     }
187                 },
188                 "vimId": {
189                     "type": "string"
190                 },
191                 "vimName": {
192                     "type": "string"
193                 },
194                 "tenantId": {
195                     "type": "string",
196                     "description": "tenant UUID"
197                 }
198             }
199         },
200         "VimHostResource": {
201             "type": "object",
202             "required": [
203                 "name",
204                 "cpu",
205                 "memory_mb",
206                 "disk_gb",
207                 "project"
208             ],
209             "properties": {
210                 "name": {
211                     "type": "string",
212                     "description": "host name"
213                 },
214                 "cpu": {
215                     "type": "integer",
216                     "description": "The cpu info on the host"
217                 },
218                 "memory_mb": {
219                     "type": "integer",
220                     "description": "The memory info on the host (in MB)"
221                 },
222                 "disk_gb": {
223                     "type": "integer",
224                     "description": "The disk info on the host (in GB)"
225                 },
226                 "project": {
227                     "type": "string",
228                     "description": "The project id (or special name like total, used_now, used_max)."
229                 }
230             }
231         }
232     }
233 }