From: Shannon Sterz <s.sterz@proxmox.com>
To: pdm-devel@lists.proxmox.com
Subject: [PATCH proxmox v2 05/16] pve-api-types: expose certificates info endpoint
Date: Wed, 5 Aug 2026 15:18:28 +0200 [thread overview]
Message-ID: <20260805131838.254723-7-s.sterz@proxmox.com> (raw)
In-Reply-To: <20260805131838.254723-2-s.sterz@proxmox.com>
so the certificate information of a cluster node can be queried.
Signed-off-by: Shannon Sterz <s.sterz@proxmox.com>
---
pve-api-types/Cargo.toml | 1 +
pve-api-types/debian/control | 2 ++
pve-api-types/generate.pl | 3 +++
pve-api-types/src/generated/code.rs | 15 ++++++++++++++-
pve-api-types/src/types/mod.rs | 1 +
5 files changed, 21 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/debian/control b/pve-api-types/debian/control
index cbb36af5..479a13f9 100644
--- a/pve-api-types/debian/control
+++ b/pve-api-types/debian/control
@@ -8,6 +8,7 @@ Build-Depends-Arch: cargo:native <!nocheck>,
libstd-rust-dev <!nocheck>,
librust-anyhow-1+default-dev <!nocheck>,
librust-async-trait-0.1+default-dev <!nocheck>,
+ librust-proxmox-acme-api-1+default-dev (>= 1.0.2-~~) <!nocheck>,
librust-proxmox-api-macro-1+default-dev (>= 1.5.0-~~) <!nocheck>,
librust-proxmox-apt-api-types-3+default-dev <!nocheck>,
librust-proxmox-fixed-string-0.1+default-dev <!nocheck>,
@@ -36,6 +37,7 @@ Depends:
${misc:Depends},
librust-anyhow-1+default-dev,
librust-async-trait-0.1+default-dev,
+ librust-proxmox-acme-api-1+default-dev (>= 1.0.2-~~),
librust-proxmox-api-macro-1+default-dev (>= 1.5.0-~~),
librust-proxmox-apt-api-types-3+default-dev,
librust-proxmox-fixed-string-0.1+default-dev,
diff --git a/pve-api-types/generate.pl b/pve-api-types/generate.pl
index 927c822b..f7550e8c 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: Allows querying a node's current certificates.
+api(GET => '/nodes/{node}/certificates/info', 'certificates_info', 'output-type' => 'Vec<CertificateInfo>');
+
# 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<Vec<CertificateInfo>, Error> {
+ Err(Error::Other("certificates_info not implemented"))
+ }
+
/// get the status of all ceph flags
async fn cluster_ceph_flags(&self) -> Result<Vec<CephFlagInfo>, 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<Vec<CertificateInfo>, 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<Vec<CephFlagInfo>, 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
next prev parent reply other threads:[~2026-08-05 13:19 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-05 13:18 [PATCH cluster/common/datacenter-manager/manager/proxmox v2 00/16] TLS Certificate Staging Shannon Sterz
2026-08-05 13:18 ` [PATCH cluster v2 01/16] setup: allow caller to provide the certificate filename Shannon Sterz
2026-08-05 13:18 ` [PATCH pve-common v2 02/16] certificate: add helper to verify that a certificate was signed by a ca Shannon Sterz
2026-08-05 13:18 ` [PATCH manager v2 03/16] bin/api: add a new staged certificate when renewing self-signed cert Shannon Sterz
2026-08-05 13:18 ` [PATCH manager v2 04/16] api: certificates: if node parameter is 'localhost' return local certs Shannon Sterz
2026-08-05 13:18 ` Shannon Sterz [this message]
2026-08-05 13:18 ` [PATCH datacenter-manager v2 06/16] client: allow users to update a changed fingerprint interactively Shannon Sterz
2026-08-05 13:18 ` [PATCH datacenter-manager v2 07/16] cli/api-types: move Fingerprint to common api type crate Shannon Sterz
2026-08-05 13:18 ` [PATCH datacenter-manager v2 08/16] server: connection: report mismatching fingerprint as untrusted on probe Shannon Sterz
2026-08-05 13:18 ` [PATCH datacenter-manager v2 09/16] ui: wizard: add context if a provided fingerprint did not match remote Shannon Sterz
2026-08-05 13:18 ` [PATCH datacenter-manager v2 10/16] ui: wizard: nodes page: always update fingerprints on user confirmation Shannon Sterz
2026-08-05 13:18 ` [PATCH datacenter-manager v2 11/16] pdm-api-types: implement ApiType for Fingerprint Shannon Sterz
2026-08-05 13:18 ` [PATCH datacenter-manager v2 12/16] pdm-api-types: add staged_fingerprints field to NodeUrl Shannon Sterz
2026-08-05 13:18 ` [PATCH datacenter-manager v2 13/16] server: remotes: lock remotes config when updating it Shannon Sterz
2026-08-05 13:18 ` [PATCH datacenter-manager v2 14/16] server: connection: rotate in staged fingerprints when encountering them Shannon Sterz
2026-08-05 13:18 ` [PATCH datacenter-manager v2 15/16] server: api: tasks: move `spawn_aborted_on_shutdown()` to super module Shannon Sterz
2026-08-05 13:18 ` [PATCH datacenter-manager v2 16/16] server: bin: api: tasks: add task to discover new staged certificates Shannon Sterz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260805131838.254723-7-s.sterz@proxmox.com \
--to=s.sterz@proxmox.com \
--cc=pdm-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.