From: Thomas Lamprecht <t.lamprecht@proxmox.com>
To: Proxmox Datacenter Manager development discussion
<pdm-devel@lists.proxmox.com>,
Dominik Csapak <d.csapak@proxmox.com>
Subject: Re: [pdm-devel] [PATCH datacenter-manager 1/9] server: factor out task filters into `TaskFilters` type
Date: Mon, 20 Jan 2025 18:42:53 +0100 [thread overview]
Message-ID: <3586cfee-8405-4e84-a793-074a157388a1@proxmox.com> (raw)
In-Reply-To: <20250120093006.927014-9-d.csapak@proxmox.com>
Am 20.01.25 um 10:29 schrieb Dominik Csapak:
> so we can reuse it
>
> Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
> ---
> lib/pdm-api-types/src/lib.rs | 81 ++++++++++++++++++++++++++++++++++-
> server/src/api/nodes/tasks.rs | 80 ++++++++--------------------------
> 2 files changed, 98 insertions(+), 63 deletions(-)
>
> diff --git a/lib/pdm-api-types/src/lib.rs b/lib/pdm-api-types/src/lib.rs
> index bf312cc..3844907 100644
> --- a/lib/pdm-api-types/src/lib.rs
> +++ b/lib/pdm-api-types/src/lib.rs
> @@ -219,7 +219,7 @@ pub enum NodePowerCommand {
>
> #[api]
> /// The state of a task.
> -#[derive(Eq, PartialEq, Debug, Serialize, Deserialize)]
> +#[derive(Clone, Eq, PartialEq, Debug, Serialize, Deserialize)]
> #[serde(rename_all = "lowercase")]
> pub enum TaskStateType {
> /// Ok
> @@ -418,3 +418,82 @@ impl fmt::Display for RemoteUpid {
>
> serde_plain::derive_deserialize_from_fromstr!(RemoteUpid, "valid remote upid");
> serde_plain::derive_serialize_from_display!(RemoteUpid);
> +
> +fn limit_default() -> u64 {
> + 50
> +}
> +
> +#[api(
> + properties: {
> + start: {
> + type: u64,
> + description: "List tasks beginning from this offset.",
> + default: 0,
> + optional: true,
> + },
> + limit: {
> + type: u64,
> + description: "Only list this amount of tasks. (0 means no limit)",
> + default: 50,
> + optional: true,
> + },
> + running: {
> + type: bool,
> + description: "Only list running tasks.",
> + optional: true,
> + default: false,
> + },
> + errors: {
> + type: bool,
> + description: "Only list erroneous tasks.",
> + optional:true,
> + default: false,
> + },
> + userfilter: {
> + optional: true,
> + type: String,
> + description: "Only list tasks from this user.",
> + },
> + since: {
> + type: i64,
> + description: "Only list tasks since this UNIX epoch.",
> + optional: true,
> + },
> + until: {
> + type: i64,
> + description: "Only list tasks until this UNIX epoch.",
> + optional: true,
> + },
> + typefilter: {
> + optional: true,
> + type: String,
> + description: "Only list tasks whose type contains this.",
> + },
> + statusfilter: {
General thought:
Before relying on these spellings even more we might take the chance and clean that up,
i.e. here already now directly and in our other projects support both until next
major release. I.e., separate words and not glue them together or just drop "filter",
it's used inconsistently anyway.
Might be little, but doubling down on ugly things even if they are small is not really
great either. Maybe we can go through the whole API schema for the next major release
and do a bigger clean-up before the pain of doing that increases significantly.
_______________________________________________
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-01-20 17:42 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-20 9:29 [pdm-devel] [PATCH yew-comp/datacenter-manager] ui: implement remote task list Dominik Csapak
2025-01-20 9:29 ` [pdm-devel] [PATCH yew-comp 1/7] tasks: make date filter functional Dominik Csapak
2025-01-20 11:30 ` Thomas Lamprecht
2025-01-20 12:10 ` Dominik Csapak
2025-01-21 8:33 ` Thomas Lamprecht
2025-01-21 9:46 ` Dominik Csapak
2025-01-20 9:29 ` [pdm-devel] [PATCH yew-comp 2/7] tasks: load more tasks on end of list Dominik Csapak
2025-01-20 17:29 ` Thomas Lamprecht
2025-01-21 9:43 ` Dominik Csapak
2025-01-20 9:29 ` [pdm-devel] [PATCH yew-comp 3/7] utils: factor out task description into own function Dominik Csapak
2025-01-20 17:29 ` Thomas Lamprecht
2025-01-21 9:44 ` Dominik Csapak
2025-01-20 9:29 ` [pdm-devel] [PATCH yew-comp 4/7] running tasks: make TaskListItem renderer configurable Dominik Csapak
2025-01-20 9:29 ` [pdm-devel] [PATCH yew-comp 5/7] running tasks: make buttons configurable Dominik Csapak
2025-01-20 9:29 ` [pdm-devel] [PATCH yew-comp 6/7] tasks: make columns configurable Dominik Csapak
2025-01-20 17:37 ` Thomas Lamprecht
2025-01-20 9:29 ` [pdm-devel] [PATCH yew-comp 7/7] tasks: make the 'show task' action configurable Dominik Csapak
2025-01-20 9:29 ` [pdm-devel] [PATCH datacenter-manager 1/9] server: factor out task filters into `TaskFilters` type Dominik Csapak
2025-01-20 17:42 ` Thomas Lamprecht [this message]
2025-01-20 9:29 ` [pdm-devel] [PATCH datacenter-manager 2/9] server: task cache: skip remotes with errors on fetch Dominik Csapak
2025-01-20 17:45 ` Thomas Lamprecht
2025-01-21 8:29 ` Dietmar Maurer
2025-01-20 9:30 ` [pdm-devel] [PATCH datacenter-manager 3/9] server: task cache: add filter options Dominik Csapak
2025-01-20 9:30 ` [pdm-devel] [PATCH datacenter-manager 4/9] server: task cache: reverse task order Dominik Csapak
2025-01-20 9:30 ` [pdm-devel] [PATCH datacenter-manager 5/9] pdm-client: export PveUpid Dominik Csapak
2025-01-20 9:30 ` [pdm-devel] [PATCH datacenter-manager 6/9] ui: refactor RemoteConfigPanel into own module Dominik Csapak
2025-01-20 9:30 ` [pdm-devel] [PATCH datacenter-manager 7/9] ui: remotes: add tasks to global remote panel Dominik Csapak
2025-01-20 9:30 ` [pdm-devel] [PATCH datacenter-manager 8/9] ui: register pve tasks Dominik Csapak
2025-01-20 9:30 ` [pdm-devel] [PATCH datacenter-manager 9/9] ui: also show running remote tasks in 'running tasks' list Dominik Csapak
2025-01-20 11:27 ` [pdm-devel] applied: [PATCH yew-comp/datacenter-manager] ui: implement remote task list Dietmar Maurer
2025-01-20 11:34 ` Thomas Lamprecht
2025-01-21 8:41 ` [pdm-devel] " 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=3586cfee-8405-4e84-a793-074a157388a1@proxmox.com \
--to=t.lamprecht@proxmox.com \
--cc=d.csapak@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox