Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
aos
GitHub Repository: aos/firecracker
Path: blob/main/src/api_server/swagger/firecracker.yaml
1958 views
1
swagger: "2.0"
2
info:
3
title: Firecracker API
4
description: RESTful public-facing API.
5
The API is accessible through HTTP calls on specific URLs
6
carrying JSON modeled data.
7
The transport medium is a Unix Domain Socket.
8
version: 0.24.0
9
termsOfService: ""
10
contact:
11
email: "[email protected]"
12
license:
13
name: "Apache 2.0"
14
url: "http://www.apache.org/licenses/LICENSE-2.0.html"
15
16
host: "localhost"
17
basePath: "/"
18
19
schemes:
20
- http
21
consumes:
22
- application/json
23
produces:
24
- application/json
25
26
paths:
27
/:
28
get:
29
summary: Returns general information about an instance.
30
operationId: describeInstance
31
responses:
32
200:
33
description: The instance information
34
schema:
35
$ref: "#/definitions/InstanceInfo"
36
default:
37
description: Internal Server Error
38
schema:
39
$ref: "#/definitions/Error"
40
41
/actions:
42
put:
43
summary: Creates a synchronous action.
44
operationId: createSyncAction
45
parameters:
46
- name: info
47
in: body
48
required: true
49
schema:
50
$ref: "#/definitions/InstanceActionInfo"
51
responses:
52
204:
53
description: The update was successful
54
400:
55
description: The action cannot be executed due to bad input
56
schema:
57
$ref: "#/definitions/Error"
58
default:
59
description: Internal Server Error
60
schema:
61
$ref: "#/definitions/Error"
62
63
/balloon:
64
get:
65
summary: Returns the current balloon device configuration.
66
operationId: describeBalloonConfig
67
responses:
68
200:
69
description: The balloon device configuration
70
schema:
71
$ref: "#/definitions/Balloon"
72
400:
73
description: Balloon device not configured.
74
schema:
75
$ref: "#/definitions/Error"
76
default:
77
description: Internal Server Error
78
schema:
79
$ref: "#/definitions/Error"
80
put:
81
summary: Creates or updates a balloon device.
82
description:
83
Creates a new balloon device if one does not already exist, otherwise updates it, before machine startup.
84
This will fail after machine startup.
85
Will fail if update is not possible.
86
operationId: putBalloon
87
parameters:
88
- name: body
89
in: body
90
description: Balloon properties
91
required: true
92
schema:
93
$ref: "#/definitions/Balloon"
94
responses:
95
204:
96
description: Balloon device created/updated
97
400:
98
description: Balloon device cannot be created/updated due to bad input
99
schema:
100
$ref: "#/definitions/Error"
101
default:
102
description: Internal server error
103
schema:
104
$ref: "#/definitions/Error"
105
patch:
106
summary: Updates a balloon device.
107
description:
108
Updates an existing balloon device, before or after machine startup.
109
Will fail if update is not possible.
110
operationId: patchBalloon
111
parameters:
112
- name: body
113
in: body
114
description: Balloon properties
115
required: true
116
schema:
117
$ref: "#/definitions/BalloonUpdate"
118
responses:
119
204:
120
description: Balloon device updated
121
400:
122
description: Balloon device cannot be updated due to bad input
123
schema:
124
$ref: "#/definitions/Error"
125
default:
126
description: Internal server error
127
schema:
128
$ref: "#/definitions/Error"
129
130
/balloon/statistics:
131
get:
132
summary: Returns the latest balloon device statistics, only if enabled pre-boot.
133
operationId: describeBalloonStats
134
responses:
135
200:
136
description: The balloon device statistics
137
schema:
138
$ref: "#/definitions/BalloonStats"
139
400:
140
description: The balloon device statistics were not enabled when the device was configured.
141
schema:
142
$ref: "#/definitions/Error"
143
default:
144
description: Internal Server Error
145
schema:
146
$ref: "#/definitions/Error"
147
patch:
148
summary: Updates a balloon device statistics polling interval.
149
description:
150
Updates an existing balloon device statistics interval, before or after machine startup.
151
Will fail if update is not possible.
152
operationId: patchBalloonStatsInterval
153
parameters:
154
- name: body
155
in: body
156
description: Balloon properties
157
required: true
158
schema:
159
$ref: "#/definitions/BalloonStatsUpdate"
160
responses:
161
204:
162
description: Balloon statistics interval updated
163
400:
164
description: Balloon statistics interval cannot be updated due to bad input
165
schema:
166
$ref: "#/definitions/Error"
167
default:
168
description: Internal server error
169
schema:
170
$ref: "#/definitions/Error"
171
172
/boot-source:
173
put:
174
summary: Creates or updates the boot source. Pre-boot only.
175
description:
176
Creates new boot source if one does not already exist, otherwise updates it.
177
Will fail if update is not possible.
178
operationId: putGuestBootSource
179
parameters:
180
- name: body
181
in: body
182
description: Guest boot source properties
183
required: true
184
schema:
185
$ref: "#/definitions/BootSource"
186
responses:
187
204:
188
description: Boot source created/updated
189
400:
190
description: Boot source cannot be created due to bad input
191
schema:
192
$ref: "#/definitions/Error"
193
default:
194
description: Internal server error
195
schema:
196
$ref: "#/definitions/Error"
197
198
/drives/{drive_id}:
199
put:
200
summary: Creates or updates a drive. Pre-boot only.
201
description:
202
Creates new drive with ID specified by drive_id path parameter.
203
If a drive with the specified ID already exists, updates its state based on new input.
204
Will fail if update is not possible.
205
operationId: putGuestDriveByID
206
parameters:
207
- name: drive_id
208
in: path
209
description: The id of the guest drive
210
required: true
211
type: string
212
- name: body
213
in: body
214
description: Guest drive properties
215
required: true
216
schema:
217
$ref: "#/definitions/Drive"
218
responses:
219
204:
220
description: Drive created/updated
221
400:
222
description: Drive cannot be created/updated due to bad input
223
schema:
224
$ref: "#/definitions/Error"
225
default:
226
description: Internal server error.
227
schema:
228
$ref: "#/definitions/Error"
229
patch:
230
summary: Updates the properties of a drive. Post-boot only.
231
description:
232
Updates the properties of the drive with the ID specified by drive_id path parameter.
233
Will fail if update is not possible.
234
operationId: patchGuestDriveByID
235
parameters:
236
- name: drive_id
237
in: path
238
description: The id of the guest drive
239
required: true
240
type: string
241
- name: body
242
in: body
243
description: Guest drive properties
244
required: true
245
schema:
246
$ref: "#/definitions/PartialDrive"
247
responses:
248
204:
249
description: Drive updated
250
400:
251
description: Drive cannot be updated due to bad input
252
schema:
253
$ref: "#/definitions/Error"
254
default:
255
description: Internal server error.
256
schema:
257
$ref: "#/definitions/Error"
258
259
/logger:
260
put:
261
summary: Initializes the logger by specifying a named pipe or a file for the logs output.
262
operationId: putLogger
263
parameters:
264
- name: body
265
in: body
266
description: Logging system description
267
required: true
268
schema:
269
$ref: "#/definitions/Logger"
270
responses:
271
204:
272
description: Logger created.
273
400:
274
description: Logger cannot be initialized due to bad input.
275
schema:
276
$ref: "#/definitions/Error"
277
default:
278
description: Internal server error.
279
schema:
280
$ref: "#/definitions/Error"
281
282
/machine-config:
283
get:
284
summary: Gets the machine configuration of the VM.
285
description:
286
Gets the machine configuration of the VM. When called before the PUT operation, it
287
will return the default values for the vCPU count (=1), memory size (=128 MiB).
288
By default Hyperthreading is disabled and there is no CPU Template.
289
operationId: getMachineConfiguration
290
responses:
291
200:
292
description: OK
293
schema:
294
$ref: "#/definitions/MachineConfiguration"
295
default:
296
description: Internal server error
297
schema:
298
$ref: "#/definitions/Error"
299
300
put:
301
summary: Updates the Machine Configuration of the VM. Pre-boot only.
302
description:
303
Updates the Virtual Machine Configuration with the specified input.
304
Firecracker starts with default values for vCPU count (=1) and memory size (=128 MiB).
305
With Hyperthreading enabled, the vCPU count is restricted to be 1 or an even number,
306
otherwise there are no restrictions regarding the vCPU count.
307
If any of the parameters has an incorrect value, the whole update fails.
308
operationId: putMachineConfiguration
309
parameters:
310
- name: body
311
in: body
312
description: Machine Configuration Parameters
313
schema:
314
$ref: "#/definitions/MachineConfiguration"
315
responses:
316
204:
317
description: Machine Configuration created/updated
318
400:
319
description: Machine Configuration cannot be updated due to bad input
320
schema:
321
$ref: "#/definitions/Error"
322
default:
323
description: Internal server error
324
schema:
325
$ref: "#/definitions/Error"
326
327
patch:
328
summary: Partially updates the Machine Configuration of the VM. Pre-boot only.
329
description:
330
Partially updates the Virtual Machine Configuration with the specified input.
331
If any of the parameters has an incorrect value, the whole update fails.
332
operationId: patchMachineConfiguration
333
parameters:
334
- name: body
335
in: body
336
description: A subset of Machine Configuration Parameters
337
schema:
338
$ref: "#/definitions/MachineConfiguration"
339
responses:
340
204:
341
description: Machine Configuration created/updated
342
400:
343
description: Machine Configuration cannot be updated due to bad input
344
schema:
345
$ref: "#/definitions/Error"
346
default:
347
description: Internal server error
348
schema:
349
$ref: "#/definitions/Error"
350
351
/metrics:
352
put:
353
summary: Initializes the metrics system by specifying a named pipe or a file for the metrics output.
354
operationId: putMetrics
355
parameters:
356
- name: body
357
in: body
358
description: Metrics system description
359
required: true
360
schema:
361
$ref: "#/definitions/Metrics"
362
responses:
363
204:
364
description: Metrics system created.
365
400:
366
description: Metrics system cannot be initialized due to bad input.
367
schema:
368
$ref: "#/definitions/Error"
369
default:
370
description: Internal server error.
371
schema:
372
$ref: "#/definitions/Error"
373
374
/mmds:
375
put:
376
summary: Creates a MMDS (Microvm Metadata Service) data store.
377
parameters:
378
- name: body
379
in: body
380
description: The MMDS data store as JSON.
381
schema:
382
type: object
383
responses:
384
204:
385
description: MMDS data store created/updated.
386
400:
387
description: MMDS data store cannot be created due to bad input.
388
schema:
389
$ref: "#/definitions/Error"
390
default:
391
description: Internal server error
392
schema:
393
$ref: "#/definitions/Error"
394
patch:
395
summary: Updates the MMDS data store.
396
parameters:
397
- name: body
398
in: body
399
description: The MMDS data store patch JSON.
400
schema:
401
type: object
402
responses:
403
204:
404
description: MMDS data store updated.
405
400:
406
description: MMDS data store cannot be updated due to bad input.
407
schema:
408
$ref: "#/definitions/Error"
409
default:
410
description: Internal server error
411
schema:
412
$ref: "#/definitions/Error"
413
get:
414
summary: Get the MMDS data store.
415
responses:
416
200:
417
description: The MMDS data store JSON.
418
schema:
419
type: object
420
404:
421
description: The MMDS data store content can not be found.
422
schema:
423
$ref: "#/definitions/Error"
424
default:
425
description: Internal server error
426
schema:
427
$ref: "#/definitions/Error"
428
429
/mmds/config:
430
put:
431
summary: Set MMDS configuration. Pre-boot only.
432
description:
433
Creates MMDS configuration to be used by the MMDS network stack.
434
parameters:
435
- name: body
436
in: body
437
description: The MMDS configuration as JSON.
438
required: true
439
schema:
440
$ref: "#/definitions/MmdsConfig"
441
responses:
442
204:
443
description: MMDS configuration was created/updated.
444
400:
445
description: MMDS configuration cannot be updated due to bad input.
446
schema:
447
$ref: "#/definitions/Error"
448
default:
449
description: Internal server error
450
schema:
451
$ref: "#/definitions/Error"
452
453
/network-interfaces/{iface_id}:
454
put:
455
summary: Creates a network interface. Pre-boot only.
456
description:
457
Creates new network interface with ID specified by iface_id path parameter.
458
operationId: putGuestNetworkInterfaceByID
459
parameters:
460
- name: iface_id
461
in: path
462
description: The id of the guest network interface
463
required: true
464
type: string
465
- name: body
466
in: body
467
description: Guest network interface properties
468
required: true
469
schema:
470
$ref: "#/definitions/NetworkInterface"
471
responses:
472
204:
473
description: Network interface created/updated
474
400:
475
description: Network interface cannot be created due to bad input
476
schema:
477
$ref: "#/definitions/Error"
478
default:
479
description: Internal server error
480
schema:
481
$ref: "#/definitions/Error"
482
patch:
483
summary: Updates the rate limiters applied to a network interface. Post-boot only.
484
description:
485
Updates the rate limiters applied to a network interface.
486
operationId: patchGuestNetworkInterfaceByID
487
parameters:
488
- name: iface_id
489
in: path
490
description: The id of the guest network interface
491
required: true
492
type: string
493
- name: body
494
in: body
495
description: A subset of the guest network interface properties
496
required: true
497
schema:
498
$ref: "#/definitions/PartialNetworkInterface"
499
responses:
500
204:
501
description: Network interface updated
502
400:
503
description: Network interface cannot be updated due to bad input
504
schema:
505
$ref: "#/definitions/Error"
506
default:
507
description: Internal server error
508
schema:
509
$ref: "#/definitions/Error"
510
511
/snapshot/create:
512
put:
513
summary: Creates a full or diff snapshot. Post-boot only.
514
description:
515
Creates a snapshot of the microVM state. The microVM should be
516
in the `Paused` state.
517
operationId: createSnapshot
518
parameters:
519
- name: body
520
in: body
521
description: The configuration used for creating a snaphot.
522
required: true
523
schema:
524
$ref: "#/definitions/SnapshotCreateParams"
525
responses:
526
204:
527
description: Snapshot created
528
400:
529
description: Snapshot cannot be created due to bad input
530
schema:
531
$ref: "#/definitions/Error"
532
default:
533
description: Internal server error
534
schema:
535
$ref: "#/definitions/Error"
536
537
/snapshot/load:
538
put:
539
summary: Loads a snapshot. Pre-boot only.
540
description:
541
Loads the microVM state from a snapshot.
542
Only accepted on a fresh Firecracker process (before configuring
543
any resource other than the Logger and Metrics).
544
operationId: loadSnapshot
545
parameters:
546
- name: body
547
in: body
548
description: The configuration used for loading a snaphot.
549
required: true
550
schema:
551
$ref: "#/definitions/SnapshotLoadParams"
552
responses:
553
204:
554
description: Snapshot loaded
555
400:
556
description: Snapshot cannot be loaded due to bad input
557
schema:
558
$ref: "#/definitions/Error"
559
default:
560
description: Internal server error
561
schema:
562
$ref: "#/definitions/Error"
563
564
/vm:
565
patch:
566
summary: Updates the microVM state.
567
description:
568
Sets the desired state (Paused or Resumed) for the microVM.
569
operationId: patchVm
570
parameters:
571
- name: body
572
in: body
573
description: The microVM state
574
required: true
575
schema:
576
$ref: "#/definitions/Vm"
577
responses:
578
204:
579
description: Vm state updated
580
400:
581
description: Vm state cannot be updated due to bad input
582
schema:
583
$ref: "#/definitions/Error"
584
default:
585
description: Internal server error
586
schema:
587
$ref: "#/definitions/Error"
588
589
/vm/config:
590
get:
591
summary: Gets the full VM configuration.
592
description:
593
Gets configuration for all VM resources.
594
operationId: getExportVmConfig
595
responses:
596
200:
597
description: OK
598
schema:
599
$ref: "#/definitions/FullVmConfiguration"
600
default:
601
description: Internal server error
602
schema:
603
$ref: "#/definitions/Error"
604
605
/vsock:
606
put:
607
summary: Creates/updates a vsock device. Pre-boot only.
608
description:
609
The first call creates the device with the configuration specified
610
in body. Subsequent calls will update the device configuration.
611
May fail if update is not possible.
612
operationId: putGuestVsock
613
parameters:
614
- name: body
615
in: body
616
description: Guest vsock properties
617
required: true
618
schema:
619
$ref: "#/definitions/Vsock"
620
responses:
621
204:
622
description: Vsock created/updated
623
400:
624
description: Vsock cannot be created due to bad input
625
schema:
626
$ref: "#/definitions/Error"
627
default:
628
description: Internal server error
629
schema:
630
$ref: "#/definitions/Error"
631
632
definitions:
633
Balloon:
634
type: object
635
required:
636
- amount_mib
637
- deflate_on_oom
638
description:
639
Balloon device descriptor.
640
properties:
641
amount_mib:
642
type: integer
643
description: Target balloon size in MiB.
644
deflate_on_oom:
645
type: boolean
646
description: Whether the balloon should deflate when the guest has memory pressure.
647
stats_polling_interval_s:
648
type: integer
649
description: Interval in seconds between refreshing statistics. A non-zero value will enable the statistics. Defaults to 0.
650
651
BalloonUpdate:
652
type: object
653
required:
654
- amount_mib
655
description:
656
Balloon device descriptor.
657
properties:
658
amount_mib:
659
type: integer
660
description: Target balloon size in MiB.
661
662
BalloonStats:
663
type: object
664
description:
665
Describes the balloon device statistics.
666
required:
667
- target_pages
668
- actual_pages
669
- target_mib
670
- actual_mib
671
properties:
672
target_pages:
673
description: Target number of pages the device aims to hold.
674
type: integer
675
actual_pages:
676
description: Actual number of pages the device is holding.
677
type: integer
678
target_mib:
679
description: Target amount of memory (in MiB) the device aims to hold.
680
type: integer
681
actual_mib:
682
description: Actual amount of memory (in MiB) the device is holding.
683
type: integer
684
swap_in:
685
description: The amount of memory that has been swapped in (in bytes).
686
type: integer
687
format: int64
688
swap_out:
689
description: The amount of memory that has been swapped out to disk (in bytes).
690
type: integer
691
format: int64
692
major_faults:
693
description: The number of major page faults that have occurred.
694
type: integer
695
format: int64
696
minor_faults:
697
description: The number of minor page faults that have occurred.
698
type: integer
699
format: int64
700
free_memory:
701
description: The amount of memory not being used for any purpose (in bytes).
702
type: integer
703
format: int64
704
total_memory:
705
description: The total amount of memory available (in bytes).
706
type: integer
707
format: int64
708
available_memory:
709
description: An estimate of how much memory is available (in bytes) for starting new applications, without pushing the system to swap.
710
type: integer
711
format: int64
712
disk_caches:
713
description: The amount of memory, in bytes, that can be quickly reclaimed without additional I/O. Typically these pages are used for caching files from disk.
714
type: integer
715
format: int64
716
hugetlb_allocations:
717
description: The number of successful hugetlb page allocations in the guest.
718
type: integer
719
format: int64
720
hugetlb_failures:
721
description: The number of failed hugetlb page allocations in the guest.
722
type: integer
723
format: int64
724
725
BalloonStatsUpdate:
726
type: object
727
required:
728
- stats_polling_interval_s
729
description:
730
Update the statistics polling interval, with the first statistics update scheduled immediately. Statistics cannot be turned on/off after boot.
731
properties:
732
stats_polling_interval_s:
733
type: integer
734
description: Interval in seconds between refreshing statistics.
735
736
BootSource:
737
type: object
738
required:
739
- kernel_image_path
740
description:
741
Boot source descriptor.
742
properties:
743
boot_args:
744
type: string
745
description: Kernel boot arguments
746
initrd_path:
747
type: string
748
description: Host level path to the initrd image used to boot the guest
749
kernel_image_path:
750
type: string
751
description: Host level path to the kernel image used to boot the guest
752
753
CpuTemplate:
754
type: string
755
description:
756
The CPU Template defines a set of flags to be disabled from the microvm so that
757
the features exposed to the guest are the same as in the selected instance type.
758
enum:
759
- C3
760
- T2
761
762
Drive:
763
type: object
764
required:
765
- drive_id
766
- is_read_only
767
- is_root_device
768
- path_on_host
769
properties:
770
drive_id:
771
type: string
772
cache_type:
773
type: string
774
description:
775
Represents the caching strategy for the block device.
776
default: "Unsafe"
777
is_read_only:
778
type: boolean
779
is_root_device:
780
type: boolean
781
partuuid:
782
type: string
783
description:
784
Represents the unique id of the boot partition of this device. It is
785
optional and it will be taken into account only if the is_root_device
786
field is true.
787
path_on_host:
788
type: string
789
description: Host level path for the guest drive
790
rate_limiter:
791
$ref: "#/definitions/RateLimiter"
792
793
Error:
794
type: object
795
properties:
796
fault_message:
797
type: string
798
description: A description of the error condition
799
readOnly: true
800
801
FullVmConfiguration:
802
type: object
803
properties:
804
balloon_device:
805
$ref: "#/definitions/Balloon"
806
block_devices:
807
type: array
808
description: Configurations for all block devices.
809
items:
810
$ref: "#/definitions/Drive"
811
boot_source:
812
$ref: "#/definitions/BootSource"
813
logger:
814
$ref: "#/definitions/Logger"
815
machine_config:
816
$ref: "#/definitions/MachineConfiguration"
817
metrics:
818
$ref: "#/definitions/Metrics"
819
mmds_config:
820
$ref: "#/definitions/MmdsConfig"
821
net_devices:
822
type: array
823
description: Configurations for all net devices.
824
items:
825
$ref: "#/definitions/NetworkInterface"
826
vsock_device:
827
$ref: "#/definitions/Vsock"
828
829
InstanceActionInfo:
830
type: object
831
description:
832
Variant wrapper containing the real action.
833
required:
834
- action_type
835
properties:
836
action_type:
837
description: Enumeration indicating what type of action is contained in the payload
838
type: string
839
enum:
840
- FlushMetrics
841
- InstanceStart
842
- SendCtrlAltDel
843
844
InstanceInfo:
845
type: object
846
description:
847
Describes MicroVM instance information.
848
required:
849
- app_name
850
- id
851
- state
852
- vmm_version
853
properties:
854
app_name:
855
description: Application name.
856
type: string
857
id:
858
description: MicroVM / instance ID.
859
type: string
860
state:
861
description:
862
The current detailed state (Not started, Running, Paused) of the Firecracker instance.
863
This value is read-only for the control-plane.
864
type: string
865
enum:
866
- Not started
867
- Running
868
- Paused
869
vmm_version:
870
description: MicroVM hypervisor build version.
871
type: string
872
873
Logger:
874
type: object
875
description:
876
Describes the configuration option for the logging capability.
877
required:
878
- log_path
879
properties:
880
level:
881
type: string
882
description: Set the level. The possible values are case-insensitive.
883
enum: [Error, Warning, Info, Debug]
884
default: Warning
885
log_path:
886
type: string
887
description: Path to the named pipe or file for the human readable log output.
888
show_level:
889
type: boolean
890
description: Whether or not to output the level in the logs.
891
default: false
892
show_log_origin:
893
type: boolean
894
description: Whether or not to include the file path and line number of the log's origin.
895
default: false
896
897
MachineConfiguration:
898
type: object
899
description:
900
Describes the number of vCPUs, memory size, Hyperthreading capabilities and
901
the CPU template.
902
required:
903
- ht_enabled
904
- mem_size_mib
905
- vcpu_count
906
properties:
907
cpu_template:
908
$ref: "#/definitions/CpuTemplate"
909
ht_enabled:
910
type: boolean
911
description: Flag for enabling/disabling Hyperthreading
912
mem_size_mib:
913
type: integer
914
description: Memory size of VM
915
track_dirty_pages:
916
type: boolean
917
description:
918
Enable dirty page tracking. If this is enabled, then incremental guest memory
919
snapshots can be created. These belong to diff snapshots, which contain, besides
920
the microVM state, only the memory dirtied since a previous snapshot. Full snapshots
921
each contain a full copy of the guest memory.
922
vcpu_count:
923
type: integer
924
minimum: 1
925
maximum: 32
926
description: Number of vCPUs (either 1 or an even number)
927
928
Metrics:
929
type: object
930
description:
931
Describes the configuration option for the metrics capability.
932
required:
933
- metrics_path
934
properties:
935
metrics_path:
936
type: string
937
description: Path to the named pipe or file where the JSON-formatted metrics are flushed.
938
939
MmdsConfig:
940
type: object
941
description:
942
Defines the MMDS configuration.
943
properties:
944
ipv4_address:
945
type: string
946
format: "169.254.([1-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-4]).([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])"
947
default: "169.254.169.254"
948
description: A valid IPv4 link-local address.
949
950
NetworkInterface:
951
type: object
952
description:
953
Defines a network interface.
954
required:
955
- host_dev_name
956
- iface_id
957
properties:
958
allow_mmds_requests:
959
type: boolean
960
description:
961
If this field is set, the device model will reply to HTTP GET
962
requests sent to the MMDS address via this interface. In this case,
963
both ARP requests for 169.254.169.254 and TCP segments heading to the
964
same address are intercepted by the device model, and do not reach
965
the associated TAP device.
966
guest_mac:
967
type: string
968
host_dev_name:
969
type: string
970
description: Host level path for the guest network interface
971
iface_id:
972
type: string
973
rx_rate_limiter:
974
$ref: "#/definitions/RateLimiter"
975
tx_rate_limiter:
976
$ref: "#/definitions/RateLimiter"
977
978
PartialDrive:
979
type: object
980
required:
981
- drive_id
982
properties:
983
drive_id:
984
type: string
985
path_on_host:
986
type: string
987
description: Host level path for the guest drive
988
rate_limiter:
989
$ref: "#/definitions/RateLimiter"
990
991
PartialNetworkInterface:
992
type: object
993
description:
994
Defines a partial network interface structure, used to update the rate limiters
995
for that interface, after microvm start.
996
required:
997
- iface_id
998
properties:
999
iface_id:
1000
type: string
1001
rx_rate_limiter:
1002
$ref: "#/definitions/RateLimiter"
1003
tx_rate_limiter:
1004
$ref: "#/definitions/RateLimiter"
1005
1006
RateLimiter:
1007
type: object
1008
description:
1009
Defines an IO rate limiter with independent bytes/s and ops/s limits.
1010
Limits are defined by configuring each of the _bandwidth_ and _ops_ token buckets.
1011
properties:
1012
bandwidth:
1013
$ref: "#/definitions/TokenBucket"
1014
description: Token bucket with bytes as tokens
1015
ops:
1016
$ref: "#/definitions/TokenBucket"
1017
description: Token bucket with operations as tokens
1018
1019
SnapshotCreateParams:
1020
type: object
1021
required:
1022
- mem_file_path
1023
- snapshot_path
1024
properties:
1025
mem_file_path:
1026
type: string
1027
description: Path to the file that will contain the guest memory.
1028
snapshot_path:
1029
type: string
1030
description: Path to the file that will contain the microVM state.
1031
snapshot_type:
1032
type: string
1033
enum:
1034
- Full
1035
- Diff
1036
description:
1037
Type of snapshot to create. It is optional and by default, a full
1038
snapshot is created.
1039
version:
1040
type: string
1041
description:
1042
The microVM version for which we want to create the snapshot.
1043
It is optional and it defaults to the current version.
1044
1045
SnapshotLoadParams:
1046
type: object
1047
required:
1048
- mem_file_path
1049
- snapshot_path
1050
properties:
1051
enable_diff_snapshots:
1052
type: boolean
1053
description:
1054
Enable support for incremental (diff) snapshots by tracking dirty guest pages.
1055
mem_file_path:
1056
type: string
1057
description: Path to the file that contains the guest memory to be loaded.
1058
snapshot_path:
1059
type: string
1060
description: Path to the file that contains the microVM state to be loaded.
1061
resume_vm:
1062
type: boolean
1063
description:
1064
When set to true, the vm is also resumed if the snapshot load is successful.
1065
1066
TokenBucket:
1067
type: object
1068
description:
1069
Defines a token bucket with a maximum capacity (size), an initial burst size
1070
(one_time_burst) and an interval for refilling purposes (refill_time).
1071
The refill-rate is derived from size and refill_time, and it is the constant
1072
rate at which the tokens replenish. The refill process only starts happening after
1073
the initial burst budget is consumed.
1074
Consumption from the token bucket is unbounded in speed which allows for bursts
1075
bound in size by the amount of tokens available.
1076
Once the token bucket is empty, consumption speed is bound by the refill_rate.
1077
required:
1078
- refill_time
1079
- size
1080
properties:
1081
one_time_burst:
1082
type: integer
1083
format: int64
1084
description: The initial size of a token bucket.
1085
minimum: 0
1086
refill_time:
1087
type: integer
1088
format: int64
1089
description: The amount of milliseconds it takes for the bucket to refill.
1090
minimum: 0
1091
size:
1092
type: integer
1093
format: int64
1094
description: The total number of tokens this bucket can hold.
1095
minimum: 0
1096
1097
Vm:
1098
type: object
1099
description:
1100
Defines the microVM running state. It is especially useful in the snapshotting context.
1101
required:
1102
- state
1103
properties:
1104
state:
1105
type: string
1106
enum:
1107
- Paused
1108
- Resumed
1109
1110
Vsock:
1111
type: object
1112
description:
1113
Defines a vsock device, backed by a set of Unix Domain Sockets, on the host side.
1114
For host-initiated connections, Firecracker will be listening on the Unix socket
1115
identified by the path `uds_path`. Firecracker will create this socket, bind and
1116
listen on it. Host-initiated connections will be performed by connection to this
1117
socket and issuing a connection forwarding request to the desired guest-side vsock
1118
port (i.e. `CONNECT 52\n`, to connect to port 52).
1119
For guest-initiated connections, Firecracker will expect host software to be
1120
bound and listening on Unix sockets at `uds_path_<PORT>`.
1121
E.g. "/path/to/host_vsock.sock_52" for port number 52.
1122
required:
1123
- guest_cid
1124
- uds_path
1125
- vsock_id
1126
properties:
1127
guest_cid:
1128
type: integer
1129
minimum: 3
1130
description: Guest Vsock CID
1131
uds_path:
1132
type: string
1133
description: Path to UNIX domain socket, used to proxy vsock connections.
1134
vsock_id:
1135
type: string
1136
1137