1#[derive(Debug, Clone)]
2pub struct ConfigClient<T> {
3 client: T,
4 path: String,
5}
6impl<T> ConfigClient<T>
7where
8 T: crate::client::Client,
9{
10 pub fn new(client: T, parent_path: &str) -> Self {
11 Self {
12 client,
13 path: format!("{}{}", parent_path, "/config"),
14 }
15 }
16}
17impl<T> ConfigClient<T>
18where
19 T: crate::client::Client,
20{
21 #[doc = "Get the virtual machine configuration with pending configuration changes applied. Set the 'current' parameter to get the current configuration instead."]
22 #[doc = ""]
23 #[doc = "Permission check: perm(\"/vms/{vmid}\", [\"VM.Audit\"])"]
24 pub async fn get(&self, params: GetParams) -> Result<GetOutput, T::Error> {
25 let path = self.path.to_string();
26 self.client.get(&path, ¶ms).await
27 }
28}
29impl<T> ConfigClient<T>
30where
31 T: crate::client::Client,
32{
33 #[doc = "Set virtual machine options (asynchronous API)."]
34 #[doc = ""]
35 #[doc = "Permission check: perm(\"/vms/{vmid}\", [\"VM.Config.Disk\", \"VM.Config.CDROM\", \"VM.Config.CPU\", \"VM.Config.Memory\", \"VM.Config.Network\", \"VM.Config.HWType\", \"VM.Config.Options\", \"VM.Config.Cloudinit\"], any)"]
36 pub async fn post(&self, params: PostParams) -> Result<Option<String>, T::Error> {
37 let path = self.path.to_string();
38 self.client.post(&path, ¶ms).await
39 }
40}
41impl<T> ConfigClient<T>
42where
43 T: crate::client::Client,
44{
45 #[doc = "Set virtual machine options (synchronous API) - You should consider using the POST method instead for any actions involving hotplug or storage allocation."]
46 #[doc = ""]
47 #[doc = "Permission check: perm(\"/vms/{vmid}\", [\"VM.Config.Disk\", \"VM.Config.CDROM\", \"VM.Config.CPU\", \"VM.Config.Memory\", \"VM.Config.Network\", \"VM.Config.HWType\", \"VM.Config.Options\", \"VM.Config.Cloudinit\"], any)"]
48 pub async fn put(&self, params: PutParams) -> Result<(), T::Error> {
49 let path = self.path.to_string();
50 self.client.put(&path, ¶ms).await
51 }
52}
53impl GetOutput {
54 pub fn new(digest: String) -> Self {
55 Self {
56 digest,
57 acpi: ::std::default::Default::default(),
58 affinity: ::std::default::Default::default(),
59 agent: ::std::default::Default::default(),
60 allow_ksm: ::std::default::Default::default(),
61 amd_sev: ::std::default::Default::default(),
62 arch: ::std::default::Default::default(),
63 args: ::std::default::Default::default(),
64 audio0: ::std::default::Default::default(),
65 autostart: ::std::default::Default::default(),
66 balloon: ::std::default::Default::default(),
67 bios: ::std::default::Default::default(),
68 boot: ::std::default::Default::default(),
69 bootdisk: ::std::default::Default::default(),
70 cdrom: ::std::default::Default::default(),
71 cicustom: ::std::default::Default::default(),
72 cipassword: ::std::default::Default::default(),
73 citype: ::std::default::Default::default(),
74 ciupgrade: ::std::default::Default::default(),
75 ciuser: ::std::default::Default::default(),
76 cores: ::std::default::Default::default(),
77 cpu: ::std::default::Default::default(),
78 cpulimit: ::std::default::Default::default(),
79 cpuunits: ::std::default::Default::default(),
80 description: ::std::default::Default::default(),
81 efidisk0: ::std::default::Default::default(),
82 freeze: ::std::default::Default::default(),
83 hookscript: ::std::default::Default::default(),
84 hostpcis: ::std::default::Default::default(),
85 hotplug: ::std::default::Default::default(),
86 hugepages: ::std::default::Default::default(),
87 ides: ::std::default::Default::default(),
88 intel_tdx: ::std::default::Default::default(),
89 ipconfigs: ::std::default::Default::default(),
90 ivshmem: ::std::default::Default::default(),
91 keephugepages: ::std::default::Default::default(),
92 keyboard: ::std::default::Default::default(),
93 kvm: ::std::default::Default::default(),
94 localtime: ::std::default::Default::default(),
95 lock: ::std::default::Default::default(),
96 machine: ::std::default::Default::default(),
97 memory: ::std::default::Default::default(),
98 meta: ::std::default::Default::default(),
99 migrate_downtime: ::std::default::Default::default(),
100 migrate_speed: ::std::default::Default::default(),
101 name: ::std::default::Default::default(),
102 nameserver: ::std::default::Default::default(),
103 nets: ::std::default::Default::default(),
104 numa: ::std::default::Default::default(),
105 numas: ::std::default::Default::default(),
106 onboot: ::std::default::Default::default(),
107 ostype: ::std::default::Default::default(),
108 parallels: ::std::default::Default::default(),
109 parent: ::std::default::Default::default(),
110 protection: ::std::default::Default::default(),
111 reboot: ::std::default::Default::default(),
112 rng0: ::std::default::Default::default(),
113 running_nets_host_mtu: ::std::default::Default::default(),
114 runningcpu: ::std::default::Default::default(),
115 runningmachine: ::std::default::Default::default(),
116 satas: ::std::default::Default::default(),
117 scsis: ::std::default::Default::default(),
118 scsihw: ::std::default::Default::default(),
119 searchdomain: ::std::default::Default::default(),
120 serials: ::std::default::Default::default(),
121 shares: ::std::default::Default::default(),
122 smbios1: ::std::default::Default::default(),
123 smp: ::std::default::Default::default(),
124 snaptime: ::std::default::Default::default(),
125 sockets: ::std::default::Default::default(),
126 spice_enhancements: ::std::default::Default::default(),
127 sshkeys: ::std::default::Default::default(),
128 startdate: ::std::default::Default::default(),
129 startup: ::std::default::Default::default(),
130 tablet: ::std::default::Default::default(),
131 tags: ::std::default::Default::default(),
132 tdf: ::std::default::Default::default(),
133 template: ::std::default::Default::default(),
134 tpmstate0: ::std::default::Default::default(),
135 unuseds: ::std::default::Default::default(),
136 usbs: ::std::default::Default::default(),
137 vcpus: ::std::default::Default::default(),
138 vga: ::std::default::Default::default(),
139 virtios: ::std::default::Default::default(),
140 virtiofss: ::std::default::Default::default(),
141 vmgenid: ::std::default::Default::default(),
142 vmstate: ::std::default::Default::default(),
143 vmstatestorage: ::std::default::Default::default(),
144 watchdog: ::std::default::Default::default(),
145 additional_properties: ::std::default::Default::default(),
146 }
147 }
148}
149#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
150pub struct GetOutput {
151 #[serde(
152 serialize_with = "crate::types::serialize_bool_optional",
153 deserialize_with = "crate::types::deserialize_bool_optional"
154 )]
155 #[serde(skip_serializing_if = "Option::is_none", default)]
156 #[doc = "Enable/disable ACPI."]
157 #[doc = ""]
158 pub acpi: Option<bool>,
159 #[serde(skip_serializing_if = "Option::is_none", default)]
160 #[doc = "List of host cores used to execute guest processes, for example: 0,5,8-11"]
161 #[doc = ""]
162 pub affinity: Option<String>,
163 #[serde(skip_serializing_if = "Option::is_none", default)]
164 #[doc = "Enable/disable communication with the QEMU Guest Agent and its properties."]
165 #[doc = ""]
166 pub agent: Option<String>,
167 #[serde(rename = "allow-ksm")]
168 #[serde(
169 serialize_with = "crate::types::serialize_bool_optional",
170 deserialize_with = "crate::types::deserialize_bool_optional"
171 )]
172 #[serde(skip_serializing_if = "Option::is_none", default)]
173 #[doc = "Allow memory pages of this guest to be merged via KSM (Kernel Samepage Merging)."]
174 #[doc = ""]
175 pub allow_ksm: Option<bool>,
176 #[serde(rename = "amd-sev")]
177 #[serde(skip_serializing_if = "Option::is_none", default)]
178 #[doc = "Secure Encrypted Virtualization (SEV) features by AMD CPUs"]
179 #[doc = ""]
180 pub amd_sev: Option<String>,
181 #[serde(skip_serializing_if = "Option::is_none", default)]
182 #[doc = "Virtual processor architecture. Defaults to the host."]
183 #[doc = ""]
184 pub arch: Option<Arch>,
185 #[serde(skip_serializing_if = "Option::is_none", default)]
186 #[doc = "Arbitrary arguments passed to kvm."]
187 #[doc = ""]
188 #[doc = "Arbitrary arguments passed to kvm, for example:"]
189 #[doc = ""]
190 #[doc = "args: -no-reboot -smbios 'type=0,vendor=FOO'"]
191 #[doc = ""]
192 #[doc = "NOTE: this option is for experts only."]
193 #[doc = ""]
194 pub args: Option<String>,
195 #[serde(skip_serializing_if = "Option::is_none", default)]
196 #[doc = "Configure a audio device, useful in combination with QXL/Spice."]
197 #[doc = ""]
198 pub audio0: Option<String>,
199 #[serde(
200 serialize_with = "crate::types::serialize_bool_optional",
201 deserialize_with = "crate::types::deserialize_bool_optional"
202 )]
203 #[serde(skip_serializing_if = "Option::is_none", default)]
204 #[doc = "Automatic restart after crash (currently ignored)."]
205 #[doc = ""]
206 pub autostart: Option<bool>,
207 #[serde(
208 serialize_with = "crate::types::serialize_unsigned_int_optional",
209 deserialize_with = "crate::types::deserialize_unsigned_int_optional"
210 )]
211 #[serde(skip_serializing_if = "Option::is_none", default)]
212 #[doc = "Amount of target RAM for the VM in MiB. Using zero disables the ballon driver."]
213 #[doc = ""]
214 pub balloon: Option<u64>,
215 #[serde(skip_serializing_if = "Option::is_none", default)]
216 #[doc = "Select BIOS implementation."]
217 #[doc = ""]
218 pub bios: Option<Bios>,
219 #[serde(skip_serializing_if = "Option::is_none", default)]
220 #[doc = "Specify guest boot order. Use the 'order=' sub-property as usage with no key or 'legacy=' is deprecated."]
221 #[doc = ""]
222 pub boot: Option<String>,
223 #[serde(skip_serializing_if = "Option::is_none", default)]
224 #[doc = "Enable booting from specified disk. Deprecated: Use 'boot: order=foo;bar' instead."]
225 #[doc = ""]
226 pub bootdisk: Option<BootdiskStr>,
227 #[serde(skip_serializing_if = "Option::is_none", default)]
228 #[doc = "This is an alias for option -ide2"]
229 #[doc = ""]
230 pub cdrom: Option<String>,
231 #[serde(skip_serializing_if = "Option::is_none", default)]
232 #[doc = "cloud-init: Specify custom files to replace the automatically generated ones at start."]
233 #[doc = ""]
234 pub cicustom: Option<String>,
235 #[serde(skip_serializing_if = "Option::is_none", default)]
236 #[doc = "cloud-init: Password to assign the user. Using this is generally not recommended. Use ssh keys instead. Also note that older cloud-init versions do not support hashed passwords."]
237 #[doc = ""]
238 pub cipassword: Option<String>,
239 #[serde(skip_serializing_if = "Option::is_none", default)]
240 #[doc = "Specifies the cloud-init configuration format. The default depends on the configured operating system type (`ostype`. We use the `nocloud` format for Linux, and `configdrive2` for windows."]
241 #[doc = ""]
242 pub citype: Option<Citype>,
243 #[serde(
244 serialize_with = "crate::types::serialize_bool_optional",
245 deserialize_with = "crate::types::deserialize_bool_optional"
246 )]
247 #[serde(skip_serializing_if = "Option::is_none", default)]
248 #[doc = "cloud-init: do an automatic package upgrade after the first boot."]
249 #[doc = ""]
250 pub ciupgrade: Option<bool>,
251 #[serde(skip_serializing_if = "Option::is_none", default)]
252 #[doc = "cloud-init: User name to change ssh keys and password for instead of the image's configured default user."]
253 #[doc = ""]
254 pub ciuser: Option<String>,
255 #[serde(
256 serialize_with = "crate::types::serialize_non_zero_pos_int_optional",
257 deserialize_with = "crate::types::deserialize_non_zero_pos_int_optional"
258 )]
259 #[serde(skip_serializing_if = "Option::is_none", default)]
260 #[doc = "The number of cores per socket."]
261 #[doc = ""]
262 pub cores: Option<std::num::NonZeroU64>,
263 #[serde(skip_serializing_if = "Option::is_none", default)]
264 #[doc = "Emulated CPU type."]
265 #[doc = ""]
266 pub cpu: Option<String>,
267 #[serde(skip_serializing_if = "Option::is_none", default)]
268 #[doc = "Limit of CPU usage."]
269 #[doc = ""]
270 #[doc = "Limit of CPU usage."]
271 #[doc = ""]
272 #[doc = "NOTE: If the computer has 2 CPUs, it has total of '2' CPU time. Value '0' indicates no CPU limit."]
273 #[doc = ""]
274 pub cpulimit: Option<CpulimitNum>,
275 #[serde(skip_serializing_if = "Option::is_none", default)]
276 #[doc = "CPU weight for a VM, will be clamped to \\\\[1, 10000\\\\] in cgroup v2."]
277 #[doc = ""]
278 #[doc = "CPU weight for a VM. Argument is used in the kernel fair scheduler. The larger the number is, the more CPU time this VM gets. Number is relative to weights of all the other running VMs."]
279 #[doc = ""]
280 pub cpuunits: Option<CpuunitsInt>,
281 #[serde(skip_serializing_if = "Option::is_none", default)]
282 #[doc = "Description for the VM. Shown in the web-interface VM's summary. This is saved as comment inside the configuration file."]
283 #[doc = ""]
284 pub description: Option<DescriptionStr>,
285 #[doc = "SHA1 digest of configuration file. This can be used to prevent concurrent modifications."]
286 #[doc = ""]
287 pub digest: String,
288 #[serde(skip_serializing_if = "Option::is_none", default)]
289 #[doc = "Configure a disk for storing EFI vars."]
290 #[doc = ""]
291 pub efidisk0: Option<String>,
292 #[serde(
293 serialize_with = "crate::types::serialize_bool_optional",
294 deserialize_with = "crate::types::deserialize_bool_optional"
295 )]
296 #[serde(skip_serializing_if = "Option::is_none", default)]
297 #[doc = "Freeze CPU at startup (use 'c' monitor command to start execution)."]
298 #[doc = ""]
299 pub freeze: Option<bool>,
300 #[serde(skip_serializing_if = "Option::is_none", default)]
301 #[doc = "Script that will be executed during various steps in the vms lifetime."]
302 #[doc = ""]
303 pub hookscript: Option<String>,
304 #[serde(rename = "hostpci[n]")]
305 #[serde(
306 serialize_with = "crate::types::serialize_multi::<NumberedHostpcis, _>",
307 deserialize_with = "crate::types::deserialize_multi::<NumberedHostpcis, _>"
308 )]
309 #[serde(skip_serializing_if = "::std::collections::HashMap::is_empty", default)]
310 #[serde(flatten)]
311 #[doc = "Map host PCI devices into guest."]
312 #[doc = ""]
313 #[doc = "Map host PCI devices into guest."]
314 #[doc = ""]
315 #[doc = "NOTE: This option allows direct access to host hardware. So it is no longer"]
316 #[doc = ""]
317 #[doc = "possible to migrate such machines - use with special care."]
318 #[doc = ""]
319 #[doc = "CAUTION: Experimental! User reported problems with this option."]
320 #[doc = ""]
321 pub hostpcis: ::std::collections::HashMap<u32, String>,
322 #[serde(skip_serializing_if = "Option::is_none", default)]
323 #[doc = "Selectively enable hotplug features. This is a comma separated list of hotplug features: 'network', 'disk', 'cpu', 'memory', 'usb' and 'cloudinit'. Use '0' to disable hotplug completely. Using '1' as value is an alias for the default `network,disk,usb`. USB hotplugging is possible for guests with machine version \\\\>= 7.1 and ostype l26 or windows \\\\> 7."]
324 #[doc = ""]
325 pub hotplug: Option<String>,
326 #[serde(skip_serializing_if = "Option::is_none", default)]
327 #[doc = "Enables hugepages memory."]
328 #[doc = ""]
329 #[doc = "Sets the size of hugepages in MiB. If the value is set to 'any' then 1 GiB hugepages will be used if possible, otherwise the size will fall back to 2 MiB."]
330 #[doc = ""]
331 pub hugepages: Option<Hugepages>,
332 #[serde(rename = "ide[n]")]
333 #[serde(
334 serialize_with = "crate::types::serialize_multi::<NumberedIdes, _>",
335 deserialize_with = "crate::types::deserialize_multi::<NumberedIdes, _>"
336 )]
337 #[serde(skip_serializing_if = "::std::collections::HashMap::is_empty", default)]
338 #[serde(flatten)]
339 #[doc = "Use volume as IDE hard disk or CD-ROM (n is 0 to 3)."]
340 #[doc = ""]
341 pub ides: ::std::collections::HashMap<u32, String>,
342 #[serde(rename = "intel-tdx")]
343 #[serde(skip_serializing_if = "Option::is_none", default)]
344 #[doc = "Trusted Domain Extension (TDX) features by Intel CPUs"]
345 #[doc = ""]
346 pub intel_tdx: Option<String>,
347 #[serde(rename = "ipconfig[n]")]
348 #[serde(
349 serialize_with = "crate::types::serialize_multi::<NumberedIpconfigs, _>",
350 deserialize_with = "crate::types::deserialize_multi::<NumberedIpconfigs, _>"
351 )]
352 #[serde(skip_serializing_if = "::std::collections::HashMap::is_empty", default)]
353 #[serde(flatten)]
354 #[doc = "cloud-init: Specify IP addresses and gateways for the corresponding interface."]
355 #[doc = ""]
356 #[doc = "IP addresses use CIDR notation, gateways are optional but need an IP of the same type specified."]
357 #[doc = ""]
358 #[doc = "The special string 'dhcp' can be used for IP addresses to use DHCP, in which case no explicit"]
359 #[doc = ""]
360 #[doc = "gateway should be provided."]
361 #[doc = ""]
362 #[doc = "For IPv6 the special string 'auto' can be used to use stateless autoconfiguration. This requires"]
363 #[doc = ""]
364 #[doc = "cloud-init 19.4 or newer."]
365 #[doc = ""]
366 #[doc = "If cloud-init is enabled and neither an IPv4 nor an IPv6 address is specified, it defaults to using"]
367 #[doc = ""]
368 #[doc = "dhcp on IPv4."]
369 #[doc = ""]
370 pub ipconfigs: ::std::collections::HashMap<u32, String>,
371 #[serde(skip_serializing_if = "Option::is_none", default)]
372 #[doc = "Inter-VM shared memory. Useful for direct communication between VMs, or to the host."]
373 #[doc = ""]
374 pub ivshmem: Option<String>,
375 #[serde(
376 serialize_with = "crate::types::serialize_bool_optional",
377 deserialize_with = "crate::types::deserialize_bool_optional"
378 )]
379 #[serde(skip_serializing_if = "Option::is_none", default)]
380 #[doc = "Use together with hugepages. If enabled, hugepages will not not be deleted after VM shutdown and can be used for subsequent starts."]
381 #[doc = ""]
382 pub keephugepages: Option<bool>,
383 #[serde(skip_serializing_if = "Option::is_none", default)]
384 #[doc = "Keyboard layout for VNC server. This option is generally not required and is often better handled from within the guest OS."]
385 #[doc = ""]
386 pub keyboard: Option<Keyboard>,
387 #[serde(
388 serialize_with = "crate::types::serialize_bool_optional",
389 deserialize_with = "crate::types::deserialize_bool_optional"
390 )]
391 #[serde(skip_serializing_if = "Option::is_none", default)]
392 #[doc = "Enable/disable KVM hardware virtualization."]
393 #[doc = ""]
394 pub kvm: Option<bool>,
395 #[serde(
396 serialize_with = "crate::types::serialize_bool_optional",
397 deserialize_with = "crate::types::deserialize_bool_optional"
398 )]
399 #[serde(skip_serializing_if = "Option::is_none", default)]
400 #[doc = "Set the real time clock (RTC) to local time. This is enabled by default if the `ostype` indicates a Microsoft Windows OS."]
401 #[doc = ""]
402 pub localtime: Option<bool>,
403 #[serde(skip_serializing_if = "Option::is_none", default)]
404 #[doc = "Lock/unlock the VM."]
405 #[doc = ""]
406 pub lock: Option<Lock>,
407 #[serde(skip_serializing_if = "Option::is_none", default)]
408 #[doc = "Specify the QEMU machine."]
409 #[doc = ""]
410 pub machine: Option<String>,
411 #[serde(skip_serializing_if = "Option::is_none", default)]
412 #[doc = "Memory properties."]
413 #[doc = ""]
414 pub memory: Option<String>,
415 #[serde(skip_serializing_if = "Option::is_none", default)]
416 #[doc = "Some (read-only) meta-information about this guest."]
417 #[doc = ""]
418 pub meta: Option<String>,
419 #[serde(skip_serializing_if = "Option::is_none", default)]
420 #[doc = "Set maximum tolerated downtime (in seconds) for migrations. Should the migration not be able to converge in the very end, because too much newly dirtied RAM needs to be transferred, the limit will be increased automatically step-by-step until migration can converge."]
421 #[doc = ""]
422 pub migrate_downtime: Option<MigrateDowntimeNum>,
423 #[serde(
424 serialize_with = "crate::types::serialize_unsigned_int_optional",
425 deserialize_with = "crate::types::deserialize_unsigned_int_optional"
426 )]
427 #[serde(skip_serializing_if = "Option::is_none", default)]
428 #[doc = "Set maximum speed (in MB/s) for migrations. Value 0 is no limit."]
429 #[doc = ""]
430 pub migrate_speed: Option<u64>,
431 #[serde(skip_serializing_if = "Option::is_none", default)]
432 #[doc = "Set a name for the VM. Only used on the configuration web interface."]
433 #[doc = ""]
434 pub name: Option<String>,
435 #[serde(skip_serializing_if = "Option::is_none", default)]
436 #[doc = "cloud-init: Sets DNS server IP address for a container. Create will automatically use the setting from the host if neither searchdomain nor nameserver are set."]
437 #[doc = ""]
438 pub nameserver: Option<String>,
439 #[serde(rename = "net[n]")]
440 #[serde(
441 serialize_with = "crate::types::serialize_multi::<NumberedNets, _>",
442 deserialize_with = "crate::types::deserialize_multi::<NumberedNets, _>"
443 )]
444 #[serde(skip_serializing_if = "::std::collections::HashMap::is_empty", default)]
445 #[serde(flatten)]
446 #[doc = "Specify network devices."]
447 #[doc = ""]
448 pub nets: ::std::collections::HashMap<u32, String>,
449 #[serde(
450 serialize_with = "crate::types::serialize_bool_optional",
451 deserialize_with = "crate::types::deserialize_bool_optional"
452 )]
453 #[serde(skip_serializing_if = "Option::is_none", default)]
454 #[doc = "Enable/disable NUMA."]
455 #[doc = ""]
456 pub numa: Option<bool>,
457 #[serde(rename = "numa[n]")]
458 #[serde(
459 serialize_with = "crate::types::serialize_multi::<NumberedNumas, _>",
460 deserialize_with = "crate::types::deserialize_multi::<NumberedNumas, _>"
461 )]
462 #[serde(skip_serializing_if = "::std::collections::HashMap::is_empty", default)]
463 #[serde(flatten)]
464 #[doc = "NUMA topology."]
465 #[doc = ""]
466 pub numas: ::std::collections::HashMap<u32, String>,
467 #[serde(
468 serialize_with = "crate::types::serialize_bool_optional",
469 deserialize_with = "crate::types::deserialize_bool_optional"
470 )]
471 #[serde(skip_serializing_if = "Option::is_none", default)]
472 #[doc = "Specifies whether a VM will be started during system bootup."]
473 #[doc = ""]
474 pub onboot: Option<bool>,
475 #[serde(skip_serializing_if = "Option::is_none", default)]
476 #[doc = "Specify guest operating system."]
477 #[doc = ""]
478 #[doc = "Specify guest operating system. This is used to enable special"]
479 #[doc = ""]
480 #[doc = "optimization/features for specific operating systems:"]
481 #[doc = ""]
482 #[doc = "\\\\[horizontal\\\\]"]
483 #[doc = ""]
484 #[doc = "other;; unspecified OS"]
485 #[doc = ""]
486 #[doc = "wxp;; Microsoft Windows XP"]
487 #[doc = ""]
488 #[doc = "w2k;; Microsoft Windows 2000"]
489 #[doc = ""]
490 #[doc = "w2k3;; Microsoft Windows 2003"]
491 #[doc = ""]
492 #[doc = "w2k8;; Microsoft Windows 2008"]
493 #[doc = ""]
494 #[doc = "wvista;; Microsoft Windows Vista"]
495 #[doc = ""]
496 #[doc = "win7;; Microsoft Windows 7"]
497 #[doc = ""]
498 #[doc = "win8;; Microsoft Windows 8/2012/2012r2"]
499 #[doc = ""]
500 #[doc = "win10;; Microsoft Windows 10/2016/2019"]
501 #[doc = ""]
502 #[doc = "win11;; Microsoft Windows 11/2022/2025"]
503 #[doc = ""]
504 #[doc = "l24;; Linux 2.4 Kernel"]
505 #[doc = ""]
506 #[doc = "l26;; Linux 2.6 - 6.X Kernel"]
507 #[doc = ""]
508 #[doc = "solaris;; Solaris/OpenSolaris/OpenIndiania kernel"]
509 #[doc = ""]
510 pub ostype: Option<Ostype>,
511 #[serde(rename = "parallel[n]")]
512 #[serde(
513 serialize_with = "crate::types::serialize_multi::<NumberedParallels, _>",
514 deserialize_with = "crate::types::deserialize_multi::<NumberedParallels, _>"
515 )]
516 #[serde(skip_serializing_if = "::std::collections::HashMap::is_empty", default)]
517 #[serde(flatten)]
518 #[doc = "Map host parallel devices (n is 0 to 2)."]
519 #[doc = ""]
520 #[doc = "Map host parallel devices (n is 0 to 2)."]
521 #[doc = ""]
522 #[doc = "NOTE: This option allows direct access to host hardware. So it is no longer possible to migrate such"]
523 #[doc = ""]
524 #[doc = "machines - use with special care."]
525 #[doc = ""]
526 #[doc = "CAUTION: Experimental! User reported problems with this option."]
527 #[doc = ""]
528 pub parallels: ::std::collections::HashMap<u32, ParallelNStr>,
529 #[serde(skip_serializing_if = "Option::is_none", default)]
530 #[doc = "Parent snapshot name. This is used internally, and should not be modified."]
531 #[doc = ""]
532 pub parent: Option<ParentStr>,
533 #[serde(
534 serialize_with = "crate::types::serialize_bool_optional",
535 deserialize_with = "crate::types::deserialize_bool_optional"
536 )]
537 #[serde(skip_serializing_if = "Option::is_none", default)]
538 #[doc = "Sets the protection flag of the VM. This will disable the remove VM and remove disk operations."]
539 #[doc = ""]
540 pub protection: Option<bool>,
541 #[serde(
542 serialize_with = "crate::types::serialize_bool_optional",
543 deserialize_with = "crate::types::deserialize_bool_optional"
544 )]
545 #[serde(skip_serializing_if = "Option::is_none", default)]
546 #[doc = "Allow reboot. If set to '0' the VM exit on reboot."]
547 #[doc = ""]
548 pub reboot: Option<bool>,
549 #[serde(skip_serializing_if = "Option::is_none", default)]
550 #[doc = "Configure a VirtIO-based Random Number Generator."]
551 #[doc = ""]
552 pub rng0: Option<String>,
553 #[serde(rename = "running-nets-host-mtu")]
554 #[serde(skip_serializing_if = "Option::is_none", default)]
555 #[doc = "List of VirtIO network devices and their effective host_mtu setting. A value of 0 means that the host_mtu parameter is to be avoided for the corresponding device. This is used internally for snapshots."]
556 #[doc = ""]
557 pub running_nets_host_mtu: Option<RunningNetsHostMtuStr>,
558 #[serde(skip_serializing_if = "Option::is_none", default)]
559 #[doc = "Specifies the QEMU '-cpu' parameter of the running vm. This is used internally for snapshots."]
560 #[doc = ""]
561 pub runningcpu: Option<RunningcpuStr>,
562 #[serde(skip_serializing_if = "Option::is_none", default)]
563 #[doc = "Specifies the QEMU machine type of the running vm. This is used internally for snapshots."]
564 #[doc = ""]
565 pub runningmachine: Option<String>,
566 #[serde(rename = "sata[n]")]
567 #[serde(
568 serialize_with = "crate::types::serialize_multi::<NumberedSatas, _>",
569 deserialize_with = "crate::types::deserialize_multi::<NumberedSatas, _>"
570 )]
571 #[serde(skip_serializing_if = "::std::collections::HashMap::is_empty", default)]
572 #[serde(flatten)]
573 #[doc = "Use volume as SATA hard disk or CD-ROM (n is 0 to 5)."]
574 #[doc = ""]
575 pub satas: ::std::collections::HashMap<u32, String>,
576 #[serde(rename = "scsi[n]")]
577 #[serde(
578 serialize_with = "crate::types::serialize_multi::<NumberedScsis, _>",
579 deserialize_with = "crate::types::deserialize_multi::<NumberedScsis, _>"
580 )]
581 #[serde(skip_serializing_if = "::std::collections::HashMap::is_empty", default)]
582 #[serde(flatten)]
583 #[doc = "Use volume as SCSI hard disk or CD-ROM (n is 0 to 30)."]
584 #[doc = ""]
585 pub scsis: ::std::collections::HashMap<u32, String>,
586 #[serde(skip_serializing_if = "Option::is_none", default)]
587 #[doc = "SCSI controller model"]
588 #[doc = ""]
589 pub scsihw: Option<Scsihw>,
590 #[serde(skip_serializing_if = "Option::is_none", default)]
591 #[doc = "cloud-init: Sets DNS search domains for a container. Create will automatically use the setting from the host if neither searchdomain nor nameserver are set."]
592 #[doc = ""]
593 pub searchdomain: Option<String>,
594 #[serde(rename = "serial[n]")]
595 #[serde(
596 serialize_with = "crate::types::serialize_multi::<NumberedSerials, _>",
597 deserialize_with = "crate::types::deserialize_multi::<NumberedSerials, _>"
598 )]
599 #[serde(skip_serializing_if = "::std::collections::HashMap::is_empty", default)]
600 #[serde(flatten)]
601 #[doc = "Create a serial device inside the VM (n is 0 to 3)"]
602 #[doc = ""]
603 #[doc = "Create a serial device inside the VM (n is 0 to 3), and pass through a"]
604 #[doc = ""]
605 #[doc = "host serial device (i.e. /dev/ttyS0), or create a unix socket on the"]
606 #[doc = ""]
607 #[doc = "host side (use 'qm terminal' to open a terminal connection)."]
608 #[doc = ""]
609 #[doc = "NOTE: If you pass through a host serial device, it is no longer possible to migrate such machines -"]
610 #[doc = ""]
611 #[doc = "use with special care."]
612 #[doc = ""]
613 #[doc = "CAUTION: Experimental! User reported problems with this option."]
614 #[doc = ""]
615 pub serials: ::std::collections::HashMap<u32, SerialNStr>,
616 #[serde(skip_serializing_if = "Option::is_none", default)]
617 #[doc = "Amount of memory shares for auto-ballooning. The larger the number is, the more memory this VM gets. Number is relative to weights of all other running VMs. Using zero disables auto-ballooning. Auto-ballooning is done by pvestatd."]
618 #[doc = ""]
619 pub shares: Option<SharesInt>,
620 #[serde(skip_serializing_if = "Option::is_none", default)]
621 #[doc = "Specify SMBIOS type 1 fields."]
622 #[doc = ""]
623 pub smbios1: Option<Smbios1Str>,
624 #[serde(
625 serialize_with = "crate::types::serialize_non_zero_pos_int_optional",
626 deserialize_with = "crate::types::deserialize_non_zero_pos_int_optional"
627 )]
628 #[serde(skip_serializing_if = "Option::is_none", default)]
629 #[doc = "The number of CPUs. Please use option -sockets instead."]
630 #[doc = ""]
631 pub smp: Option<std::num::NonZeroU64>,
632 #[serde(
633 serialize_with = "crate::types::serialize_unsigned_int_optional",
634 deserialize_with = "crate::types::deserialize_unsigned_int_optional"
635 )]
636 #[serde(skip_serializing_if = "Option::is_none", default)]
637 #[doc = "Timestamp for snapshots."]
638 #[doc = ""]
639 pub snaptime: Option<u64>,
640 #[serde(
641 serialize_with = "crate::types::serialize_non_zero_pos_int_optional",
642 deserialize_with = "crate::types::deserialize_non_zero_pos_int_optional"
643 )]
644 #[serde(skip_serializing_if = "Option::is_none", default)]
645 #[doc = "The number of CPU sockets."]
646 #[doc = ""]
647 pub sockets: Option<std::num::NonZeroU64>,
648 #[serde(skip_serializing_if = "Option::is_none", default)]
649 #[doc = "Configure additional enhancements for SPICE."]
650 #[doc = ""]
651 pub spice_enhancements: Option<String>,
652 #[serde(skip_serializing_if = "Option::is_none", default)]
653 #[doc = "cloud-init: Setup public SSH keys (one key per line, OpenSSH format)."]
654 #[doc = ""]
655 pub sshkeys: Option<String>,
656 #[serde(skip_serializing_if = "Option::is_none", default)]
657 #[doc = "Set the initial date of the real time clock. Valid format for date are:'now' or '2006-06-17T16:01:21' or '2006-06-17'."]
658 #[doc = ""]
659 pub startdate: Option<StartdateStr>,
660 #[serde(skip_serializing_if = "Option::is_none", default)]
661 #[doc = "Startup and shutdown behavior. Order is a non-negative number defining the general startup order. Shutdown in done with reverse ordering. Additionally you can set the 'up' or 'down' delay in seconds, which specifies a delay to wait before the next VM is started or stopped."]
662 #[doc = ""]
663 pub startup: Option<String>,
664 #[serde(
665 serialize_with = "crate::types::serialize_bool_optional",
666 deserialize_with = "crate::types::deserialize_bool_optional"
667 )]
668 #[serde(skip_serializing_if = "Option::is_none", default)]
669 #[doc = "Enable/disable the USB tablet device."]
670 #[doc = ""]
671 #[doc = "Enable/disable the USB tablet device. This device is usually needed to allow absolute mouse positioning with VNC. Else the mouse runs out of sync with normal VNC clients. If you're running lots of console-only guests on one host, you may consider disabling this to save some context switches. This is turned off by default if you use spice (`qm set \\\\<vmid\\\\> --vga qxl`)."]
672 #[doc = ""]
673 pub tablet: Option<bool>,
674 #[serde(skip_serializing_if = "Option::is_none", default)]
675 #[doc = "Tags of the VM. This is only meta information."]
676 #[doc = ""]
677 pub tags: Option<String>,
678 #[serde(
679 serialize_with = "crate::types::serialize_bool_optional",
680 deserialize_with = "crate::types::deserialize_bool_optional"
681 )]
682 #[serde(skip_serializing_if = "Option::is_none", default)]
683 #[doc = "Enable/disable time drift fix."]
684 #[doc = ""]
685 pub tdf: Option<bool>,
686 #[serde(
687 serialize_with = "crate::types::serialize_bool_optional",
688 deserialize_with = "crate::types::deserialize_bool_optional"
689 )]
690 #[serde(skip_serializing_if = "Option::is_none", default)]
691 #[doc = "Enable/disable Template."]
692 #[doc = ""]
693 pub template: Option<bool>,
694 #[serde(skip_serializing_if = "Option::is_none", default)]
695 #[doc = "Configure a Disk for storing TPM state. The format is fixed to 'raw'."]
696 #[doc = ""]
697 pub tpmstate0: Option<String>,
698 #[serde(rename = "unused[n]")]
699 #[serde(
700 serialize_with = "crate::types::serialize_multi::<NumberedUnuseds, _>",
701 deserialize_with = "crate::types::deserialize_multi::<NumberedUnuseds, _>"
702 )]
703 #[serde(skip_serializing_if = "::std::collections::HashMap::is_empty", default)]
704 #[serde(flatten)]
705 #[doc = "Reference to unused volumes. This is used internally, and should not be modified manually."]
706 #[doc = ""]
707 pub unuseds: ::std::collections::HashMap<u32, String>,
708 #[serde(rename = "usb[n]")]
709 #[serde(
710 serialize_with = "crate::types::serialize_multi::<NumberedUsbs, _>",
711 deserialize_with = "crate::types::deserialize_multi::<NumberedUsbs, _>"
712 )]
713 #[serde(skip_serializing_if = "::std::collections::HashMap::is_empty", default)]
714 #[serde(flatten)]
715 #[doc = "Configure an USB device (n is 0 to 4, for machine version \\\\>= 7.1 and ostype l26 or windows \\\\> 7, n can be up to 14)."]
716 #[doc = ""]
717 pub usbs: ::std::collections::HashMap<u32, String>,
718 #[serde(skip_serializing_if = "Option::is_none", default)]
719 #[doc = "Number of hotplugged vcpus."]
720 #[doc = ""]
721 pub vcpus: Option<VcpusInt>,
722 #[serde(skip_serializing_if = "Option::is_none", default)]
723 #[doc = "Configure the VGA hardware."]
724 #[doc = ""]
725 #[doc = "Configure the VGA Hardware. If you want to use high resolution modes (\\\\>= 1280x1024x16) you may need to increase the vga memory option. Since QEMU 2.9 the default VGA display type is 'std' for all OS types besides some Windows versions (XP and older) which use 'cirrus'. The 'qxl' option enables the SPICE display server. For win* OS you can select how many independent displays you want, Linux guests can add displays them self."]
726 #[doc = ""]
727 #[doc = "You can also run without any graphic card, using a serial device as terminal."]
728 #[doc = ""]
729 pub vga: Option<String>,
730 #[serde(rename = "virtio[n]")]
731 #[serde(
732 serialize_with = "crate::types::serialize_multi::<NumberedVirtios, _>",
733 deserialize_with = "crate::types::deserialize_multi::<NumberedVirtios, _>"
734 )]
735 #[serde(skip_serializing_if = "::std::collections::HashMap::is_empty", default)]
736 #[serde(flatten)]
737 #[doc = "Use volume as VIRTIO hard disk (n is 0 to 15)."]
738 #[doc = ""]
739 pub virtios: ::std::collections::HashMap<u32, String>,
740 #[serde(rename = "virtiofs[n]")]
741 #[serde(
742 serialize_with = "crate::types::serialize_multi::<NumberedVirtiofss, _>",
743 deserialize_with = "crate::types::deserialize_multi::<NumberedVirtiofss, _>"
744 )]
745 #[serde(skip_serializing_if = "::std::collections::HashMap::is_empty", default)]
746 #[serde(flatten)]
747 #[doc = "Configuration for sharing a directory between host and guest using Virtio-fs."]
748 #[doc = ""]
749 pub virtiofss: ::std::collections::HashMap<u32, String>,
750 #[serde(skip_serializing_if = "Option::is_none", default)]
751 #[doc = "Set VM Generation ID. Use '1' to autogenerate on create or update, pass '0' to disable explicitly."]
752 #[doc = ""]
753 #[doc = "The VM generation ID (vmgenid) device exposes a 128-bit integer value identifier to the guest OS. This allows to notify the guest operating system when the virtual machine is executed with a different configuration (e.g. snapshot execution or creation from a template). The guest operating system notices the change, and is then able to react as appropriate by marking its copies of distributed databases as dirty, re-initializing its random number generator, etc."]
754 #[doc = ""]
755 #[doc = "Note that auto-creation only works when done through API/CLI create or update methods, but not when manually editing the config file."]
756 #[doc = ""]
757 pub vmgenid: Option<VmgenidStr>,
758 #[serde(skip_serializing_if = "Option::is_none", default)]
759 #[doc = "Reference to a volume which stores the VM state. This is used internally for snapshots."]
760 #[doc = ""]
761 pub vmstate: Option<String>,
762 #[serde(skip_serializing_if = "Option::is_none", default)]
763 #[doc = "Default storage for VM state volumes/files."]
764 #[doc = ""]
765 pub vmstatestorage: Option<String>,
766 #[serde(skip_serializing_if = "Option::is_none", default)]
767 #[doc = "Create a virtual hardware watchdog device."]
768 #[doc = ""]
769 #[doc = "Create a virtual hardware watchdog device. Once enabled (by a guest action), the watchdog must be periodically polled by an agent inside the guest or else the watchdog will reset the guest (or execute the respective action specified)"]
770 #[doc = ""]
771 pub watchdog: Option<String>,
772 #[serde(
773 flatten,
774 deserialize_with = "crate::types::multi::deserialize_additional_data::<'_, GetOutput, _, _>"
775 )]
776 pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
777}
778impl crate::types::multi::Test for GetOutput {
779 fn test_fn() -> fn(&str) -> bool {
780 fn the_test(input: &str) -> bool {
781 let array = [
782 <NumberedHostpcis as crate::types::multi::NumberedItems>::key_matches
783 as fn(&str) -> bool,
784 <NumberedIdes as crate::types::multi::NumberedItems>::key_matches
785 as fn(&str) -> bool,
786 <NumberedIpconfigs as crate::types::multi::NumberedItems>::key_matches
787 as fn(&str) -> bool,
788 <NumberedNets as crate::types::multi::NumberedItems>::key_matches
789 as fn(&str) -> bool,
790 <NumberedNumas as crate::types::multi::NumberedItems>::key_matches
791 as fn(&str) -> bool,
792 <NumberedParallels as crate::types::multi::NumberedItems>::key_matches
793 as fn(&str) -> bool,
794 <NumberedSatas as crate::types::multi::NumberedItems>::key_matches
795 as fn(&str) -> bool,
796 <NumberedScsis as crate::types::multi::NumberedItems>::key_matches
797 as fn(&str) -> bool,
798 <NumberedSerials as crate::types::multi::NumberedItems>::key_matches
799 as fn(&str) -> bool,
800 <NumberedUnuseds as crate::types::multi::NumberedItems>::key_matches
801 as fn(&str) -> bool,
802 <NumberedUsbs as crate::types::multi::NumberedItems>::key_matches
803 as fn(&str) -> bool,
804 <NumberedVirtios as crate::types::multi::NumberedItems>::key_matches
805 as fn(&str) -> bool,
806 <NumberedVirtiofss as crate::types::multi::NumberedItems>::key_matches
807 as fn(&str) -> bool,
808 ];
809 array.iter().any(|f| f(input))
810 }
811 the_test as _
812 }
813}
814#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize, Default)]
815pub struct GetParams {
816 #[serde(
817 serialize_with = "crate::types::serialize_bool_optional",
818 deserialize_with = "crate::types::deserialize_bool_optional"
819 )]
820 #[serde(skip_serializing_if = "Option::is_none", default)]
821 #[doc = "Get current values (instead of pending values)."]
822 #[doc = ""]
823 pub current: Option<bool>,
824 #[serde(skip_serializing_if = "Option::is_none", default)]
825 #[doc = "Fetch config values from given snapshot."]
826 #[doc = ""]
827 pub snapshot: Option<SnapshotStr>,
828 #[serde(
829 flatten,
830 default,
831 skip_serializing_if = "::std::collections::HashMap::is_empty"
832 )]
833 pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
834}
835#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize, Default)]
836pub struct PostParams {
837 #[serde(
838 serialize_with = "crate::types::serialize_bool_optional",
839 deserialize_with = "crate::types::deserialize_bool_optional"
840 )]
841 #[serde(skip_serializing_if = "Option::is_none", default)]
842 #[doc = "Enable/disable ACPI."]
843 #[doc = ""]
844 pub acpi: Option<bool>,
845 #[serde(skip_serializing_if = "Option::is_none", default)]
846 #[doc = "List of host cores used to execute guest processes, for example: 0,5,8-11"]
847 #[doc = ""]
848 pub affinity: Option<String>,
849 #[serde(skip_serializing_if = "Option::is_none", default)]
850 #[doc = "Enable/disable communication with the QEMU Guest Agent and its properties."]
851 #[doc = ""]
852 pub agent: Option<String>,
853 #[serde(rename = "allow-ksm")]
854 #[serde(
855 serialize_with = "crate::types::serialize_bool_optional",
856 deserialize_with = "crate::types::deserialize_bool_optional"
857 )]
858 #[serde(skip_serializing_if = "Option::is_none", default)]
859 #[doc = "Allow memory pages of this guest to be merged via KSM (Kernel Samepage Merging)."]
860 #[doc = ""]
861 pub allow_ksm: Option<bool>,
862 #[serde(rename = "amd-sev")]
863 #[serde(skip_serializing_if = "Option::is_none", default)]
864 #[doc = "Secure Encrypted Virtualization (SEV) features by AMD CPUs"]
865 #[doc = ""]
866 pub amd_sev: Option<String>,
867 #[serde(skip_serializing_if = "Option::is_none", default)]
868 #[doc = "Virtual processor architecture. Defaults to the host."]
869 #[doc = ""]
870 pub arch: Option<Arch>,
871 #[serde(skip_serializing_if = "Option::is_none", default)]
872 #[doc = "Arbitrary arguments passed to kvm."]
873 #[doc = ""]
874 #[doc = "Arbitrary arguments passed to kvm, for example:"]
875 #[doc = ""]
876 #[doc = "args: -no-reboot -smbios 'type=0,vendor=FOO'"]
877 #[doc = ""]
878 #[doc = "NOTE: this option is for experts only."]
879 #[doc = ""]
880 pub args: Option<String>,
881 #[serde(skip_serializing_if = "Option::is_none", default)]
882 #[doc = "Configure a audio device, useful in combination with QXL/Spice."]
883 #[doc = ""]
884 pub audio0: Option<String>,
885 #[serde(
886 serialize_with = "crate::types::serialize_bool_optional",
887 deserialize_with = "crate::types::deserialize_bool_optional"
888 )]
889 #[serde(skip_serializing_if = "Option::is_none", default)]
890 #[doc = "Automatic restart after crash (currently ignored)."]
891 #[doc = ""]
892 pub autostart: Option<bool>,
893 #[serde(skip_serializing_if = "Option::is_none", default)]
894 #[doc = "Time to wait for the task to finish. We return 'null' if the task finish within that time."]
895 #[doc = ""]
896 pub background_delay: Option<BackgroundDelayInt>,
897 #[serde(
898 serialize_with = "crate::types::serialize_unsigned_int_optional",
899 deserialize_with = "crate::types::deserialize_unsigned_int_optional"
900 )]
901 #[serde(skip_serializing_if = "Option::is_none", default)]
902 #[doc = "Amount of target RAM for the VM in MiB. Using zero disables the ballon driver."]
903 #[doc = ""]
904 pub balloon: Option<u64>,
905 #[serde(skip_serializing_if = "Option::is_none", default)]
906 #[doc = "Select BIOS implementation."]
907 #[doc = ""]
908 pub bios: Option<Bios>,
909 #[serde(skip_serializing_if = "Option::is_none", default)]
910 #[doc = "Specify guest boot order. Use the 'order=' sub-property as usage with no key or 'legacy=' is deprecated."]
911 #[doc = ""]
912 pub boot: Option<String>,
913 #[serde(skip_serializing_if = "Option::is_none", default)]
914 #[doc = "Enable booting from specified disk. Deprecated: Use 'boot: order=foo;bar' instead."]
915 #[doc = ""]
916 pub bootdisk: Option<BootdiskStr>,
917 #[serde(skip_serializing_if = "Option::is_none", default)]
918 #[doc = "This is an alias for option -ide2"]
919 #[doc = ""]
920 pub cdrom: Option<String>,
921 #[serde(skip_serializing_if = "Option::is_none", default)]
922 #[doc = "cloud-init: Specify custom files to replace the automatically generated ones at start."]
923 #[doc = ""]
924 pub cicustom: Option<String>,
925 #[serde(skip_serializing_if = "Option::is_none", default)]
926 #[doc = "cloud-init: Password to assign the user. Using this is generally not recommended. Use ssh keys instead. Also note that older cloud-init versions do not support hashed passwords."]
927 #[doc = ""]
928 pub cipassword: Option<String>,
929 #[serde(skip_serializing_if = "Option::is_none", default)]
930 #[doc = "Specifies the cloud-init configuration format. The default depends on the configured operating system type (`ostype`. We use the `nocloud` format for Linux, and `configdrive2` for windows."]
931 #[doc = ""]
932 pub citype: Option<Citype>,
933 #[serde(
934 serialize_with = "crate::types::serialize_bool_optional",
935 deserialize_with = "crate::types::deserialize_bool_optional"
936 )]
937 #[serde(skip_serializing_if = "Option::is_none", default)]
938 #[doc = "cloud-init: do an automatic package upgrade after the first boot."]
939 #[doc = ""]
940 pub ciupgrade: Option<bool>,
941 #[serde(skip_serializing_if = "Option::is_none", default)]
942 #[doc = "cloud-init: User name to change ssh keys and password for instead of the image's configured default user."]
943 #[doc = ""]
944 pub ciuser: Option<String>,
945 #[serde(
946 serialize_with = "crate::types::serialize_non_zero_pos_int_optional",
947 deserialize_with = "crate::types::deserialize_non_zero_pos_int_optional"
948 )]
949 #[serde(skip_serializing_if = "Option::is_none", default)]
950 #[doc = "The number of cores per socket."]
951 #[doc = ""]
952 pub cores: Option<std::num::NonZeroU64>,
953 #[serde(skip_serializing_if = "Option::is_none", default)]
954 #[doc = "Emulated CPU type."]
955 #[doc = ""]
956 pub cpu: Option<String>,
957 #[serde(skip_serializing_if = "Option::is_none", default)]
958 #[doc = "Limit of CPU usage."]
959 #[doc = ""]
960 #[doc = "Limit of CPU usage."]
961 #[doc = ""]
962 #[doc = "NOTE: If the computer has 2 CPUs, it has total of '2' CPU time. Value '0' indicates no CPU limit."]
963 #[doc = ""]
964 pub cpulimit: Option<CpulimitNum>,
965 #[serde(skip_serializing_if = "Option::is_none", default)]
966 #[doc = "CPU weight for a VM, will be clamped to \\\\[1, 10000\\\\] in cgroup v2."]
967 #[doc = ""]
968 #[doc = "CPU weight for a VM. Argument is used in the kernel fair scheduler. The larger the number is, the more CPU time this VM gets. Number is relative to weights of all the other running VMs."]
969 #[doc = ""]
970 pub cpuunits: Option<CpuunitsInt>,
971 #[serde(skip_serializing_if = "Option::is_none", default)]
972 #[doc = "A list of settings you want to delete."]
973 #[doc = ""]
974 pub delete: Option<String>,
975 #[serde(skip_serializing_if = "Option::is_none", default)]
976 #[doc = "Description for the VM. Shown in the web-interface VM's summary. This is saved as comment inside the configuration file."]
977 #[doc = ""]
978 pub description: Option<DescriptionStr>,
979 #[serde(skip_serializing_if = "Option::is_none", default)]
980 #[doc = "Prevent changes if current configuration file has different SHA1 digest. This can be used to prevent concurrent modifications."]
981 #[doc = ""]
982 pub digest: Option<DigestStr>,
983 #[serde(skip_serializing_if = "Option::is_none", default)]
984 #[doc = "Configure a disk for storing EFI vars. Use the special syntax STORAGE_ID:SIZE_IN_GiB to allocate a new volume. Note that SIZE_IN_GiB is ignored here and that the default EFI vars are copied to the volume instead. Use STORAGE_ID:0 and the 'import-from' parameter to import from an existing volume."]
985 #[doc = ""]
986 pub efidisk0: Option<String>,
987 #[serde(
988 serialize_with = "crate::types::serialize_bool_optional",
989 deserialize_with = "crate::types::deserialize_bool_optional"
990 )]
991 #[serde(skip_serializing_if = "Option::is_none", default)]
992 #[doc = "Force physical removal. Without this, we simple remove the disk from the config file and create an additional configuration entry called 'unused\\\\[n\\\\]', which contains the volume ID. Unlink of unused\\\\[n\\\\] always cause physical removal."]
993 #[doc = ""]
994 pub force: Option<bool>,
995 #[serde(
996 serialize_with = "crate::types::serialize_bool_optional",
997 deserialize_with = "crate::types::deserialize_bool_optional"
998 )]
999 #[serde(skip_serializing_if = "Option::is_none", default)]
1000 #[doc = "Freeze CPU at startup (use 'c' monitor command to start execution)."]
1001 #[doc = ""]
1002 pub freeze: Option<bool>,
1003 #[serde(skip_serializing_if = "Option::is_none", default)]
1004 #[doc = "Script that will be executed during various steps in the vms lifetime."]
1005 #[doc = ""]
1006 pub hookscript: Option<String>,
1007 #[serde(rename = "hostpci[n]")]
1008 #[serde(
1009 serialize_with = "crate::types::serialize_multi::<NumberedHostpcis, _>",
1010 deserialize_with = "crate::types::deserialize_multi::<NumberedHostpcis, _>"
1011 )]
1012 #[serde(skip_serializing_if = "::std::collections::HashMap::is_empty", default)]
1013 #[serde(flatten)]
1014 #[doc = "Map host PCI devices into guest."]
1015 #[doc = ""]
1016 #[doc = "Map host PCI devices into guest."]
1017 #[doc = ""]
1018 #[doc = "NOTE: This option allows direct access to host hardware. So it is no longer"]
1019 #[doc = ""]
1020 #[doc = "possible to migrate such machines - use with special care."]
1021 #[doc = ""]
1022 #[doc = "CAUTION: Experimental! User reported problems with this option."]
1023 #[doc = ""]
1024 pub hostpcis: ::std::collections::HashMap<u32, String>,
1025 #[serde(skip_serializing_if = "Option::is_none", default)]
1026 #[doc = "Selectively enable hotplug features. This is a comma separated list of hotplug features: 'network', 'disk', 'cpu', 'memory', 'usb' and 'cloudinit'. Use '0' to disable hotplug completely. Using '1' as value is an alias for the default `network,disk,usb`. USB hotplugging is possible for guests with machine version \\\\>= 7.1 and ostype l26 or windows \\\\> 7."]
1027 #[doc = ""]
1028 pub hotplug: Option<String>,
1029 #[serde(skip_serializing_if = "Option::is_none", default)]
1030 #[doc = "Enables hugepages memory."]
1031 #[doc = ""]
1032 #[doc = "Sets the size of hugepages in MiB. If the value is set to 'any' then 1 GiB hugepages will be used if possible, otherwise the size will fall back to 2 MiB."]
1033 #[doc = ""]
1034 pub hugepages: Option<Hugepages>,
1035 #[serde(rename = "ide[n]")]
1036 #[serde(
1037 serialize_with = "crate::types::serialize_multi::<NumberedIdes, _>",
1038 deserialize_with = "crate::types::deserialize_multi::<NumberedIdes, _>"
1039 )]
1040 #[serde(skip_serializing_if = "::std::collections::HashMap::is_empty", default)]
1041 #[serde(flatten)]
1042 #[doc = "Use volume as IDE hard disk or CD-ROM (n is 0 to 3). Use the special syntax STORAGE_ID:SIZE_IN_GiB to allocate a new volume. Use STORAGE_ID:0 and the 'import-from' parameter to import from an existing volume."]
1043 #[doc = ""]
1044 pub ides: ::std::collections::HashMap<u32, String>,
1045 #[serde(rename = "import-working-storage")]
1046 #[serde(skip_serializing_if = "Option::is_none", default)]
1047 #[doc = "A file-based storage with 'images' content-type enabled, which is used as an intermediary extraction storage during import. Defaults to the source storage."]
1048 #[doc = ""]
1049 pub import_working_storage: Option<String>,
1050 #[serde(rename = "intel-tdx")]
1051 #[serde(skip_serializing_if = "Option::is_none", default)]
1052 #[doc = "Trusted Domain Extension (TDX) features by Intel CPUs"]
1053 #[doc = ""]
1054 pub intel_tdx: Option<String>,
1055 #[serde(rename = "ipconfig[n]")]
1056 #[serde(
1057 serialize_with = "crate::types::serialize_multi::<NumberedIpconfigs, _>",
1058 deserialize_with = "crate::types::deserialize_multi::<NumberedIpconfigs, _>"
1059 )]
1060 #[serde(skip_serializing_if = "::std::collections::HashMap::is_empty", default)]
1061 #[serde(flatten)]
1062 #[doc = "cloud-init: Specify IP addresses and gateways for the corresponding interface."]
1063 #[doc = ""]
1064 #[doc = "IP addresses use CIDR notation, gateways are optional but need an IP of the same type specified."]
1065 #[doc = ""]
1066 #[doc = "The special string 'dhcp' can be used for IP addresses to use DHCP, in which case no explicit"]
1067 #[doc = ""]
1068 #[doc = "gateway should be provided."]
1069 #[doc = ""]
1070 #[doc = "For IPv6 the special string 'auto' can be used to use stateless autoconfiguration. This requires"]
1071 #[doc = ""]
1072 #[doc = "cloud-init 19.4 or newer."]
1073 #[doc = ""]
1074 #[doc = "If cloud-init is enabled and neither an IPv4 nor an IPv6 address is specified, it defaults to using"]
1075 #[doc = ""]
1076 #[doc = "dhcp on IPv4."]
1077 #[doc = ""]
1078 pub ipconfigs: ::std::collections::HashMap<u32, String>,
1079 #[serde(skip_serializing_if = "Option::is_none", default)]
1080 #[doc = "Inter-VM shared memory. Useful for direct communication between VMs, or to the host."]
1081 #[doc = ""]
1082 pub ivshmem: Option<String>,
1083 #[serde(
1084 serialize_with = "crate::types::serialize_bool_optional",
1085 deserialize_with = "crate::types::deserialize_bool_optional"
1086 )]
1087 #[serde(skip_serializing_if = "Option::is_none", default)]
1088 #[doc = "Use together with hugepages. If enabled, hugepages will not not be deleted after VM shutdown and can be used for subsequent starts."]
1089 #[doc = ""]
1090 pub keephugepages: Option<bool>,
1091 #[serde(skip_serializing_if = "Option::is_none", default)]
1092 #[doc = "Keyboard layout for VNC server. This option is generally not required and is often better handled from within the guest OS."]
1093 #[doc = ""]
1094 pub keyboard: Option<Keyboard>,
1095 #[serde(
1096 serialize_with = "crate::types::serialize_bool_optional",
1097 deserialize_with = "crate::types::deserialize_bool_optional"
1098 )]
1099 #[serde(skip_serializing_if = "Option::is_none", default)]
1100 #[doc = "Enable/disable KVM hardware virtualization."]
1101 #[doc = ""]
1102 pub kvm: Option<bool>,
1103 #[serde(
1104 serialize_with = "crate::types::serialize_bool_optional",
1105 deserialize_with = "crate::types::deserialize_bool_optional"
1106 )]
1107 #[serde(skip_serializing_if = "Option::is_none", default)]
1108 #[doc = "Set the real time clock (RTC) to local time. This is enabled by default if the `ostype` indicates a Microsoft Windows OS."]
1109 #[doc = ""]
1110 pub localtime: Option<bool>,
1111 #[serde(skip_serializing_if = "Option::is_none", default)]
1112 #[doc = "Lock/unlock the VM."]
1113 #[doc = ""]
1114 pub lock: Option<Lock>,
1115 #[serde(skip_serializing_if = "Option::is_none", default)]
1116 #[doc = "Specify the QEMU machine."]
1117 #[doc = ""]
1118 pub machine: Option<String>,
1119 #[serde(skip_serializing_if = "Option::is_none", default)]
1120 #[doc = "Memory properties."]
1121 #[doc = ""]
1122 pub memory: Option<String>,
1123 #[serde(skip_serializing_if = "Option::is_none", default)]
1124 #[doc = "Set maximum tolerated downtime (in seconds) for migrations. Should the migration not be able to converge in the very end, because too much newly dirtied RAM needs to be transferred, the limit will be increased automatically step-by-step until migration can converge."]
1125 #[doc = ""]
1126 pub migrate_downtime: Option<MigrateDowntimeNum>,
1127 #[serde(
1128 serialize_with = "crate::types::serialize_unsigned_int_optional",
1129 deserialize_with = "crate::types::deserialize_unsigned_int_optional"
1130 )]
1131 #[serde(skip_serializing_if = "Option::is_none", default)]
1132 #[doc = "Set maximum speed (in MB/s) for migrations. Value 0 is no limit."]
1133 #[doc = ""]
1134 pub migrate_speed: Option<u64>,
1135 #[serde(skip_serializing_if = "Option::is_none", default)]
1136 #[doc = "Set a name for the VM. Only used on the configuration web interface."]
1137 #[doc = ""]
1138 pub name: Option<String>,
1139 #[serde(skip_serializing_if = "Option::is_none", default)]
1140 #[doc = "cloud-init: Sets DNS server IP address for a container. Create will automatically use the setting from the host if neither searchdomain nor nameserver are set."]
1141 #[doc = ""]
1142 pub nameserver: Option<String>,
1143 #[serde(rename = "net[n]")]
1144 #[serde(
1145 serialize_with = "crate::types::serialize_multi::<NumberedNets, _>",
1146 deserialize_with = "crate::types::deserialize_multi::<NumberedNets, _>"
1147 )]
1148 #[serde(skip_serializing_if = "::std::collections::HashMap::is_empty", default)]
1149 #[serde(flatten)]
1150 #[doc = "Specify network devices."]
1151 #[doc = ""]
1152 pub nets: ::std::collections::HashMap<u32, String>,
1153 #[serde(
1154 serialize_with = "crate::types::serialize_bool_optional",
1155 deserialize_with = "crate::types::deserialize_bool_optional"
1156 )]
1157 #[serde(skip_serializing_if = "Option::is_none", default)]
1158 #[doc = "Enable/disable NUMA."]
1159 #[doc = ""]
1160 pub numa: Option<bool>,
1161 #[serde(rename = "numa[n]")]
1162 #[serde(
1163 serialize_with = "crate::types::serialize_multi::<NumberedNumas, _>",
1164 deserialize_with = "crate::types::deserialize_multi::<NumberedNumas, _>"
1165 )]
1166 #[serde(skip_serializing_if = "::std::collections::HashMap::is_empty", default)]
1167 #[serde(flatten)]
1168 #[doc = "NUMA topology."]
1169 #[doc = ""]
1170 pub numas: ::std::collections::HashMap<u32, String>,
1171 #[serde(
1172 serialize_with = "crate::types::serialize_bool_optional",
1173 deserialize_with = "crate::types::deserialize_bool_optional"
1174 )]
1175 #[serde(skip_serializing_if = "Option::is_none", default)]
1176 #[doc = "Specifies whether a VM will be started during system bootup."]
1177 #[doc = ""]
1178 pub onboot: Option<bool>,
1179 #[serde(skip_serializing_if = "Option::is_none", default)]
1180 #[doc = "Specify guest operating system."]
1181 #[doc = ""]
1182 #[doc = "Specify guest operating system. This is used to enable special"]
1183 #[doc = ""]
1184 #[doc = "optimization/features for specific operating systems:"]
1185 #[doc = ""]
1186 #[doc = "\\\\[horizontal\\\\]"]
1187 #[doc = ""]
1188 #[doc = "other;; unspecified OS"]
1189 #[doc = ""]
1190 #[doc = "wxp;; Microsoft Windows XP"]
1191 #[doc = ""]
1192 #[doc = "w2k;; Microsoft Windows 2000"]
1193 #[doc = ""]
1194 #[doc = "w2k3;; Microsoft Windows 2003"]
1195 #[doc = ""]
1196 #[doc = "w2k8;; Microsoft Windows 2008"]
1197 #[doc = ""]
1198 #[doc = "wvista;; Microsoft Windows Vista"]
1199 #[doc = ""]
1200 #[doc = "win7;; Microsoft Windows 7"]
1201 #[doc = ""]
1202 #[doc = "win8;; Microsoft Windows 8/2012/2012r2"]
1203 #[doc = ""]
1204 #[doc = "win10;; Microsoft Windows 10/2016/2019"]
1205 #[doc = ""]
1206 #[doc = "win11;; Microsoft Windows 11/2022/2025"]
1207 #[doc = ""]
1208 #[doc = "l24;; Linux 2.4 Kernel"]
1209 #[doc = ""]
1210 #[doc = "l26;; Linux 2.6 - 6.X Kernel"]
1211 #[doc = ""]
1212 #[doc = "solaris;; Solaris/OpenSolaris/OpenIndiania kernel"]
1213 #[doc = ""]
1214 pub ostype: Option<Ostype>,
1215 #[serde(rename = "parallel[n]")]
1216 #[serde(
1217 serialize_with = "crate::types::serialize_multi::<NumberedParallels, _>",
1218 deserialize_with = "crate::types::deserialize_multi::<NumberedParallels, _>"
1219 )]
1220 #[serde(skip_serializing_if = "::std::collections::HashMap::is_empty", default)]
1221 #[serde(flatten)]
1222 #[doc = "Map host parallel devices (n is 0 to 2)."]
1223 #[doc = ""]
1224 #[doc = "Map host parallel devices (n is 0 to 2)."]
1225 #[doc = ""]
1226 #[doc = "NOTE: This option allows direct access to host hardware. So it is no longer possible to migrate such"]
1227 #[doc = ""]
1228 #[doc = "machines - use with special care."]
1229 #[doc = ""]
1230 #[doc = "CAUTION: Experimental! User reported problems with this option."]
1231 #[doc = ""]
1232 pub parallels: ::std::collections::HashMap<u32, ParallelNStr>,
1233 #[serde(
1234 serialize_with = "crate::types::serialize_bool_optional",
1235 deserialize_with = "crate::types::deserialize_bool_optional"
1236 )]
1237 #[serde(skip_serializing_if = "Option::is_none", default)]
1238 #[doc = "Sets the protection flag of the VM. This will disable the remove VM and remove disk operations."]
1239 #[doc = ""]
1240 pub protection: Option<bool>,
1241 #[serde(
1242 serialize_with = "crate::types::serialize_bool_optional",
1243 deserialize_with = "crate::types::deserialize_bool_optional"
1244 )]
1245 #[serde(skip_serializing_if = "Option::is_none", default)]
1246 #[doc = "Allow reboot. If set to '0' the VM exit on reboot."]
1247 #[doc = ""]
1248 pub reboot: Option<bool>,
1249 #[serde(skip_serializing_if = "Option::is_none", default)]
1250 #[doc = "Revert a pending change."]
1251 #[doc = ""]
1252 pub revert: Option<String>,
1253 #[serde(skip_serializing_if = "Option::is_none", default)]
1254 #[doc = "Configure a VirtIO-based Random Number Generator."]
1255 #[doc = ""]
1256 pub rng0: Option<String>,
1257 #[serde(rename = "sata[n]")]
1258 #[serde(
1259 serialize_with = "crate::types::serialize_multi::<NumberedSatas, _>",
1260 deserialize_with = "crate::types::deserialize_multi::<NumberedSatas, _>"
1261 )]
1262 #[serde(skip_serializing_if = "::std::collections::HashMap::is_empty", default)]
1263 #[serde(flatten)]
1264 #[doc = "Use volume as SATA hard disk or CD-ROM (n is 0 to 5). Use the special syntax STORAGE_ID:SIZE_IN_GiB to allocate a new volume. Use STORAGE_ID:0 and the 'import-from' parameter to import from an existing volume."]
1265 #[doc = ""]
1266 pub satas: ::std::collections::HashMap<u32, String>,
1267 #[serde(rename = "scsi[n]")]
1268 #[serde(
1269 serialize_with = "crate::types::serialize_multi::<NumberedScsis, _>",
1270 deserialize_with = "crate::types::deserialize_multi::<NumberedScsis, _>"
1271 )]
1272 #[serde(skip_serializing_if = "::std::collections::HashMap::is_empty", default)]
1273 #[serde(flatten)]
1274 #[doc = "Use volume as SCSI hard disk or CD-ROM (n is 0 to 30). Use the special syntax STORAGE_ID:SIZE_IN_GiB to allocate a new volume. Use STORAGE_ID:0 and the 'import-from' parameter to import from an existing volume."]
1275 #[doc = ""]
1276 pub scsis: ::std::collections::HashMap<u32, String>,
1277 #[serde(skip_serializing_if = "Option::is_none", default)]
1278 #[doc = "SCSI controller model"]
1279 #[doc = ""]
1280 pub scsihw: Option<Scsihw>,
1281 #[serde(skip_serializing_if = "Option::is_none", default)]
1282 #[doc = "cloud-init: Sets DNS search domains for a container. Create will automatically use the setting from the host if neither searchdomain nor nameserver are set."]
1283 #[doc = ""]
1284 pub searchdomain: Option<String>,
1285 #[serde(rename = "serial[n]")]
1286 #[serde(
1287 serialize_with = "crate::types::serialize_multi::<NumberedSerials, _>",
1288 deserialize_with = "crate::types::deserialize_multi::<NumberedSerials, _>"
1289 )]
1290 #[serde(skip_serializing_if = "::std::collections::HashMap::is_empty", default)]
1291 #[serde(flatten)]
1292 #[doc = "Create a serial device inside the VM (n is 0 to 3)"]
1293 #[doc = ""]
1294 #[doc = "Create a serial device inside the VM (n is 0 to 3), and pass through a"]
1295 #[doc = ""]
1296 #[doc = "host serial device (i.e. /dev/ttyS0), or create a unix socket on the"]
1297 #[doc = ""]
1298 #[doc = "host side (use 'qm terminal' to open a terminal connection)."]
1299 #[doc = ""]
1300 #[doc = "NOTE: If you pass through a host serial device, it is no longer possible to migrate such machines -"]
1301 #[doc = ""]
1302 #[doc = "use with special care."]
1303 #[doc = ""]
1304 #[doc = "CAUTION: Experimental! User reported problems with this option."]
1305 #[doc = ""]
1306 pub serials: ::std::collections::HashMap<u32, SerialNStr>,
1307 #[serde(skip_serializing_if = "Option::is_none", default)]
1308 #[doc = "Amount of memory shares for auto-ballooning. The larger the number is, the more memory this VM gets. Number is relative to weights of all other running VMs. Using zero disables auto-ballooning. Auto-ballooning is done by pvestatd."]
1309 #[doc = ""]
1310 pub shares: Option<SharesInt>,
1311 #[serde(
1312 serialize_with = "crate::types::serialize_bool_optional",
1313 deserialize_with = "crate::types::deserialize_bool_optional"
1314 )]
1315 #[serde(skip_serializing_if = "Option::is_none", default)]
1316 #[doc = "Ignore locks - only root is allowed to use this option."]
1317 #[doc = ""]
1318 pub skiplock: Option<bool>,
1319 #[serde(skip_serializing_if = "Option::is_none", default)]
1320 #[doc = "Specify SMBIOS type 1 fields."]
1321 #[doc = ""]
1322 pub smbios1: Option<Smbios1Str>,
1323 #[serde(
1324 serialize_with = "crate::types::serialize_non_zero_pos_int_optional",
1325 deserialize_with = "crate::types::deserialize_non_zero_pos_int_optional"
1326 )]
1327 #[serde(skip_serializing_if = "Option::is_none", default)]
1328 #[doc = "The number of CPUs. Please use option -sockets instead."]
1329 #[doc = ""]
1330 pub smp: Option<std::num::NonZeroU64>,
1331 #[serde(
1332 serialize_with = "crate::types::serialize_non_zero_pos_int_optional",
1333 deserialize_with = "crate::types::deserialize_non_zero_pos_int_optional"
1334 )]
1335 #[serde(skip_serializing_if = "Option::is_none", default)]
1336 #[doc = "The number of CPU sockets."]
1337 #[doc = ""]
1338 pub sockets: Option<std::num::NonZeroU64>,
1339 #[serde(skip_serializing_if = "Option::is_none", default)]
1340 #[doc = "Configure additional enhancements for SPICE."]
1341 #[doc = ""]
1342 pub spice_enhancements: Option<String>,
1343 #[serde(skip_serializing_if = "Option::is_none", default)]
1344 #[doc = "cloud-init: Setup public SSH keys (one key per line, OpenSSH format)."]
1345 #[doc = ""]
1346 pub sshkeys: Option<String>,
1347 #[serde(skip_serializing_if = "Option::is_none", default)]
1348 #[doc = "Set the initial date of the real time clock. Valid format for date are:'now' or '2006-06-17T16:01:21' or '2006-06-17'."]
1349 #[doc = ""]
1350 pub startdate: Option<StartdateStr>,
1351 #[serde(skip_serializing_if = "Option::is_none", default)]
1352 #[doc = "Startup and shutdown behavior. Order is a non-negative number defining the general startup order. Shutdown in done with reverse ordering. Additionally you can set the 'up' or 'down' delay in seconds, which specifies a delay to wait before the next VM is started or stopped."]
1353 #[doc = ""]
1354 pub startup: Option<String>,
1355 #[serde(
1356 serialize_with = "crate::types::serialize_bool_optional",
1357 deserialize_with = "crate::types::deserialize_bool_optional"
1358 )]
1359 #[serde(skip_serializing_if = "Option::is_none", default)]
1360 #[doc = "Enable/disable the USB tablet device."]
1361 #[doc = ""]
1362 #[doc = "Enable/disable the USB tablet device. This device is usually needed to allow absolute mouse positioning with VNC. Else the mouse runs out of sync with normal VNC clients. If you're running lots of console-only guests on one host, you may consider disabling this to save some context switches. This is turned off by default if you use spice (`qm set \\\\<vmid\\\\> --vga qxl`)."]
1363 #[doc = ""]
1364 pub tablet: Option<bool>,
1365 #[serde(skip_serializing_if = "Option::is_none", default)]
1366 #[doc = "Tags of the VM. This is only meta information."]
1367 #[doc = ""]
1368 pub tags: Option<String>,
1369 #[serde(
1370 serialize_with = "crate::types::serialize_bool_optional",
1371 deserialize_with = "crate::types::deserialize_bool_optional"
1372 )]
1373 #[serde(skip_serializing_if = "Option::is_none", default)]
1374 #[doc = "Enable/disable time drift fix."]
1375 #[doc = ""]
1376 pub tdf: Option<bool>,
1377 #[serde(
1378 serialize_with = "crate::types::serialize_bool_optional",
1379 deserialize_with = "crate::types::deserialize_bool_optional"
1380 )]
1381 #[serde(skip_serializing_if = "Option::is_none", default)]
1382 #[doc = "Enable/disable Template."]
1383 #[doc = ""]
1384 pub template: Option<bool>,
1385 #[serde(skip_serializing_if = "Option::is_none", default)]
1386 #[doc = "Configure a Disk for storing TPM state. The format is fixed to 'raw'. Use the special syntax STORAGE_ID:SIZE_IN_GiB to allocate a new volume. Note that SIZE_IN_GiB is ignored here and 4 MiB will be used instead. Use STORAGE_ID:0 and the 'import-from' parameter to import from an existing volume."]
1387 #[doc = ""]
1388 pub tpmstate0: Option<String>,
1389 #[serde(rename = "unused[n]")]
1390 #[serde(
1391 serialize_with = "crate::types::serialize_multi::<NumberedUnuseds, _>",
1392 deserialize_with = "crate::types::deserialize_multi::<NumberedUnuseds, _>"
1393 )]
1394 #[serde(skip_serializing_if = "::std::collections::HashMap::is_empty", default)]
1395 #[serde(flatten)]
1396 #[doc = "Reference to unused volumes. This is used internally, and should not be modified manually."]
1397 #[doc = ""]
1398 pub unuseds: ::std::collections::HashMap<u32, String>,
1399 #[serde(rename = "usb[n]")]
1400 #[serde(
1401 serialize_with = "crate::types::serialize_multi::<NumberedUsbs, _>",
1402 deserialize_with = "crate::types::deserialize_multi::<NumberedUsbs, _>"
1403 )]
1404 #[serde(skip_serializing_if = "::std::collections::HashMap::is_empty", default)]
1405 #[serde(flatten)]
1406 #[doc = "Configure an USB device (n is 0 to 4, for machine version \\\\>= 7.1 and ostype l26 or windows \\\\> 7, n can be up to 14)."]
1407 #[doc = ""]
1408 pub usbs: ::std::collections::HashMap<u32, String>,
1409 #[serde(skip_serializing_if = "Option::is_none", default)]
1410 #[doc = "Number of hotplugged vcpus."]
1411 #[doc = ""]
1412 pub vcpus: Option<VcpusInt>,
1413 #[serde(skip_serializing_if = "Option::is_none", default)]
1414 #[doc = "Configure the VGA hardware."]
1415 #[doc = ""]
1416 #[doc = "Configure the VGA Hardware. If you want to use high resolution modes (\\\\>= 1280x1024x16) you may need to increase the vga memory option. Since QEMU 2.9 the default VGA display type is 'std' for all OS types besides some Windows versions (XP and older) which use 'cirrus'. The 'qxl' option enables the SPICE display server. For win* OS you can select how many independent displays you want, Linux guests can add displays them self."]
1417 #[doc = ""]
1418 #[doc = "You can also run without any graphic card, using a serial device as terminal."]
1419 #[doc = ""]
1420 pub vga: Option<String>,
1421 #[serde(rename = "virtio[n]")]
1422 #[serde(
1423 serialize_with = "crate::types::serialize_multi::<NumberedVirtios, _>",
1424 deserialize_with = "crate::types::deserialize_multi::<NumberedVirtios, _>"
1425 )]
1426 #[serde(skip_serializing_if = "::std::collections::HashMap::is_empty", default)]
1427 #[serde(flatten)]
1428 #[doc = "Use volume as VIRTIO hard disk (n is 0 to 15). Use the special syntax STORAGE_ID:SIZE_IN_GiB to allocate a new volume. Use STORAGE_ID:0 and the 'import-from' parameter to import from an existing volume."]
1429 #[doc = ""]
1430 pub virtios: ::std::collections::HashMap<u32, String>,
1431 #[serde(rename = "virtiofs[n]")]
1432 #[serde(
1433 serialize_with = "crate::types::serialize_multi::<NumberedVirtiofss, _>",
1434 deserialize_with = "crate::types::deserialize_multi::<NumberedVirtiofss, _>"
1435 )]
1436 #[serde(skip_serializing_if = "::std::collections::HashMap::is_empty", default)]
1437 #[serde(flatten)]
1438 #[doc = "Configuration for sharing a directory between host and guest using Virtio-fs."]
1439 #[doc = ""]
1440 pub virtiofss: ::std::collections::HashMap<u32, String>,
1441 #[serde(skip_serializing_if = "Option::is_none", default)]
1442 #[doc = "Set VM Generation ID. Use '1' to autogenerate on create or update, pass '0' to disable explicitly."]
1443 #[doc = ""]
1444 #[doc = "The VM generation ID (vmgenid) device exposes a 128-bit integer value identifier to the guest OS. This allows to notify the guest operating system when the virtual machine is executed with a different configuration (e.g. snapshot execution or creation from a template). The guest operating system notices the change, and is then able to react as appropriate by marking its copies of distributed databases as dirty, re-initializing its random number generator, etc."]
1445 #[doc = ""]
1446 #[doc = "Note that auto-creation only works when done through API/CLI create or update methods, but not when manually editing the config file."]
1447 #[doc = ""]
1448 pub vmgenid: Option<VmgenidStr>,
1449 #[serde(skip_serializing_if = "Option::is_none", default)]
1450 #[doc = "Default storage for VM state volumes/files."]
1451 #[doc = ""]
1452 pub vmstatestorage: Option<String>,
1453 #[serde(skip_serializing_if = "Option::is_none", default)]
1454 #[doc = "Create a virtual hardware watchdog device."]
1455 #[doc = ""]
1456 #[doc = "Create a virtual hardware watchdog device. Once enabled (by a guest action), the watchdog must be periodically polled by an agent inside the guest or else the watchdog will reset the guest (or execute the respective action specified)"]
1457 #[doc = ""]
1458 pub watchdog: Option<String>,
1459 #[serde(
1460 flatten,
1461 deserialize_with = "crate::types::multi::deserialize_additional_data::<'_, PostParams, _, _>"
1462 )]
1463 pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
1464}
1465impl crate::types::multi::Test for PostParams {
1466 fn test_fn() -> fn(&str) -> bool {
1467 fn the_test(input: &str) -> bool {
1468 let array = [
1469 <NumberedHostpcis as crate::types::multi::NumberedItems>::key_matches
1470 as fn(&str) -> bool,
1471 <NumberedIdes as crate::types::multi::NumberedItems>::key_matches
1472 as fn(&str) -> bool,
1473 <NumberedIpconfigs as crate::types::multi::NumberedItems>::key_matches
1474 as fn(&str) -> bool,
1475 <NumberedNets as crate::types::multi::NumberedItems>::key_matches
1476 as fn(&str) -> bool,
1477 <NumberedNumas as crate::types::multi::NumberedItems>::key_matches
1478 as fn(&str) -> bool,
1479 <NumberedParallels as crate::types::multi::NumberedItems>::key_matches
1480 as fn(&str) -> bool,
1481 <NumberedSatas as crate::types::multi::NumberedItems>::key_matches
1482 as fn(&str) -> bool,
1483 <NumberedScsis as crate::types::multi::NumberedItems>::key_matches
1484 as fn(&str) -> bool,
1485 <NumberedSerials as crate::types::multi::NumberedItems>::key_matches
1486 as fn(&str) -> bool,
1487 <NumberedUnuseds as crate::types::multi::NumberedItems>::key_matches
1488 as fn(&str) -> bool,
1489 <NumberedUsbs as crate::types::multi::NumberedItems>::key_matches
1490 as fn(&str) -> bool,
1491 <NumberedVirtios as crate::types::multi::NumberedItems>::key_matches
1492 as fn(&str) -> bool,
1493 <NumberedVirtiofss as crate::types::multi::NumberedItems>::key_matches
1494 as fn(&str) -> bool,
1495 ];
1496 array.iter().any(|f| f(input))
1497 }
1498 the_test as _
1499 }
1500}
1501#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize, Default)]
1502pub struct PutParams {
1503 #[serde(
1504 serialize_with = "crate::types::serialize_bool_optional",
1505 deserialize_with = "crate::types::deserialize_bool_optional"
1506 )]
1507 #[serde(skip_serializing_if = "Option::is_none", default)]
1508 #[doc = "Enable/disable ACPI."]
1509 #[doc = ""]
1510 pub acpi: Option<bool>,
1511 #[serde(skip_serializing_if = "Option::is_none", default)]
1512 #[doc = "List of host cores used to execute guest processes, for example: 0,5,8-11"]
1513 #[doc = ""]
1514 pub affinity: Option<String>,
1515 #[serde(skip_serializing_if = "Option::is_none", default)]
1516 #[doc = "Enable/disable communication with the QEMU Guest Agent and its properties."]
1517 #[doc = ""]
1518 pub agent: Option<String>,
1519 #[serde(rename = "allow-ksm")]
1520 #[serde(
1521 serialize_with = "crate::types::serialize_bool_optional",
1522 deserialize_with = "crate::types::deserialize_bool_optional"
1523 )]
1524 #[serde(skip_serializing_if = "Option::is_none", default)]
1525 #[doc = "Allow memory pages of this guest to be merged via KSM (Kernel Samepage Merging)."]
1526 #[doc = ""]
1527 pub allow_ksm: Option<bool>,
1528 #[serde(rename = "amd-sev")]
1529 #[serde(skip_serializing_if = "Option::is_none", default)]
1530 #[doc = "Secure Encrypted Virtualization (SEV) features by AMD CPUs"]
1531 #[doc = ""]
1532 pub amd_sev: Option<String>,
1533 #[serde(skip_serializing_if = "Option::is_none", default)]
1534 #[doc = "Virtual processor architecture. Defaults to the host."]
1535 #[doc = ""]
1536 pub arch: Option<Arch>,
1537 #[serde(skip_serializing_if = "Option::is_none", default)]
1538 #[doc = "Arbitrary arguments passed to kvm."]
1539 #[doc = ""]
1540 #[doc = "Arbitrary arguments passed to kvm, for example:"]
1541 #[doc = ""]
1542 #[doc = "args: -no-reboot -smbios 'type=0,vendor=FOO'"]
1543 #[doc = ""]
1544 #[doc = "NOTE: this option is for experts only."]
1545 #[doc = ""]
1546 pub args: Option<String>,
1547 #[serde(skip_serializing_if = "Option::is_none", default)]
1548 #[doc = "Configure a audio device, useful in combination with QXL/Spice."]
1549 #[doc = ""]
1550 pub audio0: Option<String>,
1551 #[serde(
1552 serialize_with = "crate::types::serialize_bool_optional",
1553 deserialize_with = "crate::types::deserialize_bool_optional"
1554 )]
1555 #[serde(skip_serializing_if = "Option::is_none", default)]
1556 #[doc = "Automatic restart after crash (currently ignored)."]
1557 #[doc = ""]
1558 pub autostart: Option<bool>,
1559 #[serde(
1560 serialize_with = "crate::types::serialize_unsigned_int_optional",
1561 deserialize_with = "crate::types::deserialize_unsigned_int_optional"
1562 )]
1563 #[serde(skip_serializing_if = "Option::is_none", default)]
1564 #[doc = "Amount of target RAM for the VM in MiB. Using zero disables the ballon driver."]
1565 #[doc = ""]
1566 pub balloon: Option<u64>,
1567 #[serde(skip_serializing_if = "Option::is_none", default)]
1568 #[doc = "Select BIOS implementation."]
1569 #[doc = ""]
1570 pub bios: Option<Bios>,
1571 #[serde(skip_serializing_if = "Option::is_none", default)]
1572 #[doc = "Specify guest boot order. Use the 'order=' sub-property as usage with no key or 'legacy=' is deprecated."]
1573 #[doc = ""]
1574 pub boot: Option<String>,
1575 #[serde(skip_serializing_if = "Option::is_none", default)]
1576 #[doc = "Enable booting from specified disk. Deprecated: Use 'boot: order=foo;bar' instead."]
1577 #[doc = ""]
1578 pub bootdisk: Option<BootdiskStr>,
1579 #[serde(skip_serializing_if = "Option::is_none", default)]
1580 #[doc = "This is an alias for option -ide2"]
1581 #[doc = ""]
1582 pub cdrom: Option<String>,
1583 #[serde(skip_serializing_if = "Option::is_none", default)]
1584 #[doc = "cloud-init: Specify custom files to replace the automatically generated ones at start."]
1585 #[doc = ""]
1586 pub cicustom: Option<String>,
1587 #[serde(skip_serializing_if = "Option::is_none", default)]
1588 #[doc = "cloud-init: Password to assign the user. Using this is generally not recommended. Use ssh keys instead. Also note that older cloud-init versions do not support hashed passwords."]
1589 #[doc = ""]
1590 pub cipassword: Option<String>,
1591 #[serde(skip_serializing_if = "Option::is_none", default)]
1592 #[doc = "Specifies the cloud-init configuration format. The default depends on the configured operating system type (`ostype`. We use the `nocloud` format for Linux, and `configdrive2` for windows."]
1593 #[doc = ""]
1594 pub citype: Option<Citype>,
1595 #[serde(
1596 serialize_with = "crate::types::serialize_bool_optional",
1597 deserialize_with = "crate::types::deserialize_bool_optional"
1598 )]
1599 #[serde(skip_serializing_if = "Option::is_none", default)]
1600 #[doc = "cloud-init: do an automatic package upgrade after the first boot."]
1601 #[doc = ""]
1602 pub ciupgrade: Option<bool>,
1603 #[serde(skip_serializing_if = "Option::is_none", default)]
1604 #[doc = "cloud-init: User name to change ssh keys and password for instead of the image's configured default user."]
1605 #[doc = ""]
1606 pub ciuser: Option<String>,
1607 #[serde(
1608 serialize_with = "crate::types::serialize_non_zero_pos_int_optional",
1609 deserialize_with = "crate::types::deserialize_non_zero_pos_int_optional"
1610 )]
1611 #[serde(skip_serializing_if = "Option::is_none", default)]
1612 #[doc = "The number of cores per socket."]
1613 #[doc = ""]
1614 pub cores: Option<std::num::NonZeroU64>,
1615 #[serde(skip_serializing_if = "Option::is_none", default)]
1616 #[doc = "Emulated CPU type."]
1617 #[doc = ""]
1618 pub cpu: Option<String>,
1619 #[serde(skip_serializing_if = "Option::is_none", default)]
1620 #[doc = "Limit of CPU usage."]
1621 #[doc = ""]
1622 #[doc = "Limit of CPU usage."]
1623 #[doc = ""]
1624 #[doc = "NOTE: If the computer has 2 CPUs, it has total of '2' CPU time. Value '0' indicates no CPU limit."]
1625 #[doc = ""]
1626 pub cpulimit: Option<CpulimitNum>,
1627 #[serde(skip_serializing_if = "Option::is_none", default)]
1628 #[doc = "CPU weight for a VM, will be clamped to \\\\[1, 10000\\\\] in cgroup v2."]
1629 #[doc = ""]
1630 #[doc = "CPU weight for a VM. Argument is used in the kernel fair scheduler. The larger the number is, the more CPU time this VM gets. Number is relative to weights of all the other running VMs."]
1631 #[doc = ""]
1632 pub cpuunits: Option<CpuunitsInt>,
1633 #[serde(skip_serializing_if = "Option::is_none", default)]
1634 #[doc = "A list of settings you want to delete."]
1635 #[doc = ""]
1636 pub delete: Option<String>,
1637 #[serde(skip_serializing_if = "Option::is_none", default)]
1638 #[doc = "Description for the VM. Shown in the web-interface VM's summary. This is saved as comment inside the configuration file."]
1639 #[doc = ""]
1640 pub description: Option<DescriptionStr>,
1641 #[serde(skip_serializing_if = "Option::is_none", default)]
1642 #[doc = "Prevent changes if current configuration file has different SHA1 digest. This can be used to prevent concurrent modifications."]
1643 #[doc = ""]
1644 pub digest: Option<DigestStr>,
1645 #[serde(skip_serializing_if = "Option::is_none", default)]
1646 #[doc = "Configure a disk for storing EFI vars. Use the special syntax STORAGE_ID:SIZE_IN_GiB to allocate a new volume. Note that SIZE_IN_GiB is ignored here and that the default EFI vars are copied to the volume instead. Use STORAGE_ID:0 and the 'import-from' parameter to import from an existing volume."]
1647 #[doc = ""]
1648 pub efidisk0: Option<String>,
1649 #[serde(
1650 serialize_with = "crate::types::serialize_bool_optional",
1651 deserialize_with = "crate::types::deserialize_bool_optional"
1652 )]
1653 #[serde(skip_serializing_if = "Option::is_none", default)]
1654 #[doc = "Force physical removal. Without this, we simple remove the disk from the config file and create an additional configuration entry called 'unused\\\\[n\\\\]', which contains the volume ID. Unlink of unused\\\\[n\\\\] always cause physical removal."]
1655 #[doc = ""]
1656 pub force: Option<bool>,
1657 #[serde(
1658 serialize_with = "crate::types::serialize_bool_optional",
1659 deserialize_with = "crate::types::deserialize_bool_optional"
1660 )]
1661 #[serde(skip_serializing_if = "Option::is_none", default)]
1662 #[doc = "Freeze CPU at startup (use 'c' monitor command to start execution)."]
1663 #[doc = ""]
1664 pub freeze: Option<bool>,
1665 #[serde(skip_serializing_if = "Option::is_none", default)]
1666 #[doc = "Script that will be executed during various steps in the vms lifetime."]
1667 #[doc = ""]
1668 pub hookscript: Option<String>,
1669 #[serde(rename = "hostpci[n]")]
1670 #[serde(
1671 serialize_with = "crate::types::serialize_multi::<NumberedHostpcis, _>",
1672 deserialize_with = "crate::types::deserialize_multi::<NumberedHostpcis, _>"
1673 )]
1674 #[serde(skip_serializing_if = "::std::collections::HashMap::is_empty", default)]
1675 #[serde(flatten)]
1676 #[doc = "Map host PCI devices into guest."]
1677 #[doc = ""]
1678 #[doc = "Map host PCI devices into guest."]
1679 #[doc = ""]
1680 #[doc = "NOTE: This option allows direct access to host hardware. So it is no longer"]
1681 #[doc = ""]
1682 #[doc = "possible to migrate such machines - use with special care."]
1683 #[doc = ""]
1684 #[doc = "CAUTION: Experimental! User reported problems with this option."]
1685 #[doc = ""]
1686 pub hostpcis: ::std::collections::HashMap<u32, String>,
1687 #[serde(skip_serializing_if = "Option::is_none", default)]
1688 #[doc = "Selectively enable hotplug features. This is a comma separated list of hotplug features: 'network', 'disk', 'cpu', 'memory', 'usb' and 'cloudinit'. Use '0' to disable hotplug completely. Using '1' as value is an alias for the default `network,disk,usb`. USB hotplugging is possible for guests with machine version \\\\>= 7.1 and ostype l26 or windows \\\\> 7."]
1689 #[doc = ""]
1690 pub hotplug: Option<String>,
1691 #[serde(skip_serializing_if = "Option::is_none", default)]
1692 #[doc = "Enables hugepages memory."]
1693 #[doc = ""]
1694 #[doc = "Sets the size of hugepages in MiB. If the value is set to 'any' then 1 GiB hugepages will be used if possible, otherwise the size will fall back to 2 MiB."]
1695 #[doc = ""]
1696 pub hugepages: Option<Hugepages>,
1697 #[serde(rename = "ide[n]")]
1698 #[serde(
1699 serialize_with = "crate::types::serialize_multi::<NumberedIdes, _>",
1700 deserialize_with = "crate::types::deserialize_multi::<NumberedIdes, _>"
1701 )]
1702 #[serde(skip_serializing_if = "::std::collections::HashMap::is_empty", default)]
1703 #[serde(flatten)]
1704 #[doc = "Use volume as IDE hard disk or CD-ROM (n is 0 to 3). Use the special syntax STORAGE_ID:SIZE_IN_GiB to allocate a new volume. Use STORAGE_ID:0 and the 'import-from' parameter to import from an existing volume."]
1705 #[doc = ""]
1706 pub ides: ::std::collections::HashMap<u32, String>,
1707 #[serde(rename = "intel-tdx")]
1708 #[serde(skip_serializing_if = "Option::is_none", default)]
1709 #[doc = "Trusted Domain Extension (TDX) features by Intel CPUs"]
1710 #[doc = ""]
1711 pub intel_tdx: Option<String>,
1712 #[serde(rename = "ipconfig[n]")]
1713 #[serde(
1714 serialize_with = "crate::types::serialize_multi::<NumberedIpconfigs, _>",
1715 deserialize_with = "crate::types::deserialize_multi::<NumberedIpconfigs, _>"
1716 )]
1717 #[serde(skip_serializing_if = "::std::collections::HashMap::is_empty", default)]
1718 #[serde(flatten)]
1719 #[doc = "cloud-init: Specify IP addresses and gateways for the corresponding interface."]
1720 #[doc = ""]
1721 #[doc = "IP addresses use CIDR notation, gateways are optional but need an IP of the same type specified."]
1722 #[doc = ""]
1723 #[doc = "The special string 'dhcp' can be used for IP addresses to use DHCP, in which case no explicit"]
1724 #[doc = ""]
1725 #[doc = "gateway should be provided."]
1726 #[doc = ""]
1727 #[doc = "For IPv6 the special string 'auto' can be used to use stateless autoconfiguration. This requires"]
1728 #[doc = ""]
1729 #[doc = "cloud-init 19.4 or newer."]
1730 #[doc = ""]
1731 #[doc = "If cloud-init is enabled and neither an IPv4 nor an IPv6 address is specified, it defaults to using"]
1732 #[doc = ""]
1733 #[doc = "dhcp on IPv4."]
1734 #[doc = ""]
1735 pub ipconfigs: ::std::collections::HashMap<u32, String>,
1736 #[serde(skip_serializing_if = "Option::is_none", default)]
1737 #[doc = "Inter-VM shared memory. Useful for direct communication between VMs, or to the host."]
1738 #[doc = ""]
1739 pub ivshmem: Option<String>,
1740 #[serde(
1741 serialize_with = "crate::types::serialize_bool_optional",
1742 deserialize_with = "crate::types::deserialize_bool_optional"
1743 )]
1744 #[serde(skip_serializing_if = "Option::is_none", default)]
1745 #[doc = "Use together with hugepages. If enabled, hugepages will not not be deleted after VM shutdown and can be used for subsequent starts."]
1746 #[doc = ""]
1747 pub keephugepages: Option<bool>,
1748 #[serde(skip_serializing_if = "Option::is_none", default)]
1749 #[doc = "Keyboard layout for VNC server. This option is generally not required and is often better handled from within the guest OS."]
1750 #[doc = ""]
1751 pub keyboard: Option<Keyboard>,
1752 #[serde(
1753 serialize_with = "crate::types::serialize_bool_optional",
1754 deserialize_with = "crate::types::deserialize_bool_optional"
1755 )]
1756 #[serde(skip_serializing_if = "Option::is_none", default)]
1757 #[doc = "Enable/disable KVM hardware virtualization."]
1758 #[doc = ""]
1759 pub kvm: Option<bool>,
1760 #[serde(
1761 serialize_with = "crate::types::serialize_bool_optional",
1762 deserialize_with = "crate::types::deserialize_bool_optional"
1763 )]
1764 #[serde(skip_serializing_if = "Option::is_none", default)]
1765 #[doc = "Set the real time clock (RTC) to local time. This is enabled by default if the `ostype` indicates a Microsoft Windows OS."]
1766 #[doc = ""]
1767 pub localtime: Option<bool>,
1768 #[serde(skip_serializing_if = "Option::is_none", default)]
1769 #[doc = "Lock/unlock the VM."]
1770 #[doc = ""]
1771 pub lock: Option<Lock>,
1772 #[serde(skip_serializing_if = "Option::is_none", default)]
1773 #[doc = "Specify the QEMU machine."]
1774 #[doc = ""]
1775 pub machine: Option<String>,
1776 #[serde(skip_serializing_if = "Option::is_none", default)]
1777 #[doc = "Memory properties."]
1778 #[doc = ""]
1779 pub memory: Option<String>,
1780 #[serde(skip_serializing_if = "Option::is_none", default)]
1781 #[doc = "Set maximum tolerated downtime (in seconds) for migrations. Should the migration not be able to converge in the very end, because too much newly dirtied RAM needs to be transferred, the limit will be increased automatically step-by-step until migration can converge."]
1782 #[doc = ""]
1783 pub migrate_downtime: Option<MigrateDowntimeNum>,
1784 #[serde(
1785 serialize_with = "crate::types::serialize_unsigned_int_optional",
1786 deserialize_with = "crate::types::deserialize_unsigned_int_optional"
1787 )]
1788 #[serde(skip_serializing_if = "Option::is_none", default)]
1789 #[doc = "Set maximum speed (in MB/s) for migrations. Value 0 is no limit."]
1790 #[doc = ""]
1791 pub migrate_speed: Option<u64>,
1792 #[serde(skip_serializing_if = "Option::is_none", default)]
1793 #[doc = "Set a name for the VM. Only used on the configuration web interface."]
1794 #[doc = ""]
1795 pub name: Option<String>,
1796 #[serde(skip_serializing_if = "Option::is_none", default)]
1797 #[doc = "cloud-init: Sets DNS server IP address for a container. Create will automatically use the setting from the host if neither searchdomain nor nameserver are set."]
1798 #[doc = ""]
1799 pub nameserver: Option<String>,
1800 #[serde(rename = "net[n]")]
1801 #[serde(
1802 serialize_with = "crate::types::serialize_multi::<NumberedNets, _>",
1803 deserialize_with = "crate::types::deserialize_multi::<NumberedNets, _>"
1804 )]
1805 #[serde(skip_serializing_if = "::std::collections::HashMap::is_empty", default)]
1806 #[serde(flatten)]
1807 #[doc = "Specify network devices."]
1808 #[doc = ""]
1809 pub nets: ::std::collections::HashMap<u32, String>,
1810 #[serde(
1811 serialize_with = "crate::types::serialize_bool_optional",
1812 deserialize_with = "crate::types::deserialize_bool_optional"
1813 )]
1814 #[serde(skip_serializing_if = "Option::is_none", default)]
1815 #[doc = "Enable/disable NUMA."]
1816 #[doc = ""]
1817 pub numa: Option<bool>,
1818 #[serde(rename = "numa[n]")]
1819 #[serde(
1820 serialize_with = "crate::types::serialize_multi::<NumberedNumas, _>",
1821 deserialize_with = "crate::types::deserialize_multi::<NumberedNumas, _>"
1822 )]
1823 #[serde(skip_serializing_if = "::std::collections::HashMap::is_empty", default)]
1824 #[serde(flatten)]
1825 #[doc = "NUMA topology."]
1826 #[doc = ""]
1827 pub numas: ::std::collections::HashMap<u32, String>,
1828 #[serde(
1829 serialize_with = "crate::types::serialize_bool_optional",
1830 deserialize_with = "crate::types::deserialize_bool_optional"
1831 )]
1832 #[serde(skip_serializing_if = "Option::is_none", default)]
1833 #[doc = "Specifies whether a VM will be started during system bootup."]
1834 #[doc = ""]
1835 pub onboot: Option<bool>,
1836 #[serde(skip_serializing_if = "Option::is_none", default)]
1837 #[doc = "Specify guest operating system."]
1838 #[doc = ""]
1839 #[doc = "Specify guest operating system. This is used to enable special"]
1840 #[doc = ""]
1841 #[doc = "optimization/features for specific operating systems:"]
1842 #[doc = ""]
1843 #[doc = "\\\\[horizontal\\\\]"]
1844 #[doc = ""]
1845 #[doc = "other;; unspecified OS"]
1846 #[doc = ""]
1847 #[doc = "wxp;; Microsoft Windows XP"]
1848 #[doc = ""]
1849 #[doc = "w2k;; Microsoft Windows 2000"]
1850 #[doc = ""]
1851 #[doc = "w2k3;; Microsoft Windows 2003"]
1852 #[doc = ""]
1853 #[doc = "w2k8;; Microsoft Windows 2008"]
1854 #[doc = ""]
1855 #[doc = "wvista;; Microsoft Windows Vista"]
1856 #[doc = ""]
1857 #[doc = "win7;; Microsoft Windows 7"]
1858 #[doc = ""]
1859 #[doc = "win8;; Microsoft Windows 8/2012/2012r2"]
1860 #[doc = ""]
1861 #[doc = "win10;; Microsoft Windows 10/2016/2019"]
1862 #[doc = ""]
1863 #[doc = "win11;; Microsoft Windows 11/2022/2025"]
1864 #[doc = ""]
1865 #[doc = "l24;; Linux 2.4 Kernel"]
1866 #[doc = ""]
1867 #[doc = "l26;; Linux 2.6 - 6.X Kernel"]
1868 #[doc = ""]
1869 #[doc = "solaris;; Solaris/OpenSolaris/OpenIndiania kernel"]
1870 #[doc = ""]
1871 pub ostype: Option<Ostype>,
1872 #[serde(rename = "parallel[n]")]
1873 #[serde(
1874 serialize_with = "crate::types::serialize_multi::<NumberedParallels, _>",
1875 deserialize_with = "crate::types::deserialize_multi::<NumberedParallels, _>"
1876 )]
1877 #[serde(skip_serializing_if = "::std::collections::HashMap::is_empty", default)]
1878 #[serde(flatten)]
1879 #[doc = "Map host parallel devices (n is 0 to 2)."]
1880 #[doc = ""]
1881 #[doc = "Map host parallel devices (n is 0 to 2)."]
1882 #[doc = ""]
1883 #[doc = "NOTE: This option allows direct access to host hardware. So it is no longer possible to migrate such"]
1884 #[doc = ""]
1885 #[doc = "machines - use with special care."]
1886 #[doc = ""]
1887 #[doc = "CAUTION: Experimental! User reported problems with this option."]
1888 #[doc = ""]
1889 pub parallels: ::std::collections::HashMap<u32, ParallelNStr>,
1890 #[serde(
1891 serialize_with = "crate::types::serialize_bool_optional",
1892 deserialize_with = "crate::types::deserialize_bool_optional"
1893 )]
1894 #[serde(skip_serializing_if = "Option::is_none", default)]
1895 #[doc = "Sets the protection flag of the VM. This will disable the remove VM and remove disk operations."]
1896 #[doc = ""]
1897 pub protection: Option<bool>,
1898 #[serde(
1899 serialize_with = "crate::types::serialize_bool_optional",
1900 deserialize_with = "crate::types::deserialize_bool_optional"
1901 )]
1902 #[serde(skip_serializing_if = "Option::is_none", default)]
1903 #[doc = "Allow reboot. If set to '0' the VM exit on reboot."]
1904 #[doc = ""]
1905 pub reboot: Option<bool>,
1906 #[serde(skip_serializing_if = "Option::is_none", default)]
1907 #[doc = "Revert a pending change."]
1908 #[doc = ""]
1909 pub revert: Option<String>,
1910 #[serde(skip_serializing_if = "Option::is_none", default)]
1911 #[doc = "Configure a VirtIO-based Random Number Generator."]
1912 #[doc = ""]
1913 pub rng0: Option<String>,
1914 #[serde(rename = "sata[n]")]
1915 #[serde(
1916 serialize_with = "crate::types::serialize_multi::<NumberedSatas, _>",
1917 deserialize_with = "crate::types::deserialize_multi::<NumberedSatas, _>"
1918 )]
1919 #[serde(skip_serializing_if = "::std::collections::HashMap::is_empty", default)]
1920 #[serde(flatten)]
1921 #[doc = "Use volume as SATA hard disk or CD-ROM (n is 0 to 5). Use the special syntax STORAGE_ID:SIZE_IN_GiB to allocate a new volume. Use STORAGE_ID:0 and the 'import-from' parameter to import from an existing volume."]
1922 #[doc = ""]
1923 pub satas: ::std::collections::HashMap<u32, String>,
1924 #[serde(rename = "scsi[n]")]
1925 #[serde(
1926 serialize_with = "crate::types::serialize_multi::<NumberedScsis, _>",
1927 deserialize_with = "crate::types::deserialize_multi::<NumberedScsis, _>"
1928 )]
1929 #[serde(skip_serializing_if = "::std::collections::HashMap::is_empty", default)]
1930 #[serde(flatten)]
1931 #[doc = "Use volume as SCSI hard disk or CD-ROM (n is 0 to 30). Use the special syntax STORAGE_ID:SIZE_IN_GiB to allocate a new volume. Use STORAGE_ID:0 and the 'import-from' parameter to import from an existing volume."]
1932 #[doc = ""]
1933 pub scsis: ::std::collections::HashMap<u32, String>,
1934 #[serde(skip_serializing_if = "Option::is_none", default)]
1935 #[doc = "SCSI controller model"]
1936 #[doc = ""]
1937 pub scsihw: Option<Scsihw>,
1938 #[serde(skip_serializing_if = "Option::is_none", default)]
1939 #[doc = "cloud-init: Sets DNS search domains for a container. Create will automatically use the setting from the host if neither searchdomain nor nameserver are set."]
1940 #[doc = ""]
1941 pub searchdomain: Option<String>,
1942 #[serde(rename = "serial[n]")]
1943 #[serde(
1944 serialize_with = "crate::types::serialize_multi::<NumberedSerials, _>",
1945 deserialize_with = "crate::types::deserialize_multi::<NumberedSerials, _>"
1946 )]
1947 #[serde(skip_serializing_if = "::std::collections::HashMap::is_empty", default)]
1948 #[serde(flatten)]
1949 #[doc = "Create a serial device inside the VM (n is 0 to 3)"]
1950 #[doc = ""]
1951 #[doc = "Create a serial device inside the VM (n is 0 to 3), and pass through a"]
1952 #[doc = ""]
1953 #[doc = "host serial device (i.e. /dev/ttyS0), or create a unix socket on the"]
1954 #[doc = ""]
1955 #[doc = "host side (use 'qm terminal' to open a terminal connection)."]
1956 #[doc = ""]
1957 #[doc = "NOTE: If you pass through a host serial device, it is no longer possible to migrate such machines -"]
1958 #[doc = ""]
1959 #[doc = "use with special care."]
1960 #[doc = ""]
1961 #[doc = "CAUTION: Experimental! User reported problems with this option."]
1962 #[doc = ""]
1963 pub serials: ::std::collections::HashMap<u32, SerialNStr>,
1964 #[serde(skip_serializing_if = "Option::is_none", default)]
1965 #[doc = "Amount of memory shares for auto-ballooning. The larger the number is, the more memory this VM gets. Number is relative to weights of all other running VMs. Using zero disables auto-ballooning. Auto-ballooning is done by pvestatd."]
1966 #[doc = ""]
1967 pub shares: Option<SharesInt>,
1968 #[serde(
1969 serialize_with = "crate::types::serialize_bool_optional",
1970 deserialize_with = "crate::types::deserialize_bool_optional"
1971 )]
1972 #[serde(skip_serializing_if = "Option::is_none", default)]
1973 #[doc = "Ignore locks - only root is allowed to use this option."]
1974 #[doc = ""]
1975 pub skiplock: Option<bool>,
1976 #[serde(skip_serializing_if = "Option::is_none", default)]
1977 #[doc = "Specify SMBIOS type 1 fields."]
1978 #[doc = ""]
1979 pub smbios1: Option<Smbios1Str>,
1980 #[serde(
1981 serialize_with = "crate::types::serialize_non_zero_pos_int_optional",
1982 deserialize_with = "crate::types::deserialize_non_zero_pos_int_optional"
1983 )]
1984 #[serde(skip_serializing_if = "Option::is_none", default)]
1985 #[doc = "The number of CPUs. Please use option -sockets instead."]
1986 #[doc = ""]
1987 pub smp: Option<std::num::NonZeroU64>,
1988 #[serde(
1989 serialize_with = "crate::types::serialize_non_zero_pos_int_optional",
1990 deserialize_with = "crate::types::deserialize_non_zero_pos_int_optional"
1991 )]
1992 #[serde(skip_serializing_if = "Option::is_none", default)]
1993 #[doc = "The number of CPU sockets."]
1994 #[doc = ""]
1995 pub sockets: Option<std::num::NonZeroU64>,
1996 #[serde(skip_serializing_if = "Option::is_none", default)]
1997 #[doc = "Configure additional enhancements for SPICE."]
1998 #[doc = ""]
1999 pub spice_enhancements: Option<String>,
2000 #[serde(skip_serializing_if = "Option::is_none", default)]
2001 #[doc = "cloud-init: Setup public SSH keys (one key per line, OpenSSH format)."]
2002 #[doc = ""]
2003 pub sshkeys: Option<String>,
2004 #[serde(skip_serializing_if = "Option::is_none", default)]
2005 #[doc = "Set the initial date of the real time clock. Valid format for date are:'now' or '2006-06-17T16:01:21' or '2006-06-17'."]
2006 #[doc = ""]
2007 pub startdate: Option<StartdateStr>,
2008 #[serde(skip_serializing_if = "Option::is_none", default)]
2009 #[doc = "Startup and shutdown behavior. Order is a non-negative number defining the general startup order. Shutdown in done with reverse ordering. Additionally you can set the 'up' or 'down' delay in seconds, which specifies a delay to wait before the next VM is started or stopped."]
2010 #[doc = ""]
2011 pub startup: Option<String>,
2012 #[serde(
2013 serialize_with = "crate::types::serialize_bool_optional",
2014 deserialize_with = "crate::types::deserialize_bool_optional"
2015 )]
2016 #[serde(skip_serializing_if = "Option::is_none", default)]
2017 #[doc = "Enable/disable the USB tablet device."]
2018 #[doc = ""]
2019 #[doc = "Enable/disable the USB tablet device. This device is usually needed to allow absolute mouse positioning with VNC. Else the mouse runs out of sync with normal VNC clients. If you're running lots of console-only guests on one host, you may consider disabling this to save some context switches. This is turned off by default if you use spice (`qm set \\\\<vmid\\\\> --vga qxl`)."]
2020 #[doc = ""]
2021 pub tablet: Option<bool>,
2022 #[serde(skip_serializing_if = "Option::is_none", default)]
2023 #[doc = "Tags of the VM. This is only meta information."]
2024 #[doc = ""]
2025 pub tags: Option<String>,
2026 #[serde(
2027 serialize_with = "crate::types::serialize_bool_optional",
2028 deserialize_with = "crate::types::deserialize_bool_optional"
2029 )]
2030 #[serde(skip_serializing_if = "Option::is_none", default)]
2031 #[doc = "Enable/disable time drift fix."]
2032 #[doc = ""]
2033 pub tdf: Option<bool>,
2034 #[serde(
2035 serialize_with = "crate::types::serialize_bool_optional",
2036 deserialize_with = "crate::types::deserialize_bool_optional"
2037 )]
2038 #[serde(skip_serializing_if = "Option::is_none", default)]
2039 #[doc = "Enable/disable Template."]
2040 #[doc = ""]
2041 pub template: Option<bool>,
2042 #[serde(skip_serializing_if = "Option::is_none", default)]
2043 #[doc = "Configure a Disk for storing TPM state. The format is fixed to 'raw'. Use the special syntax STORAGE_ID:SIZE_IN_GiB to allocate a new volume. Note that SIZE_IN_GiB is ignored here and 4 MiB will be used instead. Use STORAGE_ID:0 and the 'import-from' parameter to import from an existing volume."]
2044 #[doc = ""]
2045 pub tpmstate0: Option<String>,
2046 #[serde(rename = "unused[n]")]
2047 #[serde(
2048 serialize_with = "crate::types::serialize_multi::<NumberedUnuseds, _>",
2049 deserialize_with = "crate::types::deserialize_multi::<NumberedUnuseds, _>"
2050 )]
2051 #[serde(skip_serializing_if = "::std::collections::HashMap::is_empty", default)]
2052 #[serde(flatten)]
2053 #[doc = "Reference to unused volumes. This is used internally, and should not be modified manually."]
2054 #[doc = ""]
2055 pub unuseds: ::std::collections::HashMap<u32, String>,
2056 #[serde(rename = "usb[n]")]
2057 #[serde(
2058 serialize_with = "crate::types::serialize_multi::<NumberedUsbs, _>",
2059 deserialize_with = "crate::types::deserialize_multi::<NumberedUsbs, _>"
2060 )]
2061 #[serde(skip_serializing_if = "::std::collections::HashMap::is_empty", default)]
2062 #[serde(flatten)]
2063 #[doc = "Configure an USB device (n is 0 to 4, for machine version \\\\>= 7.1 and ostype l26 or windows \\\\> 7, n can be up to 14)."]
2064 #[doc = ""]
2065 pub usbs: ::std::collections::HashMap<u32, String>,
2066 #[serde(skip_serializing_if = "Option::is_none", default)]
2067 #[doc = "Number of hotplugged vcpus."]
2068 #[doc = ""]
2069 pub vcpus: Option<VcpusInt>,
2070 #[serde(skip_serializing_if = "Option::is_none", default)]
2071 #[doc = "Configure the VGA hardware."]
2072 #[doc = ""]
2073 #[doc = "Configure the VGA Hardware. If you want to use high resolution modes (\\\\>= 1280x1024x16) you may need to increase the vga memory option. Since QEMU 2.9 the default VGA display type is 'std' for all OS types besides some Windows versions (XP and older) which use 'cirrus'. The 'qxl' option enables the SPICE display server. For win* OS you can select how many independent displays you want, Linux guests can add displays them self."]
2074 #[doc = ""]
2075 #[doc = "You can also run without any graphic card, using a serial device as terminal."]
2076 #[doc = ""]
2077 pub vga: Option<String>,
2078 #[serde(rename = "virtio[n]")]
2079 #[serde(
2080 serialize_with = "crate::types::serialize_multi::<NumberedVirtios, _>",
2081 deserialize_with = "crate::types::deserialize_multi::<NumberedVirtios, _>"
2082 )]
2083 #[serde(skip_serializing_if = "::std::collections::HashMap::is_empty", default)]
2084 #[serde(flatten)]
2085 #[doc = "Use volume as VIRTIO hard disk (n is 0 to 15). Use the special syntax STORAGE_ID:SIZE_IN_GiB to allocate a new volume. Use STORAGE_ID:0 and the 'import-from' parameter to import from an existing volume."]
2086 #[doc = ""]
2087 pub virtios: ::std::collections::HashMap<u32, String>,
2088 #[serde(rename = "virtiofs[n]")]
2089 #[serde(
2090 serialize_with = "crate::types::serialize_multi::<NumberedVirtiofss, _>",
2091 deserialize_with = "crate::types::deserialize_multi::<NumberedVirtiofss, _>"
2092 )]
2093 #[serde(skip_serializing_if = "::std::collections::HashMap::is_empty", default)]
2094 #[serde(flatten)]
2095 #[doc = "Configuration for sharing a directory between host and guest using Virtio-fs."]
2096 #[doc = ""]
2097 pub virtiofss: ::std::collections::HashMap<u32, String>,
2098 #[serde(skip_serializing_if = "Option::is_none", default)]
2099 #[doc = "Set VM Generation ID. Use '1' to autogenerate on create or update, pass '0' to disable explicitly."]
2100 #[doc = ""]
2101 #[doc = "The VM generation ID (vmgenid) device exposes a 128-bit integer value identifier to the guest OS. This allows to notify the guest operating system when the virtual machine is executed with a different configuration (e.g. snapshot execution or creation from a template). The guest operating system notices the change, and is then able to react as appropriate by marking its copies of distributed databases as dirty, re-initializing its random number generator, etc."]
2102 #[doc = ""]
2103 #[doc = "Note that auto-creation only works when done through API/CLI create or update methods, but not when manually editing the config file."]
2104 #[doc = ""]
2105 pub vmgenid: Option<VmgenidStr>,
2106 #[serde(skip_serializing_if = "Option::is_none", default)]
2107 #[doc = "Default storage for VM state volumes/files."]
2108 #[doc = ""]
2109 pub vmstatestorage: Option<String>,
2110 #[serde(skip_serializing_if = "Option::is_none", default)]
2111 #[doc = "Create a virtual hardware watchdog device."]
2112 #[doc = ""]
2113 #[doc = "Create a virtual hardware watchdog device. Once enabled (by a guest action), the watchdog must be periodically polled by an agent inside the guest or else the watchdog will reset the guest (or execute the respective action specified)"]
2114 #[doc = ""]
2115 pub watchdog: Option<String>,
2116 #[serde(
2117 flatten,
2118 deserialize_with = "crate::types::multi::deserialize_additional_data::<'_, PutParams, _, _>"
2119 )]
2120 pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
2121}
2122impl crate::types::multi::Test for PutParams {
2123 fn test_fn() -> fn(&str) -> bool {
2124 fn the_test(input: &str) -> bool {
2125 let array = [
2126 <NumberedHostpcis as crate::types::multi::NumberedItems>::key_matches
2127 as fn(&str) -> bool,
2128 <NumberedIdes as crate::types::multi::NumberedItems>::key_matches
2129 as fn(&str) -> bool,
2130 <NumberedIpconfigs as crate::types::multi::NumberedItems>::key_matches
2131 as fn(&str) -> bool,
2132 <NumberedNets as crate::types::multi::NumberedItems>::key_matches
2133 as fn(&str) -> bool,
2134 <NumberedNumas as crate::types::multi::NumberedItems>::key_matches
2135 as fn(&str) -> bool,
2136 <NumberedParallels as crate::types::multi::NumberedItems>::key_matches
2137 as fn(&str) -> bool,
2138 <NumberedSatas as crate::types::multi::NumberedItems>::key_matches
2139 as fn(&str) -> bool,
2140 <NumberedScsis as crate::types::multi::NumberedItems>::key_matches
2141 as fn(&str) -> bool,
2142 <NumberedSerials as crate::types::multi::NumberedItems>::key_matches
2143 as fn(&str) -> bool,
2144 <NumberedUnuseds as crate::types::multi::NumberedItems>::key_matches
2145 as fn(&str) -> bool,
2146 <NumberedUsbs as crate::types::multi::NumberedItems>::key_matches
2147 as fn(&str) -> bool,
2148 <NumberedVirtios as crate::types::multi::NumberedItems>::key_matches
2149 as fn(&str) -> bool,
2150 <NumberedVirtiofss as crate::types::multi::NumberedItems>::key_matches
2151 as fn(&str) -> bool,
2152 ];
2153 array.iter().any(|f| f(input))
2154 }
2155 the_test as _
2156 }
2157}
2158#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize, PartialEq)]
2159#[doc = "Virtual processor architecture. Defaults to the host."]
2160#[doc = ""]
2161pub enum Arch {
2162 #[serde(rename = "aarch64")]
2163 Aarch64,
2164 #[serde(rename = "x86_64")]
2165 X8664,
2166}
2167impl TryFrom<&str> for Arch {
2168 type Error = String;
2169 fn try_from(value: &str) -> Result<Self, <Self as TryFrom<&str>>::Error> {
2170 match value {
2171 "aarch64" => Ok(Self::Aarch64),
2172 "x86_64" => Ok(Self::X8664),
2173 v => Err(format!("Unknown variant {v}")),
2174 }
2175 }
2176}
2177#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize, PartialEq, Default)]
2178#[doc = "Select BIOS implementation."]
2179#[doc = ""]
2180pub enum Bios {
2181 #[serde(rename = "ovmf")]
2182 Ovmf,
2183 #[serde(rename = "seabios")]
2184 #[default]
2185 Seabios,
2186}
2187impl TryFrom<&str> for Bios {
2188 type Error = String;
2189 fn try_from(value: &str) -> Result<Self, <Self as TryFrom<&str>>::Error> {
2190 match value {
2191 "ovmf" => Ok(Self::Ovmf),
2192 "seabios" => Ok(Self::Seabios),
2193 v => Err(format!("Unknown variant {v}")),
2194 }
2195 }
2196}
2197#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize, PartialEq)]
2198#[doc = "Specifies the cloud-init configuration format. The default depends on the configured operating system type (`ostype`. We use the `nocloud` format for Linux, and `configdrive2` for windows."]
2199#[doc = ""]
2200pub enum Citype {
2201 #[serde(rename = "configdrive2")]
2202 Configdrive2,
2203 #[serde(rename = "nocloud")]
2204 Nocloud,
2205 #[serde(rename = "opennebula")]
2206 Opennebula,
2207}
2208impl TryFrom<&str> for Citype {
2209 type Error = String;
2210 fn try_from(value: &str) -> Result<Self, <Self as TryFrom<&str>>::Error> {
2211 match value {
2212 "configdrive2" => Ok(Self::Configdrive2),
2213 "nocloud" => Ok(Self::Nocloud),
2214 "opennebula" => Ok(Self::Opennebula),
2215 v => Err(format!("Unknown variant {v}")),
2216 }
2217 }
2218}
2219#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize, PartialEq)]
2220#[doc = "Enables hugepages memory."]
2221#[doc = ""]
2222#[doc = "Sets the size of hugepages in MiB. If the value is set to 'any' then 1 GiB hugepages will be used if possible, otherwise the size will fall back to 2 MiB."]
2223#[doc = ""]
2224pub enum Hugepages {
2225 #[serde(rename = "1024")]
2226 _1024,
2227 #[serde(rename = "2")]
2228 _2,
2229 #[serde(rename = "any")]
2230 Any,
2231}
2232impl TryFrom<&str> for Hugepages {
2233 type Error = String;
2234 fn try_from(value: &str) -> Result<Self, <Self as TryFrom<&str>>::Error> {
2235 match value {
2236 "1024" => Ok(Self::_1024),
2237 "2" => Ok(Self::_2),
2238 "any" => Ok(Self::Any),
2239 v => Err(format!("Unknown variant {v}")),
2240 }
2241 }
2242}
2243#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize, PartialEq)]
2244#[doc = "Keyboard layout for VNC server. This option is generally not required and is often better handled from within the guest OS."]
2245#[doc = ""]
2246pub enum Keyboard {
2247 #[serde(rename = "da")]
2248 Da,
2249 #[serde(rename = "de")]
2250 De,
2251 #[serde(rename = "de-ch")]
2252 DeCh,
2253 #[serde(rename = "en-gb")]
2254 EnGb,
2255 #[serde(rename = "en-us")]
2256 EnUs,
2257 #[serde(rename = "es")]
2258 Es,
2259 #[serde(rename = "fi")]
2260 Fi,
2261 #[serde(rename = "fr")]
2262 Fr,
2263 #[serde(rename = "fr-be")]
2264 FrBe,
2265 #[serde(rename = "fr-ca")]
2266 FrCa,
2267 #[serde(rename = "fr-ch")]
2268 FrCh,
2269 #[serde(rename = "hu")]
2270 Hu,
2271 #[serde(rename = "is")]
2272 Is,
2273 #[serde(rename = "it")]
2274 It,
2275 #[serde(rename = "ja")]
2276 Ja,
2277 #[serde(rename = "lt")]
2278 Lt,
2279 #[serde(rename = "mk")]
2280 Mk,
2281 #[serde(rename = "nl")]
2282 Nl,
2283 #[serde(rename = "no")]
2284 No,
2285 #[serde(rename = "pl")]
2286 Pl,
2287 #[serde(rename = "pt")]
2288 Pt,
2289 #[serde(rename = "pt-br")]
2290 PtBr,
2291 #[serde(rename = "sl")]
2292 Sl,
2293 #[serde(rename = "sv")]
2294 Sv,
2295 #[serde(rename = "tr")]
2296 Tr,
2297}
2298impl TryFrom<&str> for Keyboard {
2299 type Error = String;
2300 fn try_from(value: &str) -> Result<Self, <Self as TryFrom<&str>>::Error> {
2301 match value {
2302 "da" => Ok(Self::Da),
2303 "de" => Ok(Self::De),
2304 "de-ch" => Ok(Self::DeCh),
2305 "en-gb" => Ok(Self::EnGb),
2306 "en-us" => Ok(Self::EnUs),
2307 "es" => Ok(Self::Es),
2308 "fi" => Ok(Self::Fi),
2309 "fr" => Ok(Self::Fr),
2310 "fr-be" => Ok(Self::FrBe),
2311 "fr-ca" => Ok(Self::FrCa),
2312 "fr-ch" => Ok(Self::FrCh),
2313 "hu" => Ok(Self::Hu),
2314 "is" => Ok(Self::Is),
2315 "it" => Ok(Self::It),
2316 "ja" => Ok(Self::Ja),
2317 "lt" => Ok(Self::Lt),
2318 "mk" => Ok(Self::Mk),
2319 "nl" => Ok(Self::Nl),
2320 "no" => Ok(Self::No),
2321 "pl" => Ok(Self::Pl),
2322 "pt" => Ok(Self::Pt),
2323 "pt-br" => Ok(Self::PtBr),
2324 "sl" => Ok(Self::Sl),
2325 "sv" => Ok(Self::Sv),
2326 "tr" => Ok(Self::Tr),
2327 v => Err(format!("Unknown variant {v}")),
2328 }
2329 }
2330}
2331#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize, PartialEq)]
2332#[doc = "Lock/unlock the VM."]
2333#[doc = ""]
2334pub enum Lock {
2335 #[serde(rename = "backup")]
2336 Backup,
2337 #[serde(rename = "clone")]
2338 Clone,
2339 #[serde(rename = "create")]
2340 Create,
2341 #[serde(rename = "migrate")]
2342 Migrate,
2343 #[serde(rename = "rollback")]
2344 Rollback,
2345 #[serde(rename = "snapshot")]
2346 Snapshot,
2347 #[serde(rename = "snapshot-delete")]
2348 SnapshotDelete,
2349 #[serde(rename = "suspended")]
2350 Suspended,
2351 #[serde(rename = "suspending")]
2352 Suspending,
2353}
2354impl TryFrom<&str> for Lock {
2355 type Error = String;
2356 fn try_from(value: &str) -> Result<Self, <Self as TryFrom<&str>>::Error> {
2357 match value {
2358 "backup" => Ok(Self::Backup),
2359 "clone" => Ok(Self::Clone),
2360 "create" => Ok(Self::Create),
2361 "migrate" => Ok(Self::Migrate),
2362 "rollback" => Ok(Self::Rollback),
2363 "snapshot" => Ok(Self::Snapshot),
2364 "snapshot-delete" => Ok(Self::SnapshotDelete),
2365 "suspended" => Ok(Self::Suspended),
2366 "suspending" => Ok(Self::Suspending),
2367 v => Err(format!("Unknown variant {v}")),
2368 }
2369 }
2370}
2371#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize, PartialEq, Default)]
2372#[doc = "Specify guest operating system."]
2373#[doc = ""]
2374#[doc = "Specify guest operating system. This is used to enable special"]
2375#[doc = ""]
2376#[doc = "optimization/features for specific operating systems:"]
2377#[doc = ""]
2378#[doc = "\\[horizontal\\]"]
2379#[doc = ""]
2380#[doc = "other;; unspecified OS"]
2381#[doc = ""]
2382#[doc = "wxp;; Microsoft Windows XP"]
2383#[doc = ""]
2384#[doc = "w2k;; Microsoft Windows 2000"]
2385#[doc = ""]
2386#[doc = "w2k3;; Microsoft Windows 2003"]
2387#[doc = ""]
2388#[doc = "w2k8;; Microsoft Windows 2008"]
2389#[doc = ""]
2390#[doc = "wvista;; Microsoft Windows Vista"]
2391#[doc = ""]
2392#[doc = "win7;; Microsoft Windows 7"]
2393#[doc = ""]
2394#[doc = "win8;; Microsoft Windows 8/2012/2012r2"]
2395#[doc = ""]
2396#[doc = "win10;; Microsoft Windows 10/2016/2019"]
2397#[doc = ""]
2398#[doc = "win11;; Microsoft Windows 11/2022/2025"]
2399#[doc = ""]
2400#[doc = "l24;; Linux 2.4 Kernel"]
2401#[doc = ""]
2402#[doc = "l26;; Linux 2.6 - 6.X Kernel"]
2403#[doc = ""]
2404#[doc = "solaris;; Solaris/OpenSolaris/OpenIndiania kernel"]
2405#[doc = ""]
2406pub enum Ostype {
2407 #[serde(rename = "l24")]
2408 L24,
2409 #[serde(rename = "l26")]
2410 L26,
2411 #[serde(rename = "other")]
2412 #[default]
2413 Other,
2414 #[serde(rename = "solaris")]
2415 Solaris,
2416 #[serde(rename = "w2k")]
2417 W2k,
2418 #[serde(rename = "w2k3")]
2419 W2k3,
2420 #[serde(rename = "w2k8")]
2421 W2k8,
2422 #[serde(rename = "win10")]
2423 Win10,
2424 #[serde(rename = "win11")]
2425 Win11,
2426 #[serde(rename = "win7")]
2427 Win7,
2428 #[serde(rename = "win8")]
2429 Win8,
2430 #[serde(rename = "wvista")]
2431 Wvista,
2432 #[serde(rename = "wxp")]
2433 Wxp,
2434}
2435impl TryFrom<&str> for Ostype {
2436 type Error = String;
2437 fn try_from(value: &str) -> Result<Self, <Self as TryFrom<&str>>::Error> {
2438 match value {
2439 "l24" => Ok(Self::L24),
2440 "l26" => Ok(Self::L26),
2441 "other" => Ok(Self::Other),
2442 "solaris" => Ok(Self::Solaris),
2443 "w2k" => Ok(Self::W2k),
2444 "w2k3" => Ok(Self::W2k3),
2445 "w2k8" => Ok(Self::W2k8),
2446 "win10" => Ok(Self::Win10),
2447 "win11" => Ok(Self::Win11),
2448 "win7" => Ok(Self::Win7),
2449 "win8" => Ok(Self::Win8),
2450 "wvista" => Ok(Self::Wvista),
2451 "wxp" => Ok(Self::Wxp),
2452 v => Err(format!("Unknown variant {v}")),
2453 }
2454 }
2455}
2456#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize, PartialEq, Default)]
2457#[doc = "SCSI controller model"]
2458#[doc = ""]
2459pub enum Scsihw {
2460 #[serde(rename = "lsi")]
2461 #[default]
2462 Lsi,
2463 #[serde(rename = "lsi53c810")]
2464 Lsi53c810,
2465 #[serde(rename = "megasas")]
2466 Megasas,
2467 #[serde(rename = "pvscsi")]
2468 Pvscsi,
2469 #[serde(rename = "virtio-scsi-pci")]
2470 VirtioScsiPci,
2471 #[serde(rename = "virtio-scsi-single")]
2472 VirtioScsiSingle,
2473}
2474impl TryFrom<&str> for Scsihw {
2475 type Error = String;
2476 fn try_from(value: &str) -> Result<Self, <Self as TryFrom<&str>>::Error> {
2477 match value {
2478 "lsi" => Ok(Self::Lsi),
2479 "lsi53c810" => Ok(Self::Lsi53c810),
2480 "megasas" => Ok(Self::Megasas),
2481 "pvscsi" => Ok(Self::Pvscsi),
2482 "virtio-scsi-pci" => Ok(Self::VirtioScsiPci),
2483 "virtio-scsi-single" => Ok(Self::VirtioScsiSingle),
2484 v => Err(format!("Unknown variant {v}")),
2485 }
2486 }
2487}
2488#[derive(Default)]
2489struct NumberedHostpcis;
2490impl crate::types::multi::NumberedItems for NumberedHostpcis {
2491 type Item = String;
2492 const PREFIX: &'static str = "hostpci";
2493}
2494#[derive(Default)]
2495struct NumberedIdes;
2496impl crate::types::multi::NumberedItems for NumberedIdes {
2497 type Item = String;
2498 const PREFIX: &'static str = "ide";
2499}
2500#[derive(Default)]
2501struct NumberedIpconfigs;
2502impl crate::types::multi::NumberedItems for NumberedIpconfigs {
2503 type Item = String;
2504 const PREFIX: &'static str = "ipconfig";
2505}
2506#[derive(Default)]
2507struct NumberedNets;
2508impl crate::types::multi::NumberedItems for NumberedNets {
2509 type Item = String;
2510 const PREFIX: &'static str = "net";
2511}
2512#[derive(Default)]
2513struct NumberedNumas;
2514impl crate::types::multi::NumberedItems for NumberedNumas {
2515 type Item = String;
2516 const PREFIX: &'static str = "numa";
2517}
2518#[derive(Default)]
2519struct NumberedParallels;
2520impl crate::types::multi::NumberedItems for NumberedParallels {
2521 type Item = ParallelNStr;
2522 const PREFIX: &'static str = "parallel";
2523}
2524#[derive(Default)]
2525struct NumberedSatas;
2526impl crate::types::multi::NumberedItems for NumberedSatas {
2527 type Item = String;
2528 const PREFIX: &'static str = "sata";
2529}
2530#[derive(Default)]
2531struct NumberedScsis;
2532impl crate::types::multi::NumberedItems for NumberedScsis {
2533 type Item = String;
2534 const PREFIX: &'static str = "scsi";
2535}
2536#[derive(Default)]
2537struct NumberedSerials;
2538impl crate::types::multi::NumberedItems for NumberedSerials {
2539 type Item = SerialNStr;
2540 const PREFIX: &'static str = "serial";
2541}
2542#[derive(Default)]
2543struct NumberedUnuseds;
2544impl crate::types::multi::NumberedItems for NumberedUnuseds {
2545 type Item = String;
2546 const PREFIX: &'static str = "unused";
2547}
2548#[derive(Default)]
2549struct NumberedUsbs;
2550impl crate::types::multi::NumberedItems for NumberedUsbs {
2551 type Item = String;
2552 const PREFIX: &'static str = "usb";
2553}
2554#[derive(Default)]
2555struct NumberedVirtiofss;
2556impl crate::types::multi::NumberedItems for NumberedVirtiofss {
2557 type Item = String;
2558 const PREFIX: &'static str = "virtiofs";
2559}
2560#[derive(Default)]
2561struct NumberedVirtios;
2562impl crate::types::multi::NumberedItems for NumberedVirtios {
2563 type Item = String;
2564 const PREFIX: &'static str = "virtio";
2565}
2566#[derive(Debug, Clone, Copy, PartialEq, PartialOrd)]
2567pub struct BackgroundDelayInt(i128);
2568impl crate::types::bounded_integer::BoundedInteger for BackgroundDelayInt {
2569 const MIN: Option<i128> = Some(1i128);
2570 const MAX: Option<i128> = Some(30i128);
2571 const DEFAULT: Option<i128> = None::<i128>;
2572 const TYPE_DESCRIPTION: &'static str = "an integer between 1 and 30";
2573 fn get(&self) -> i128 {
2574 self.0
2575 }
2576 fn new(value: i128) -> Result<Self, crate::types::bounded_integer::BoundedIntegerError> {
2577 Self::validate(value)?;
2578 Ok(Self(value))
2579 }
2580}
2581impl std::convert::TryFrom<i128> for BackgroundDelayInt {
2582 type Error = crate::types::bounded_integer::BoundedIntegerError;
2583 fn try_from(value: i128) -> Result<Self, Self::Error> {
2584 crate::types::bounded_integer::BoundedInteger::new(value)
2585 }
2586}
2587impl ::serde::Serialize for BackgroundDelayInt {
2588 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
2589 where
2590 S: ::serde::Serializer,
2591 {
2592 crate::types::bounded_integer::serialize_bounded_integer(self, serializer)
2593 }
2594}
2595impl<'de> ::serde::Deserialize<'de> for BackgroundDelayInt {
2596 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
2597 where
2598 D: ::serde::Deserializer<'de>,
2599 {
2600 crate::types::bounded_integer::deserialize_bounded_integer(deserializer)
2601 }
2602}
2603#[derive(Debug, Clone, Copy, PartialEq, PartialOrd)]
2604pub struct CpuunitsInt(i128);
2605impl crate::types::bounded_integer::BoundedInteger for CpuunitsInt {
2606 const MIN: Option<i128> = Some(1i128);
2607 const MAX: Option<i128> = Some(262144i128);
2608 const DEFAULT: Option<i128> = None::<i128>;
2609 const TYPE_DESCRIPTION: &'static str = "an integer between 1 and 262144";
2610 fn get(&self) -> i128 {
2611 self.0
2612 }
2613 fn new(value: i128) -> Result<Self, crate::types::bounded_integer::BoundedIntegerError> {
2614 Self::validate(value)?;
2615 Ok(Self(value))
2616 }
2617}
2618impl std::convert::TryFrom<i128> for CpuunitsInt {
2619 type Error = crate::types::bounded_integer::BoundedIntegerError;
2620 fn try_from(value: i128) -> Result<Self, Self::Error> {
2621 crate::types::bounded_integer::BoundedInteger::new(value)
2622 }
2623}
2624impl ::serde::Serialize for CpuunitsInt {
2625 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
2626 where
2627 S: ::serde::Serializer,
2628 {
2629 crate::types::bounded_integer::serialize_bounded_integer(self, serializer)
2630 }
2631}
2632impl<'de> ::serde::Deserialize<'de> for CpuunitsInt {
2633 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
2634 where
2635 D: ::serde::Deserializer<'de>,
2636 {
2637 crate::types::bounded_integer::deserialize_bounded_integer(deserializer)
2638 }
2639}
2640#[derive(Debug, Clone, Copy, PartialEq, PartialOrd)]
2641pub struct SharesInt(i128);
2642impl crate::types::bounded_integer::BoundedInteger for SharesInt {
2643 const MIN: Option<i128> = Some(0i128);
2644 const MAX: Option<i128> = Some(50000i128);
2645 const DEFAULT: Option<i128> = Some(1000i128);
2646 const TYPE_DESCRIPTION: &'static str = "an integer between 0 and 50000";
2647 fn get(&self) -> i128 {
2648 self.0
2649 }
2650 fn new(value: i128) -> Result<Self, crate::types::bounded_integer::BoundedIntegerError> {
2651 Self::validate(value)?;
2652 Ok(Self(value))
2653 }
2654}
2655impl std::convert::TryFrom<i128> for SharesInt {
2656 type Error = crate::types::bounded_integer::BoundedIntegerError;
2657 fn try_from(value: i128) -> Result<Self, Self::Error> {
2658 crate::types::bounded_integer::BoundedInteger::new(value)
2659 }
2660}
2661impl ::serde::Serialize for SharesInt {
2662 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
2663 where
2664 S: ::serde::Serializer,
2665 {
2666 crate::types::bounded_integer::serialize_bounded_integer(self, serializer)
2667 }
2668}
2669impl<'de> ::serde::Deserialize<'de> for SharesInt {
2670 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
2671 where
2672 D: ::serde::Deserializer<'de>,
2673 {
2674 crate::types::bounded_integer::deserialize_bounded_integer(deserializer)
2675 }
2676}
2677#[derive(Debug, Clone, Copy, PartialEq, PartialOrd)]
2678pub struct VcpusInt(i128);
2679impl crate::types::bounded_integer::BoundedInteger for VcpusInt {
2680 const MIN: Option<i128> = Some(1i128);
2681 const MAX: Option<i128> = None::<i128>;
2682 const DEFAULT: Option<i128> = Some(0i128);
2683 const TYPE_DESCRIPTION: &'static str = "an integer greater than or equal to 1";
2684 fn get(&self) -> i128 {
2685 self.0
2686 }
2687 fn new(value: i128) -> Result<Self, crate::types::bounded_integer::BoundedIntegerError> {
2688 Self::validate(value)?;
2689 Ok(Self(value))
2690 }
2691}
2692impl std::convert::TryFrom<i128> for VcpusInt {
2693 type Error = crate::types::bounded_integer::BoundedIntegerError;
2694 fn try_from(value: i128) -> Result<Self, Self::Error> {
2695 crate::types::bounded_integer::BoundedInteger::new(value)
2696 }
2697}
2698impl ::serde::Serialize for VcpusInt {
2699 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
2700 where
2701 S: ::serde::Serializer,
2702 {
2703 crate::types::bounded_integer::serialize_bounded_integer(self, serializer)
2704 }
2705}
2706impl<'de> ::serde::Deserialize<'de> for VcpusInt {
2707 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
2708 where
2709 D: ::serde::Deserializer<'de>,
2710 {
2711 crate::types::bounded_integer::deserialize_bounded_integer(deserializer)
2712 }
2713}
2714#[derive(Debug, Clone, Copy, PartialEq, PartialOrd)]
2715pub struct CpulimitNum(f64);
2716impl crate::types::bounded_number::BoundedNumber for CpulimitNum {
2717 const MIN: Option<f64> = Some(0f64);
2718 const MAX: Option<f64> = Some(128f64);
2719 const DEFAULT: Option<f64> = Some(0f64);
2720 const TYPE_DESCRIPTION: &'static str = "an number between 0 and 128";
2721 fn get(&self) -> f64 {
2722 self.0
2723 }
2724 fn new(value: f64) -> Result<Self, crate::types::bounded_number::BoundedNumberError> {
2725 Self::validate(value)?;
2726 Ok(Self(value))
2727 }
2728}
2729impl std::convert::TryFrom<f64> for CpulimitNum {
2730 type Error = crate::types::bounded_number::BoundedNumberError;
2731 fn try_from(value: f64) -> Result<Self, Self::Error> {
2732 crate::types::bounded_number::BoundedNumber::new(value)
2733 }
2734}
2735impl std::convert::TryFrom<f32> for CpulimitNum {
2736 type Error = crate::types::bounded_number::BoundedNumberError;
2737 fn try_from(value: f32) -> Result<Self, Self::Error> {
2738 crate::types::bounded_number::BoundedNumber::new(value as f64)
2739 }
2740}
2741impl std::convert::TryFrom<i32> for CpulimitNum {
2742 type Error = crate::types::bounded_number::BoundedNumberError;
2743 fn try_from(value: i32) -> Result<Self, Self::Error> {
2744 crate::types::bounded_number::BoundedNumber::new(value as f64)
2745 }
2746}
2747impl std::convert::TryFrom<i64> for CpulimitNum {
2748 type Error = crate::types::bounded_number::BoundedNumberError;
2749 fn try_from(value: i64) -> Result<Self, Self::Error> {
2750 crate::types::bounded_number::BoundedNumber::new(value as f64)
2751 }
2752}
2753impl ::serde::Serialize for CpulimitNum {
2754 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
2755 where
2756 S: ::serde::Serializer,
2757 {
2758 crate::types::bounded_number::serialize_bounded_number(self, serializer)
2759 }
2760}
2761impl<'de> ::serde::Deserialize<'de> for CpulimitNum {
2762 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
2763 where
2764 D: ::serde::Deserializer<'de>,
2765 {
2766 crate::types::bounded_number::deserialize_bounded_number(deserializer)
2767 }
2768}
2769#[derive(Debug, Clone, Copy, PartialEq, PartialOrd)]
2770pub struct MigrateDowntimeNum(f64);
2771impl crate::types::bounded_number::BoundedNumber for MigrateDowntimeNum {
2772 const MIN: Option<f64> = Some(0f64);
2773 const MAX: Option<f64> = None::<f64>;
2774 const DEFAULT: Option<f64> = Some(0.1f64);
2775 const TYPE_DESCRIPTION: &'static str = "an number greater than or equal to 0";
2776 fn get(&self) -> f64 {
2777 self.0
2778 }
2779 fn new(value: f64) -> Result<Self, crate::types::bounded_number::BoundedNumberError> {
2780 Self::validate(value)?;
2781 Ok(Self(value))
2782 }
2783}
2784impl std::convert::TryFrom<f64> for MigrateDowntimeNum {
2785 type Error = crate::types::bounded_number::BoundedNumberError;
2786 fn try_from(value: f64) -> Result<Self, Self::Error> {
2787 crate::types::bounded_number::BoundedNumber::new(value)
2788 }
2789}
2790impl std::convert::TryFrom<f32> for MigrateDowntimeNum {
2791 type Error = crate::types::bounded_number::BoundedNumberError;
2792 fn try_from(value: f32) -> Result<Self, Self::Error> {
2793 crate::types::bounded_number::BoundedNumber::new(value as f64)
2794 }
2795}
2796impl std::convert::TryFrom<i32> for MigrateDowntimeNum {
2797 type Error = crate::types::bounded_number::BoundedNumberError;
2798 fn try_from(value: i32) -> Result<Self, Self::Error> {
2799 crate::types::bounded_number::BoundedNumber::new(value as f64)
2800 }
2801}
2802impl std::convert::TryFrom<i64> for MigrateDowntimeNum {
2803 type Error = crate::types::bounded_number::BoundedNumberError;
2804 fn try_from(value: i64) -> Result<Self, Self::Error> {
2805 crate::types::bounded_number::BoundedNumber::new(value as f64)
2806 }
2807}
2808impl ::serde::Serialize for MigrateDowntimeNum {
2809 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
2810 where
2811 S: ::serde::Serializer,
2812 {
2813 crate::types::bounded_number::serialize_bounded_number(self, serializer)
2814 }
2815}
2816impl<'de> ::serde::Deserialize<'de> for MigrateDowntimeNum {
2817 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
2818 where
2819 D: ::serde::Deserializer<'de>,
2820 {
2821 crate::types::bounded_number::deserialize_bounded_number(deserializer)
2822 }
2823}
2824#[derive(Debug, Clone, PartialEq, PartialOrd)]
2825pub struct BootdiskStr {
2826 value: String,
2827}
2828impl crate::types::bounded_string::BoundedString for BootdiskStr {
2829 const MIN_LENGTH: Option<usize> = None::<usize>;
2830 const MAX_LENGTH: Option<usize> = None::<usize>;
2831 const DEFAULT: Option<&'static str> = None::<&'static str>;
2832 const PATTERN: Option<&'static str> = Some("(ide|sata|scsi|virtio)\\d+");
2833 const TYPE_DESCRIPTION: &'static str =
2834 "a string with pattern r\"(ide|sata|scsi|virtio)\\d+\" and no length constraints";
2835 fn get_value(&self) -> &str {
2836 &self.value
2837 }
2838 fn new(value: String) -> Result<Self, crate::types::bounded_string::BoundedStringError> {
2839 Self::validate(&value)?;
2840 Ok(Self { value })
2841 }
2842}
2843impl std::convert::TryFrom<String> for BootdiskStr {
2844 type Error = crate::types::bounded_string::BoundedStringError;
2845 fn try_from(value: String) -> Result<Self, Self::Error> {
2846 crate::types::bounded_string::BoundedString::new(value)
2847 }
2848}
2849impl ::serde::Serialize for BootdiskStr {
2850 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
2851 where
2852 S: ::serde::Serializer,
2853 {
2854 crate::types::bounded_string::serialize_bounded_string(self, serializer)
2855 }
2856}
2857impl<'de> ::serde::Deserialize<'de> for BootdiskStr {
2858 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
2859 where
2860 D: ::serde::Deserializer<'de>,
2861 {
2862 crate::types::bounded_string::deserialize_bounded_string(deserializer)
2863 }
2864}
2865#[derive(Debug, Clone, PartialEq, PartialOrd)]
2866pub struct DescriptionStr {
2867 value: String,
2868}
2869impl crate::types::bounded_string::BoundedString for DescriptionStr {
2870 const MIN_LENGTH: Option<usize> = None::<usize>;
2871 const MAX_LENGTH: Option<usize> = Some(8192usize);
2872 const DEFAULT: Option<&'static str> = None::<&'static str>;
2873 const PATTERN: Option<&'static str> = None::<&'static str>;
2874 const TYPE_DESCRIPTION: &'static str = "a string with length at most 8192";
2875 fn get_value(&self) -> &str {
2876 &self.value
2877 }
2878 fn new(value: String) -> Result<Self, crate::types::bounded_string::BoundedStringError> {
2879 Self::validate(&value)?;
2880 Ok(Self { value })
2881 }
2882}
2883impl std::convert::TryFrom<String> for DescriptionStr {
2884 type Error = crate::types::bounded_string::BoundedStringError;
2885 fn try_from(value: String) -> Result<Self, Self::Error> {
2886 crate::types::bounded_string::BoundedString::new(value)
2887 }
2888}
2889impl ::serde::Serialize for DescriptionStr {
2890 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
2891 where
2892 S: ::serde::Serializer,
2893 {
2894 crate::types::bounded_string::serialize_bounded_string(self, serializer)
2895 }
2896}
2897impl<'de> ::serde::Deserialize<'de> for DescriptionStr {
2898 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
2899 where
2900 D: ::serde::Deserializer<'de>,
2901 {
2902 crate::types::bounded_string::deserialize_bounded_string(deserializer)
2903 }
2904}
2905#[derive(Debug, Clone, PartialEq, PartialOrd)]
2906pub struct DigestStr {
2907 value: String,
2908}
2909impl crate::types::bounded_string::BoundedString for DigestStr {
2910 const MIN_LENGTH: Option<usize> = None::<usize>;
2911 const MAX_LENGTH: Option<usize> = Some(40usize);
2912 const DEFAULT: Option<&'static str> = None::<&'static str>;
2913 const PATTERN: Option<&'static str> = None::<&'static str>;
2914 const TYPE_DESCRIPTION: &'static str = "a string with length at most 40";
2915 fn get_value(&self) -> &str {
2916 &self.value
2917 }
2918 fn new(value: String) -> Result<Self, crate::types::bounded_string::BoundedStringError> {
2919 Self::validate(&value)?;
2920 Ok(Self { value })
2921 }
2922}
2923impl std::convert::TryFrom<String> for DigestStr {
2924 type Error = crate::types::bounded_string::BoundedStringError;
2925 fn try_from(value: String) -> Result<Self, Self::Error> {
2926 crate::types::bounded_string::BoundedString::new(value)
2927 }
2928}
2929impl ::serde::Serialize for DigestStr {
2930 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
2931 where
2932 S: ::serde::Serializer,
2933 {
2934 crate::types::bounded_string::serialize_bounded_string(self, serializer)
2935 }
2936}
2937impl<'de> ::serde::Deserialize<'de> for DigestStr {
2938 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
2939 where
2940 D: ::serde::Deserializer<'de>,
2941 {
2942 crate::types::bounded_string::deserialize_bounded_string(deserializer)
2943 }
2944}
2945#[derive(Debug, Clone, PartialEq, PartialOrd)]
2946pub struct ParallelNStr {
2947 value: String,
2948}
2949impl crate::types::bounded_string::BoundedString for ParallelNStr {
2950 const MIN_LENGTH: Option<usize> = None::<usize>;
2951 const MAX_LENGTH: Option<usize> = None::<usize>;
2952 const DEFAULT: Option<&'static str> = None::<&'static str>;
2953 const PATTERN: Option<&'static str> = Some("/dev/parport\\d+|/dev/usb/lp\\d+");
2954 const TYPE_DESCRIPTION: &'static str =
2955 "a string with pattern r\"/dev/parport\\d+|/dev/usb/lp\\d+\" and no length constraints";
2956 fn get_value(&self) -> &str {
2957 &self.value
2958 }
2959 fn new(value: String) -> Result<Self, crate::types::bounded_string::BoundedStringError> {
2960 Self::validate(&value)?;
2961 Ok(Self { value })
2962 }
2963}
2964impl std::convert::TryFrom<String> for ParallelNStr {
2965 type Error = crate::types::bounded_string::BoundedStringError;
2966 fn try_from(value: String) -> Result<Self, Self::Error> {
2967 crate::types::bounded_string::BoundedString::new(value)
2968 }
2969}
2970impl ::serde::Serialize for ParallelNStr {
2971 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
2972 where
2973 S: ::serde::Serializer,
2974 {
2975 crate::types::bounded_string::serialize_bounded_string(self, serializer)
2976 }
2977}
2978impl<'de> ::serde::Deserialize<'de> for ParallelNStr {
2979 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
2980 where
2981 D: ::serde::Deserializer<'de>,
2982 {
2983 crate::types::bounded_string::deserialize_bounded_string(deserializer)
2984 }
2985}
2986#[derive(Debug, Clone, PartialEq, PartialOrd)]
2987pub struct ParentStr {
2988 value: String,
2989}
2990impl crate::types::bounded_string::BoundedString for ParentStr {
2991 const MIN_LENGTH: Option<usize> = None::<usize>;
2992 const MAX_LENGTH: Option<usize> = Some(40usize);
2993 const DEFAULT: Option<&'static str> = None::<&'static str>;
2994 const PATTERN: Option<&'static str> = None::<&'static str>;
2995 const TYPE_DESCRIPTION: &'static str = "a string with length at most 40";
2996 fn get_value(&self) -> &str {
2997 &self.value
2998 }
2999 fn new(value: String) -> Result<Self, crate::types::bounded_string::BoundedStringError> {
3000 Self::validate(&value)?;
3001 Ok(Self { value })
3002 }
3003}
3004impl std::convert::TryFrom<String> for ParentStr {
3005 type Error = crate::types::bounded_string::BoundedStringError;
3006 fn try_from(value: String) -> Result<Self, Self::Error> {
3007 crate::types::bounded_string::BoundedString::new(value)
3008 }
3009}
3010impl ::serde::Serialize for ParentStr {
3011 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
3012 where
3013 S: ::serde::Serializer,
3014 {
3015 crate::types::bounded_string::serialize_bounded_string(self, serializer)
3016 }
3017}
3018impl<'de> ::serde::Deserialize<'de> for ParentStr {
3019 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
3020 where
3021 D: ::serde::Deserializer<'de>,
3022 {
3023 crate::types::bounded_string::deserialize_bounded_string(deserializer)
3024 }
3025}
3026#[derive(Debug, Clone, PartialEq, PartialOrd)]
3027pub struct RunningNetsHostMtuStr {
3028 value: String,
3029}
3030impl crate::types::bounded_string::BoundedString for RunningNetsHostMtuStr {
3031 const MIN_LENGTH: Option<usize> = None::<usize>;
3032 const MAX_LENGTH: Option<usize> = None::<usize>;
3033 const DEFAULT: Option<&'static str> = None::<&'static str>;
3034 const PATTERN: Option<&'static str> = Some("net\\d+=\\d+(,net\\d+=\\d+)*");
3035 const TYPE_DESCRIPTION: &'static str =
3036 "a string with pattern r\"net\\d+=\\d+(,net\\d+=\\d+)*\" and no length constraints";
3037 fn get_value(&self) -> &str {
3038 &self.value
3039 }
3040 fn new(value: String) -> Result<Self, crate::types::bounded_string::BoundedStringError> {
3041 Self::validate(&value)?;
3042 Ok(Self { value })
3043 }
3044}
3045impl std::convert::TryFrom<String> for RunningNetsHostMtuStr {
3046 type Error = crate::types::bounded_string::BoundedStringError;
3047 fn try_from(value: String) -> Result<Self, Self::Error> {
3048 crate::types::bounded_string::BoundedString::new(value)
3049 }
3050}
3051impl ::serde::Serialize for RunningNetsHostMtuStr {
3052 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
3053 where
3054 S: ::serde::Serializer,
3055 {
3056 crate::types::bounded_string::serialize_bounded_string(self, serializer)
3057 }
3058}
3059impl<'de> ::serde::Deserialize<'de> for RunningNetsHostMtuStr {
3060 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
3061 where
3062 D: ::serde::Deserializer<'de>,
3063 {
3064 crate::types::bounded_string::deserialize_bounded_string(deserializer)
3065 }
3066}
3067#[derive(Debug, Clone, PartialEq, PartialOrd)]
3068pub struct RunningcpuStr {
3069 value: String,
3070}
3071impl crate::types::bounded_string::BoundedString for RunningcpuStr {
3072 const MIN_LENGTH: Option<usize> = None::<usize>;
3073 const MAX_LENGTH: Option<usize> = None::<usize>;
3074 const DEFAULT: Option<&'static str> = None::<&'static str>;
3075 const PATTERN: Option<&'static str> = Some("(?^:^((?>[+-]?[\\w\\-\\._=]+,?)+)$)");
3076 const TYPE_DESCRIPTION: &'static str =
3077 "a string with pattern r\"(?^:^((?>[+-]?[\\w\\-\\._=]+,?)+)$)\" and no length constraints";
3078 fn get_value(&self) -> &str {
3079 &self.value
3080 }
3081 fn new(value: String) -> Result<Self, crate::types::bounded_string::BoundedStringError> {
3082 Self::validate(&value)?;
3083 Ok(Self { value })
3084 }
3085}
3086impl std::convert::TryFrom<String> for RunningcpuStr {
3087 type Error = crate::types::bounded_string::BoundedStringError;
3088 fn try_from(value: String) -> Result<Self, Self::Error> {
3089 crate::types::bounded_string::BoundedString::new(value)
3090 }
3091}
3092impl ::serde::Serialize for RunningcpuStr {
3093 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
3094 where
3095 S: ::serde::Serializer,
3096 {
3097 crate::types::bounded_string::serialize_bounded_string(self, serializer)
3098 }
3099}
3100impl<'de> ::serde::Deserialize<'de> for RunningcpuStr {
3101 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
3102 where
3103 D: ::serde::Deserializer<'de>,
3104 {
3105 crate::types::bounded_string::deserialize_bounded_string(deserializer)
3106 }
3107}
3108#[derive(Debug, Clone, PartialEq, PartialOrd)]
3109pub struct SerialNStr {
3110 value: String,
3111}
3112impl crate::types::bounded_string::BoundedString for SerialNStr {
3113 const MIN_LENGTH: Option<usize> = None::<usize>;
3114 const MAX_LENGTH: Option<usize> = None::<usize>;
3115 const DEFAULT: Option<&'static str> = None::<&'static str>;
3116 const PATTERN: Option<&'static str> = Some("(/dev/.+|socket)");
3117 const TYPE_DESCRIPTION: &'static str =
3118 "a string with pattern r\"(/dev/.+|socket)\" and no length constraints";
3119 fn get_value(&self) -> &str {
3120 &self.value
3121 }
3122 fn new(value: String) -> Result<Self, crate::types::bounded_string::BoundedStringError> {
3123 Self::validate(&value)?;
3124 Ok(Self { value })
3125 }
3126}
3127impl std::convert::TryFrom<String> for SerialNStr {
3128 type Error = crate::types::bounded_string::BoundedStringError;
3129 fn try_from(value: String) -> Result<Self, Self::Error> {
3130 crate::types::bounded_string::BoundedString::new(value)
3131 }
3132}
3133impl ::serde::Serialize for SerialNStr {
3134 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
3135 where
3136 S: ::serde::Serializer,
3137 {
3138 crate::types::bounded_string::serialize_bounded_string(self, serializer)
3139 }
3140}
3141impl<'de> ::serde::Deserialize<'de> for SerialNStr {
3142 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
3143 where
3144 D: ::serde::Deserializer<'de>,
3145 {
3146 crate::types::bounded_string::deserialize_bounded_string(deserializer)
3147 }
3148}
3149#[derive(Debug, Clone, PartialEq, PartialOrd)]
3150pub struct Smbios1Str {
3151 value: String,
3152}
3153impl crate::types::bounded_string::BoundedString for Smbios1Str {
3154 const MIN_LENGTH: Option<usize> = None::<usize>;
3155 const MAX_LENGTH: Option<usize> = Some(512usize);
3156 const DEFAULT: Option<&'static str> = None::<&'static str>;
3157 const PATTERN: Option<&'static str> = None::<&'static str>;
3158 const TYPE_DESCRIPTION: &'static str = "a string with length at most 512";
3159 fn get_value(&self) -> &str {
3160 &self.value
3161 }
3162 fn new(value: String) -> Result<Self, crate::types::bounded_string::BoundedStringError> {
3163 Self::validate(&value)?;
3164 Ok(Self { value })
3165 }
3166}
3167impl std::convert::TryFrom<String> for Smbios1Str {
3168 type Error = crate::types::bounded_string::BoundedStringError;
3169 fn try_from(value: String) -> Result<Self, Self::Error> {
3170 crate::types::bounded_string::BoundedString::new(value)
3171 }
3172}
3173impl ::serde::Serialize for Smbios1Str {
3174 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
3175 where
3176 S: ::serde::Serializer,
3177 {
3178 crate::types::bounded_string::serialize_bounded_string(self, serializer)
3179 }
3180}
3181impl<'de> ::serde::Deserialize<'de> for Smbios1Str {
3182 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
3183 where
3184 D: ::serde::Deserializer<'de>,
3185 {
3186 crate::types::bounded_string::deserialize_bounded_string(deserializer)
3187 }
3188}
3189#[derive(Debug, Clone, PartialEq, PartialOrd)]
3190pub struct SnapshotStr {
3191 value: String,
3192}
3193impl crate::types::bounded_string::BoundedString for SnapshotStr {
3194 const MIN_LENGTH: Option<usize> = None::<usize>;
3195 const MAX_LENGTH: Option<usize> = Some(40usize);
3196 const DEFAULT: Option<&'static str> = None::<&'static str>;
3197 const PATTERN: Option<&'static str> = None::<&'static str>;
3198 const TYPE_DESCRIPTION: &'static str = "a string with length at most 40";
3199 fn get_value(&self) -> &str {
3200 &self.value
3201 }
3202 fn new(value: String) -> Result<Self, crate::types::bounded_string::BoundedStringError> {
3203 Self::validate(&value)?;
3204 Ok(Self { value })
3205 }
3206}
3207impl std::convert::TryFrom<String> for SnapshotStr {
3208 type Error = crate::types::bounded_string::BoundedStringError;
3209 fn try_from(value: String) -> Result<Self, Self::Error> {
3210 crate::types::bounded_string::BoundedString::new(value)
3211 }
3212}
3213impl ::serde::Serialize for SnapshotStr {
3214 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
3215 where
3216 S: ::serde::Serializer,
3217 {
3218 crate::types::bounded_string::serialize_bounded_string(self, serializer)
3219 }
3220}
3221impl<'de> ::serde::Deserialize<'de> for SnapshotStr {
3222 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
3223 where
3224 D: ::serde::Deserializer<'de>,
3225 {
3226 crate::types::bounded_string::deserialize_bounded_string(deserializer)
3227 }
3228}
3229#[derive(Debug, Clone, PartialEq, PartialOrd)]
3230pub struct StartdateStr {
3231 value: String,
3232}
3233impl crate::types::bounded_string::BoundedString for StartdateStr {
3234 const MIN_LENGTH: Option<usize> = None::<usize>;
3235 const MAX_LENGTH: Option<usize> = None::<usize>;
3236 const DEFAULT: Option<&'static str> = Some("now");
3237 const PATTERN: Option<&'static str> =
3238 Some("(now|\\d{4}-\\d{1,2}-\\d{1,2}(T\\d{1,2}:\\d{1,2}:\\d{1,2})?)");
3239 const TYPE_DESCRIPTION: &'static str = "a string with pattern r\"(now|\\d{4}-\\d{1,2}-\\d{1,2}(T\\d{1,2}:\\d{1,2}:\\d{1,2})?)\" and no length constraints";
3240 fn get_value(&self) -> &str {
3241 &self.value
3242 }
3243 fn new(value: String) -> Result<Self, crate::types::bounded_string::BoundedStringError> {
3244 Self::validate(&value)?;
3245 Ok(Self { value })
3246 }
3247}
3248impl std::convert::TryFrom<String> for StartdateStr {
3249 type Error = crate::types::bounded_string::BoundedStringError;
3250 fn try_from(value: String) -> Result<Self, Self::Error> {
3251 crate::types::bounded_string::BoundedString::new(value)
3252 }
3253}
3254impl ::serde::Serialize for StartdateStr {
3255 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
3256 where
3257 S: ::serde::Serializer,
3258 {
3259 crate::types::bounded_string::serialize_bounded_string(self, serializer)
3260 }
3261}
3262impl<'de> ::serde::Deserialize<'de> for StartdateStr {
3263 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
3264 where
3265 D: ::serde::Deserializer<'de>,
3266 {
3267 crate::types::bounded_string::deserialize_bounded_string(deserializer)
3268 }
3269}
3270#[derive(Debug, Clone, PartialEq, PartialOrd)]
3271pub struct VmgenidStr {
3272 value: String,
3273}
3274impl crate::types::bounded_string::BoundedString for VmgenidStr {
3275 const MIN_LENGTH: Option<usize> = None::<usize>;
3276 const MAX_LENGTH: Option<usize> = None::<usize>;
3277 const DEFAULT: Option<&'static str> = Some("1 (autogenerated)");
3278 const PATTERN: Option<&'static str> =
3279 Some("(?:[a-fA-F0-9]{8}(?:-[a-fA-F0-9]{4}){3}-[a-fA-F0-9]{12}|[01])");
3280 const TYPE_DESCRIPTION: &'static str = "a string with pattern r\"(?:[a-fA-F0-9]{8}(?:-[a-fA-F0-9]{4}){3}-[a-fA-F0-9]{12}|[01])\" and no length constraints";
3281 fn get_value(&self) -> &str {
3282 &self.value
3283 }
3284 fn new(value: String) -> Result<Self, crate::types::bounded_string::BoundedStringError> {
3285 Self::validate(&value)?;
3286 Ok(Self { value })
3287 }
3288}
3289impl std::convert::TryFrom<String> for VmgenidStr {
3290 type Error = crate::types::bounded_string::BoundedStringError;
3291 fn try_from(value: String) -> Result<Self, Self::Error> {
3292 crate::types::bounded_string::BoundedString::new(value)
3293 }
3294}
3295impl ::serde::Serialize for VmgenidStr {
3296 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
3297 where
3298 S: ::serde::Serializer,
3299 {
3300 crate::types::bounded_string::serialize_bounded_string(self, serializer)
3301 }
3302}
3303impl<'de> ::serde::Deserialize<'de> for VmgenidStr {
3304 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
3305 where
3306 D: ::serde::Deserializer<'de>,
3307 {
3308 crate::types::bounded_string::deserialize_bounded_string(deserializer)
3309 }
3310}