[pve-devel] [PATCH pve-container 2/2] fix #5339: api: lxc: ip: add 'all' option so that all addresses can be returned.
Fabian Grünbichler
f.gruenbichler at proxmox.com
Fri Jul 5 09:49:17 CEST 2024
> Wolfgang Bumiller <w.bumiller at proxmox.com> hat am 05.07.2024 09:45 CEST geschrieben:
>
>
> On Tue, Jul 02, 2024 at 04:29:25PM GMT, Fabian Grünbichler wrote:
> > apologies again for the long delay!
> >
> > > Johannes Cornelis Draaijer via pve-devel <pve-devel at lists.proxmox.com> hat am 18.04.2024 22:49 CEST geschrieben:
> >
> > > Signed-off-by: Johannes Cornelis Draaijer <jcdra1 at gmail.com>
> > > ---
> > > src/PVE/API2/LXC.pm | 16 +++++++++++++---
> > > src/PVE/LXC.pm | 9 +++++++--
> > > 2 files changed, 20 insertions(+), 5 deletions(-)
> > >
> > > diff --git a/src/PVE/API2/LXC.pm b/src/PVE/API2/LXC.pm
> > > index 89ba64c..3561317 100644
> > > --- a/src/PVE/API2/LXC.pm
> > > +++ b/src/PVE/API2/LXC.pm
> > > @@ -2533,6 +2533,12 @@ __PACKAGE__->register_method({
> > > properties => {
> > > node => get_standard_option('pve-node'),
> > > vmid => get_standard_option('pve-vmid', { completion => \&PVE::LXC::complete_ctid }),
> > > + all => {
> > > + type => 'boolean',
> > > + default => 0,
> > > + optional => 1,
> > > + description => 'Return all adresses of each interface instead of only one',
> >
> > typo: s/adresses/addresses
> >
> > > + }
> > > },
> > > },
> > > returns => {
> > > @@ -2552,12 +2558,14 @@ __PACKAGE__->register_method({
> > > },
> > > inet => {
> > > type => 'string',
> > > - description => 'The IPv4 address of the interface',
> > > + format => 'CIDRv4-list',
> >
> > this format here and the code below don't agree. a string type with the -list suffix needs actually be a string with the list elements delimited by either space, ',' or ';'. in this case, comma or semicolon is probably okay.
> >
>
> Since the caller needs to specify a new parameter, shouldn't we just
> return an actual array instead?
the retun schema wouldn't match then for either variant of the call..
More information about the pve-devel
mailing list