From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id 877F61FF13A for ; Wed, 01 Apr 2026 00:55:43 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 7348B941E; Wed, 1 Apr 2026 00:56:10 +0200 (CEST) Message-ID: <8e73d3a8-5f7c-48c3-aee5-66409f11151f@proxmox.com> Date: Wed, 1 Apr 2026 00:55:34 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Beta Subject: Re: [PATCH proxmox v3 4/8] schema: provide integer schema for node ports To: Christoph Heiss , pve-devel@lists.proxmox.com References: <20260330182856.2401050-1-c.heiss@proxmox.com> <20260330182856.2401050-5-c.heiss@proxmox.com> Content-Language: en-US From: Thomas Lamprecht In-Reply-To: <20260330182856.2401050-5-c.heiss@proxmox.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1774997678609 X-SPAM-LEVEL: Spam detection results: 0 AWL -1.503 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 1 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 1 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 1 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 Message-ID-Hash: CLZYNNJIEFWQRJW7TGOGK3YHLCRFNIG3 X-Message-ID-Hash: CLZYNNJIEFWQRJW7TGOGK3YHLCRFNIG3 X-MailFrom: t.lamprecht@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Am 30.03.26 um 20:28 schrieb Christoph Heiss: > Signed-off-by: Christoph Heiss > --- > Changes v2 -> v3: > * no changes > > Changes v1 -> v2: > * no changes > > proxmox-schema/src/api_types.rs | 7 ++++++- > 1 file changed, 6 insertions(+), 1 deletion(-) > > diff --git a/proxmox-schema/src/api_types.rs b/proxmox-schema/src/api_types.rs > index cfad4a10..3e31d97e 100644 > --- a/proxmox-schema/src/api_types.rs > +++ b/proxmox-schema/src/api_types.rs > @@ -1,7 +1,7 @@ > //! The "basic" api types we generally require along with some of their macros. > use const_format::concatcp; > > -use crate::{ApiStringFormat, ArraySchema, Schema, StringSchema}; > +use crate::{ApiStringFormat, ArraySchema, IntegerSchema, Schema, StringSchema}; > > #[rustfmt::skip] > const IPV4OCTET: &str = r"(?:25[0-5]|(?:2[0-4]|1[0-9]|[1-9])?[0-9])"; > @@ -221,6 +221,11 @@ pub const HOST_PORT_SCHEMA: Schema = > .format(&HOST_PORT_FORMAT) > .schema(); > > +pub const PORT_SCHEMA: Schema = IntegerSchema::new("Node port") nit: Description is a bit odd for a generic port? Could be just "Port" or "Network port" if we want to have some correlation with network? > + .minimum(1) > + .maximum(65535) > + .schema(); > + > pub const HTTP_URL_SCHEMA: Schema = StringSchema::new("HTTP(s) url with optional port.") > .format(&HTTP_URL_FORMAT) > .schema();