From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id C6DBE1FF179 for ; Wed, 1 Oct 2025 17:47:48 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id CF7D624BFA; Wed, 1 Oct 2025 17:47:55 +0200 (CEST) From: Hannes Laimer To: pdm-devel@lists.proxmox.com Date: Wed, 1 Oct 2025 17:47:17 +0200 Message-ID: <20251001154717.405839-3-h.laimer@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20251001154717.405839-1-h.laimer@proxmox.com> References: <20251001154717.405839-1-h.laimer@proxmox.com> MIME-Version: 1.0 X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1759333618023 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.045 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: [pdm-devel] [PATCH 2/2] pve-api-types: regenerate X-BeenThere: pdm-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox Datacenter Manager development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox Datacenter Manager development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pdm-devel-bounces@lists.proxmox.com Sender: "pdm-devel" Signed-off-by: Hannes Laimer --- pve-api-types/src/generated/types.rs | 168 +++++++++++++++++++++++++++ 1 file changed, 168 insertions(+) diff --git a/pve-api-types/src/generated/types.rs b/pve-api-types/src/generated/types.rs index 2979e708..2da1fd28 100644 --- a/pve-api-types/src/generated/types.rs +++ b/pve-api-types/src/generated/types.rs @@ -247,6 +247,7 @@ pub struct ClusterJoinInfo { const_regex! { CLUSTER_JOIN_INFO_NODELIST_NAME_RE = r##"^(?i:[a-z0-9](?i:[a-z0-9\-]*[a-z0-9])?)$"##; +CLUSTER_JOIN_INFO_NODELIST_PVE_FP_RE = r##"([A-Fa-f0-9]{2}:){31}[A-Fa-f0-9]{2}"##; } @@ -268,6 +269,7 @@ CLUSTER_JOIN_INFO_NODELIST_NAME_RE = r##"^(?i:[a-z0-9](?i:[a-z0-9\-]*[a-z0-9])?) description: "FIXME: Missing description in PVE.", }, pve_fp: { + format: &ApiStringFormat::Pattern(&CLUSTER_JOIN_INFO_NODELIST_PVE_FP_RE), type: String, description: "FIXME: Missing description in PVE.", }, @@ -1217,9 +1219,16 @@ pub struct CreateTokenResponseInfo { pub privsep: Option, } +const_regex! { + +CREATE_VNET_ALIAS_RE = r##"(?^u:(?^i:[\(\)-_.\w\d\s]{0,256}))"##; + +} + #[api( properties: { alias: { + format: &ApiStringFormat::Pattern(&CREATE_VNET_ALIAS_RE), max_length: 256, optional: true, type: String, @@ -2434,6 +2443,12 @@ pub enum LxcConfigCmode { serde_plain::derive_display_from_serialize!(LxcConfigCmode); serde_plain::derive_fromstr_from_deserialize!(LxcConfigCmode); +const_regex! { + +LXC_CONFIG_DEV_MODE_RE = r##"0[0-7]{3}"##; + +} + #[api( default_key: "path", properties: { @@ -2447,6 +2462,7 @@ serde_plain::derive_fromstr_from_deserialize!(LxcConfigCmode); type: Integer, }, mode: { + format: &ApiStringFormat::Pattern(&LXC_CONFIG_DEV_MODE_RE), optional: true, type: String, }, @@ -2490,6 +2506,12 @@ pub struct LxcConfigDev { pub uid: Option, } +const_regex! { + +LXC_CONFIG_FEATURES_MOUNT_RE = r##"(?^u:(?^:[a-zA-Z0-9_; ]+))"##; + +} + #[api( properties: { force_rw_sys: { @@ -2509,6 +2531,7 @@ pub struct LxcConfigDev { optional: true, }, mount: { + format: &ApiStringFormat::Pattern(&LXC_CONFIG_FEATURES_MOUNT_RE), optional: true, type: String, }, @@ -2608,6 +2631,7 @@ serde_plain::derive_fromstr_from_deserialize!(LxcConfigLock); const_regex! { +LXC_CONFIG_MP_MOUNTOPTIONS_RE = r##"(?^u:(?^:(?^:(discard|lazytime|noatime|nodev|noexec|nosuid))(;(?^:(discard|lazytime|noatime|nodev|noexec|nosuid)))*))"##; LXC_CONFIG_MP_SIZE_RE = r##"^(\d+(\.\d+)?)([KMGT])?$"##; } @@ -2624,6 +2648,7 @@ LXC_CONFIG_MP_SIZE_RE = r##"^(\d+(\.\d+)?)([KMGT])?$"##; optional: true, }, mountoptions: { + format: &ApiStringFormat::Pattern(&LXC_CONFIG_MP_MOUNTOPTIONS_RE), optional: true, type: String, }, @@ -2711,13 +2736,17 @@ pub struct LxcConfigMp { const_regex! { +LXC_CONFIG_NET_BRIDGE_RE = r##"[-_.\w\d]+"##; LXC_CONFIG_NET_HWADDR_RE = r##"^(?i)[a-f0-9][02468ace](?::[a-f0-9]{2}){5}$"##; +LXC_CONFIG_NET_NAME_RE = r##"[-_.\w\d]+"##; +LXC_CONFIG_NET_TRUNKS_RE = r##"(?^u:(?^:\d+(?:;\d+)*))"##; } #[api( properties: { bridge: { + format: &ApiStringFormat::Pattern(&LXC_CONFIG_NET_BRIDGE_RE), optional: true, type: String, }, @@ -2761,6 +2790,7 @@ LXC_CONFIG_NET_HWADDR_RE = r##"^(?i)[a-f0-9][02468ace](?::[a-f0-9]{2}){5}$"##; type: Integer, }, name: { + format: &ApiStringFormat::Pattern(&LXC_CONFIG_NET_NAME_RE), type: String, }, tag: { @@ -2770,6 +2800,7 @@ LXC_CONFIG_NET_HWADDR_RE = r##"^(?i)[a-f0-9][02468ace](?::[a-f0-9]{2}){5}$"##; type: Integer, }, trunks: { + format: &ApiStringFormat::Pattern(&LXC_CONFIG_NET_TRUNKS_RE), optional: true, type: String, }, @@ -2903,6 +2934,7 @@ serde_plain::derive_fromstr_from_deserialize!(LxcConfigOstype); const_regex! { +LXC_CONFIG_ROOTFS_MOUNTOPTIONS_RE = r##"(?^u:(?^:(?^:(discard|lazytime|noatime|nodev|noexec|nosuid))(;(?^:(discard|lazytime|noatime|nodev|noexec|nosuid)))*))"##; LXC_CONFIG_ROOTFS_SIZE_RE = r##"^(\d+(\.\d+)?)([KMGT])?$"##; } @@ -2915,6 +2947,7 @@ LXC_CONFIG_ROOTFS_SIZE_RE = r##"^(\d+(\.\d+)?)([KMGT])?$"##; optional: true, }, mountoptions: { + format: &ApiStringFormat::Pattern(&LXC_CONFIG_ROOTFS_MOUNTOPTIONS_RE), optional: true, type: String, }, @@ -4536,12 +4569,19 @@ pub enum NodeSubscriptionInfoStatus { serde_plain::derive_display_from_serialize!(NodeSubscriptionInfoStatus); serde_plain::derive_fromstr_from_deserialize!(NodeSubscriptionInfoStatus); +const_regex! { + +PROXMOX_REMOTE_FINGERPRINT_RE = r##"([A-Fa-f0-9]{2}:){31}[A-Fa-f0-9]{2}"##; + +} + #[api( properties: { apitoken: { type: String, }, fingerprint: { + format: &ApiStringFormat::Pattern(&PROXMOX_REMOTE_FINGERPRINT_RE), optional: true, type: String, }, @@ -4648,11 +4688,18 @@ pub enum PveQemuSevFmtType { serde_plain::derive_display_from_serialize!(PveQemuSevFmtType); serde_plain::derive_fromstr_from_deserialize!(PveQemuSevFmtType); +const_regex! { + +PVE_QM_BOOT_LEGACY_RE = r##"[acdn]{1,4}"##; + +} + #[api( default_key: "legacy", properties: { legacy: { default: "cdn", + format: &ApiStringFormat::Pattern(&PVE_QM_BOOT_LEGACY_RE), optional: true, type: String, }, @@ -4738,7 +4785,14 @@ pub struct PveQmCicustom { const_regex! { +PVE_QM_HOSTPCI_DEVICE_ID_RE = r##"(?^u:(?^:^0x[0-9a-fA-F]{4}$))"##; +PVE_QM_HOSTPCI_HOST_RE = r##"(?^u:(?^:(?^:(?:[a-f0-9]{4,}:)?[a-f0-9]{2}:[a-f0-9]{2}(?:\.[a-f0-9])?)(;(?^:(?:[a-f0-9]{4,}:)?[a-f0-9]{2}:[a-f0-9]{2}(?:\.[a-f0-9])?))*))"##; PVE_QM_HOSTPCI_MAPPING_RE = r##"^(?i:[a-z][a-z0-9_-]+)$"##; +PVE_QM_HOSTPCI_MDEV_RE = r##"[^/\.:]+"##; +PVE_QM_HOSTPCI_ROMFILE_RE = r##"[^,;]+"##; +PVE_QM_HOSTPCI_SUB_DEVICE_ID_RE = r##"(?^u:(?^:^0x[0-9a-fA-F]{4}$))"##; +PVE_QM_HOSTPCI_SUB_VENDOR_ID_RE = r##"(?^u:(?^:^0x[0-9a-fA-F]{4}$))"##; +PVE_QM_HOSTPCI_VENDOR_ID_RE = r##"(?^u:(?^:^0x[0-9a-fA-F]{4}$))"##; } @@ -4746,10 +4800,12 @@ PVE_QM_HOSTPCI_MAPPING_RE = r##"^(?i:[a-z][a-z0-9_-]+)$"##; default_key: "host", properties: { "device-id": { + format: &ApiStringFormat::Pattern(&PVE_QM_HOSTPCI_DEVICE_ID_RE), optional: true, type: String, }, host: { + format: &ApiStringFormat::Pattern(&PVE_QM_HOSTPCI_HOST_RE), optional: true, type: String, }, @@ -4763,6 +4819,7 @@ PVE_QM_HOSTPCI_MAPPING_RE = r##"^(?i:[a-z][a-z0-9_-]+)$"##; type: String, }, mdev: { + format: &ApiStringFormat::Pattern(&PVE_QM_HOSTPCI_MDEV_RE), optional: true, type: String, }, @@ -4775,18 +4832,22 @@ PVE_QM_HOSTPCI_MAPPING_RE = r##"^(?i:[a-z][a-z0-9_-]+)$"##; optional: true, }, romfile: { + format: &ApiStringFormat::Pattern(&PVE_QM_HOSTPCI_ROMFILE_RE), optional: true, type: String, }, "sub-device-id": { + format: &ApiStringFormat::Pattern(&PVE_QM_HOSTPCI_SUB_DEVICE_ID_RE), optional: true, type: String, }, "sub-vendor-id": { + format: &ApiStringFormat::Pattern(&PVE_QM_HOSTPCI_SUB_VENDOR_ID_RE), optional: true, type: String, }, "vendor-id": { + format: &ApiStringFormat::Pattern(&PVE_QM_HOSTPCI_VENDOR_ID_RE), optional: true, type: String, }, @@ -4876,6 +4937,7 @@ const_regex! { PVE_QM_IDE_MODEL_RE = r##"^[-%a-zA-Z0-9_.!~*'()]*$"##; PVE_QM_IDE_SERIAL_RE = r##"^[-%a-zA-Z0-9_.!~*'()]*$"##; PVE_QM_IDE_SIZE_RE = r##"^(\d+(\.\d+)?)([KMGT])?$"##; +PVE_QM_IDE_WWN_RE = r##"(?^u:(?^:^(0x)[0-9a-fA-F]{16}))"##; } @@ -5022,6 +5084,7 @@ PVE_QM_IDE_SIZE_RE = r##"^(\d+(\.\d+)?)([KMGT])?$"##; type: PveQmIdeWerror, }, wwn: { + format: &ApiStringFormat::Pattern(&PVE_QM_IDE_WWN_RE), optional: true, type: String, }, @@ -5445,6 +5508,18 @@ pub enum PveQmRngSource { serde_plain::derive_display_from_serialize!(PveQmRngSource); serde_plain::derive_fromstr_from_deserialize!(PveQmRngSource); +const_regex! { + +PVE_QM_SMBIOS1_FAMILY_RE = r##"[A-Za-z0-9+\/]+={0,2}"##; +PVE_QM_SMBIOS1_MANUFACTURER_RE = r##"[A-Za-z0-9+\/]+={0,2}"##; +PVE_QM_SMBIOS1_PRODUCT_RE = r##"[A-Za-z0-9+\/]+={0,2}"##; +PVE_QM_SMBIOS1_SERIAL_RE = r##"[A-Za-z0-9+\/]+={0,2}"##; +PVE_QM_SMBIOS1_SKU_RE = r##"[A-Za-z0-9+\/]+={0,2}"##; +PVE_QM_SMBIOS1_UUID_RE = r##"[a-fA-F0-9]{8}(?:-[a-fA-F0-9]{4}){3}-[a-fA-F0-9]{12}"##; +PVE_QM_SMBIOS1_VERSION_RE = r##"[A-Za-z0-9+\/]+={0,2}"##; + +} + #[api( properties: { base64: { @@ -5452,30 +5527,37 @@ serde_plain::derive_fromstr_from_deserialize!(PveQmRngSource); optional: true, }, family: { + format: &ApiStringFormat::Pattern(&PVE_QM_SMBIOS1_FAMILY_RE), optional: true, type: String, }, manufacturer: { + format: &ApiStringFormat::Pattern(&PVE_QM_SMBIOS1_MANUFACTURER_RE), optional: true, type: String, }, product: { + format: &ApiStringFormat::Pattern(&PVE_QM_SMBIOS1_PRODUCT_RE), optional: true, type: String, }, serial: { + format: &ApiStringFormat::Pattern(&PVE_QM_SMBIOS1_SERIAL_RE), optional: true, type: String, }, sku: { + format: &ApiStringFormat::Pattern(&PVE_QM_SMBIOS1_SKU_RE), optional: true, type: String, }, uuid: { + format: &ApiStringFormat::Pattern(&PVE_QM_SMBIOS1_UUID_RE), optional: true, type: String, }, version: { + format: &ApiStringFormat::Pattern(&PVE_QM_SMBIOS1_VERSION_RE), optional: true, type: String, }, @@ -5583,6 +5665,13 @@ pub enum PveQmWatchdogModel { serde_plain::derive_display_from_serialize!(PveQmWatchdogModel); serde_plain::derive_fromstr_from_deserialize!(PveQmWatchdogModel); +const_regex! { + +PVE_VM_CPU_CONF_FLAGS_RE = r##"(?^u:(?^:(?^:([+-])([a-zA-Z0-9\-_\.]+))(;(?^:([+-])([a-zA-Z0-9\-_\.]+)))*))"##; +PVE_VM_CPU_CONF_HV_VENDOR_ID_RE = r##"(?^u:(?^:[a-zA-Z0-9]{1,12}))"##; + +} + #[api( default_key: "cputype", properties: { @@ -5592,6 +5681,7 @@ serde_plain::derive_fromstr_from_deserialize!(PveQmWatchdogModel); type: String, }, flags: { + format: &ApiStringFormat::Pattern(&PVE_VM_CPU_CONF_FLAGS_RE), optional: true, type: String, }, @@ -5606,6 +5696,7 @@ serde_plain::derive_fromstr_from_deserialize!(PveQmWatchdogModel); optional: true, }, "hv-vendor-id": { + format: &ApiStringFormat::Pattern(&PVE_VM_CPU_CONF_HV_VENDOR_ID_RE), optional: true, type: String, }, @@ -5895,11 +5986,17 @@ serde_plain::derive_fromstr_from_deserialize!(PveVmCpuConfReportedModel); const_regex! { +QEMU_CONFIG_PARALLEL_RE = r##"/dev/parport\d+|/dev/usb/lp\d+"##; +QEMU_CONFIG_SERIAL_RE = r##"(/dev/.+|socket)"##; QEMU_CONFIG_AFFINITY_RE = r##"^(\s*\d+(-\d+)?\s*)(,\s*\d+(-\d+)?\s*)?$"##; QEMU_CONFIG_BOOTDISK_RE = r##"^(ide|sata|scsi|virtio|efidisk|tpmstate)\d+$"##; QEMU_CONFIG_PARENT_RE = r##"^(?i:[a-z][a-z0-9_-]+)$"##; +QEMU_CONFIG_RUNNING_NETS_HOST_MTU_RE = r##"net\d+=\d+(,net\d+=\d+)*"##; +QEMU_CONFIG_RUNNINGCPU_RE = r##"(?^u:(?^:^((?>[+-]?[\w\-\._=]+,?)+)$))"##; QEMU_CONFIG_SSHKEYS_RE = r##"^[-%a-zA-Z0-9_.!~*'()]*$"##; +QEMU_CONFIG_STARTDATE_RE = r##"(now|\d{4}-\d{1,2}-\d{1,2}(T\d{1,2}:\d{1,2}:\d{1,2})?)"##; QEMU_CONFIG_TAGS_RE = r##"^(?i)[a-z0-9_][a-z0-9_\-+.]*$"##; +QEMU_CONFIG_VMGENID_RE = r##"(?:[a-fA-F0-9]{8}(?:-[a-fA-F0-9]{4}){3}-[a-fA-F0-9]{12}|[01])"##; QEMU_CONFIG_VMSTATESTORAGE_RE = r##"^(?i:[a-z][a-z0-9\-_.]*[a-z0-9])$"##; } @@ -6154,10 +6251,12 @@ QEMU_CONFIG_VMSTATESTORAGE_RE = r##"^(?i:[a-z][a-z0-9\-_.]*[a-z0-9])$"##; type: String, }, "running-nets-host-mtu": { + format: &ApiStringFormat::Pattern(&QEMU_CONFIG_RUNNING_NETS_HOST_MTU_RE), optional: true, type: String, }, runningcpu: { + format: &ApiStringFormat::Pattern(&QEMU_CONFIG_RUNNINGCPU_RE), optional: true, type: String, }, @@ -6225,6 +6324,7 @@ QEMU_CONFIG_VMSTATESTORAGE_RE = r##"^(?i:[a-z][a-z0-9\-_.]*[a-z0-9])$"##; }, startdate: { default: "now", + format: &ApiStringFormat::Pattern(&QEMU_CONFIG_STARTDATE_RE), optional: true, type: String, type_text: "(now | YYYY-MM-DD | YYYY-MM-DDTHH:MM:SS)", @@ -6281,6 +6381,7 @@ QEMU_CONFIG_VMSTATESTORAGE_RE = r##"^(?i:[a-z][a-z0-9\-_.]*[a-z0-9])$"##; }, vmgenid: { default: "1 (autogenerated)", + format: &ApiStringFormat::Pattern(&QEMU_CONFIG_VMGENID_RE), optional: true, type: String, }, @@ -6802,6 +6903,7 @@ generate_array_field! { r#"Map host parallel devices (n is 0 to 2)."#, String => { description: "Map host parallel devices (n is 0 to 2).", + format: &ApiStringFormat::Pattern(&QEMU_CONFIG_PARALLEL_RE), type: String, } parallel @@ -6831,6 +6933,7 @@ generate_array_field! { r#"Create a serial device inside the VM (n is 0 to 3)"#, String => { description: "Create a serial device inside the VM (n is 0 to 3)", + format: &ApiStringFormat::Pattern(&QEMU_CONFIG_SERIAL_RE), type: String, } serial @@ -7127,9 +7230,16 @@ pub enum QemuConfigHugepages { serde_plain::derive_display_from_serialize!(QemuConfigHugepages); serde_plain::derive_fromstr_from_deserialize!(QemuConfigHugepages); +const_regex! { + +QEMU_CONFIG_IVSHMEM_NAME_RE = r##"[a-zA-Z0-9\-]+"##; + +} + #[api( properties: { name: { + format: &ApiStringFormat::Pattern(&QEMU_CONFIG_IVSHMEM_NAME_RE), optional: true, type: String, }, @@ -7271,6 +7381,12 @@ pub enum QemuConfigLock { serde_plain::derive_display_from_serialize!(QemuConfigLock); serde_plain::derive_fromstr_from_deserialize!(QemuConfigLock); +const_regex! { + +QEMU_CONFIG_MACHINE_TYPE_RE = r##"(pc|pc(-i440fx)?-\d+(\.\d+)+(\+pve\d+)?(\.pxe)?|q35|pc-q35-\d+(\.\d+)+(\+pve\d+)?(\.pxe)?|virt(?:-\d+(\.\d+)+)?(\+pve\d+)?)"##; + +} + #[api( default_key: "type", properties: { @@ -7288,6 +7404,7 @@ serde_plain::derive_fromstr_from_deserialize!(QemuConfigLock); optional: true, }, type: { + format: &ApiStringFormat::Pattern(&QEMU_CONFIG_MACHINE_TYPE_RE), max_length: 40, optional: true, type: String, @@ -7364,9 +7481,16 @@ pub struct QemuConfigMemory { pub current: u64, } +const_regex! { + +QEMU_CONFIG_META_CREATION_QEMU_RE = r##"\d+(\.\d+)+"##; + +} + #[api( properties: { "creation-qemu": { + format: &ApiStringFormat::Pattern(&QEMU_CONFIG_META_CREATION_QEMU_RE), optional: true, type: String, }, @@ -7395,6 +7519,7 @@ const_regex! { QEMU_CONFIG_NET_BRIDGE_RE = r##"^[-_.\w\d]+$"##; QEMU_CONFIG_NET_MACADDR_RE = r##"^(?i)[a-f0-9][02468ace](?::[a-f0-9]{2}){5}$"##; +QEMU_CONFIG_NET_TRUNKS_RE = r##"(?^u:(?^:\d+(?:-\d+)?(?:;\d+(?:-\d+)?)*))"##; } @@ -7465,6 +7590,7 @@ QEMU_CONFIG_NET_MACADDR_RE = r##"^(?i)[a-f0-9][02468ace](?::[a-f0-9]{2}){5}$"##; type: Integer, }, trunks: { + format: &ApiStringFormat::Pattern(&QEMU_CONFIG_NET_TRUNKS_RE), optional: true, type: String, }, @@ -7583,12 +7709,21 @@ pub enum QemuConfigNetModel { serde_plain::derive_display_from_serialize!(QemuConfigNetModel); serde_plain::derive_fromstr_from_deserialize!(QemuConfigNetModel); +const_regex! { + +QEMU_CONFIG_NUMA_CPUS_RE = r##"(?^u:(?^:\d+(?:-\d+)?(?:;\d+(?:-\d+)?)*))"##; +QEMU_CONFIG_NUMA_HOSTNODES_RE = r##"(?^u:(?^:\d+(?:-\d+)?(?:;\d+(?:-\d+)?)*))"##; + +} + #[api( properties: { cpus: { + format: &ApiStringFormat::Pattern(&QEMU_CONFIG_NUMA_CPUS_RE), type: String, }, hostnodes: { + format: &ApiStringFormat::Pattern(&QEMU_CONFIG_NUMA_HOSTNODES_RE), optional: true, type: String, }, @@ -7685,6 +7820,7 @@ const_regex! { QEMU_CONFIG_SATA_SERIAL_RE = r##"^[-%a-zA-Z0-9_.!~*'()]*$"##; QEMU_CONFIG_SATA_SIZE_RE = r##"^(\d+(\.\d+)?)([KMGT])?$"##; +QEMU_CONFIG_SATA_WWN_RE = r##"(?^u:(?^:^(0x)[0-9a-fA-F]{16}))"##; } @@ -7825,6 +7961,7 @@ QEMU_CONFIG_SATA_SIZE_RE = r##"^(\d+(\.\d+)?)([KMGT])?$"##; type: PveQmIdeWerror, }, wwn: { + format: &ApiStringFormat::Pattern(&QEMU_CONFIG_SATA_WWN_RE), optional: true, type: String, }, @@ -8010,8 +8147,11 @@ pub struct QemuConfigSata { const_regex! { +QEMU_CONFIG_SCSI_PRODUCT_RE = r##"[A-Za-z0-9\-_\s]{,16}"##; QEMU_CONFIG_SCSI_SERIAL_RE = r##"^[-%a-zA-Z0-9_.!~*'()]*$"##; QEMU_CONFIG_SCSI_SIZE_RE = r##"^(\d+(\.\d+)?)([KMGT])?$"##; +QEMU_CONFIG_SCSI_VENDOR_RE = r##"[A-Za-z0-9\-_\s]{,8}"##; +QEMU_CONFIG_SCSI_WWN_RE = r##"(?^u:(?^:^(0x)[0-9a-fA-F]{16}))"##; } @@ -8121,6 +8261,7 @@ QEMU_CONFIG_SCSI_SIZE_RE = r##"^(\d+(\.\d+)?)([KMGT])?$"##; type: PveQmIdeMedia, }, product: { + format: &ApiStringFormat::Pattern(&QEMU_CONFIG_SCSI_PRODUCT_RE), optional: true, type: String, }, @@ -8169,6 +8310,7 @@ QEMU_CONFIG_SCSI_SIZE_RE = r##"^(\d+(\.\d+)?)([KMGT])?$"##; optional: true, }, vendor: { + format: &ApiStringFormat::Pattern(&QEMU_CONFIG_SCSI_VENDOR_RE), optional: true, type: String, }, @@ -8177,6 +8319,7 @@ QEMU_CONFIG_SCSI_SIZE_RE = r##"^(\d+(\.\d+)?)([KMGT])?$"##; type: PveQmIdeWerror, }, wwn: { + format: &ApiStringFormat::Pattern(&QEMU_CONFIG_SCSI_WWN_RE), optional: true, type: String, }, @@ -8533,6 +8676,7 @@ pub struct QemuConfigUnused { const_regex! { +QEMU_CONFIG_USB_HOST_RE = r##"(?^u:(?^:(?:(?:(?^:(0x)?([0-9A-Fa-f]{4}):(0x)?([0-9A-Fa-f]{4})))|(?:(?^:(\d+)\-(\d+(\.\d+)*)))|[Ss][Pp][Ii][Cc][Ee])))"##; QEMU_CONFIG_USB_MAPPING_RE = r##"^(?i:[a-z][a-z0-9_-]+)$"##; } @@ -8541,6 +8685,7 @@ QEMU_CONFIG_USB_MAPPING_RE = r##"^(?i:[a-z][a-z0-9_-]+)$"##; default_key: "host", properties: { host: { + format: &ApiStringFormat::Pattern(&QEMU_CONFIG_USB_HOST_RE), optional: true, type: String, }, @@ -10280,9 +10425,16 @@ pub enum SdnObjectState { serde_plain::derive_display_from_serialize!(SdnObjectState); serde_plain::derive_fromstr_from_deserialize!(SdnObjectState); +const_regex! { + +SDN_VNET_ALIAS_RE = r##"(?^u:(?^i:[\(\)-_.\w\d\s]{0,256}))"##; + +} + #[api( properties: { alias: { + format: &ApiStringFormat::Pattern(&SDN_VNET_ALIAS_RE), max_length: 256, optional: true, type: String, @@ -10372,9 +10524,16 @@ pub struct SdnVnet { pub zone: Option, } +const_regex! { + +SDN_VNET_PENDING_ALIAS_RE = r##"(?^u:(?^i:[\(\)-_.\w\d\s]{0,256}))"##; + +} + #[api( properties: { alias: { + format: &ApiStringFormat::Pattern(&SDN_VNET_PENDING_ALIAS_RE), max_length: 256, optional: true, type: String, @@ -11035,6 +11194,7 @@ pub struct StartLxc { const_regex! { START_QEMU_MIGRATEDFROM_RE = r##"^(?i:[a-z0-9](?i:[a-z0-9\-]*[a-z0-9])?)$"##; +START_QEMU_NETS_HOST_MTU_RE = r##"net\d+=\d+(,net\d+=\d+)*"##; } @@ -11064,6 +11224,7 @@ START_QEMU_MIGRATEDFROM_RE = r##"^(?i:[a-z0-9](?i:[a-z0-9\-]*[a-z0-9])?)$"##; type: StartQemuMigrationType, }, "nets-host-mtu": { + format: &ApiStringFormat::Pattern(&START_QEMU_NETS_HOST_MTU_RE), optional: true, type: String, }, @@ -11553,6 +11714,12 @@ pub struct TaskStatus { pub user: String, } +const_regex! { + +VERSION_RESPONSE_REPOID_RE = r##"[0-9a-fA-F]{8,64}"##; + +} + #[api( properties: { console: { @@ -11563,6 +11730,7 @@ pub struct TaskStatus { type: String, }, repoid: { + format: &ApiStringFormat::Pattern(&VERSION_RESPONSE_REPOID_RE), type: String, }, version: { -- 2.47.3 _______________________________________________ pdm-devel mailing list pdm-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pdm-devel