From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id 875441FF1D4 for ; Fri, 7 Nov 2025 09:59:27 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id BA6E5BA8B; Fri, 7 Nov 2025 10:00:09 +0100 (CET) From: Stefan Hanreich To: pdm-devel@lists.proxmox.com Date: Fri, 7 Nov 2025 09:59:23 +0100 Message-ID: <20251107085934.118815-4-s.hanreich@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20251107085934.118815-1-s.hanreich@proxmox.com> References: <20251107085934.118815-1-s.hanreich@proxmox.com> MIME-Version: 1.0 X-SPAM-LEVEL: Spam detection results: 0 AWL -0.330 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 KAM_LAZY_DOMAIN_SECURITY 1 Sending domain does not have any anti-forgery methods POISEN_SPAM_PILL 0.1 Meta: its spam POISEN_SPAM_PILL_1 0.1 random spam to be learned in bayes POISEN_SPAM_PILL_3 0.1 random spam to be learned in bayes RDNS_NONE 0.793 Delivered to internal network by a host with no rDNS SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_NONE 0.001 SPF: sender does not publish an SPF Record Subject: [pdm-devel] [PATCH proxmox 3/3] 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: Stefan Hanreich --- pve-api-types/src/generated/code.rs | 25 +++++++ pve-api-types/src/generated/types.rs | 104 +++++++++++++++++++++++---- 2 files changed, 116 insertions(+), 13 deletions(-) diff --git a/pve-api-types/src/generated/code.rs b/pve-api-types/src/generated/code.rs index 07728f3f..0f73aa97 100644 --- a/pve-api-types/src/generated/code.rs +++ b/pve-api-types/src/generated/code.rs @@ -329,8 +329,11 @@ /// - /nodes/{node}/scan/pbs /// - /nodes/{node}/scan/zfs /// - /nodes/{node}/sdn +/// - /nodes/{node}/sdn/vnets +/// - /nodes/{node}/sdn/vnets/{vnet} /// - /nodes/{node}/sdn/zones /// - /nodes/{node}/sdn/zones/{zone} +/// - /nodes/{node}/sdn/zones/{zone}/bridges /// - /nodes/{node}/sdn/zones/{zone}/content /// - /nodes/{node}/services /// - /nodes/{node}/services/{service} @@ -472,6 +475,16 @@ pub trait PveClient { Err(Error::Other("get_task_status not implemented")) } + /// Get the MAC VRF for a VNet in an EVPN zone. + async fn get_vnet_mac_vrf(&self, node: &str, vnet: &str) -> Result, Error> { + Err(Error::Other("get_vnet_mac_vrf not implemented")) + } + + /// Get the IP VRF of an EVPN zone. + async fn get_zone_ip_vrf(&self, node: &str, zone: &str) -> Result, Error> { + Err(Error::Other("get_zone_ip_vrf not implemented")) + } + /// List available updates. async fn list_available_updates(&self, node: &str) -> Result, Error> { Err(Error::Other("list_available_updates not implemented")) @@ -974,6 +987,18 @@ where Ok(self.0.get(url).await?.expect_json()?.data) } + /// Get the MAC VRF for a VNet in an EVPN zone. + async fn get_vnet_mac_vrf(&self, node: &str, vnet: &str) -> Result, Error> { + let url = &format!("/api2/extjs/nodes/{node}/sdn/vnets/{vnet}/mac-vrf"); + Ok(self.0.get(url).await?.expect_json()?.data) + } + + /// Get the IP VRF of an EVPN zone. + async fn get_zone_ip_vrf(&self, node: &str, zone: &str) -> Result, Error> { + let url = &format!("/api2/extjs/nodes/{node}/sdn/zones/{zone}/ip-vrf"); + Ok(self.0.get(url).await?.expect_json()?.data) + } + /// List available updates. async fn list_available_updates(&self, node: &str) -> Result, Error> { let url = &format!("/api2/extjs/nodes/{node}/apt/update"); diff --git a/pve-api-types/src/generated/types.rs b/pve-api-types/src/generated/types.rs index 6c42b620..5d55168f 100644 --- a/pve-api-types/src/generated/types.rs +++ b/pve-api-types/src/generated/types.rs @@ -11920,6 +11920,46 @@ pub struct SdnVnet { pub zone: Option, } +const_regex! { + +SDN_VNET_MAC_VRF_MAC_RE = r##"^(?i)[a-f0-9][02468ace](?::[a-f0-9]{2}){5}$"##; + +} + +#[test] +fn test_regex_compilation_31() { + use regex::Regex; + let _: &Regex = &SDN_VNET_MAC_VRF_MAC_RE; +} +#[api( + properties: { + ip: { + format: &ApiStringFormat::VerifyFn(verifiers::verify_ip), + type: String, + }, + mac: { + format: &ApiStringFormat::Pattern(&SDN_VNET_MAC_VRF_MAC_RE), + type: String, + }, + nexthop: { + format: &ApiStringFormat::VerifyFn(verifiers::verify_ip), + type: String, + }, + }, +)] +/// Object. +#[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)] +pub struct SdnVnetMacVrf { + /// The IP address of the MAC VRF entry. + pub ip: String, + + /// The MAC address of the MAC VRF entry. + pub mac: String, + + /// The IP address of the nexthop. + pub nexthop: String, +} + #[api( properties: { alias: { @@ -11996,7 +12036,7 @@ SDN_ZONE_EXITNODES_PRIMARY_RE = r##"^(?i:[a-z0-9](?i:[a-z0-9\-]*[a-z0-9])?)$"##; } #[test] -fn test_regex_compilation_31() { +fn test_regex_compilation_32() { use regex::Regex; let _: &Regex = &SDN_ZONE_EXITNODES_RE; let _: &Regex = &SDN_ZONE_EXITNODES_PRIMARY_RE; @@ -12262,6 +12302,44 @@ pub enum SdnZoneDhcp { serde_plain::derive_display_from_serialize!(SdnZoneDhcp); serde_plain::derive_fromstr_from_deserialize!(SdnZoneDhcp); +#[api( + properties: { + ip: { + format: &ApiStringFormat::VerifyFn(verifiers::verify_cidr), + type: String, + }, + metric: { + type: Integer, + }, + nexthops: { + items: { + description: "the interface name or ip address of the next hop", + type: String, + }, + type: Array, + }, + protocol: { + type: String, + }, + }, +)] +/// Object. +#[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)] +pub struct SdnZoneIpVrf { + /// The CIDR of the route table entry. + pub ip: String, + + /// This route's metric. + #[serde(deserialize_with = "proxmox_serde::perl::deserialize_i64")] + pub metric: i64, + + /// A list of nexthops for the route table entry. + pub nexthops: Vec, + + /// The protocol where this route was learned from (e.g. BGP). + pub protocol: String, +} + const_regex! { SDN_ZONE_PENDING_EXITNODES_RE = r##"^(?i:[a-z0-9](?i:[a-z0-9\-]*[a-z0-9])?)$"##; @@ -12270,7 +12348,7 @@ SDN_ZONE_PENDING_EXITNODES_PRIMARY_RE = r##"^(?i:[a-z0-9](?i:[a-z0-9\-]*[a-z0-9] } #[test] -fn test_regex_compilation_32() { +fn test_regex_compilation_33() { use regex::Regex; let _: &Regex = &SDN_ZONE_PENDING_EXITNODES_RE; let _: &Regex = &SDN_ZONE_PENDING_EXITNODES_PRIMARY_RE; @@ -12600,7 +12678,7 @@ START_QEMU_TARGETSTORAGE_RE = r##"^(?i:[a-z][a-z0-9\-_.]*[a-z0-9]):(?i:[a-z][a-z } #[test] -fn test_regex_compilation_33() { +fn test_regex_compilation_34() { use regex::Regex; let _: &Regex = &START_QEMU_MIGRATEDFROM_RE; let _: &Regex = &START_QEMU_TARGETSTORAGE_RE; @@ -12771,7 +12849,7 @@ STOP_QEMU_MIGRATEDFROM_RE = r##"^(?i:[a-z0-9](?i:[a-z0-9\-]*[a-z0-9])?)$"##; } #[test] -fn test_regex_compilation_34() { +fn test_regex_compilation_35() { use regex::Regex; let _: &Regex = &STOP_QEMU_MIGRATEDFROM_RE; } @@ -12870,7 +12948,7 @@ STORAGE_INFO_STORAGE_RE = r##"^(?i:[a-z][a-z0-9\-_.]*[a-z0-9])$"##; } #[test] -fn test_regex_compilation_35() { +fn test_regex_compilation_36() { use regex::Regex; let _: &Regex = &STORAGE_INFO_STORAGE_RE; } @@ -13209,7 +13287,7 @@ UPDATE_QEMU_CONFIG_VMSTATESTORAGE_RE = r##"^(?i:[a-z][a-z0-9\-_.]*[a-z0-9])$"##; } #[test] -fn test_regex_compilation_36() { +fn test_regex_compilation_37() { use regex::Regex; let _: &Regex = &UPDATE_QEMU_CONFIG_AFFINITY_RE; let _: &Regex = &UPDATE_QEMU_CONFIG_BOOTDISK_RE; @@ -14100,7 +14178,7 @@ UPDATE_QEMU_CONFIG_ASYNC_VMSTATESTORAGE_RE = r##"^(?i:[a-z][a-z0-9\-_.]*[a-z0-9] } #[test] -fn test_regex_compilation_37() { +fn test_regex_compilation_38() { use regex::Regex; let _: &Regex = &UPDATE_QEMU_CONFIG_ASYNC_AFFINITY_RE; let _: &Regex = &UPDATE_QEMU_CONFIG_ASYNC_BOOTDISK_RE; @@ -14969,7 +15047,7 @@ UPDATE_QEMU_CONFIG_EFIDISK0_SIZE_RE = r##"^(\d+(\.\d+)?)([KMGT])?$"##; } #[test] -fn test_regex_compilation_38() { +fn test_regex_compilation_39() { use regex::Regex; let _: &Regex = &UPDATE_QEMU_CONFIG_EFIDISK0_SIZE_RE; } @@ -15046,7 +15124,7 @@ UPDATE_QEMU_CONFIG_IDE_SIZE_RE = r##"^(\d+(\.\d+)?)([KMGT])?$"##; } #[test] -fn test_regex_compilation_39() { +fn test_regex_compilation_40() { use regex::Regex; let _: &Regex = &UPDATE_QEMU_CONFIG_IDE_MODEL_RE; let _: &Regex = &UPDATE_QEMU_CONFIG_IDE_SERIAL_RE; @@ -15402,7 +15480,7 @@ UPDATE_QEMU_CONFIG_SATA_SIZE_RE = r##"^(\d+(\.\d+)?)([KMGT])?$"##; } #[test] -fn test_regex_compilation_40() { +fn test_regex_compilation_41() { use regex::Regex; let _: &Regex = &UPDATE_QEMU_CONFIG_SATA_SERIAL_RE; let _: &Regex = &UPDATE_QEMU_CONFIG_SATA_SIZE_RE; @@ -15747,7 +15825,7 @@ UPDATE_QEMU_CONFIG_SCSI_SIZE_RE = r##"^(\d+(\.\d+)?)([KMGT])?$"##; } #[test] -fn test_regex_compilation_41() { +fn test_regex_compilation_42() { use regex::Regex; let _: &Regex = &UPDATE_QEMU_CONFIG_SCSI_SERIAL_RE; let _: &Regex = &UPDATE_QEMU_CONFIG_SCSI_SIZE_RE; @@ -16147,7 +16225,7 @@ UPDATE_QEMU_CONFIG_TPMSTATE0_SIZE_RE = r##"^(\d+(\.\d+)?)([KMGT])?$"##; } #[test] -fn test_regex_compilation_42() { +fn test_regex_compilation_43() { use regex::Regex; let _: &Regex = &UPDATE_QEMU_CONFIG_TPMSTATE0_SIZE_RE; } @@ -16203,7 +16281,7 @@ UPDATE_QEMU_CONFIG_VIRTIO_SIZE_RE = r##"^(\d+(\.\d+)?)([KMGT])?$"##; } #[test] -fn test_regex_compilation_43() { +fn test_regex_compilation_44() { use regex::Regex; let _: &Regex = &UPDATE_QEMU_CONFIG_VIRTIO_SERIAL_RE; let _: &Regex = &UPDATE_QEMU_CONFIG_VIRTIO_SIZE_RE; -- 2.47.3 _______________________________________________ pdm-devel mailing list pdm-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pdm-devel