From: Dominik Csapak <d.csapak@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH storage 1/2] api: try to add more return schema information
Date: Mon, 6 Oct 2025 13:24:02 +0200 [thread overview]
Message-ID: <20251006112409.2141871-2-d.csapak@proxmox.com> (raw)
In-Reply-To: <20251006112409.2141871-1-d.csapak@proxmox.com>
no problem for 'select_existing', but we cannot actually describe
'format' with our JSONSchema, since it uses an array as a form of tuple,
and even with oneOf this cannot be described currently.
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
src/PVE/API2/Storage/Status.pm | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/src/PVE/API2/Storage/Status.pm b/src/PVE/API2/Storage/Status.pm
index 7bde4ec..ff32782 100644
--- a/src/PVE/API2/Storage/Status.pm
+++ b/src/PVE/API2/Storage/Status.pm
@@ -171,6 +171,23 @@ __PACKAGE__->register_method({
renderer => 'fraction_as_percentage',
optional => 1,
},
+ select_existing => {
+ description => "Instead of creating new volumes, one must select one that"
+ . " is already existing. Only included if 'format' parameter is set.",
+ type => 'boolean',
+ optional => 1,
+ },
+
+ # we can't include this return schema, since we cannot properly
+ # describe what it actually is with the json schema:
+ #
+ # a tuple in form of an array where the first element is an
+ # object, and the second is a string.
+ #format => {
+ # description => "Lists the supported and default format."
+ # . " Only included if 'format' parameter is set.",
+ # optional => 1,
+ #},
},
},
links => [{ rel => 'child', href => "{storage}" }],
--
2.47.3
_______________________________________________
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-10-06 11:24 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-06 11:24 [pve-devel] [PATCH manager/storage 0/3] Improve return schema for storage listing Dominik Csapak
2025-10-06 11:24 ` Dominik Csapak [this message]
2025-10-06 11:24 ` [pve-devel] [PATCH storage 2/2] api: list: return 'formats' info in a better structured way Dominik Csapak
2025-10-06 11:24 ` [pve-devel] [PATCH manager 1/1] ui: disk storage selector: use new api return format Dominik Csapak
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=20251006112409.2141871-2-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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.