public inbox for pdm-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pdm-devel] [PATCH datacenter-manager 0/2] support eligibility checking in the cli
@ 2025-12-15 16:21 Shannon Sterz
  2025-12-15 16:21 ` [pdm-devel] [PATCH datacenter-manager 1/2] cli: admin: add `support-eligibility` subcommand Shannon Sterz
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Shannon Sterz @ 2025-12-15 16:21 UTC (permalink / raw)
  To: pdm-devel

these two patches add commands for query and updating the enterprise
support eligibility status of pdm itself as well as updating it. it also
includes a patch to add such a command to the system report. for a
reasoning on why this naming was chosen see commit 1.

Shannon Sterz (2):
  cli: admin: add `support-eligibility` subcommand
  server: add the new `support-eligibility` subcommand to the report

 cli/admin/src/main.rs                |  2 +
 cli/admin/src/support_eligibility.rs | 66 ++++++++++++++++++++++++++++
 server/src/report.rs                 |  4 ++
 3 files changed, 72 insertions(+)
 create mode 100644 cli/admin/src/support_eligibility.rs

--
2.47.3



_______________________________________________
pdm-devel mailing list
pdm-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pdm-devel


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [pdm-devel] [PATCH datacenter-manager 1/2] cli: admin: add `support-eligibility` subcommand
  2025-12-15 16:21 [pdm-devel] [PATCH datacenter-manager 0/2] support eligibility checking in the cli Shannon Sterz
@ 2025-12-15 16:21 ` Shannon Sterz
  2025-12-15 16:21 ` [pdm-devel] [PATCH datacenter-manager 2/2] server: add the new `support-eligibility` subcommand to the report Shannon Sterz
  2025-12-16  8:14 ` [pdm-devel] [PATCH datacenter-manager 0/2] support eligibility checking in the cli Lukas Wagner
  2 siblings, 0 replies; 5+ messages in thread
From: Shannon Sterz @ 2025-12-15 16:21 UTC (permalink / raw)
  To: pdm-devel

add cli methods to allow updating and checking the subscription
information of pdm itself. before, the cli only had a cli method that
prints the subscription status for each remote without providing
information on whether the pdm host itself is eligible for support.

the term `support-eligiblity` for the subcommand was chosen over
`subscription`, because:

1. there are no subscriptions for pdm itself, only for the remotes it
is connected to. users may be confused that they can't set a
subscription here like they can with other proxmox products

2. avoid confusion with the `remote subscriptions` subcommand

Signed-off-by: Shannon Sterz <s.sterz@proxmox.com>
---
 cli/admin/src/main.rs                |  2 +
 cli/admin/src/support_eligibility.rs | 66 ++++++++++++++++++++++++++++
 2 files changed, 68 insertions(+)
 create mode 100644 cli/admin/src/support_eligibility.rs

diff --git a/cli/admin/src/main.rs b/cli/admin/src/main.rs
index e6a74df..f4cbc80 100644
--- a/cli/admin/src/main.rs
+++ b/cli/admin/src/main.rs
@@ -9,6 +9,7 @@ use proxmox_router::RpcEnvironment;
 use proxmox_schema::api;
 
 mod remotes;
