update swagger json/yaml
[platform/core/system/edge-orchestration.git] / doc / edge-orchestration-api.json
1 {
2         "swagger": "2.0",
3         "info": {
4                 "title": "Edge Orchestration",
5                 "description": "Edge Orchestration support to deliver distributed service process environment.",
6                 "version": "v1-20190307"
7         },
8         "schemes": [
9                 "http"
10         ],
11         "tags": [
12                 {
13                         "name": "Device Resource",
14                         "description": "Device resource"                
15                 },
16                 {
17                         "name": "Service Manager",
18                         "description": "Managing services"
19                 }
20         ],
21         "paths": {
22                 "/api/v1/device/resource/usage/cpu": {
23                         "get": {
24                                 "tags": [
25                                         "Device Resource"
26                                 ],
27                                 "description": "Get device cpu usage",
28                                 "consumes": [
29                                         "application/json"
30                                 ],
31                                 "produces": [
32                                         "application/json"
33                                 ],
34                                 "responses": {
35                                         "200": {
36                                                 "description": "Successful operation",
37                                                 "schema": {
38                                                         "$ref": "#/definitions/CPU"
39                                                 }
40                                         }
41                                 }
42                         }
43                 },
44                 "/api/v1/device/resource/usage/memory": {
45                         "get": {
46                                 "tags": [
47                                         "Device Resource"
48                                 ],
49                                 "description": "Get device memory usage",
50                                 "consumes": [
51                                         "application/json"
52                                 ],
53                                 "produces": [
54                                         "application/json"
55                                 ],
56                                 "responses": {
57                                         "200": {
58                                                 "description": "Successful operation",
59                                                 "schema": {
60                                                         "$ref": "#/definitions/Memory"
61                                                 }
62                                         }
63                                 }
64                         }
65                 },
66                 "/api/v1/device/resource/usage/network": {
67                         "get": {
68                                 "tags": [
69                                         "Device Resource"
70                                 ],
71                                 "description": "Get device network usage",
72                                 "consumes": [
73                                         "application/json"
74                                 ],
75                                 "produces": [
76                                         "application/json"
77                                 ],
78                                 "responses": {
79                                         "200": {
80                                                 "description": "Successful operation",
81                                                 "schema": {
82                                                         "$ref": "#/definitions/Network"
83                                                 }
84                                         }
85                                 }
86                         }
87                 },
88                 "/api/v1/device/resource/usage/disk": {
89                         "get": {
90                                 "tags": [
91                                         "Device Resource"
92                                 ],
93                                 "description": "Get device disk usage",
94                                 "consumes": [
95                                         "application/json"
96                                 ],
97                                 "produces": [
98                                         "application/json"
99                                 ],
100                                 "responses": {
101                                         "200": {
102                                                 "description": "Successful operation",
103                                                 "schema": {
104                                                         "$ref": "#/definitions/Disk"
105                                                 }
106                                         }
107                                 }
108                         }
109                 },
110                 "/api/v1/servicemgr/service": {
111                         "post": {
112                                 "tags": [
113                                         "Service Manager"
114                                 ],
115                                 "description": "Create service",
116                                 "consumes": [
117                                         "application/json"
118                                 ],
119                                 "produces": [
120                                         "application/json"
121                                 ],
122                                 "parameters": [
123                                         {
124                                                 "in": "body",
125                                                 "name": "body",
126                                                 "description": "Parameters for request service execution",
127                                                 "schema": {
128                                                         "$ref": "#/definitions/ServiceRequest"
129                                                 }
130                                         }
131                                 ],
132                                 "responses": {
133                                         "200": {
134                                                 "description": "Successful operation",
135                                                 "schema": {
136                                                         "$ref": "#/definitions/APIResponse"
137                                                 }
138                                         }
139                                 }
140                         },
141                         "delete": {
142                                 "tags": [
143                                         "Service Manager"
144                                 ],
145                                 "description": "Destroy service",
146                                 "consumes": [
147                                         "application/json"
148                                 ],
149                                 "produces": [
150                                         "application/json"
151                                 ],
152                                 "responses": {
153                                         "200": {
154                                                 "description": "Successful operation",
155                                                 "schema": {
156                                                         "$ref": "#/definitions/APIResponse"
157                                                 }
158                                         }
159                                 }
160                         },
161                         "get": {
162                                 "tags": [
163                                         "Service Manager"
164                                 ],
165                                 "description": "Get Service list",
166                                 "consumes": [
167                                         "application/json"
168                                 ],
169                                 "produces": [
170                                         "application/json"
171                                 ],
172                                 "responses": {
173                                         "200": {
174                                                 "description": "Successful operation",
175                                                 "schema": {
176                                                         "$ref": "#/definitions/ServiceList"
177                                                 }
178                                         }
179                                 }
180                         }
181                 },
182                 "/api/v1/servicemgr/service/{serviceID}": {
183                         "get": {
184                                 "tags": [
185                                         "Service Manager"
186                                 ],
187                                 "description": "Get service information",
188                                 "consumes": [
189                                         "application/json"
190                                 ],
191                                 "produces": [
192                                         "application/json"
193                                 ],
194                                 "parameters": [
195                                         {
196                                                 "name": "serviceID",
197                                                 "in": "path",
198                                                 "description": "Name of service",
199                                                 "required": true,
200                                                 "type": "string"
201                                         }
202                                 ],
203                                 "responses": {
204                                         "200": {
205                                                 "description": "Successful operation",
206                                                 "schema": {
207                                                         "$ref": "#/definitions/ServiceInfo"
208                                                 }
209                                         }
210                                 }
211                         }
212                 }
213         },
214         "definitions": {
215                 "CPU": {
216                         "type": "object",
217                         "properties": {
218                                 "cpu": {
219                                         "type": "string",
220                                         "description": "Usage of CPU",
221                                         "example": "0.187383"
222                                 }
223                         }
224                 },
225                 "Memory": {
226                         "type": "object",
227                         "properties": {
228                                 "memory": {
229                                         "type": "string",
230                                         "description": "Usage of Memory",
231                                         "example": "11.871336"
232                                 }
233                         }
234                 },
235                 "Network": {
236                         "type": "object",
237                         "properties": {
238                                 "network": {
239                                         "type": "string",
240                                         "description": "Usage of Network",
241                                         "example": "0.003023"
242                                 }
243                         }
244                 },
245                 "Disk": {
246                         "type": "object",
247                         "properties": {
248                                 "network": {
249                                         "type": "string",
250                                         "description": "Usage of Disk",
251                                         "example": ""
252                                 }
253                         }
254                 },
255                 "SystemParam": {
256                         "type": "object",
257                         "properties": {
258                                 "ipAddr": {
259                                         "type": "string",
260                                         "description": "IP Addr of device requesting service",
261                                         "example": "127.0.0.1"
262                                 },
263                                 "port": {
264                                         "type": "string",
265                                         "description": "Port number of device requesting service",
266                                         "example": "5432"
267                                 }
268                         }
269                 },
270                 "UserParam": {
271                         "type": "object",
272                         "properties": {
273                                 "arguments": {
274                                         "type": "string",
275                                         "description": "User parameter of requesting service",
276                                         "example": "5"
277                                 }
278                         }
279                 },
280                 "ServiceRequest": {
281                         "type": "object",
282                         "properties": {
283                                 "serviceName": {
284                                         "type": "string",
285                                         "description": "Name of requested service",
286                                         "example": "helloWorld_service"
287                                 },
288                                 "status": {
289                                         "type": "string",
290                                         "description": "Status of requested service",
291                                         "example": "Start"
292                                 },
293                                 "type": {
294                                         "type": "string",
295                                         "description": "Type of resource for requested service",
296                                         "example": "CPU"
297                                 },
298                                 "systemParam": {
299                                         "$ref": "#/definitions/SystemParam"
300                                 },
301                                 "userParam": {
302                                         "$ref": "#/definitions/UserParam"
303                                 }
304                         }
305                 },
306                 "ServiceInfo": {
307                         "type": "object",
308                         "properties": {
309                                 "serviceName": {
310                                         "type": "string",
311                                         "description": "Service name",
312                                         "example": "helloWorld_service"
313                                 },
314                                 "serviceID": {
315                                         "type": "string",
316                                         "description": "Unique ID of service",
317                                         "example": "helloWorld_service_deviceID_UUID"
318                                 },
319                                 "status": {
320                                         "type": "string",
321                                         "description": "Status of service",
322                                         "example": "Start"
323                                 },
324                                 "deviceID": {
325                                         "type": "string",
326                                         "description": "DeviceID on which the service is operating",
327                                         "example": "Edge_deviceID"
328                                 }
329                         }
330                 },
331                 "ServiceList": {
332                         "type": "array",
333                         "items": {
334                                 "$ref": "#/definitions/ServiceInfo"
335                         }
336                 },
337                 "APIResponse": {
338                         "type": "object",
339                         "properties": {
340                                 "message": {
341                                         "type": "string",
342                                         "description": "Return the status of the request"
343                                 }
344                         }
345                 }
346         }
347 }