public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Hannes Laimer <h.laimer@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [PATCH pve-network v5 8/9] api: vnets: include the zone type in the vnet list
Date: Thu, 29 Oct 2026 16:41:47 +0100	[thread overview]
Message-ID: <20261029154148.2882594-9-h.laimer@proxmox.com> (raw)
In-Reply-To: <20261029154148.2882594-1-h.laimer@proxmox.com>

Only vnets in EVPN zones can set the IPv6 Router Advertisement
options, and only their IPv6 subnets can set the prefix flags and
lifetimes. With the zone type on every entry, the list alone shows
which vnets and subnets take these options.

Signed-off-by: Hannes Laimer <h.laimer@proxmox.com>
---

Notes:
    v5:
     - the zone type follows a pending zone change

 src/PVE/API2/Network/SDN/Vnets.pm | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/src/PVE/API2/Network/SDN/Vnets.pm b/src/PVE/API2/Network/SDN/Vnets.pm
index 0bd027ec1c0d..756826b54068 100644
--- a/src/PVE/API2/Network/SDN/Vnets.pm
+++ b/src/PVE/API2/Network/SDN/Vnets.pm
@@ -160,6 +160,12 @@ __PACKAGE__->register_method({
                     optional => 0,
                     description => 'Name of the VNet.',
                 },
+                'zone-type' => {
+                    type => 'string',
+                    description => 'Type of the zone this VNet belongs to.',
+                    enum => PVE::Network::SDN::Zones::Plugin->lookup_types(),
+                    optional => 1,
+                },
                 pending => {
                     type => 'object',
                     description =>
@@ -179,15 +185,20 @@ __PACKAGE__->register_method({
         my $authuser = $rpcenv->get_user();
 
         my $cfg = {};
+        my $zone_cfg = {};
         if ($param->{pending}) {
             my $running_cfg = PVE::Network::SDN::running_config();
             my $config = PVE::Network::SDN::Vnets::config();
+            my $zone_config = PVE::Network::SDN::Zones::config();
             $cfg = PVE::Network::SDN::pending_config($running_cfg, $config, 'vnets');
+            $zone_cfg = PVE::Network::SDN::pending_config($running_cfg, $zone_config, 'zones');
         } elsif ($param->{running}) {
             my $running_cfg = PVE::Network::SDN::running_config();
             $cfg = $running_cfg->{vnets};
+            $zone_cfg = $running_cfg->{zones};
         } else {
             $cfg = PVE::Network::SDN::Vnets::config();
+            $zone_cfg = PVE::Network::SDN::Zones::config();
         }
 
         my @sids = PVE::Network::SDN::Vnets::sdn_vnets_ids($cfg);
@@ -197,6 +208,9 @@ __PACKAGE__->register_method({
             my $scfg = &$api_sdn_vnets_config($cfg, $id);
             my $zoneid = $scfg->{zone} // $scfg->{pending}->{zone};
             next if !$rpcenv->check_any($authuser, "/sdn/zones/$zoneid/$id", $privs, 1);
+            my $type_zoneid = $scfg->{pending}->{zone} // $zoneid;
+            $scfg->{'zone-type'} = $zone_cfg->{ids}->{$type_zoneid}->{type}
+                if $zone_cfg->{ids}->{$type_zoneid};
 
             push @$res, $scfg;
         }
-- 
2.47.3





  parent reply	other threads:[~2026-10-29 15:43 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-29 15:41 [PATCH docs/manager/network/proxmox{-perl-rs,-ve-rs} v5 0/9] add IPv6 RA / SLAAC support to EVPN zones Hannes Laimer
2026-10-29 15:41 ` [PATCH proxmox-perl-rs v5 1/9] pve-rs: sdn: add IPv6 RA builder binding Hannes Laimer
2026-10-29 15:41 ` [PATCH proxmox-ve-rs v5 2/9] frr: add IPv6 router advertisement support Hannes Laimer
2026-10-29 15:41 ` [PATCH proxmox-ve-rs v5 3/9] ve-config: sdn: add IPv6 router advertisement settings Hannes Laimer
2026-10-29 15:41 ` [PATCH pve-manager v5 4/9] ui: sdn: add IPv6 RA / SLAAC support Hannes Laimer
2026-10-29 15:41 ` [PATCH pve-network v5 5/9] sdn: evpn: derive IP version from CIDR for gateway-less subnets Hannes Laimer
2026-10-29 15:41 ` [PATCH pve-network v5 6/9] sdn: evpn: accept untracked IPv6 neighbor advertisements Hannes Laimer
2026-10-29 15:41 ` [PATCH pve-network v5 7/9] sdn: evpn: add IPv6 RA / SLAAC support Hannes Laimer
2026-10-29 15:41 ` Hannes Laimer [this message]
2026-10-29 15:41 ` [PATCH pve-docs v5 9/9] sdn: add IPv6 RA / SLAAC section Hannes Laimer
2026-10-30 15:07 ` [PATCH docs/manager/network/proxmox{-perl-rs,-ve-rs} v5 0/9] add IPv6 RA / SLAAC support to EVPN zones Lukas Sichert
2026-10-30 16:30   ` Lukas Sichert

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=20261029154148.2882594-9-h.laimer@proxmox.com \
    --to=h.laimer@proxmox.com \
    --cc=pve-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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal