Skip to content

Commit 098bae3

Browse files
committed
Add GetExportVMConfig to read the /vm/config endpoint
While working on this I noticed a bug in the swagger.yaml definitions that were not reflecting the state of the Firecracker API. Full description firecracker-microvm/firecracker#2963 Signed-off-by: Lorenzo Fontana <[email protected]>
1 parent d678255 commit 098bae3

File tree

3 files changed

+75
-63
lines changed

3 files changed

+75
-63
lines changed

client/models/full_vm_configuration.go

Lines changed: 56 additions & 56 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

client/swagger.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -829,29 +829,29 @@ definitions:
829829
FullVmConfiguration:
830830
type: object
831831
properties:
832-
balloon_device:
832+
balloon:
833833
$ref: "#/definitions/Balloon"
834-
block_devices:
834+
drives:
835835
type: array
836836
description: Configurations for all block devices.
837837
items:
838838
$ref: "#/definitions/Drive"
839-
boot_source:
839+
boot-source:
840840
$ref: "#/definitions/BootSource"
841841
logger:
842842
$ref: "#/definitions/Logger"
843-
machine_config:
843+
machine-config:
844844
$ref: "#/definitions/MachineConfiguration"
845845
metrics:
846846
$ref: "#/definitions/Metrics"
847-
mmds_config:
847+
mmds-config:
848848
$ref: "#/definitions/MmdsConfig"
849-
net_devices:
849+
network-interfaces:
850850
type: array
851851
description: Configurations for all net devices.
852852
items:
853853
$ref: "#/definitions/NetworkInterface"
854-
vsock_device:
854+
vsock:
855855
$ref: "#/definitions/Vsock"
856856

857857
InstanceActionInfo:

firecracker.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -474,3 +474,15 @@ func (f *Client) PatchBalloonStatsInterval(ctx context.Context, balloonStatsUpda
474474

475475
return f.client.Operations.PatchBalloonStatsInterval(params)
476476
}
477+
478+
type GetExportVMConfigOpt func(*ops.GetExportVMConfigParams)
479+
480+
func (f *Client) GetExportVMConfig(opts ...GetExportVMConfigOpt) (*ops.GetExportVMConfigOK, error) {
481+
p := ops.NewGetExportVMConfigParams()
482+
p.SetTimeout(time.Duration(f.firecrackerRequestTimeout) * time.Millisecond)
483+
for _, opt := range opts {
484+
opt(p)
485+
}
486+
487+
return f.client.Operations.GetExportVMConfig(p)
488+
}

0 commit comments

Comments
 (0)