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 3/4] make refresh
Date: Thu, 27 Nov 2025 11:44:32 +0100	[thread overview]
Message-ID: <20251127104447.162951-4-l.wagner@proxmox.com> (raw)
In-Reply-To: <20251127104447.162951-1-l.wagner@proxmox.com>

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
---
 pve-api-types/src/generated/code.rs  |  24 ++++-
 pve-api-types/src/generated/types.rs | 128 +++++++++++++++++++++++++++
 2 files changed, 150 insertions(+), 2 deletions(-)

diff --git a/pve-api-types/src/generated/code.rs b/pve-api-types/src/generated/code.rs
index d2b53f29..b0fb03a1 100644
--- a/pve-api-types/src/generated/code.rs
+++ b/pve-api-types/src/generated/code.rs
@@ -145,8 +145,6 @@
 /// - /nodes/{node}
 /// - /nodes/{node}/aplinfo
 /// - /nodes/{node}/apt
-/// - /nodes/{node}/apt/repositories
-/// - /nodes/{node}/apt/versions
 /// - /nodes/{node}/capabilities
 /// - /nodes/{node}/capabilities/qemu
 /// - /nodes/{node}/capabilities/qemu/cpu-flags
@@ -448,6 +446,11 @@ pub trait PveClient {
         Err(Error::Other("create_zone not implemented"))
     }
 
+    /// Get APT repository information.
+    async fn get_apt_repositories(&self, node: &str) -> Result<APTRepositoriesResult, Error> {
+        Err(Error::Other("get_apt_repositories not implemented"))
+    }
+
     /// Get package changelogs.
     async fn get_package_changelog(
         &self,
@@ -458,6 +461,11 @@ pub trait PveClient {
         Err(Error::Other("get_package_changelog not implemented"))
     }
 
+    /// Get package information for important Proxmox packages.
+    async fn get_package_versions(&self, node: &str) -> Result<Vec<InstalledPackage>, Error> {
+        Err(Error::Other("get_package_versions not implemented"))
+    }
+
     /// Read subscription info.
     async fn get_subscription(&self, node: &str) -> Result<NodeSubscriptionInfo, Error> {
         Err(Error::Other("get_subscription not implemented"))
@@ -949,6 +957,12 @@ where
         self.0.post(url, &params).await?.nodata()
     }
 
+    /// Get APT repository information.
+    async fn get_apt_repositories(&self, node: &str) -> Result<APTRepositoriesResult, Error> {
+        let url = &format!("/api2/extjs/nodes/{node}/apt/repositories");
+        Ok(self.0.get(url).await?.expect_json()?.data)
+    }
+
     /// Get package changelogs.
     async fn get_package_changelog(
         &self,
@@ -963,6 +977,12 @@ where
         Ok(self.0.get(url).await?.expect_json()?.data)
     }
 
+    /// Get package information for important Proxmox packages.
+    async fn get_package_versions(&self, node: &str) -> Result<Vec<InstalledPackage>, Error> {
+        let url = &format!("/api2/extjs/nodes/{node}/apt/versions");
+        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");
diff --git a/pve-api-types/src/generated/types.rs b/pve-api-types/src/generated/types.rs
index 740b3ca5..bde1e464 100644
--- a/pve-api-types/src/generated/types.rs
+++ b/pve-api-types/src/generated/types.rs
@@ -1719,6 +1719,134 @@ pub struct CreateZone {
     pub zone: String,
 }
 
+#[api(
+    properties: {
+        Arch: {
+            type: AptUpdateInfoArch,
+        },
+        CurrentState: {
+            type: InstalledPackageCurrentState,
+        },
+        Description: {
+            type: String,
+        },
+        ManagerVersion: {
+            optional: true,
+            type: String,
+        },
+        NotifyStatus: {
+            optional: true,
+            type: String,
+        },
+        OldVersion: {
+            optional: true,
+            type: String,
+        },
+        Origin: {
+            type: String,
+        },
+        Package: {
+            type: String,
+        },
+        Priority: {
+            type: String,
+        },
+        RunningKernel: {
+            optional: true,
+            type: String,
+        },
+        Section: {
+            type: String,
+        },
+        Title: {
+            type: String,
+        },
+        Version: {
+            type: String,
+        },
+    },
+)]
+/// Object.
+#[derive(Debug, serde::Deserialize, serde::Serialize)]
+pub struct InstalledPackage {
+    #[serde(rename = "Arch")]
+    pub arch: AptUpdateInfoArch,
+
+    #[serde(rename = "CurrentState")]
+    pub current_state: InstalledPackageCurrentState,
+
+    /// Package description.
+    #[serde(rename = "Description")]
+    pub description: String,
+
+    /// Version of the currently running pve-manager API server.
+    #[serde(default, skip_serializing_if = "Option::is_none")]
+    #[serde(rename = "ManagerVersion")]
+    pub manager_version: Option<String>,
+
+    /// Version for which PVE has already sent an 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, e.g., 'Proxmox' or 'Debian'.
+    #[serde(rename = "Origin")]
+    pub origin: String,
+
+    /// Package name.
+    #[serde(rename = "Package")]
+    pub package: String,
+
+    /// Package priority.
+    #[serde(rename = "Priority")]
+    pub priority: String,
+
+    /// Kernel release, only for package 'proxmox-ve'.
+    #[serde(default, skip_serializing_if = "Option::is_none")]
+    #[serde(rename = "RunningKernel")]
+    pub running_kernel: Option<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]
+/// Current state of the package installed on the system.
+#[derive(Clone, Copy, Debug, Eq, PartialEq, serde::Deserialize, serde::Serialize)]
+pub enum InstalledPackageCurrentState {
+    /// Installed.
+    Installed,
+    /// NotInstalled.
+    NotInstalled,
+    /// UnPacked.
+    UnPacked,
+    /// HalfConfigured.
+    HalfConfigured,
+    /// HalfInstalled.
+    HalfInstalled,
+    /// ConfigFiles.
+    ConfigFiles,
+    /// Unknown variants for forward compatibility.
+    #[serde(untagged)]
+    UnknownEnumValue(FixedString),
+}
+serde_plain::derive_display_from_serialize!(InstalledPackageCurrentState);
+serde_plain::derive_fromstr_from_deserialize!(InstalledPackageCurrentState);
+
 #[api]
 /// A guest's run state.
 #[derive(Clone, Copy, Debug, Eq, PartialEq, serde::Deserialize, serde::Serialize)]
