From: Thomas Lamprecht <t.lamprecht@proxmox.com>
To: Proxmox Datacenter Manager development discussion
<pdm-devel@lists.proxmox.com>,
Lukas Wagner <l.wagner@proxmox.com>
Subject: Re: [pdm-devel] [PATCH datacenter-manager 2/7] pbs-client: add bindings for task list, task status, task log
Date: Wed, 12 Nov 2025 21:23:40 +0100 [thread overview]
Message-ID: <1b53c0d5-333e-42ff-835b-104bf02e78e4@proxmox.com> (raw)
In-Reply-To: <20251112094203.112452-3-l.wagner@proxmox.com>
Am 12.11.25 um 10:42 schrieb Lukas Wagner:
> diff --git a/server/src/pbs_client.rs b/server/src/pbs_client.rs
> index 49087360..4285f402 100644
> --- a/server/src/pbs_client.rs
> +++ b/server/src/pbs_client.rs
> @@ -125,6 +125,75 @@ pub struct AptUpdateParams {
> pub quiet: Option<bool>,
> }
>
> +// TODO: This is incomplete, it only contains the parameters needed for remote task fetching.
> +// Ideally, the task list API in PBS would use a parameter struct defined in pbs-api-types, which
> +// is then also used here.
As we have tasks in all projects it certainly can be something very common,
and some thought that crossed my mind more than once was splitting out upid
from the proxmox-schema crate, while I can relate to why it got placed there
initially, it just feels like the wrong place. In a dedicated proxmox-task
or proxmox-upid or the like crate these types here might also fit well in.
> +#[derive(Debug, Default, Deserialize, Serialize)]
> +pub struct ListTasks {
> + /// Only list this number of tasks.
> + #[serde(default, skip_serializing_if = "Option::is_none")]
> + pub limit: Option<u64>,
> +
> + /// Only list tasks since this UNIX epoch.
> + #[serde(default, skip_serializing_if = "Option::is_none")]
> + pub since: Option<i64>,
> +}
> +
> +// TODO: The task-status APIs in PBS as well as PDM don't have a
> +// proper type defined anywhere. This should be moved to a shared crate
> +// and then the API handlers adapted.
> +#[derive(Debug, Deserialize, Serialize)]
> +pub struct TaskStatus {
> + pub exitstatus: Option<String>,
> +
> + pub id: Option<String>,
> +
> + pub node: String,
> +
> + pub pid: i64,
> +
> + pub pstart: i64,
> +
> + pub starttime: i64,
> +
> + pub status: IsRunning,
> +
> + #[serde(rename = "type")]
> + pub ty: String,
> +
> + pub upid: String,
> +
> + pub user: String,
> +}
> +
> +#[derive(Debug, Deserialize, Serialize, PartialEq)]
> +#[serde(rename_all = "kebab-case")]
> +pub enum IsRunning {
> + Running,
> + Stopped,
> +}
> +
> +impl TaskStatus {
> + /// Checks if the task is currently running.
> + pub fn is_running(&self) -> bool {
> + self.status == IsRunning::Running
> + }
> +}
> +
_______________________________________________
pdm-devel mailing list
pdm-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pdm-devel
next prev parent reply other threads:[~2025-11-12 20:22 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-12 9:41 [pdm-devel] [PATCH datacenter-manager 0/7] PBS remotes: task API and task cache support Lukas Wagner
2025-11-12 9:41 ` [pdm-devel] [PATCH datacenter-manager 1/7] pdm-api-types: remote upid: add helpers for getting native UPID type Lukas Wagner
2025-11-12 9:41 ` [pdm-devel] [PATCH datacenter-manager 2/7] pbs-client: add bindings for task list, task status, task log Lukas Wagner
2025-11-12 20:23 ` Thomas Lamprecht [this message]
2025-11-12 9:41 ` [pdm-devel] [PATCH datacenter-manager 3/7] pdm-api-types: api: factor out schema definitions for task log params Lukas Wagner
2025-11-12 9:42 ` [pdm-devel] [PATCH datacenter-manager 4/7] api: pbs tasks: add PBS task API Lukas Wagner
2025-11-12 9:42 ` [pdm-devel] [PATCH datacenter-manager 5/7] api: pve tasks: use shared helpers for RemoteUpid handling Lukas Wagner
2025-11-12 9:42 ` [pdm-devel] [PATCH datacenter-manager 6/7] remote tasks: fetch/track PBS tasks Lukas Wagner
2025-11-12 9:42 ` [pdm-devel] [PATCH datacenter-manager 7/7] remote updates: re-enable PBS update fetching Lukas Wagner
2025-11-12 20:26 ` Thomas Lamprecht
2025-11-12 20:27 ` [pdm-devel] applied-series: [PATCH datacenter-manager 0/7] PBS remotes: task API and task cache support Thomas Lamprecht
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=1b53c0d5-333e-42ff-835b-104bf02e78e4@proxmox.com \
--to=t.lamprecht@proxmox.com \
--cc=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.