Skip to content

Commit f082669

Browse files
acatangiualxiord
authored andcommitted
Correct some info therein, and beautify the api yaml.
Signed-off-by: Adrian Catangiu <[email protected]>
1 parent ebf7451 commit f082669

File tree

1 file changed

+42
-33
lines changed

1 file changed

+42
-33
lines changed

api_server/swagger/firecracker.yaml

Lines changed: 42 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ produces:
2525
paths:
2626
/:
2727
get:
28-
summary: Return general information about an instance.
28+
summary: Returns general information about an instance.
2929
operationId: describeInstance
3030
responses:
3131
200:
@@ -38,7 +38,7 @@ paths:
3838
$ref: "#/definitions/Error"
3939
/actions/{action_id}:
4040
get:
41-
summary: Return detailed information about an action.
41+
summary: Returns detailed information about an action.
4242
operationId: describeInstanceAction
4343
parameters:
4444
- name: action_id
@@ -87,9 +87,11 @@ paths:
8787

8888
/boot-source:
8989
put:
90-
summary: Creates new boot source. If boot source already exists,
91-
updates its state based on new input. Will fail if update is not possible.
92-
The only supported boot source is LocalImage.
90+
summary: Creates or updates the boot source.
91+
description:
92+
Creates new boot source if one does not already exist, otherwise updates it.
93+
Will fail if update is not possible.
94+
Note that the only currently supported boot source is LocalImage.
9395
operationId: putGuestBootSource
9496
parameters:
9597
- name: body
@@ -114,9 +116,11 @@ paths:
114116

115117
/drives/{drive_id}:
116118
put:
117-
summary: Creates new drive with ID specified by drive_id path parameter.
118-
If a drive with the specified ID already exists, updates its state based on new input.
119-
Will fail if update is not possible.
119+
summary: Creates or updates a drive.
120+
description:
121+
Creates new drive with ID specified by drive_id path parameter.
122+
If a drive with the specified ID already exists, updates its state based on new input.
123+
Will fail if update is not possible.
120124
operationId: putGuestDriveByID
121125
parameters:
122126
- name: drive_id
@@ -169,10 +173,11 @@ paths:
169173

170174
/machine-config:
171175
get:
172-
summary: Get the machine configuration of the VM.
173-
description: Get the machine configuration of the VM. When called before the PUT operation, it will return
174-
the default values for the vCPU count (=1), memory size (=128 MiB), Hyperthreading is disabled and
175-
there is no CPU Template.
176+
summary: Gets the machine configuration of the VM.
177+
description:
178+
Gets the machine configuration of the VM. When called before the PUT operation, it
179+
will return the default values for the vCPU count (=1), memory size (=128 MiB).
180+
By default Hyperthreading is disabled and there is no CPU Template.
176181
responses:
177182
200:
178183
description: OK
@@ -184,11 +189,13 @@ paths:
184189
$ref: "#/definitions/Error"
185190

186191
put:
187-
summary: Updates the Virtual Machine Configuration with the specified input.
188-
The Machine Configuration has default values for the vCPU count (=1) and the memory size (=256 MiB).
189-
When Hyperthreading is enabled, the vCPU count has to be either 1 or an even number.
190-
is disabled, there are no restrictions regarding the vCPU count.
191-
If one of the parameters does not have a correct value, the update fails and no fields are updated.
192+
summary: Updates the Machine Configuration of the VM.
193+
description:
194+
Updates the Virtual Machine Configuration with the specified input.
195+
Firecracker starts with default values for vCPU count (=1) and memory size (=128 MiB).
196+
With Hyperthreading enabled, the vCPU count is restricted to be 1 or an even number,
197+
otherwise there are no restrictions regarding the vCPU count.
198+
If any of the parameters has an incorrect value, the whole update fails.
192199
operationId: putMachineConfiguration
193200
parameters:
194201
- name: body
@@ -212,9 +219,10 @@ paths:
212219

213220
/network-interfaces/{iface_id}:
214221
put:
215-
summary: Creates new network interface with ID specified by iface_id path parameter.
216-
If network interface with specified ID already exists,
217-
updates its state based on new input. Will fail if update is not possible.
222+
summary: Creates a network interface.
223+
description:
224+
Creates new network interface with ID specified by iface_id path parameter.
225+
Updating existing interfaces is currently not allowed.
218226
operationId: putGuestNetworkInterfaceByID
219227
parameters:
220228
- name: iface_id
@@ -231,8 +239,6 @@ paths:
231239
responses:
232240
201:
233241
description: Network interface created
234-
204:
235-
description: Network interface updated
236242
400:
237243
description: Network interface cannot be created due to bad input
238244
schema:
@@ -246,8 +252,8 @@ definitions:
246252
BootSource:
247253
type: object
248254
description:
249-
Boot source descriptor. The only supported boot source type is the Local Image. Network Boot and Drive Boot will
250-
be added in future releases.
255+
Boot source descriptor. The only supported boot source type is the Local Image.
256+
Network Boot and Drive Boot will be added in future releases.
251257
properties:
252258
boot_source_id:
253259
type: string
@@ -313,7 +319,9 @@ definitions:
313319

314320
InstanceActionInfo:
315321
type: object
316-
description: Variant wrapper containing the real action
322+
description:
323+
Variant wrapper containing the real action.
324+
The timestamp field is read-only, trying to update/change it with an API call will fail.
317325
required:
318326
- action_id
319327
properties:
@@ -327,15 +335,15 @@ definitions:
327335
enum:
328336
- InstanceStart
329337
- InstanceHalt
330-
# Timestamp generated by FC - output only
331338
timestamp:
332339
type: string
333340

334341
InstanceInfo:
335342
properties:
336343
state:
337-
description: The current detailed state of the Firecracker instance.
338-
This value is read-only for the control-plane.
344+
description:
345+
The current detailed state of the Firecracker instance.
346+
This value is read-only for the control-plane.
339347
type: string
340348
enum:
341349
- Uninitialized
@@ -346,7 +354,7 @@ definitions:
346354

347355
LocalImage:
348356
type: object
349-
description: |
357+
description:
350358
Locations for local kernel image.
351359
properties:
352360
kernel_image_path:
@@ -374,10 +382,9 @@ definitions:
374382

375383
MachineConfiguration:
376384
type: object
377-
description: Machine Configuration descriptor by which you can specify the number
378-
of vCPU of one machine with vcpu_count, the memory size in MiB with
379-
mem_size_mib, the CPU template with cpu_template and whether Hyperthreading
380-
is enabled/disabled with ht_enabled
385+
description:
386+
Describes the number of vCPUs, memory size, Hyperthreading capabilities and
387+
the CPU template.
381388
properties:
382389
vcpu_count:
383390
type: integer
@@ -393,6 +400,8 @@ definitions:
393400

394401
NetworkInterface:
395402
type: object
403+
description:
404+
Defines a network interface.
396405
required:
397406
- iface_id
398407
properties:

0 commit comments

Comments
 (0)