From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id 30DBE1FF17E for ; Thu, 30 Oct 2025 16:59:05 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id A2FF4474; Thu, 30 Oct 2025 16:59:28 +0100 (CET) From: Stefan Hanreich To: pve-devel@lists.proxmox.com Date: Thu, 30 Oct 2025 16:48:35 +0100 Message-ID: <20251030154851.540408-29-s.hanreich@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20251030154851.540408-1-s.hanreich@proxmox.com> References: <20251030154851.540408-1-s.hanreich@proxmox.com> MIME-Version: 1.0 X-SPAM-LEVEL: Spam detection results: 0 AWL -0.183 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 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: [pve-devel] [PATCH pve-manager 1/8] api: nodes: use new status module for sdn subdirectory X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox VE development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pve-devel-bounces@lists.proxmox.com Sender: "pve-devel" In order to avoid having to import every single new module for future status reporting, SDN now exposes a single module that is imported here. Also remove the legacy have_sdn guards here, since SDN is pre-installed for awhile and the guard therefore not needed anymore. Signed-off-by: Stefan Hanreich --- PVE/API2/Nodes.pm | 50 ++++++----------------------------------------- 1 file changed, 6 insertions(+), 44 deletions(-) diff --git a/PVE/API2/Nodes.pm b/PVE/API2/Nodes.pm index 4590b6186..08d9d1b51 100644 --- a/PVE/API2/Nodes.pm +++ b/PVE/API2/Nodes.pm @@ -49,6 +49,7 @@ use PVE::API2::Hardware; use PVE::API2::LXC::Status; use PVE::API2::LXC; use PVE::API2::Network; +use PVE::API2::Network::SDN::Nodes::Status; use PVE::API2::NodeConfig; use PVE::API2::Qemu::CPU; use PVE::API2::Qemu; @@ -60,12 +61,6 @@ use PVE::API2::Subscription; use PVE::API2::Tasks; use PVE::API2::VZDump; -my $have_sdn; -eval { - require PVE::API2::Network::SDN::Zones::Status; - $have_sdn = 1; -}; - use base qw(PVE::RESTHandler); my $verify_command_item_desc = { @@ -201,42 +196,10 @@ __PACKAGE__->register_method({ path => 'config', }); -if ($have_sdn) { - __PACKAGE__->register_method({ - subclass => "PVE::API2::Network::SDN::Zones::Status", - path => 'sdn/zones', - }); - - __PACKAGE__->register_method({ - name => 'sdnindex', - path => 'sdn', - method => 'GET', - permissions => { user => 'all' }, - description => "SDN index.", - parameters => { - additionalProperties => 0, - properties => { - node => get_standard_option('pve-node'), - }, - }, - returns => { - type => 'array', - items => { - type => "object", - properties => {}, - }, - links => [{ rel => 'child', href => "{name}" }], - }, - code => sub { - my ($param) = @_; - - my $result = [ - { name => 'zones' }, - ]; - return $result; - }, - }); -} +__PACKAGE__->register_method({ + subclass => "PVE::API2::Network::SDN::Nodes::Status", + path => 'sdn', +}); __PACKAGE__->register_method({ name => 'index', @@ -285,6 +248,7 @@ __PACKAGE__->register_method({ { name => 'rrd' }, # fixme: remove? { name => 'rrddata' }, { name => 'scan' }, + { name => 'sdn' }, { name => 'services' }, { name => 'spiceshell' }, { name => 'startall' }, @@ -303,8 +267,6 @@ __PACKAGE__->register_method({ { name => 'wakeonlan' }, ]; - push @$result, { name => 'sdn' } if $have_sdn; - return $result; }, }); -- 2.47.3 _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel