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 DB0B01FF13C for ; Thu, 11 Jun 2026 14:03:45 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 939A237BE; Thu, 11 Jun 2026 14:03:39 +0200 (CEST) From: Shannon Sterz To: pdm-devel@lists.proxmox.com Subject: [PATCH proxmox 05/17] pve-api-types: expose certificates info endpoint Date: Thu, 11 Jun 2026 14:03:15 +0200 Message-ID: <20260611120327.257523-6-s.sterz@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260611120327.257523-1-s.sterz@proxmox.com> References: <20260611120327.257523-1-s.sterz@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1781179364058 X-SPAM-LEVEL: Spam detection results: 0 AWL -0.041 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 Message-ID-Hash: AYIUKWYE22DS4QBL4OMEYYDJP7SCN2UM X-Message-ID-Hash: AYIUKWYE22DS4QBL4OMEYYDJP7SCN2UM X-MailFrom: s.sterz@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 Datacenter Manager development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: so the certificate information of a cluster node can be queried. Signed-off-by: Shannon Sterz --- pve-api-types/Cargo.toml | 1 + pve-api-types/generate.pl | 3 +++ pve-api-types/src/generated/code.rs | 15 ++++++++++++++- pve-api-types/src/types/mod.rs | 1 + 4 files changed, 19 insertions(+), 1 deletion(-) diff --git a/pve-api-types/Cargo.toml b/pve-api-types/Cargo.toml index a56cfef4..4b57f855 100644 --- a/pve-api-types/Cargo.toml +++ b/pve-api-types/Cargo.toml @@ -21,6 +21,7 @@ serde = { workspace = true, features = [ "derive" ] } serde_json.workspace = true serde_plain.workspace = true # +proxmox-acme-api.workspace = true proxmox-api-macro.workspace = true proxmox-apt-api-types.workspace = true proxmox-fixed-string.workspace = true diff --git a/pve-api-types/generate.pl b/pve-api-types/generate.pl index 6e987753..465bba68 100755 --- a/pve-api-types/generate.pl +++ b/pve-api-types/generate.pl @@ -723,6 +723,9 @@ api(POST => '/nodes/{node}/ceph/start', 'start_ceph_services', 'param-name' => ' api(POST => '/nodes/{node}/ceph/stop', 'stop_ceph_services', 'param-name' => 'StopCephServices', 'output-type' => 'PveUpid'); api(POST => '/nodes/{node}/ceph/restart', 'restart_ceph_services', 'param-name' => 'RestartCephServices', 'output-type' => 'PveUpid'); +# Certificates: Allow query a node's current certificates +api(GET => '/nodes/{node}/certificates/info', 'certificates_info', 'output-type' => 'Vec'); + # NOW DUMP THE CODE: # # We generate one file for API types, and one for API method calls. diff --git a/pve-api-types/src/generated/code.rs b/pve-api-types/src/generated/code.rs index c66df0d9..1b3484a8 100644 --- a/pve-api-types/src/generated/code.rs +++ b/pve-api-types/src/generated/code.rs @@ -157,7 +157,6 @@ /// - /nodes/{node}/certificates/acme /// - /nodes/{node}/certificates/acme/certificate /// - /nodes/{node}/certificates/custom -/// - /nodes/{node}/certificates/info /// - /nodes/{node}/disks /// - /nodes/{node}/disks/directory /// - /nodes/{node}/disks/directory/{name} @@ -350,6 +349,11 @@ pub trait PveClient { Err(Error::Other("ceph_osd_scrub not implemented")) } + /// Get information about node's certificates. + async fn certificates_info(&self, node: &str) -> Result, Error> { + Err(Error::Other("certificates_info not implemented")) + } + /// get the status of all ceph flags async fn cluster_ceph_flags(&self) -> Result, Error> { Err(Error::Other("cluster_ceph_flags not implemented")) @@ -1870,6 +1874,15 @@ where self.0.post(url, ¶ms).await?.nodata() } + /// Get information about node's certificates. + async fn certificates_info(&self, node: &str) -> Result, Error> { + let url = &format!( + "/api2/extjs/nodes/{}/certificates/info", + percent_encode(node.as_bytes(), percent_encoding::NON_ALPHANUMERIC) + ); + Ok(self.0.get(url).await?.expect_json()?.data) + } + /// get the status of all ceph flags async fn cluster_ceph_flags(&self) -> Result, Error> { let url = "/api2/extjs/cluster/ceph/flags"; diff --git a/pve-api-types/src/types/mod.rs b/pve-api-types/src/types/mod.rs index 22ded561..79016483 100644 --- a/pve-api-types/src/types/mod.rs +++ b/pve-api-types/src/types/mod.rs @@ -22,6 +22,7 @@ pub mod verifiers; use proxmox_fixed_string::FixedString; +pub use proxmox_acme_api::CertificateInfo; pub use proxmox_apt_api_types::APTRepositoriesResult; include!("../generated/types.rs"); -- 2.47.3