-- 
2.47.3



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


  parent reply	other threads:[~2025-11-27 10:45 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-27 10:44 [pdm-devel] [PATCH datacenter-manager/proxmox{, -yew-comp} 00/18] remote update view: include product version and repository status Lukas Wagner
2025-11-27 10:44 ` [pdm-devel] [PATCH proxmox 1/4] add bindings for /nodes/{node}/apt/versions Lukas Wagner
2025-11-27 20:46   ` [pdm-devel] applied: " Thomas Lamprecht
2025-11-27 10:44 ` [pdm-devel] [PATCH proxmox 2/4] add bindings for /nodes/{node}/apt/repositories Lukas Wagner
2025-11-27 20:46   ` [pdm-devel] applied: " Thomas Lamprecht
2025-11-27 10:44 ` Lukas Wagner [this message]
2025-11-27 10:44 ` [pdm-devel] [PATCH proxmox 4/4] proxmox-apt-api-types: make APTStandardRepository compatible with PVE's serialization of the type Lukas Wagner
2025-11-27 20:46   ` [pdm-devel] applied: " Thomas Lamprecht
2025-11-27 10:44 ` [pdm-devel] [PATCH proxmox-yew-comp 1/1] apt repositories: add 'status_only' property Lukas Wagner
2025-11-27 21:26   ` [pdm-devel] applied: " Thomas Lamprecht
2025-11-27 10:44 ` [pdm-devel] [PATCH datacenter-manager 01/13] pdm-api-types: reuse APTUpdateInfo from proxmox_apt_api_types Lukas Wagner
2025-11-27 10:44 ` [pdm-devel] [PATCH datacenter-manager 02/13] pbs-client: add bindings for /nodes/localhost/apt/versions Lukas Wagner
2025-11-27 10:44 ` [pdm-devel] [PATCH datacenter-manager 03/13] pbs-client: add bindings for /nodes/localhost/apt/repositories Lukas Wagner
2025-11-27 10:44 ` [pdm-devel] [PATCH datacenter-manager 04/13] remote-updates: include version information in node update summary Lukas Wagner
2025-11-27 10:44 ` [pdm-devel] [PATCH datacenter-manager 05/13] remote updates: include repository status in node summary Lukas Wagner
2025-11-27 10:44 ` [pdm-devel] [PATCH datacenter-manager 06/13] api: pve/pbs: add passthrough endpoint for APT repo configuration Lukas Wagner
2025-11-27 10:44 ` [pdm-devel] [PATCH datacenter-manager 07/13] ui: remote updates: show table header Lukas Wagner
2025-11-27 10:44 ` [pdm-devel] [PATCH datacenter-manager 08/13] ui: remote updates: show main product version in overview table Lukas Wagner
2025-11-27 10:44 ` [pdm-devel] [PATCH datacenter-manager 09/13] ui: remote updates: show repository status column Lukas Wagner
2025-11-27 10:44 ` [pdm-devel] [PATCH datacenter-manager 10/13] ui: remote updates: show repo status details when selecting a node Lukas Wagner
2025-11-27 10:44 ` [pdm-devel] [PATCH datacenter-manager 11/13] ui: remote updates: don't attempt to load current status for unavailable nodes Lukas Wagner
2025-11-27 10:44 ` [pdm-devel] [PATCH datacenter-manager 12/13] ui: remote updates: use 'building-o' icon for PBS nodes Lukas Wagner
2025-11-27 10:44 ` [pdm-devel] [PATCH datacenter-manager 13/13] ui: remote updates: use explicit indices for parameters in tr! macro Lukas Wagner
2025-11-27 10:47 ` [pdm-devel] [PATCH datacenter-manager/proxmox{, -yew-comp} 00/18] remote update view: include product version and repository status 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=20251127104447.162951-4-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