From: Wolfgang Bumiller <w.bumiller@proxmox.com>
To: Thomas Lamprecht <t.lamprecht@proxmox.com>
Cc: Proxmox VE development discussion <pve-devel@lists.proxmox.com>
Subject: Re: [pve-devel] [PATCH manager] api: factor out shell command schema
Date: Thu, 4 Sep 2025 14:27:04 +0200 [thread overview]
Message-ID: <sxfszcr5snxs4eq4vd2igpqg32f7i24weiyqiqmo23tg5szs3r@lbngxr2ukhdq> (raw)
In-Reply-To: <c9db6455-c5a5-48ab-b039-1ce665aba0f7@proxmox.com>
On Wed, Sep 03, 2025 at 06:01:22PM +0200, Thomas Lamprecht wrote:
> Am 02.09.25 um 14:55 schrieb Wolfgang Bumiller:
> > So we only sort the enum keys once and the documentation and API dumps
> > don't keep reordering them, and to deduplicate the cmd and cmd-opts
> > schema.
> >
> > Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
> > ---
> > PVE/API2/Nodes.pm | 68 ++++++++++++++---------------------------------
> > 1 file changed, 20 insertions(+), 48 deletions(-)
> >
> > diff --git a/PVE/API2/Nodes.pm b/PVE/API2/Nodes.pm
> > index ce7eecaf1..636789277 100644
> > --- a/PVE/API2/Nodes.pm
> > +++ b/PVE/API2/Nodes.pm
> > @@ -1103,6 +1103,23 @@ my $shell_cmd_map = {
> > },
> > };
> >
> > +my @shell_cmd_params = (
>
> not really much difference in practice, but why not a %hash map?
typo, sorry
>
> > + cmd => {
> > + type => 'string',
> > + description => "Run specific command or default to login (requires 'root\@pam')",
> > + enum => [sort keys %$shell_cmd_map],
> > + optional => 1,
> > + default => 'login',
> > + },
> > + 'cmd-opts' => {
> > + type => 'string',
> > + description => "Add parameters to a command. Encoded as null terminated strings.",
> > + requires => 'cmd',
> > + optional => 1,
> > + default => '',
> > + },
> > +);
> > +
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
next prev parent reply other threads:[~2025-09-04 12:26 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-02 12:55 Wolfgang Bumiller
2025-09-03 16:01 ` Thomas Lamprecht
2025-09-04 12:27 ` Wolfgang Bumiller [this message]
2025-09-04 16:53 ` [pve-devel] applied: " 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=sxfszcr5snxs4eq4vd2igpqg32f7i24weiyqiqmo23tg5szs3r@lbngxr2ukhdq \
--to=w.bumiller@proxmox.com \
--cc=pve-devel@lists.proxmox.com \
--cc=t.lamprecht@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