public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Dominik Csapak <d.csapak@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH common/manager/http/guest/qemu-server] schema/config array support
Date: Fri, 12 May 2023 14:23:47 +0200	[thread overview]
Message-ID: <20230512122355.3244212-1-d.csapak@proxmox.com> (raw)

and removal of the '-alist' format

This series aims to implement array support for the api and
(section)config and remove the support for the (rarely used) '-alist'
formats.

currently sending arrays over the api (by sending a parameter multiple
times with form-urlencoded) results in the api call getting a \0
separated string, which it must split with e.g. split_list.

Instead, we want to simply specify an 'array' type for the api.

We only ever used '-alist' in two places:
* 'exclude-path' config/parameter for vzdump
* 'command' parameter for qemu guest agent exec via api (cli has it's
  own implementation with 'extra-args')

The dependcies/breaks are like this:

pve-http-server 1/2 is rather independent (did encounter this during
testing, and the current behaviour is imho wrong)

pve-manager patch is built to use the new and old formats of
'exclude-path', so this should be safe to apply first

pve-guest-common depends on pve-manager, pve-http-server and pve-common 1/3

qemu-sever depends on pve-http-server and pve-common 1/3

pve-http-server does not technically break the older pve-guest-common
and qemu-server versions, but the parameters would need to be
encoded/sent differently than before (iow. the api user would have to
send the commands/paths \0 separated already instead of repeating the
parameters (form-urlencoded arrays))

pve-common 2/3 depend on all above

pve-common 3/3 depend on all above and it breaks every version that uses
an '-alist' format (so older pve-guest-common + qemu-server)

we can of course omit pve-common 3/3 and leave support in the
jsonschema, but imho it's really weird to use and has no real upsides
versus using simply an array type

pve-common:

Dominik Csapak (3):
  JSONSchema: add support for array parameter in api calls, cli and
    config
  section config: implement array support
  JSONSchema: disable '-alist' format

 src/PVE/JSONSchema.pm       | 26 ++++++++-------
 src/PVE/RESTHandler.pm      | 41 ++++++++++++++++++++----
 src/PVE/SectionConfig.pm    | 64 +++++++++++++++++++++++++++----------
 test/section_config_test.pl | 26 +++++++++++++++
 4 files changed, 122 insertions(+), 35 deletions(-)

pve-manager:

Dominik Csapak (1):
  vzdump: prepare 'exclude-path' for array format

 PVE/VZDump.pm | 21 +++++++++++++++++----
 1 file changed, 17 insertions(+), 4 deletions(-)

pve-http-server:

Dominik Csapak (2):
  proxy request: forward json content type and parameters
  use proper arrays for array parameter

 src/PVE/APIServer/AnyEvent.pm | 22 ++++++++++++++++------
 1 file changed, 16 insertions(+), 6 deletions(-)

pve-guest-common

Dominik Csapak (1):
  vzdump: change 'exclude-path' from alist to an array format

 src/PVE/VZDump/Common.pm | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

qemu-server:

Dominik Csapak (1):
  api: switch agent api call to 'array' type

 PVE/API2/Qemu/Agent.pm | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

-- 
2.30.2





             reply	other threads:[~2023-05-12 12:24 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-12 12:23 Dominik Csapak [this message]
2023-05-12 12:23 ` [pve-devel] [PATCH common 1/3] JSONSchema: add support for array parameter in api calls, cli and config Dominik Csapak
2023-06-05  8:36   ` Wolfgang Bumiller
2023-05-12 12:23 ` [pve-devel] [PATCH v2 common 2/3] section config: implement array support Dominik Csapak
2023-05-15  9:07   ` Wolfgang Bumiller
2023-05-15  9:19     ` Dominik Csapak
2023-05-12 12:23 ` [pve-devel] [PATCH common 3/3] JSONSchema: disable '-alist' format Dominik Csapak
2023-06-05  8:36   ` Wolfgang Bumiller
2023-05-12 12:23 ` [pve-devel] [PATCH manager 1/1] vzdump: prepare 'exclude-path' for array format Dominik Csapak
2023-06-05  7:36   ` Wolfgang Bumiller
2023-06-05  7:54     ` Dominik Csapak
2023-06-05  7:59       ` Wolfgang Bumiller
2023-06-05  8:03   ` [pve-devel] applied: " Wolfgang Bumiller
2023-05-12 12:23 ` [pve-devel] [PATCH http-server 1/2] proxy request: forward json content type and parameters Dominik Csapak
2023-06-05  8:42   ` Wolfgang Bumiller
2023-05-12 12:23 ` [pve-devel] [PATCH http-server 2/2] use proper arrays for array parameter Dominik Csapak
2023-05-12 12:23 ` [pve-devel] [PATCH guest-common 1/1] vzdump: change 'exclude-path' from alist to an array format Dominik Csapak
2023-06-05  8:37   ` [pve-devel] [PATCH guest-common 1/1] vzdump: change 'exclude-path' from alist to an array formaty Wolfgang Bumiller
2023-05-12 12:23 ` [pve-devel] [PATCH qemu-server 1/1] api: switch agent api call to 'array' type Dominik Csapak
2023-06-05  8:38   ` Wolfgang Bumiller

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=20230512122355.3244212-1-d.csapak@proxmox.com \
    --to=d.csapak@proxmox.com \
    --cc=pve-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