+mod support_eligibility;
 
 fn main() {
     //pbs_tools::setup_libc_malloc_opts(); // TODO: move from PBS to proxmox-sys and uncomment
@@ -36,6 +37,7 @@ fn main() {
             "report",
             CliCommand::new(&API_METHOD_GENERATE_SYSTEM_REPORT),
         )
+        .insert("support-eligibility", support_eligibility::cli())
         .insert("versions", CliCommand::new(&API_METHOD_GET_VERSIONS));
 
     let mut rpcenv = CliEnvironment::new();
diff --git a/cli/admin/src/support_eligibility.rs b/cli/admin/src/support_eligibility.rs
new file mode 100644
index 0000000..0f2cfca
--- /dev/null
+++ b/cli/admin/src/support_eligibility.rs
@@ -0,0 +1,66 @@
+use serde_json::{json, Value};
+
+use proxmox_router::cli::{
+    format_and_print_result_full, get_output_format, CliCommand, CliCommandMap,
+    CommandLineInterface,
+};
+use proxmox_router::{ApiHandler, RpcEnvironment};
+use proxmox_schema::api;
+
+pub fn cli() -> CommandLineInterface {
+    CliCommandMap::new()
+        .insert("get", CliCommand::new(&API_METHOD_SUPPORT_ELIGIBILITY))
+        .insert(
+            "update",
+            CliCommand::new(&API_METHOD_UPDATE_SUPPORT_ELIGIBILITY),
+        )
+        .into()
+}
+
+#[api]
+/// Get the support eligibility information.
+async fn support_eligibility(
+    param: Value,
+    rpcenv: &mut dyn RpcEnvironment,
+) -> Result<(), anyhow::Error> {
+    let info = &server::api::nodes::subscription::API_METHOD_GET_SUBSCRIPTION;
+
+    let mut data = match info.handler {
+        ApiHandler::Async(handler) => (handler)(json!({}), info, rpcenv).await?,
+        _ => unreachable!(),
+    };
+
+    let output_format = get_output_format(&param);
+
+    format_and_print_result_full(
+        &mut data,
+        &info.returns,
+        &output_format,
+        &Default::default(),
+    );
+    Ok(())
+}
+
+#[api]
+/// Update the support eligibility information.
+async fn update_support_eligibility(
+    param: Value,
+    rpcenv: &mut dyn RpcEnvironment,
+) -> Result<(), anyhow::Error> {
+    let info = &server::api::nodes::subscription::API_METHOD_CHECK_SUBSCRIPTION;
+
+    let mut data = match info.handler {
+        ApiHandler::Async(handler) => (handler)(json!({}), info, rpcenv).await?,
+        _ => unreachable!(),
+    };
+
+    let output_format = get_output_format(&param);
+
+    format_and_print_result_full(
+        &mut data,
+        &info.returns,
+        &output_format,
+        &Default::default(),
+    );
+    Ok(())
+}
-- 
2.47.3



_______________________________________________
pdm-devel mailing list
pdm-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pdm-devel


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [pdm-devel] [PATCH datacenter-manager 2/2] server: add the new `support-eligibility` subcommand to the report
  2025-12-15 16:21 [pdm-devel] [PATCH datacenter-manager 0/2] support eligibility checking in the cli Shannon Sterz
  2025-12-15 16:21 ` [pdm-devel] [PATCH datacenter-manager 1/2] cli: admin: add `support-eligibility` subcommand Shannon Sterz
@ 2025-12-15 16:21 ` Shannon Sterz
  2025-12-16  8:14 ` [pdm-devel] [PATCH datacenter-manager 0/2] support eligibility checking in the cli Lukas Wagner
  2 siblings, 0 replies; 5+ messages in thread
From: Shannon Sterz @ 2025-12-15 16:21 UTC (permalink / raw)
  To: pdm-devel

Signed-off-by: Shannon Sterz <s.sterz@proxmox.com>
---
 server/src/report.rs | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/server/src/report.rs b/server/src/report.rs
index ae56444..9a52cd8 100644
--- a/server/src/report.rs
+++ b/server/src/report.rs
@@ -59,6 +59,10 @@ fn commands() -> Vec<(&'static str, Vec<&'static str>)> {
             "proxmox-datacenter-manager-admin",
             vec!["remote", "subscriptions"],
         ),
+        (
+            "proxmox-datacenter-manager-admin",
+            vec!["support-eligibility", "get"],
+        ),
         ("proxmox-boot-tool", vec!["status"]),
         ("df", vec!["-h", "-T"]),
         (
-- 
2.47.3



_______________________________________________
pdm-devel mailing list
pdm-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pdm-devel


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [pdm-devel] [PATCH datacenter-manager 0/2] support eligibility checking in the cli
  2025-12-15 16:21 [pdm-devel] [PATCH datacenter-manager 0/2] support eligibility checking in the cli Shannon Sterz
  2025-12-15 16:21 ` [pdm-devel] [PATCH datacenter-manager 1/2] cli: admin: add `support-eligibility` subcommand Shannon Sterz
  2025-12-15 16:21 ` [pdm-devel] [PATCH datacenter-manager 2/2] server: add the new `support-eligibility` subcommand to the report Shannon Sterz
@ 2025-12-16  8:14 ` Lukas Wagner
  2025-12-16  8:57   ` Maximiliano Sandoval
  2 siblings, 1 reply; 5+ messages in thread
From: Lukas Wagner @ 2025-12-16  8:14 UTC (permalink / raw)
  To: Proxmox Datacenter Manager development discussion, Shannon Sterz

On Mon Dec 15, 2025 at 5:21 PM CET, Shannon Sterz wrote:
> these two patches add commands for query and updating the enterprise
> support eligibility status of pdm itself as well as updating it. it also
> includes a patch to add such a command to the system report. for a
> reasoning on why this naming was chosen see commit 1.
>
> Shannon Sterz (2):
>   cli: admin: add `support-eligibility` subcommand
>   server: add the new `support-eligibility` subcommand to the report
>

Code looks good from what I can tell.

Maybe we should go with a simpler (albeit, more generic)
`support-status` command? 'eligibilty' could be a bit hard to
type/remember for some.

Reviewed-by: Lukas Wagner <l.wagner@proxmox.com>


_______________________________________________
pdm-devel mailing list
pdm-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pdm-devel


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [pdm-devel] [PATCH datacenter-manager 0/2] support eligibility checking in the cli
  2025-12-16  8:14 ` [pdm-devel] [PATCH datacenter-manager 0/2] support eligibility checking in the cli Lukas Wagner
@ 2025-12-16  8:57   ` Maximiliano Sandoval
  0 siblings, 0 replies; 5+ messages in thread
From: Maximiliano Sandoval @ 2025-12-16  8:57 UTC (permalink / raw)
  To: Lukas Wagner; +Cc: Proxmox Datacenter Manager development discussion

"Lukas Wagner" <l.wagner@proxmox.com> writes:

> On Mon Dec 15, 2025 at 5:21 PM CET, Shannon Sterz wrote:
>> these two patches add commands for query and updating the enterprise
>> support eligibility status of pdm itself as well as updating it. it also
>> includes a patch to add such a command to the system report. for a
>> reasoning on why this naming was chosen see commit 1.
>>
>> Shannon Sterz (2):
>>   cli: admin: add `support-eligibility` subcommand
>>   server: add the new `support-eligibility` subcommand to the report
>>
>
> Code looks good from what I can tell.
>
> Maybe we should go with a simpler (albeit, more generic)
> `support-status` command? 'eligibilty' could be a bit hard to
> type/remember for some.
>
> Reviewed-by: Lukas Wagner <l.wagner@proxmox.com>

Looks good to me.

I do agree that it might be a bit harder to type, but I guess one can
use auto-complete too.

Tested-by: Maximiliano Sandoval <m.sandoval@proxmox.com>

-- 
Maximiliano


_______________________________________________
pdm-devel mailing list
pdm-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pdm-devel


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2025-12-16  8:56 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-12-15 16:21 [pdm-devel] [PATCH datacenter-manager 0/2] support eligibility checking in the cli Shannon Sterz
2025-12-15 16:21 ` [pdm-devel] [PATCH datacenter-manager 1/2] cli: admin: add `support-eligibility` subcommand Shannon Sterz
2025-12-15 16:21 ` [pdm-devel] [PATCH datacenter-manager 2/2] server: add the new `support-eligibility` subcommand to the report Shannon Sterz
2025-12-16  8:14 ` [pdm-devel] [PATCH datacenter-manager 0/2] support eligibility checking in the cli Lukas Wagner
2025-12-16  8:57   ` Maximiliano Sandoval

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal