xref: /cloud-hypervisor/vmm/src/api/openapi/cloud-hypervisor.yaml (revision d3fade85a725d36653dc4f636a1e55177eac2ddc)
1openapi: 3.0.1
2info:
3  title: Cloud Hypervisor API
4  description: Local HTTP based API for managing and inspecting a cloud-hypervisor virtual machine.
5  license:
6    name: Apache 2.0
7    url: http://www.apache.org/licenses/LICENSE-2.0.html
8  version: 0.3.0
9
10servers:
11  - url: http://localhost/api/v1
12
13paths:
14  /vmm.ping:
15    get:
16      summary: Ping the VMM to check for API server availability
17      responses:
18        200:
19          description: The VMM information
20          content:
21            application/json:
22              schema:
23                $ref: "#/components/schemas/VmmPingResponse"
24
25  /vmm.shutdown:
26    put:
27      summary: Shuts the cloud-hypervisor VMM.
28      operationId: shutdownVMM
29      responses:
30        204:
31          description: The VMM successfully shutdown.
32
33  /vm.info:
34    get:
35      summary: Returns general information about the cloud-hypervisor Virtual Machine (VM) instance.
36      responses:
37        200:
38          description: The VM information
39          content:
40            application/json:
41              schema:
42                $ref: "#/components/schemas/VmInfo"
43
44  /vm.counters:
45    get:
46      summary: Get counters from the VM
47      responses:
48        200:
49          description: The VM counters
50          content:
51            application/json:
52              schema:
53                $ref: "#/components/schemas/VmCounters"
54
55  /vm.create:
56    put:
57      summary: Create the cloud-hypervisor Virtual Machine (VM) instance. The instance is not booted, only created.
58      operationId: createVM
59      requestBody:
60        description: The VM configuration
61        content:
62          application/json:
63            schema:
64              $ref: "#/components/schemas/VmConfig"
65        required: true
66      responses:
67        204:
68          description: The VM instance was successfully created.
69
70  /vm.delete:
71    put:
72      summary: Delete the cloud-hypervisor Virtual Machine (VM) instance.
73      operationId: deleteVM
74      responses:
75        204:
76          description: The VM instance was successfully deleted.
77
78  /vm.boot:
79    put:
80      summary: Boot the previously created VM instance.
81      operationId: bootVM
82      responses:
83        204:
84          description: The VM instance successfully booted.
85        404:
86          description: The VM instance could not boot because it is not created yet
87
88  /vm.pause:
89    put:
90      summary: Pause a previously booted VM instance.
91      operationId: pauseVM
92      responses:
93        204:
94          description: The VM instance successfully paused.
95        404:
96          description: The VM instance could not pause because it is not created yet
97        405:
98          description: The VM instance could not pause because it is not booted.
99
100  /vm.resume:
101    put:
102      summary: Resume a previously paused VM instance.
103      operationId: resumeVM
104      responses:
105        204:
106          description: The VM instance successfully paused.
107        404:
108          description: The VM instance could not resume because it is not booted yet
109        405:
110          description: The VM instance could not resume because it is not paused.
111
112  /vm.shutdown:
113    put:
114      summary: Shut the VM instance down.
115      operationId: shutdownVM
116      responses:
117        204:
118          description: The VM instance successfully shut down.
119        404:
120          description: The VM instance could not shut down because is not created.
121        405:
122          description: The VM instance could not shut down because it is not started.
123
124  /vm.reboot:
125    put:
126      summary: Reboot the VM instance.
127      operationId: rebootVM
128      responses:
129        204:
130          description: The VM instance successfully rebooted.
131        404:
132          description: The VM instance could not reboot because it is not created.
133        405:
134          description: The VM instance could not reboot because it is not booted.
135
136  /vm.power-button:
137    put:
138      summary: Trigger a power button in the VM
139      operationId: power-buttonVM
140      responses:
141        204:
142          description: Power button successfully triggered in the VM
143        404:
144          description: The button could not be triggered because it is not created yet
145        405:
146          description: The button could not be triggered because it is not booted.
147
148  /vm.resize:
149    put:
150      summary: Resize the VM
151      requestBody:
152        description: The target size for the VM
153        content:
154          application/json:
155            schema:
156              $ref: "#/components/schemas/VmResize"
157        required: true
158      responses:
159        204:
160          description: The VM instance was successfully resized.
161        404:
162          description: The VM instance could not be resized because it is not created.
163
164  /vm.resize-zone:
165    put:
166      summary: Resize a memory zone
167      requestBody:
168        description: The target size for the memory zone
169        content:
170          application/json:
171            schema:
172              $ref: "#/components/schemas/VmResizeZone"
173        required: true
174      responses:
175        204:
176          description: The memory zone was successfully resized.
177        500:
178          description: The memory zone could not be resized.
179
180  /vm.add-device:
181    put:
182      summary: Add a new device to the VM
183      requestBody:
184        description: The path of the new device
185        content:
186          application/json:
187            schema:
188              $ref: "#/components/schemas/DeviceConfig"
189        required: true
190      responses:
191        200:
192          description: The new device was successfully added to the VM instance.
193          content:
194            application/json:
195              schema:
196                $ref: "#/components/schemas/PciDeviceInfo"
197        204:
198          description: The new device was successfully (cold) added to the VM instance.
199        404:
200          description: The new device could not be added to the VM instance.
201
202  /vm.remove-device:
203    put:
204      summary: Remove a device from the VM
205      requestBody:
206        description: The identifier of the device
207        content:
208          application/json:
209            schema:
210              $ref: "#/components/schemas/VmRemoveDevice"
211        required: true
212      responses:
213        204:
214          description: The device was successfully removed from the VM instance.
215        404:
216          description: The device could not be removed from the VM instance.
217
218  /vm.add-disk:
219    put:
220      summary: Add a new disk to the VM
221      requestBody:
222        description: The details of the new disk
223        content:
224          application/json:
225            schema:
226              $ref: "#/components/schemas/DiskConfig"
227        required: true
228      responses:
229        200:
230          description: The new disk was successfully added to the VM instance.
231          content:
232            application/json:
233              schema:
234                $ref: "#/components/schemas/PciDeviceInfo"
235        204:
236          description: The new disk was successfully (cold) added to the VM instance.
237        500:
238          description: The new disk could not be added to the VM instance.
239
240  /vm.add-fs:
241    put:
242      summary: Add a new virtio-fs device to the VM
243      requestBody:
244        description: The details of the new virtio-fs
245        content:
246          application/json:
247            schema:
248              $ref: "#/components/schemas/FsConfig"
249        required: true
250      responses:
251        200:
252          description: The new device was successfully added to the VM instance.
253          content:
254            application/json:
255              schema:
256                $ref: "#/components/schemas/PciDeviceInfo"
257        204:
258          description: The new device was successfully (cold) added to the VM instance.
259        500:
260          description: The new device could not be added to the VM instance.
261
262  /vm.add-pmem:
263    put:
264      summary: Add a new pmem device to the VM
265      requestBody:
266        description: The details of the new pmem device
267        content:
268          application/json:
269            schema:
270              $ref: "#/components/schemas/PmemConfig"
271        required: true
272      responses:
273        200:
274          description: The new device was successfully added to the VM instance.
275          content:
276            application/json:
277              schema:
278                $ref: "#/components/schemas/PciDeviceInfo"
279        204:
280          description: The new device was successfully (cold) added to the VM instance.
281        500:
282          description: The new device could not be added to the VM instance.
283
284  /vm.add-net:
285    put:
286      summary: Add a new network device to the VM
287      requestBody:
288        description: The details of the new network device
289        content:
290          application/json:
291            schema:
292              $ref: "#/components/schemas/NetConfig"
293        required: true
294      responses:
295        200:
296          description: The new device was successfully added to the VM instance.
297          content:
298            application/json:
299              schema:
300                $ref: "#/components/schemas/PciDeviceInfo"
301        204:
302          description: The new device was successfully (cold) added to the VM instance.
303        500:
304          description: The new device could not be added to the VM instance.
305
306  /vm.add-vsock:
307    put:
308      summary: Add a new vsock device to the VM
309      requestBody:
310        description: The details of the new vsock device
311        content:
312          application/json:
313            schema:
314              $ref: "#/components/schemas/VsockConfig"
315        required: true
316      responses:
317        200:
318          description: The new device was successfully added to the VM instance.
319          content:
320            application/json:
321              schema:
322                $ref: "#/components/schemas/PciDeviceInfo"
323        204:
324          description: The new device was successfully (cold) added to the VM instance.
325        500:
326          description: The new device could not be added to the VM instance.
327
328  /vm.add-vdpa:
329    put:
330      summary: Add a new vDPA device to the VM
331      requestBody:
332        description: The details of the new vDPA device
333        content:
334          application/json:
335            schema:
336              $ref: "#/components/schemas/VdpaConfig"
337        required: true
338      responses:
339        200:
340          description: The new vDPA device was successfully added to the VM instance.
341          content:
342            application/json:
343              schema:
344                $ref: "#/components/schemas/PciDeviceInfo"
345        204:
346          description: The new vDPA device was successfully (cold) added to the VM instance.
347        500:
348          description: The new vDPA device could not be added to the VM instance.
349
350  /vm.add-user-device:
351    put:
352      requestBody:
353        content:
354          application/json:
355            schema:
356              $ref: '#/components/schemas/VmAddUserDevice'
357        description: The path of the new device
358        required: true
359      responses:
360        "200":
361          content:
362            application/json:
363              schema:
364                $ref: '#/components/schemas/PciDeviceInfo'
365          description: The new device was successfully added to the VM instance.
366        "204":
367          description: The new device was successfully (cold) added to the VM instance.
368        "404":
369          description: The new device could not be added to the VM instance.
370      summary: Add a new userspace device to the VM
371
372  /vm.snapshot:
373    put:
374      summary: Returns a VM snapshot.
375      requestBody:
376        description: The snapshot configuration
377        content:
378          application/json:
379            schema:
380              $ref: "#/components/schemas/VmSnapshotConfig"
381        required: true
382      responses:
383        204:
384          description: The VM instance was successfully snapshotted.
385        404:
386          description: The VM instance could not be snapshotted because it is not created.
387        405:
388          description: The VM instance could not be snapshotted because it is not booted.
389
390  /vm.coredump:
391    put:
392      summary: Takes a VM coredump.
393      requestBody:
394        description: The coredump configuration
395        content:
396          application/json:
397            schema:
398              $ref: "#/components/schemas/VmCoredumpData"
399        required: true
400      responses:
401        204:
402          description: The VM instance was successfully coredumped.
403        404:
404          description: The VM instance could not be coredumped because it is not created.
405        405:
406          description: The VM instance could not be coredumped because it is not booted.
407
408  /vm.restore:
409    put:
410      summary: Restore a VM from a snapshot.
411      requestBody:
412        description: The restore configuration
413        content:
414          application/json:
415            schema:
416              $ref: "#/components/schemas/RestoreConfig"
417        required: true
418      responses:
419        204:
420          description: The VM instance was successfully restored.
421        404:
422          description: The VM instance could not be restored because it is already created.
423
424  /vm.receive-migration:
425    put:
426      summary: Receive a VM migration from URL
427      requestBody:
428        description: The URL for the reception of migration state
429        content:
430          application/json:
431            schema:
432              $ref: "#/components/schemas/ReceiveMigrationData"
433        required: true
434      responses:
435        204:
436          description: The VM migration was successfully received.
437        500:
438          description: The VM migration could not be received.
439
440  /vm.send-migration:
441    put:
442      summary: Send a VM migration to URL
443      requestBody:
444        description: The URL for sending the migration state
445        content:
446          application/json:
447            schema:
448              $ref: "#/components/schemas/SendMigrationData"
449        required: true
450      responses:
451        204:
452          description: The VM migration was successfully sent.
453        500:
454          description: The VM migration could not be sent.
455
456components:
457  schemas:
458    VmmPingResponse:
459      required:
460        - version
461      type: object
462      properties:
463        build_version:
464          type: string
465        version:
466          type: string
467        pid:
468          type: integer
469          format: int64
470        features:
471          type: array
472          items:
473            type: string
474      description: Virtual Machine Monitor information
475
476    VmInfo:
477      required:
478        - config
479        - state
480      type: object
481      properties:
482        config:
483          $ref: "#/components/schemas/VmConfig"
484        state:
485          type: string
486          enum: [Created, Running, Shutdown, Paused]
487        memory_actual_size:
488          type: integer
489          format: int64
490        device_tree:
491          type: object
492          additionalProperties:
493            $ref: "#/components/schemas/DeviceNode"
494      description: Virtual Machine information
495
496    DeviceNode:
497      type: object
498      properties:
499        id:
500          type: string
501        resources:
502          type: array
503          items:
504            # Rust enum type (with data) which can't be better represented here
505            type: object
506        children:
507          type: array
508          items:
509            type: string
510        pci_bdf:
511          type: string
512
513    VmCounters:
514      type: object
515      additionalProperties:
516        type: object
517        additionalProperties:
518          type: integer
519          format: int64
520
521    PciDeviceInfo:
522      required:
523        - id
524        - bdf
525      type: object
526      properties:
527        id:
528          type: string
529        bdf:
530          type: string
531      description: Information about a PCI device
532
533    PayloadConfig:
534      type: object
535      properties:
536        firmware:
537          type: string
538        kernel:
539          type: string
540        cmdline:
541          type: string
542        initramfs:
543          type: string
544      description: Payloads to boot in guest
545
546    VmConfig:
547      required:
548        - payload
549      type: object
550      properties:
551        cpus:
552          $ref: "#/components/schemas/CpusConfig"
553        memory:
554          $ref: "#/components/schemas/MemoryConfig"
555        payload:
556          $ref: "#/components/schemas/PayloadConfig"
557        rate_limit_groups:
558          type: array
559          items:
560            $ref: "#/components/schemas/RateLimitGroupConfig"
561        disks:
562          type: array
563          items:
564            $ref: "#/components/schemas/DiskConfig"
565        net:
566          type: array
567          items:
568            $ref: "#/components/schemas/NetConfig"
569        rng:
570          $ref: "#/components/schemas/RngConfig"
571        balloon:
572          $ref: "#/components/schemas/BalloonConfig"
573        fs:
574          type: array
575          items:
576            $ref: "#/components/schemas/FsConfig"
577        pmem:
578          type: array
579          items:
580            $ref: "#/components/schemas/PmemConfig"
581        serial:
582          $ref: "#/components/schemas/ConsoleConfig"
583        console:
584          $ref: "#/components/schemas/ConsoleConfig"
585        debug_console:
586          $ref: "#/components/schemas/DebugConsoleConfig"
587        devices:
588          type: array
589          items:
590            $ref: "#/components/schemas/DeviceConfig"
591        vdpa:
592          type: array
593          items:
594            $ref: "#/components/schemas/VdpaConfig"
595        vsock:
596          $ref: "#/components/schemas/VsockConfig"
597        sgx_epc:
598          type: array
599          items:
600            $ref: "#/components/schemas/SgxEpcConfig"
601        numa:
602          type: array
603          items:
604            $ref: "#/components/schemas/NumaConfig"
605        iommu:
606          type: boolean
607          default: false
608        watchdog:
609          type: boolean
610          default: false
611        platform:
612          $ref: "#/components/schemas/PlatformConfig"
613        tpm:
614          $ref: "#/components/schemas/TpmConfig"
615      description: Virtual machine configuration
616
617    CpuAffinity:
618      required:
619        - vcpu
620        - host_cpus
621      type: object
622      properties:
623        vcpu:
624          type: integer
625        host_cpus:
626          type: array
627          items:
628            type: integer
629
630    CpuFeatures:
631      type: object
632      properties:
633        amx:
634          type: boolean
635
636    CpuTopology:
637      type: object
638      properties:
639        threads_per_core:
640          type: integer
641        cores_per_die:
642          type: integer
643        dies_per_package:
644          type: integer
645        packages:
646          type: integer
647
648    CpusConfig:
649      required:
650        - boot_vcpus
651        - max_vcpus
652      type: object
653      properties:
654        boot_vcpus:
655          minimum: 1
656          default: 1
657          type: integer
658        max_vcpus:
659          minimum: 1
660          default: 1
661          type: integer
662        topology:
663          $ref: "#/components/schemas/CpuTopology"
664        kvm_hyperv:
665          type: boolean
666          default: false
667        max_phys_bits:
668          type: integer
669        affinity:
670          type: array
671          items:
672            $ref: "#/components/schemas/CpuAffinity"
673        features:
674          $ref: "#/components/schemas/CpuFeatures"
675
676    PlatformConfig:
677      type: object
678      properties:
679        num_pci_segments:
680          type: integer
681          format: int16
682        iommu_segments:
683          type: array
684          items:
685            type: integer
686            format: int16
687        serial_number:
688          type: string
689        uuid:
690          type: string
691        oem_strings:
692          type: array
693          items:
694            type: string
695        tdx:
696          type: boolean
697          default: false
698
699    MemoryZoneConfig:
700      required:
701        - id
702        - size
703      type: object
704      properties:
705        id:
706          type: string
707        size:
708          type: integer
709          format: int64
710          default: 512 MB
711        file:
712          type: string
713        mergeable:
714          type: boolean
715          default: false
716        shared:
717          type: boolean
718          default: false
719        hugepages:
720          type: boolean
721          default: false
722        hugepage_size:
723          type: integer
724          format: int64
725        host_numa_node:
726          type: integer
727          format: int32
728        hotplug_size:
729          type: integer
730          format: int64
731        hotplugged_size:
732          type: integer
733          format: int64
734        prefault:
735          type: boolean
736          default: false
737
738    MemoryConfig:
739      required:
740        - size
741      type: object
742      properties:
743        size:
744          type: integer
745          format: int64
746          default: 512 MB
747        hotplug_size:
748          type: integer
749          format: int64
750        hotplugged_size:
751          type: integer
752          format: int64
753        mergeable:
754          type: boolean
755          default: false
756        hotplug_method:
757          type: string
758          default: "Acpi"
759        shared:
760          type: boolean
761          default: false
762        hugepages:
763          type: boolean
764          default: false
765        hugepage_size:
766          type: integer
767          format: int64
768        prefault:
769          type: boolean
770          default: false
771        thp:
772          type: boolean
773          default: true
774        zones:
775          type: array
776          items:
777            $ref: "#/components/schemas/MemoryZoneConfig"
778
779    TokenBucket:
780      required:
781        - size
782        - refill_time
783      type: object
784      properties:
785        size:
786          type: integer
787          format: int64
788          minimum: 0
789          description: The total number of tokens this bucket can hold.
790        one_time_burst:
791          type: integer
792          format: int64
793          minimum: 0
794          description: The initial size of a token bucket.
795        refill_time:
796          type: integer
797          format: int64
798          minimum: 0
799          description: The amount of milliseconds it takes for the bucket to refill.
800      description:
801        Defines a token bucket with a maximum capacity (_size_), an initial burst size
802        (_one_time_burst_) and an interval for refilling purposes (_refill_time_).
803        The refill-rate is derived from _size_ and _refill_time_, and it is the constant
804        rate at which the tokens replenish. The refill process only starts happening after
805        the initial burst budget is consumed.
806        Consumption from the token bucket is unbounded in speed which allows for bursts
807        bound in size by the amount of tokens available.
808        Once the token bucket is empty, consumption speed is bound by the refill-rate.
809
810    RateLimiterConfig:
811      type: object
812      properties:
813        bandwidth:
814          $ref: "#/components/schemas/TokenBucket"
815        ops:
816          $ref: "#/components/schemas/TokenBucket"
817      description:
818        Defines an IO rate limiter with independent bytes/s and ops/s limits.
819        Limits are defined by configuring each of the _bandwidth_ and _ops_ token buckets.
820
821    RateLimitGroupConfig:
822      required:
823        - id
824        - rate_limiter_config
825      type: object
826      properties:
827        id:
828          type: string
829        rate_limiter_config:
830          $ref: "#/components/schemas/RateLimiterConfig"
831
832    VirtQueueAffinity:
833      required:
834        - queue_index
835        - host_cpus
836      type: object
837      properties:
838        queue_index:
839          type: integer
840        host_cpus:
841          type: array
842          items:
843            type: integer
844
845    DiskConfig:
846      required:
847        - path
848      type: object
849      properties:
850        path:
851          type: string
852        readonly:
853          type: boolean
854          default: false
855        direct:
856          type: boolean
857          default: false
858        iommu:
859          type: boolean
860          default: false
861        num_queues:
862          type: integer
863          default: 1
864        queue_size:
865          type: integer
866          default: 128
867        vhost_user:
868          type: boolean
869          default: false
870        vhost_socket:
871          type: string
872        rate_limiter_config:
873          $ref: "#/components/schemas/RateLimiterConfig"
874        pci_segment:
875          type: integer
876          format: int16
877        id:
878          type: string
879        serial:
880          type: string
881        rate_limit_group:
882          type: string
883        affinity:
884          type: array
885          items:
886            $ref: "#/components/schemas/VirtQueueAffinity"
887
888    NetConfig:
889      type: object
890      properties:
891        tap:
892          type: string
893        ip:
894          type: string
895          default: "192.168.249.1"
896        mask:
897          type: string
898          default: "255.255.255.0"
899        mac:
900          type: string
901        host_mac:
902          type: string
903        mtu:
904          type: integer
905        iommu:
906          type: boolean
907          default: false
908        num_queues:
909          type: integer
910          default: 2
911        queue_size:
912          type: integer
913          default: 256
914        vhost_user:
915          type: boolean
916          default: false
917        vhost_socket:
918          type: string
919        vhost_mode:
920          type: string
921          default: "Client"
922        id:
923          type: string
924        pci_segment:
925          type: integer
926          format: int16
927        rate_limiter_config:
928          $ref: "#/components/schemas/RateLimiterConfig"
929
930    RngConfig:
931      required:
932        - src
933      type: object
934      properties:
935        src:
936          type: string
937          default: "/dev/urandom"
938        iommu:
939          type: boolean
940          default: false
941
942    BalloonConfig:
943      required:
944        - size
945      type: object
946      properties:
947        size:
948          type: integer
949          format: int64
950        deflate_on_oom:
951          type: boolean
952          default: false
953          description: Deflate balloon when the guest is under memory pressure.
954        free_page_reporting:
955          type: boolean
956          default: false
957          description: Enable guest to report free pages.
958
959    FsConfig:
960      required:
961        - num_queues
962        - queue_size
963        - socket
964        - tag
965      type: object
966      properties:
967        tag:
968          type: string
969        socket:
970          type: string
971        num_queues:
972          type: integer
973          default: 1
974        queue_size:
975          type: integer
976          default: 1024
977        pci_segment:
978          type: integer
979          format: int16
980        id:
981          type: string
982
983    PmemConfig:
984      required:
985        - file
986      type: object
987      properties:
988        file:
989          type: string
990        size:
991          type: integer
992          format: int64
993        iommu:
994          type: boolean
995          default: false
996        discard_writes:
997          type: boolean
998          default: false
999        pci_segment:
1000          type: integer
1001          format: int16
1002        id:
1003          type: string
1004
1005    ConsoleConfig:
1006      required:
1007        - mode
1008      type: object
1009      properties:
1010        file:
1011          type: string
1012        socket:
1013          type: string
1014        mode:
1015          type: string
1016          enum: ["Off", "Pty", "Tty", "File", "Socket", "Null"]
1017        iommu:
1018          type: boolean
1019          default: false
1020
1021    DebugConsoleConfig:
1022      required:
1023        - mode
1024      type: object
1025      properties:
1026        file:
1027          type: string
1028        mode:
1029          type: string
1030          enum: ["Off", "Pty", "Tty", "File", "Null"]
1031        iobase:
1032          type: integer
1033
1034    DeviceConfig:
1035      required:
1036        - path
1037      type: object
1038      properties:
1039        path:
1040          type: string
1041        iommu:
1042          type: boolean
1043          default: false
1044        pci_segment:
1045          type: integer
1046          format: int16
1047        id:
1048          type: string
1049        x_nv_gpudirect_clique:
1050          type: integer
1051          format: int8
1052    TpmConfig:
1053      required:
1054        - socket
1055      type: object
1056      properties:
1057        socket:
1058          type: string
1059
1060    VdpaConfig:
1061      required:
1062        - path
1063        - num_queues
1064      type: object
1065      properties:
1066        path:
1067          type: string
1068        num_queues:
1069          type: integer
1070          default: 1
1071        iommu:
1072          type: boolean
1073          default: false
1074        pci_segment:
1075          type: integer
1076          format: int16
1077        id:
1078          type: string
1079
1080    VsockConfig:
1081      required:
1082        - cid
1083        - socket
1084      type: object
1085      properties:
1086        cid:
1087          type: integer
1088          format: int64
1089          minimum: 3
1090          description: Guest Vsock CID
1091        socket:
1092          type: string
1093          description: Path to UNIX domain socket, used to proxy vsock connections.
1094        iommu:
1095          type: boolean
1096          default: false
1097        pci_segment:
1098          type: integer
1099          format: int16
1100        id:
1101          type: string
1102
1103    SgxEpcConfig:
1104      required:
1105        - id
1106        - size
1107      type: object
1108      properties:
1109        id:
1110          type: string
1111        size:
1112          type: integer
1113          format: int64
1114        prefault:
1115          type: boolean
1116          default: false
1117
1118    NumaDistance:
1119      required:
1120        - destination
1121        - distance
1122      type: object
1123      properties:
1124        destination:
1125          type: integer
1126          format: int32
1127        distance:
1128          type: integer
1129          format: int32
1130
1131    NumaConfig:
1132      required:
1133        - guest_numa_id
1134      type: object
1135      properties:
1136        guest_numa_id:
1137          type: integer
1138          format: int32
1139        cpus:
1140          type: array
1141          items:
1142            type: integer
1143            format: int32
1144        distances:
1145          type: array
1146          items:
1147            $ref: "#/components/schemas/NumaDistance"
1148        memory_zones:
1149          type: array
1150          items:
1151            type: string
1152        sgx_epc_sections:
1153          type: array
1154          items:
1155            type: string
1156        pci_segments:
1157          type: array
1158          items:
1159            type: integer
1160            format: int32
1161
1162    VmResize:
1163      type: object
1164      properties:
1165        desired_vcpus:
1166          minimum: 1
1167          type: integer
1168        desired_ram:
1169          description: desired memory ram in bytes
1170          type: integer
1171          format: int64
1172        desired_balloon:
1173          description: desired balloon size in bytes
1174          type: integer
1175          format: int64
1176
1177    VmResizeZone:
1178      type: object
1179      properties:
1180        id:
1181          type: string
1182        desired_ram:
1183          description: desired memory zone size in bytes
1184          type: integer
1185          format: int64
1186
1187    VmRemoveDevice:
1188      type: object
1189      properties:
1190        id:
1191          type: string
1192
1193    VmSnapshotConfig:
1194      type: object
1195      properties:
1196        destination_url:
1197          type: string
1198
1199    VmCoredumpData:
1200      type: object
1201      properties:
1202        destination_url:
1203          type: string
1204
1205    RestoreConfig:
1206      required:
1207        - source_url
1208      type: object
1209      properties:
1210        source_url:
1211          type: string
1212        prefault:
1213          type: boolean
1214
1215    ReceiveMigrationData:
1216      required:
1217        - receiver_url
1218      type: object
1219      properties:
1220        receiver_url:
1221          type: string
1222
1223    SendMigrationData:
1224      required:
1225        - destination_url
1226      type: object
1227      properties:
1228        destination_url:
1229          type: string
1230        local:
1231          type: boolean
1232
1233    VmAddUserDevice:
1234      required:
1235        - socket
1236      type: object
1237      properties:
1238        socket:
1239          type: string
1240