From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id D59511FF186 for ; Sat, 20 Sep 2025 20:27:33 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 3CEEE27692; Sat, 20 Sep 2025 20:27:49 +0200 (CEST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1758392859; x=1758997659; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ltrDhfh7Jq14wByRlO+dfrw+KXaTd6WdQuN3TRtyLig=; b=MV6s7LrrGMcKtDktQVJxB9umM2xrboxtImxMSaOHfsUnN5C+WDOHDh4CnBGdrk6uGI zbyS4+dfOhFKnTg4paToHuSrEZrqwYnnauCxRt9VrEUJUJvwavqxotCZ4+tpn7igynFI WgR8o92PgZ7DrQDTO6YTH498uItGo+1E6s2mAz93HmZYOV7+WtZcncnfbKOp5maAO4dt ghxmcrhorXMEVNG/WW6MP241boFDmwuLkuw5KReATACMSmBkCh70f9vT8vogpl9Y6hP5 h/Xixz8AWOdmKUxFZszX020Xybwb/FFRvo5uOK3xnFaM1qESpaONqbE6/S6cH4CETXiK 2y3g== X-Gm-Message-State: AOJu0Yw7eCax1C+pKPk13F9wGbD7owhT8A0yEyU+LTjAvwhx0w4ZoBLn G4hshTQd67TK3TVeEgtwtQaj31c1mKjrEQfvUHNU1Dvv2nYLMR82dwCvXSuW7jwtIBk= X-Gm-Gg: ASbGncu4zcoGTT72yf/QzFInTymE0/z3ONVhGopbsRRVMd86C+m3U8iTqnq1kFDL/4z Z1fiOXYjPpbPrmYxUARocWxcQe2gKsYuqizzZiKeIVRqQUn0l+e0BvsT9pxfEEjBz2BvTAjD0vy RL7yqTWLuWhf6yNKQ8uOkfI5W6QEj8odGOUmmF5/Gegt3Q2QchXZlnpNTHYTTKUNcOAH8n59jcG 0W1P6n84JyMQfMzB2PCsNTGov87lHZtHHuhA2LPiT68CzoOGvmfvMFS65OpeWDTwQvcafGe7TJD mgwmcCLXzL5dvz2tpb6O6KpkY1M6HS36zc0hDUF8+DsoAFRTq2pi+/bcpWtBsKKyDja2cBGx/Xx Hofm34MhIonbeQgdE4War1Lo3vupW7K7HHWXMohlv+u4ePTosDgokJNkBsdLb+NRZzdKrkkhrI1 ODLO9PS+KH/qYvgxWx6JZOcQJwwHlWgGMm5ENi7YTNCJcWtA== X-Google-Smtp-Source: AGHT+IEMW8I4nL/bAa85ZSQ4gR2XnTsxpLUAFJjiLWRLLO2oOFpZ36+p8aJIPTKzft+S1KRk+Ryopw== X-Received: by 2002:a05:690c:a058:b0:73b:bc38:28e with SMTP id 00721157ae682-73d1fb690bfmr55340647b3.2.1758392476348; Sat, 20 Sep 2025 11:21:16 -0700 (PDT) From: Thomas Skinner To: pve-devel@lists.proxmox.com Date: Sat, 20 Sep 2025 13:20:48 -0500 Message-ID: <20250920182050.1657928-3-thomas@atskinner.net> X-Mailer: git-send-email 2.47.2 In-Reply-To: <20250920182050.1657928-1-thomas@atskinner.net> References: <20250920182050.1657928-1-thomas@atskinner.net> MIME-Version: 1.0 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.009 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 FREEMAIL_FORGED_FROMDOMAIN 0.001 2nd level domains in From and EnvelopeFrom freemail headers are different FREEMAIL_FROM 0.001 Sender email is commonly abused enduser mail provider HEADER_FROM_DIFFERENT_DOMAINS 0.001 From and EnvelopeFrom 2nd level mail domains are different KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment RCVD_IN_DNSWL_NONE -0.0001 Sender listed at https://www.dnswl.org/, no trust RCVD_IN_MSPIKE_H2 0.001 Average reputation (+2) SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: [pve-devel] [PATCH manager v2 1/2] add api setter for node maintenance mode 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 Cc: Thomas Skinner Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pve-devel-bounces@lists.proxmox.com Sender: "pve-devel" Signed-off-by: Thomas Skinner --- PVE/API2/Nodes.pm | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/PVE/API2/Nodes.pm b/PVE/API2/Nodes.pm index 48898045..3f31ac6c 100644 --- a/PVE/API2/Nodes.pm +++ b/PVE/API2/Nodes.pm @@ -275,6 +275,7 @@ __PACKAGE__->register_method({ { name => 'hosts' }, { name => 'journal' }, { name => 'lxc' }, + { name => 'maintenance' }, { name => 'migrateall' }, { name => 'netstat' }, { name => 'network' }, @@ -2663,6 +2664,43 @@ __PACKAGE__->register_method({ }, }); +__PACKAGE__->register_method({ + name => 'maintenance_set', + protected => 1, + path => 'maintenance', + method => 'PUT', + description => + "Set the maintenance parameters for the node. Currently only supports HA maintenance mode for the LRM on a node.", + permissions => { + check => ['perm', '/', ['Sys.Console']], + }, + parameters => { + additionalProperties => 0, + properties => { + node => get_standard_option('pve-node'), + 'maintenance-mode' => { + description => "Enables or disabled maintenance mode for the HA LRM.", + type => 'string', + enum => ['enable', 'disable'], + }, + }, + }, + returns => { type => 'null' }, + code => sub { + my ($param) = @_; + + PVE::Cluster::check_node_exists($param->{node}); + + my $cmd = + $param->{'maintenance-mode'} eq 'enable' + ? 'enable-node-maintenance' + : 'disable-node-maintenance'; + PVE::HA::Config::queue_crm_commands("$cmd $param->{node}"); + + return undef; + }, +}); + # bash completion helper sub complete_templet_repo { -- 2.47.2 _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel