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 3F38D1FF16F for ; Tue, 8 Jul 2025 11:49:42 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id D7EFD12E2F; Tue, 8 Jul 2025 11:50:24 +0200 (CEST) Date: Tue, 8 Jul 2025 11:50:20 +0200 From: Gabriel Goller To: Wolfgang Bumiller Message-ID: Mail-Followup-To: Wolfgang Bumiller , pve-devel@lists.proxmox.com References: <20250702145101.894299-1-g.goller@proxmox.com> <20250702145101.894299-22-g.goller@proxmox.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20241002-35-39f9a6 X-SPAM-LEVEL: Spam detection results: 0 AWL -0.014 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 Subject: Re: [pve-devel] [PATCH proxmox-ve-rs v4 15/22] config: sdn: fabrics: add api types 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 Cc: pve-devel@lists.proxmox.com 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 08.07.2025 10:15, Wolfgang Bumiller wrote: >minor doc nits > >On Wed, Jul 02, 2025 at 04:50:06PM +0200, Gabriel Goller wrote: >> [snip] >> +/// API types for SDN fabric node configurations. >> +/// >> +/// This module provides specialized types that are used for API interactions when retrieving, >> +/// creating, or updating fabric/node configurations. These types serialize differently than their >> +/// section-config configuration counterparts to be nicer client-side. >> +/// >> +/// The module includes: >> +/// - [NodeData]: API-friendly version of [NodeSection] that flattens the node identifier >> +/// into separate `fabric_id` and `node_id` fields >> +/// - [Node]: API-version of [super::Node] >> +/// - [NodeDataUpdater] >> +/// - [NodeDeletableProperties] > >^ The types in those links should also be in backticks. Yep, there is also a `api::` prefix missing on most of these. >> +/// >> +/// These types include conversion methods to transform between API representations and internal >> +/// configuration objects. >> +pub mod api { >> + use serde::{Deserialize, Serialize}; >> + >> + use proxmox_schema::{Updater, UpdaterType}; >> + >> + use crate::sdn::fabric::section_config::protocol::{ >> + openfabric::{ >> + OpenfabricNodeDeletableProperties, OpenfabricNodeProperties, >> + OpenfabricNodePropertiesUpdater, >> + }, >> + ospf::{OspfNodeDeletableProperties, OspfNodeProperties, OspfNodePropertiesUpdater}, >> + }; >> + >> + use super::*; >> + >> + /// API-equivalent to [NodeSection]. > >^ backticks Yep. >> [snip] >> + impl From> for NodeSection { >> + fn from(value: NodeData) -> Self { >> + let id = NodeSectionId::new(value.fabric_id, value.node_id); >> + >> + Self { >> + id, >> + ip: value.ip, >> + ip6: value.ip6, >> + properties: value.properties, >> + } >> + } >> + } >> + >> + /// API-equivalent to [super::Node]. > >^ backticks Yes. >> [snip] >> + #[derive(Debug, Clone, Serialize, Deserialize)] >> + pub struct NodeDataUpdater { >> + #[serde(skip_serializing_if = "Option::is_none")] >> + pub(crate) ip: Option, >> + >> + #[serde(skip_serializing_if = "Option::is_none")] >> + pub(crate) ip6: Option, >> + >> + #[serde(flatten)] >> + pub(crate) properties: T, >> + >> + #[serde(skip_serializing_if = "Vec::is_empty", default = "Vec::new")] > >(^ the `= "Vec::new"` should not be necessary, but doesn't matter >either - new is `const` so it's probably more efficient this way >anyawy...) Yeah, Vec::default calls Vec::new anyway. I'll still keep it like this though. >> + pub(crate) delete: Vec>, >> + } >> + >> [snip] Thanks! _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel