From: Thomas Lamprecht <t.lamprecht@proxmox.com>
To: Dominik Csapak <d.csapak@proxmox.com>,
Proxmox VE development discussion <pve-devel@lists.proxmox.com>
Subject: Re: [pve-devel] [RFC PATCH] api: network: add return schema for interface listing
Date: Fri, 6 Dec 2024 11:00:22 +0100 [thread overview]
Message-ID: <879a46e4-b3e6-4242-8061-ba2882e04ddd@proxmox.com> (raw)
In-Reply-To: <7817aa77-3c8e-4122-b2cd-70c99816b9dc@proxmox.com>
Am 06.12.24 um 09:52 schrieb Dominik Csapak:
> On 12/5/24 09:43, Thomas Lamprecht wrote:
>> Am 05.12.24 um 09:27 schrieb Dominik Csapak:
>>> Most optiosn come from the api call parameter list
>>> (`json_config_properties`). The description and types for the remaining
>>> ons are either taken from the manpages, source code or similar
>>> documentation where available.
>>>
>>> Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
>>> ---
>>> sending as RFC because some descriptions are very barebones due to lack
>>> of documentation on the specific properties (link-type, vxlan-*, etc.)
>>>
>>> @s.hahnreich, maybe could you take a look at these and expand on some of
>>> them?
>>>
>>> PVE/API2/Network.pm | 97 ++++++++++++++++++++++++++++++++++++++++++++-
>>> 1 file changed, 95 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/PVE/API2/Network.pm b/PVE/API2/Network.pm
>>> index b9db9b27..df3db5af 100644
>>> --- a/PVE/API2/Network.pm
>>> +++ b/PVE/API2/Network.pm
>>> @@ -38,7 +38,7 @@ my $bond_mode_enum = [
>>> ];
>>>
>>> my $network_type_enum = ['bridge', 'bond', 'eth', 'alias', 'vlan',
>>> - 'OVSBridge', 'OVSBond', 'OVSPort', 'OVSIntPort'];
>>> + 'OVSBridge', 'OVSBond', 'OVSPort', 'OVSIntPort', 'vnet'];
>>>
>>> my $confdesc = {
>>> type => {
>>> @@ -223,7 +223,100 @@ __PACKAGE__->register_method({
>>> type => "array",
>>> items => {
>>> type => "object",
>>> - properties => {},
>>> + properties => json_config_properties({
>>> + iface => get_standard_option('pve-iface'),
>>> + active => {
>>> + type => 'boolean',
>>> + optional => 1,
>>> + description => "Set to 1 if the interface is active.",
>>
>> some rather higher level and certainly pre-existing in quite a few places, but might
>> it be better to do s/1/true/ here? IIRC the API accepts both IIRC, so not really a
>> problem if the user takes this literally,
>>
> this is the return schema only though, and we actually return a 1. Should i use
> true regardless ? (no hard feelings either way)
Nah, it probably is really fine as is then.
_______________________________________________
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:[~2024-12-06 10:00 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-05 8:27 Dominik Csapak
2024-12-05 8:29 ` Dominik Csapak
2024-12-05 8:43 ` Thomas Lamprecht
2024-12-05 11:53 ` Stefan Hanreich
2024-12-06 8:52 ` Dominik Csapak
2024-12-06 10:00 ` Thomas Lamprecht [this message]
2024-12-05 12:49 ` Gabriel Goller
2024-12-06 11:16 ` 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=879a46e4-b3e6-4242-8061-ba2882e04ddd@proxmox.com \
--to=t.lamprecht@proxmox.com \
--cc=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