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 9737E1FF15C for ; Fri, 28 Nov 2025 11:19:01 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id BA6F4162EE; Fri, 28 Nov 2025 11:19:22 +0100 (CET) From: Dominik Csapak To: pdm-devel@lists.proxmox.com Date: Fri, 28 Nov 2025 11:18:20 +0100 Message-ID: <20251128101848.1580111-3-d.csapak@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20251128101848.1580111-1-d.csapak@proxmox.com> References: <20251128101848.1580111-1-d.csapak@proxmox.com> MIME-Version: 1.0 X-SPAM-LEVEL: Spam detection results: 0 AWL -1.120 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 KAM_MAILER 2 Automated Mailer Tag Left in Email 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 Subject: [pdm-devel] [PATCH proxmox 2/2] pve api types: add cluster options 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" so we can get e.g. the datacenter notes. The return schema for this is currently not defined and adding it in pve-manager is rather hard. The reason for this is that while we have defined the datacenter config schema for the update call, the properties are all property-strings. In the GET call however, we parse these and return a nested object. We'd either have to copy the whole schema and make sure it does not diverge, or find some more elegant way to modify the return schema to include the parsed properties (for some properties this even happens nested, e.g. a list in a property string gets split into an actual array). Since this is not feasible at the moment, the easiest way is to simply use a Value for now. Signed-off-by: Dominik Csapak --- pve-api-types/generate.pl | 3 +++ pve-api-types/src/generated/code.rs | 14 +++++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/pve-api-types/generate.pl b/pve-api-types/generate.pl index 2caf1cff..8d509856 100755 --- a/pve-api-types/generate.pl +++ b/pve-api-types/generate.pl @@ -395,6 +395,9 @@ Schema2Rust::register_format('pve-fw-conntrack-helper' => { }); # options +# FIXME: to use a better return value than `Value`, we first must fix the return schema there +api(GET => '/cluster/options', 'cluster_options', 'output-type' => 'serde_json::Value'); + api(GET => '/cluster/firewall/options', 'cluster_firewall_options', 'return-name' => 'ClusterFirewallOptions'); api(PUT => '/cluster/firewall/options', 'set_cluster_firewall_options', 'param-name' => 'UpdateClusterFirewallOptions'); diff --git a/pve-api-types/src/generated/code.rs b/pve-api-types/src/generated/code.rs index 0dd6d8e1..ae86c93c 100644 --- a/pve-api-types/src/generated/code.rs +++ b/pve-api-types/src/generated/code.rs @@ -114,7 +114,6 @@ /// - /cluster/notifications/targets /// - /cluster/notifications/targets/{name} /// - /cluster/notifications/targets/{name}/test -/// - /cluster/options /// - /cluster/replication /// - /cluster/replication/{id} /// - /cluster/sdn/controllers/{controller} @@ -403,6 +402,12 @@ pub trait PveClient { Err(Error::Other("cluster_metrics_export not implemented")) } + /// Get datacenter options. Without 'Sys.Audit' on '/' not all options are + /// returned. + async fn cluster_options(&self) -> Result { + Err(Error::Other("cluster_options not implemented")) + } + /// Resources index (cluster wide). async fn cluster_resources( &self, @@ -1009,6 +1014,13 @@ where Ok(self.0.get(url).await?.expect_json()?.data) } + /// Get datacenter options. Without 'Sys.Audit' on '/' not all options are + /// returned. + async fn cluster_options(&self) -> Result { + let url = "/api2/extjs/cluster/options"; + Ok(self.0.get(url).await?.expect_json()?.data) + } + /// Resources index (cluster wide). async fn cluster_resources( &self, -- 2.47.3 _______________________________________________ pdm-devel mailing list pdm-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pdm-devel