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 C0C731FF0BC for ; Thu, 29 Oct 2026 15:45:26 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 6F926216A5; Thu, 29 Oct 2026 15:44:43 +0100 (CET) From: Hannes Laimer To: pve-devel@lists.proxmox.com Subject: [PATCH pve-network v4 8/9] api: vnets: include the zone type in the vnet list Date: Thu, 29 Oct 2026 15:44:07 +0100 Message-ID: <20261029144408.2646288-9-h.laimer@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20261029144408.2646288-1-h.laimer@proxmox.com> References: <20261029144408.2646288-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: 1793285060315 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.351 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: 6ODFVG6RHD77MNRYLA4BEYJQYRHXLLMJ X-Message-ID-Hash: 6ODFVG6RHD77MNRYLA4BEYJQYRHXLLMJ 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 --- src/PVE/API2/Network/SDN/Vnets.pm | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/PVE/API2/Network/SDN/Vnets.pm b/src/PVE/API2/Network/SDN/Vnets.pm index f6516d02ca8e..6683573392b7 100644 --- a/src/PVE/API2/Network/SDN/Vnets.pm +++ b/src/PVE/API2/Network/SDN/Vnets.pm @@ -204,6 +204,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 => @@ -223,15 +229,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); @@ -241,6 +252,8 @@ __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); + $scfg->{'zone-type'} = $zone_cfg->{ids}->{$zoneid}->{type} + if $zone_cfg->{ids}->{$zoneid}; push @$res, $scfg; } -- 2.47.3