all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Stefan Hanreich <s.hanreich@proxmox.com>
To: pdm-devel@lists.proxmox.com
Subject: [pdm-devel] [PATCH proxmox 3/3] pve-api-types: regenerate
Date: Fri,  7 Nov 2025 09:59:23 +0100	[thread overview]
Message-ID: <20251107085934.118815-4-s.hanreich@proxmox.com> (raw)
In-Reply-To: <20251107085934.118815-1-s.hanreich@proxmox.com>

Signed-off-by: Stefan Hanreich <s.hanreich@proxmox.com>
---
 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<Vec<SdnVnetMacVrf>, 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<Vec<SdnZoneIpVrf>, Error> {
+        Err(Error::Other("get_zone_ip_vrf not implemented"))
+    }
+
     /// List available updates.
     async fn list_available_updates(&self, node: &str) -> Result<Vec<AptUpdateInfo>, 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<Vec<SdnVnetMacVrf>, 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<Vec<SdnZoneIpVrf>, 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<Vec<AptUpdateInfo>, 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<String>,
 }
 
+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<String>,
+
+    /// 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


  parent reply	other threads:[~2025-11-07  8:59 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-07  8:59 [pdm-devel] [PATCH proxmox{, -datacenter-manager} 0/8] Integration of IP-VRF and MAC-VRF status to EVPN panel Stefan Hanreich
2025-11-07  8:59 ` [pdm-devel] [PATCH proxmox 1/3] pve-api-types: add zone / vnet status reporting endpoints Stefan Hanreich
2025-11-07  8:59 ` [pdm-devel] [PATCH proxmox 2/3] pve-api-types: generate ip-vrf / mac-vrf endpoints Stefan Hanreich
2025-11-07  8:59 ` Stefan Hanreich [this message]
2025-11-07  8:59 ` [pdm-devel] [PATCH proxmox-datacenter-manager 1/5] server: api: sdn: add ip-vrf endpoint Stefan Hanreich
2025-11-07  8:59 ` [pdm-devel] [PATCH proxmox-datacenter-manager 2/5] server: api: sdn: add mac-vrf endpoint Stefan Hanreich
2025-11-07  8:59 ` [pdm-devel] [PATCH proxmox-datacenter-manager 3/5] ui: sdn: evpn: add zone status panel Stefan Hanreich
2025-11-07  8:59 ` [pdm-devel] [PATCH proxmox-datacenter-manager 4/5] ui: sdn: evpn: add vnet " Stefan Hanreich
2025-11-07  8:59 ` [pdm-devel] [PATCH proxmox-datacenter-manager 5/5] sdn: evpn: add detail panel to the evpn panel Stefan Hanreich
  -- strict thread matches above, loose matches on Subject: below --
2025-10-21 13:50 [pdm-devel] [PATCH proxmox{, -datacenter-manager} 0/4] generate Vec's for string-lists Hannes Laimer
2025-10-21 13:50 ` [pdm-devel] [PATCH proxmox 3/3] pve-api-types: regenerate Hannes Laimer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251107085934.118815-4-s.hanreich@proxmox.com \
    --to=s.hanreich@proxmox.com \
    --cc=pdm-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal