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 795B51FF16B for ; Fri, 26 Sep 2025 09:27:49 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 59D4E964A; Fri, 26 Sep 2025 09:28:22 +0200 (CEST) From: Dominik Csapak To: pdm-devel@lists.proxmox.com Date: Fri, 26 Sep 2025 09:20:22 +0200 Message-ID: <20250926072749.560801-3-d.csapak@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20250926072749.560801-1-d.csapak@proxmox.com> References: <20250926072749.560801-1-d.csapak@proxmox.com> MIME-Version: 1.0 X-SPAM-LEVEL: Spam detection results: 0 AWL -0.123 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 POISEN_SPAM_PILL 0.1 Meta: its spam POISEN_SPAM_PILL_1 0.1 random spam to be learned in bayes POISEN_SPAM_PILL_3 0.1 random spam to be learned in bayes SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [mod.rs] Subject: [pdm-devel] [PATCH datacenter-manager 02/11] server: api: pbs: add status api call X-BeenThere: pdm-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox Datacenter Manager development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox Datacenter Manager development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pdm-devel-bounces@lists.proxmox.com Sender: "pdm-devel" Corresponds to /nodes/localhost/status api call on the pbs side. Since we only have one node per PBS remote, we don't need to have a 'nodes' path here. Signed-off-by: Dominik Csapak --- server/src/api/pbs/mod.rs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/server/src/api/pbs/mod.rs b/server/src/api/pbs/mod.rs index 4473c6c8..1250c490 100644 --- a/server/src/api/pbs/mod.rs +++ b/server/src/api/pbs/mod.rs @@ -39,6 +39,7 @@ pub const MAIN_ROUTER: Router = Router::new() #[sortable] const REMOTE_SUBDIRS: SubdirMap = &sorted!([ + ("status", &Router::new().get(&API_METHOD_GET_STATUS)), ("rrddata", &rrddata::PBS_NODE_RRD_ROUTER), ("datastore", &DATASTORE_ROUTER) ]); @@ -233,3 +234,20 @@ pub async fn scan_remote_pbs( Ok(remote) } + +#[api( + input: { + properties: { + remote: { schema: REMOTE_ID_SCHEMA }, + }, + }, + access: { + permission: &Permission::Privilege(&["resource", "{remote}", "node", "{node}"], PRIV_RESOURCE_AUDIT, false), + }, +)] +/// Get status for the PBS remote +async fn get_status(remote: String) -> Result { + let (remotes, _) = pdm_config::remotes::config()?; + let remote = get_remote(&remotes, &remote)?; + Ok(connection::make_pbs_client(remote)?.node_status().await?) +} -- 2.47.3 _______________________________________________ pdm-devel mailing list pdm-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pdm-devel