From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [IPv6:2a0f:8001:1:32::40]) by lore.proxmox.com (Postfix) with ESMTPS id 40F231FF0BC for ; Thu, 29 Oct 2026 16:43:06 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 3B40421678; Thu, 29 Oct 2026 16:42:26 +0100 (CET) From: Hannes Laimer 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 Message-ID: <20261029154148.2882594-9-h.laimer@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20261029154148.2882594-1-h.laimer@proxmox.com> References: <20261029154148.2882594-1-h.laimer@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1793288523854 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.366 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: 4DKOOALVTKYSYCFZFQJSMD7BHZAMKTWX X-Message-ID-Hash: 4DKOOALVTKYSYCFZFQJSMD7BHZAMKTWX X-MailFrom: h.laimer@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: 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 --- 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