-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathopenapi.yaml
More file actions
324 lines (324 loc) · 7.92 KB
/
openapi.yaml
File metadata and controls
324 lines (324 loc) · 7.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
openapi: 3.1.0
info:
contact:
email: [email protected]
description: OpenAPI specification for virtual machine management on Ghaf platform
license:
name: Apache License 2.0
identifier: Apache-2.0
title: Virtual Machine Management API of the Ghaf platform - OpenAPI
version: 1.0.1
externalDocs:
description: Find out more about the Ghaf platform
url: https://github.com/tiiuae/ghaf
servers:
- description: The primary server
url: https://localhost/api/v1
- description: The test server
url: https://localhost/api/test/v1
tags:
- description: Operations of virtual machines
name: vm
paths:
/vm/list:
get:
description: Gets list of IDs for all virtual machines
operationId: getVmList
responses:
"200":
content:
application/json:
schema:
items: {}
description: List of IDs for all virtual machines
default:
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorModel'
description: error payload
summary: Get list IDs for all virtual machines
tags:
- vm
/vm/info/{id}:
get:
description: Gets the virtual machine information by ID
operationId: getVmInfoById
parameters:
- description: The ID of the virtual machine
explode: false
in: path
name: id
required: true
schema: {}
style: simple
responses:
"200":
content:
application/json:
schema:
$ref: '#/components/schemas/VirtualMachineInfo'
description: successful operation
"400":
description: Invalid virtual machine ID
"404":
description: Virtual machine ID is valid but not found
default:
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorModel'
description: error payload
summary: Gets virtual machine info by ID
tags:
- vm
/vm/{action}/{id}:
put:
description: Control the virtual machine by ID
operationId: vmAction
parameters:
- description: An action is a command used to control the virtual machine
example: start
explode: false
in: path
name: action
required: true
schema:
enum:
- start
- stop
- pause
style: simple
- description: ID of the virtual machine
example: 101
explode: false
in: path
name: id
required: true
schema: {}
style: simple
responses:
"200":
content:
application/json:
schema:
$ref: '#/components/schemas/VirtualMachineInfo'
description: successful operation
"400":
description: Invalid virtual machine ID
"404":
description: Virtual machine ID is valid but not found
default:
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorModel'
description: error payload
summary: Request to perform a control action on the virtual machine by its ID
tags:
- vm
components:
schemas:
ErrorModel:
properties:
code:
example: 0
message:
example: SomeError#0
required:
- code
- message
VirtualMachineInfo:
example:
memory:
maximumAllocation: 2048
currentAllocation: 2048
totalHost: 8192
performance:
cpuUsage: 50
diskIo: ""
memoryUsage:
numerator: ""
denominator: ""
networkIo: ""
os:
name: Ubuntu
version: 23.04
devices:
list: ""
hypervisorDetails:
emulator: /usr/bin/qemu-system-x86_64
hypervisor: KVM
arch: aarch64
chipset: Q35
firmware: BIOS
cpu:
cores: 4
threads: 8
model: NVidia Tegra X1
sockets: 1
logicalCount: 8
basicDetails:
name: GUI VM
description: GUI Virtual Machine
id: 101
state: R
startTime: ""
runningTime: ""
properties:
basicDetails:
$ref: '#/components/schemas/VirtualMachineBasicDetails'
hypervisorDetails:
$ref: '#/components/schemas/VirtualMachineHypervisorDetails'
cpu:
$ref: '#/components/schemas/VirtualMachineCpu'
memory:
$ref: '#/components/schemas/VirtualMachineMemory'
startTime: {}
runningTime: {}
os:
$ref: '#/components/schemas/VirtualMachineOs'
performance:
$ref: '#/components/schemas/VirtualMachinePerformance'
devices:
$ref: '#/components/schemas/VirtualMachineDevices'
required:
- basicDetails
- cpu
- memory
- os
VirtualMachineBasicDetails:
example:
name: GUI VM
description: GUI Virtual Machine
id: 101
state: R
properties:
id:
example: 101
state:
enum:
- D
- I
- R
- S
- T
- TDebug
- W
- X
- Z
example: R
name:
example: GUI VM
description:
example: GUI Virtual Machine
required:
- id
- name
- state
VirtualMachineHypervisorDetails:
example:
emulator: /usr/bin/qemu-system-x86_64
hypervisor: KVM
arch: aarch64
chipset: Q35
firmware: BIOS
properties:
hypervisor:
enum:
- KVM
example: KVM
arch:
type: string
example: aarch64
emulator:
example: /usr/bin/qemu-system-x86_64
chipset:
example: Q35
firmware:
example: BIOS
VirtualMachineCpu:
example:
cores: 4
threads: 8
model: NVidia Tegra X1
sockets: 1
logicalCount: 8
properties:
model:
example: NVidia Tegra X1
logicalCount:
example: 8
sockets:
example: 1
cores:
example: 4
threads:
example: 8
VirtualMachineMemory:
example:
maximumAllocation: 2048
currentAllocation: 2048
totalHost: 8192
properties:
totalHost:
description: Total host memory in MB
example: 8192
format: int64
currentAllocation:
description: Currently allocated memory by VM in MB
example: 2048
format: int64
maximumAllocation:
description: Maximum possible allocated memory by VM in MB
example: 2048
format: int64
required:
- currentAllocation
- maximumAllocation
- totalHost
VirtualMachineOs:
example:
name: Ubuntu
version: 23.04
properties:
name:
example: Ubuntu
version:
example: 23.04
required:
- name
- version
VirtualMachinePerformance:
example:
cpuUsage: 50
diskIo: 30
memoryUsage: 200
networkIo: 300
properties:
cpuUsage:
type: integer
description: CPU load %
example: 50
memoryUsage:
type: integer
description: Memory usage in MB
diskIo:
type: integer
description: Disk IO in KB/s
networkIo:
type: integer
description: Network IO in KB/s
required:
- cpuUsage
- diskIo
- memoryUsage
- networkIo
VirtualMachineDevices:
example:
list: ""
properties:
list:
items: {}
required:
- list