From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [45.144.208.40]) by lore.proxmox.com (Postfix) with ESMTPS id BAC061FF0ED for ; Fri, 31 Jul 2026 11:17:10 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 6A07221562; Fri, 31 Jul 2026 11:17:03 +0200 (CEST) From: Shannon Sterz To: pdm-devel@lists.proxmox.com Subject: [PATCH proxmox 04/15] pve-api-types: expose certificates info endpoint Date: Fri, 31 Jul 2026 11:16:44 +0200 Message-ID: <20260731091655.93282-5-s.sterz@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260731091655.93282-1-s.sterz@proxmox.com> References: <20260731091655.93282-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: 1785489407956 X-SPAM-LEVEL: Spam detection results: 1 AWL -1.502 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) 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 RCVD_IN_DNSWL_LOW -0.7 Sender listed at https://www.dnswl.org/, low trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record URIBL_BLACK 3 Contains an URL listed in the URIBL blacklist [types.rs] Message-ID-Hash: ZDXGICGATY6GP6KCHXCON5GZXZNGJNTH X-Message-ID-Hash: ZDXGICGATY6GP6KCHXCON5GZXZNGJNTH 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 1caeca5c..fc553ce7 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 927c822b..25ed919e 100755 --- a/pve-api-types/generate.pl +++ b/pve-api-types/generate.pl @@ -753,6 +753,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 23b729c1..0c155ae8 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} @@ -346,6 +345,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")) @@ -1901,6 +1905,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