all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Lukas Wagner <l.wagner@proxmox.com>
To: pdm-devel@lists.proxmox.com
Subject: [pdm-devel] [PATCH proxmox-api-types 3/3] refresh bindings
Date: Tue,  2 Sep 2025 17:14:21 +0200	[thread overview]
Message-ID: <20250902151427.425017-5-l.wagner@proxmox.com> (raw)
In-Reply-To: <20250902151427.425017-1-l.wagner@proxmox.com>

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
---
 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<String>,
+    ) -> Result<String, Error> {
+        Err(Error::Other("get_package_changelog not implemented"))
+    }
+
     /// Read subscription info.
     async fn get_subscription(&self, node: &str) -> Result<NodeSubscriptionInfo, Error> {
         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<Vec<AptUpdateInfo>, Error> {
+        Err(Error::Other("list_available_updates not implemented"))
+    }
+
     /// Authentication domain index.
     async fn list_domains(&self) -> Result<Vec<ListRealm>, 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<PveUpid, Error> {
+        Err(Error::Other("update_apt_database not implemented"))
+    }
+
     /// API version details, including some parts of the global datacenter
     /// config.
     async fn version(&self) -> Result<VersionResponse, Error> {
@@ -724,6 +747,20 @@ where
         Ok(self.0.post(url, &params).await?.expect_json()?.data)
     }
 
+    /// Get package changelogs.
+    async fn get_package_changelog(
+        &self,
+        node: &str,
+        name: String,
+        version: Option<String>,
+    ) -> Result<String, Error> {
+        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<NodeSubscriptionInfo, Error> {
         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<Vec<AptUpdateInfo>, 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<Vec<ListRealm>, 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<PveUpid, Error> {
+        let url = &format!("/api2/extjs/nodes/{node}/apt/update");
+        Ok(self.0.post(url, &params).await?.expect_json()?.data)
+    }
+
     /// API version details, including some parts of the global datacenter
     /// config.
     async fn version(&self) -> Result<VersionResponse, Error> {
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<String>,
+
+    /// Old version currently installed.
+    #[serde(default, skip_serializing_if = "Option::is_none")]
+    #[serde(rename = "OldVersion")]
+    pub old_version: Option<String>,
+
+    /// 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<bool>,
+
+    /// 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<bool>,
+}
+
 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


  parent reply	other threads:[~2025-09-02 15:14 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-02 15:14 [pdm-devel] [PATCH manager/proxmox{-api-types, -yew-comp, -datacenter-manager} 00/10] PVE node update view Lukas Wagner
2025-09-02 15:14 ` [pdm-devel] [PATCH manager 1/1] api: apt: add JSON schema for 'list_updates' endpoint Lukas Wagner
2025-09-03  8:25   ` [pdm-devel] applied: " Thomas Lamprecht
2025-09-03  8:25     ` [pve-devel] applied: [pdm-devel] " Thomas Lamprecht
2025-09-02 15:14 ` [pdm-devel] [PATCH proxmox-api-types 1/3] Schema2Rust: fix handling of non-optional params Lukas Wagner
2025-09-03  8:57   ` [pdm-devel] applied: " Wolfgang Bumiller
2025-09-02 15:14 ` [pdm-devel] [PATCH proxmox-api-types 2/3] generate: add bindings for various APT functions Lukas Wagner
2025-09-03  8:58   ` [pdm-devel] applied: " Wolfgang Bumiller
2025-09-02 15:14 ` Lukas Wagner [this message]
2025-09-03  8:59   ` [pdm-devel] [PATCH proxmox-api-types 3/3] refresh bindings Wolfgang Bumiller
2025-09-02 15:14 ` [pdm-devel] [PATCH proxmox-yew-comp 1/2] apt view: allow to set task_base_url Lukas Wagner
2025-09-02 15:14 ` [pdm-devel] [PATCH proxmox-yew-comp 2/2] apt view: reload if base urls have changed Lukas Wagner
2025-09-02 15:14 ` [pdm-devel] [PATCH proxmox-datacenter-manager 1/4] server: add api for getting available updates/changelogs for remote nodes Lukas Wagner
2025-09-03  8:42   ` Lukas Wagner
2025-09-03  9:02   ` Stefan Hanreich
2025-09-03  9:19     ` Stefan Hanreich
2025-09-03  9:23     ` Lukas Wagner
2025-09-02 15:14 ` [pdm-devel] [PATCH proxmox-datacenter-manager 2/4] ui: pve: promote node.rs to dir-style module Lukas Wagner
2025-09-02 15:14 ` [pdm-devel] [PATCH proxmox-datacenter-manager 3/4] ui: pve: move node overview to a new overview tab Lukas Wagner
2025-09-03  9:10   ` Stefan Hanreich
2025-09-03  9:48     ` Lukas Wagner
2025-09-03  9:52       ` Stefan Hanreich
2025-09-03  9:55         ` Lukas Wagner
2025-09-02 15:14 ` [pdm-devel] [PATCH proxmox-datacenter-manager 4/4] ui: pve: node: add update tab Lukas Wagner
2025-09-03 10:20 ` [pdm-devel] [PATCH manager/proxmox{-api-types, -yew-comp, -datacenter-manager} 00/10] PVE node update view Stefan Hanreich
2025-09-03 11:43 ` [pdm-devel] superseded: " Lukas Wagner

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=20250902151427.425017-5-l.wagner@proxmox.com \
    --to=l.wagner@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.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal