From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id C0D821FF164 for ; Fri, 6 Dec 2024 09:53:30 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 8DDE71DC; Fri, 6 Dec 2024 09:53:30 +0100 (CET) Message-ID: <7817aa77-3c8e-4122-b2cd-70c99816b9dc@proxmox.com> Date: Fri, 6 Dec 2024 09:52:57 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Beta To: Thomas Lamprecht , Proxmox VE development discussion References: <20241205082743.459521-1-d.csapak@proxmox.com> Content-Language: en-US From: Dominik Csapak In-Reply-To: X-SPAM-LEVEL: Spam detection results: 0 AWL 0.015 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment RCVD_IN_VALIDITY_CERTIFIED_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_RPBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_SAFE_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [network.pm] Subject: Re: [pve-devel] [RFC PATCH] api: network: add return schema for interface listing X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox VE development discussion Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: pve-devel-bounces@lists.proxmox.com Sender: "pve-devel" 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 >> --- >> 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) _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel