public inbox for pmg-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Thomas Lamprecht <t.lamprecht@proxmox.com>
To: Hannes Laimer <h.laimer@proxmox.com>, pmg-devel@lists.proxmox.com
Subject: Re: [pmg-devel] [PATCH pmg-api v2] fix #2452: pmgqm support 1-24h timespans for status/send
Date: Wed, 17 Sep 2025 17:22:05 +0200	[thread overview]
Message-ID: <569e83ee-46cb-4496-94e7-76eeea6f804d@proxmox.com> (raw)
In-Reply-To: <20250808102836.50441-1-h.laimer@proxmox.com>

Am 08.08.25 um 12:28 schrieb Hannes Laimer:
> Signed-off-by: Hannes Laimer <h.laimer@proxmox.com>
> ---
> I didn't find a section for this in the docs(maybe I missed it), if
> there is one, and depending on what it says maybe we have to update that
> as well. (I can send a followup in that case)
> 
> since v1:
>  - update default templates
>  - 1..24h instead of 1..23h (thought `today` would be 24h, but it's not)
> 
>  src/PMG/CLI/pmgqm.pm                |  8 ++++----
>  src/PMG/Utils.pm                    | 10 ++++++++--
>  src/templates/spamreport-short.tt   |  4 +++-
>  src/templates/spamreport-verbose.tt |  4 +++-
>  4 files changed, 18 insertions(+), 8 deletions(-)
> 
> diff --git a/src/PMG/CLI/pmgqm.pm b/src/PMG/CLI/pmgqm.pm
> index 23968f2..41f9f1a 100755
> --- a/src/PMG/CLI/pmgqm.pm
> +++ b/src/PMG/CLI/pmgqm.pm
> @@ -90,9 +90,9 @@ __PACKAGE__->register_method({
>          additionalProperties => 0,
>          properties => {
>              timespan => {
> -                description => "Select time span.",
> +                description => "Select time span. Accepts 'today', 'yesterday', 'week' or '1h'..'24h' for the last N hours.",
>                  type => 'string',
> -                enum => ['today', 'yesterday', 'week'],
> +                pattern => '^(today|yesterday|week|([1-9]|1[0-9]|2[0-4])h)$',

Oh and FWIW, was fine as is, but it would have been a potential use case for
the relatively new oneOf schema support to split the enum and the more free
form variants into two different sub-schemas. Mostly mentioning it to ensure
it's known to a wider audience that using the oneOf schema would (or at least
should ;) be possible in the perl based APIs too.


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


      parent reply	other threads:[~2025-09-17 15:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-08 10:28 Hannes Laimer
2025-09-17 12:22 ` [pmg-devel] applied: " Thomas Lamprecht
2025-09-17 15:22 ` Thomas Lamprecht [this message]

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=569e83ee-46cb-4496-94e7-76eeea6f804d@proxmox.com \
    --to=t.lamprecht@proxmox.com \
    --cc=h.laimer@proxmox.com \
    --cc=pmg-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
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal