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 063BF1FF141 for ; Fri, 13 Feb 2026 15:35:58 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id BB02E6960; Fri, 13 Feb 2026 15:36:40 +0100 (CET) From: Christoph Heiss To: pve-devel@lists.proxmox.com Subject: [PATCH proxmox v2 4/8] schema: provide integer schema for node ports Date: Fri, 13 Feb 2026 15:35:57 +0100 Message-ID: <20260213143601.1424613-5-c.heiss@proxmox.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260213143601.1424613-1-c.heiss@proxmox.com> References: <20260213143601.1424613-1-c.heiss@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1770993382382 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.052 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 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: 7ZNUVIAPP4HNKMVTNXY55YKJZOWHIM6P X-Message-ID-Hash: 7ZNUVIAPP4HNKMVTNXY55YKJZOWHIM6P X-MailFrom: c.heiss@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: Signed-off-by: Christoph Heiss --- 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") + .minimum(1) + .maximum(65535) + .schema(); + pub const HTTP_URL_SCHEMA: Schema = StringSchema::new("HTTP(s) url with optional port.") .format(&HTTP_URL_FORMAT) .schema(); -- 2.52.0