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 152681FF16F for ; Tue, 2 Sep 2025 17:14:27 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id E9E1C184D6; Tue, 2 Sep 2025 17:14:37 +0200 (CEST) From: Lukas Wagner To: pdm-devel@lists.proxmox.com Date: Tue, 2 Sep 2025 17:14:21 +0200 Message-ID: <20250902151427.425017-5-l.wagner@proxmox.com> X-Mailer: git-send-email 2.47.2 In-Reply-To: <20250902151427.425017-1-l.wagner@proxmox.com> References: <20250902151427.425017-1-l.wagner@proxmox.com> MIME-Version: 1.0 X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1756826056920 X-SPAM-LEVEL: Spam detection results: 0 AWL -0.123 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 Subject: [pdm-devel] [PATCH proxmox-api-types 3/3] refresh bindings 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" Signed-off-by: Lukas Wagner --- pve-api-types/src/generated/code.rs | 58 +++++++++++++- pve-api-types/src/generated/types.rs | 108 +++++++++++++++++++++++++++ 2 files changed, 164 insertions(+), 2 deletions(-) diff --git a/pve-api-types/src/generated/code.rs b/pve-api-types/src/generated/code.rs index 1f34347..03ddcaa 100644 --- a/pve-api-types/src/generated/code.rs +++ b/pve-api-types/src/generated/code.rs @@ -144,9 +144,7 @@ /// - /nodes/{node} /// - /nodes/{node}/aplinfo /// - /nodes/{node}/apt -/// - /nodes/{node}/apt/changelog /// - /nodes/{node}/apt/repositories -/// - /nodes/{node}/apt/update /// - /nodes/{node}/apt/versions /// - /nodes/{node}/capabilities /// - /nodes/{node}/capabilities/qemu @@ -424,6 +422,16 @@ pub trait PveClient { Err(Error::Other("create_token not implemented")) } + /// Get package changelogs. + async fn get_package_changelog( + &self, + node: &str, + name: String, + version: Option, + ) -> Result { + Err(Error::Other("get_package_changelog not implemented")) + } + /// Read subscription info. async fn get_subscription(&self, node: &str) -> Result { Err(Error::Other("get_subscription not implemented")) @@ -455,6 +463,11 @@ pub trait PveClient { Err(Error::Other("get_task_status not implemented")) } + /// List available updates. + async fn list_available_updates(&self, node: &str) -> Result, Error> { + Err(Error::Other("list_available_updates not implemented")) + } + /// Authentication domain index. async fn list_domains(&self) -> Result, Error> { Err(Error::Other("list_domains not implemented")) @@ -659,6 +672,16 @@ pub trait PveClient { Err(Error::Other("stop_task not implemented")) } + /// This is used to resynchronize the package index files from their sources + /// (apt-get update). + async fn update_apt_database( + &self, + node: &str, + params: AptUpdateParams, + ) -> Result { + Err(Error::Other("update_apt_database not implemented")) + } + /// API version details, including some parts of the global datacenter /// config. async fn version(&self) -> Result { @@ -724,6 +747,20 @@ where Ok(self.0.post(url, ¶ms).await?.expect_json()?.data) } + /// Get package changelogs. + async fn get_package_changelog( + &self, + node: &str, + name: String, + version: Option, + ) -> Result { + let url = &ApiPathBuilder::new(format!("/api2/extjs/nodes/{node}/apt/changelog")) + .arg("name", &name) + .maybe_arg("version", &version) + .build(); + Ok(self.0.get(url).await?.expect_json()?.data) + } + /// Read subscription info. async fn get_subscription(&self, node: &str) -> Result { let url = &format!("/api2/extjs/nodes/{node}/subscription"); @@ -787,6 +824,12 @@ where Ok(self.0.get(url).await?.expect_json()?.data) } + /// List available updates. + async fn list_available_updates(&self, node: &str) -> Result, Error> { + let url = &format!("/api2/extjs/nodes/{node}/apt/update"); + Ok(self.0.get(url).await?.expect_json()?.data) + } + /// Authentication domain index. async fn list_domains(&self) -> Result, Error> { let url = "/api2/extjs/access/domains"; @@ -1032,6 +1075,17 @@ where self.0.delete(url).await?.nodata() } + /// This is used to resynchronize the package index files from their sources + /// (apt-get update). + async fn update_apt_database( + &self, + node: &str, + params: AptUpdateParams, + ) -> Result { + let url = &format!("/api2/extjs/nodes/{node}/apt/update"); + Ok(self.0.post(url, ¶ms).await?.expect_json()?.data) + } + /// API version details, including some parts of the global datacenter /// config. async fn version(&self) -> Result { diff --git a/pve-api-types/src/generated/types.rs b/pve-api-types/src/generated/types.rs index 35fa6cc..70b7b30 100644 --- a/pve-api-types/src/generated/types.rs +++ b/pve-api-types/src/generated/types.rs @@ -1,3 +1,111 @@ +#[api( + properties: { + Arch: { + type: String, + }, + Description: { + type: String, + }, + NotifyStatus: { + optional: true, + type: String, + }, + OldVersion: { + optional: true, + type: String, + }, + Origin: { + type: String, + }, + Package: { + type: String, + }, + Priority: { + type: String, + }, + Section: { + type: String, + }, + Title: { + type: String, + }, + Version: { + type: String, + }, + }, +)] +/// Object. +#[derive(Debug, serde::Deserialize, serde::Serialize)] +pub struct AptUpdateInfo { + /// Package Architecture. + #[serde(rename = "Arch")] + pub arch: String, + + /// Human-readable package description. + #[serde(rename = "Description")] + pub description: String, + + /// Version for which PVE has already sent a update notification for. + #[serde(default, skip_serializing_if = "Option::is_none")] + #[serde(rename = "NotifyStatus")] + pub notify_status: Option, + + /// Old version currently installed. + #[serde(default, skip_serializing_if = "Option::is_none")] + #[serde(rename = "OldVersion")] + pub old_version: Option, + + /// Package origin. + #[serde(rename = "Origin")] + pub origin: String, + + /// Package name. + #[serde(rename = "Package")] + pub package: String, + + /// Package priority in human-readable form. + #[serde(rename = "Priority")] + pub priority: String, + + /// Package section. + #[serde(rename = "Section")] + pub section: String, + + /// Package title. + #[serde(rename = "Title")] + pub title: String, + + /// New version to be updated to. + #[serde(rename = "Version")] + pub version: String, +} + +#[api( + properties: { + notify: { + default: false, + optional: true, + }, + quiet: { + default: false, + optional: true, + }, + }, +)] +/// Object. +#[derive(Debug, serde::Deserialize, serde::Serialize)] +pub struct AptUpdateParams { + /// Send notification about new packages. + #[serde(deserialize_with = "proxmox_serde::perl::deserialize_bool")] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub notify: Option, + + /// Only produces output suitable for logging, omitting progress indicators. + #[serde(deserialize_with = "proxmox_serde::perl::deserialize_bool")] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub quiet: Option, +} + const CLUSTER_RESOURCE_CONTENT: Schema = proxmox_schema::ArraySchema::new("list", &StorageContent::API_SCHEMA).schema(); -- 2.47.2 _______________________________________________ pdm-devel mailing list pdm-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pdm-devel