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 AAC0E1FF185 for ; Mon, 7 Jul 2025 09:48:25 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id C20BF1C9B1; Mon, 7 Jul 2025 09:49:06 +0200 (CEST) Date: Mon, 7 Jul 2025 09:48:31 +0200 From: Wolfgang Bumiller To: pve-devel@lists.proxmox.com Message-ID: References: <20250702145101.894299-1-g.goller@proxmox.com> <20250702145101.894299-31-g.goller@proxmox.com> <3odaualnrq4gt4kflksaricqhwlt42euhjrr6tvt67tqjdi2lp@dcubuzy7q5kr> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <3odaualnrq4gt4kflksaricqhwlt42euhjrr6tvt67tqjdi2lp@dcubuzy7q5kr> X-SPAM-LEVEL: Spam detection results: 0 AWL 0.080 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-perl-rs v4 2/5] pve-rs: sdn: fabrics: add api methods 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-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pve-devel-bounces@lists.proxmox.com Sender: "pve-devel" On Fri, Jul 04, 2025 at 05:56:46PM +0200, Gabriel Goller wrote: > On 04.07.2025 14:57, Wolfgang Bumiller wrote: > > On Wed, Jul 02, 2025 at 04:50:15PM +0200, Gabriel Goller wrote: > > > From: Stefan Hanreich > > > > > > The FabricConfig from proxmox-ve-config implements CRUD functionality > > > for Fabrics and Nodes stored in the section config. We expose them via > > > perlmod, so they can be used in the API endpoints defined in perl. > > > they map 1:1 to the respective API endpoints. > > > > > > They are simply calling the respective implementation of FabricConfig, > > > and convert from / to the API representations of the Fabrics / Nodes > > > returned by FabricConfig. > > > > > > Co-authored-by: Gabriel Goller > > > Signed-off-by: Stefan Hanreich > > > --- > > > pve-rs/src/bindings/sdn/fabrics.rs | 212 ++++++++++++++++++++++++++++- > > > 1 file changed, 211 insertions(+), 1 deletion(-) > > > > > > diff --git a/pve-rs/src/bindings/sdn/fabrics.rs b/pve-rs/src/bindings/sdn/fabrics.rs > > > index fac5602c0241..2efa1c6306ae 100644 > > > --- a/pve-rs/src/bindings/sdn/fabrics.rs > > > +++ b/pve-rs/src/bindings/sdn/fabrics.rs > > > @@ -17,7 +17,20 @@ pub mod pve_rs_sdn_fabrics { > > > use proxmox_section_config::typed::SectionConfigData; > > > use proxmox_ve_config::common::valid::Validatable; > > > > > > - use proxmox_ve_config::sdn::fabric::{section_config::Section, FabricConfig}; > > > + use proxmox_ve_config::sdn::fabric::{ > > > + section_config::{ > > > + fabric::{ > > > + api::{Fabric, FabricUpdater}, > > > + FabricId, > > > + }, > > > + node::{ > > > + api::{Node, NodeUpdater}, > > > + Node as ConfigNode, NodeId, > > > + }, > > > + Section, > > > + }, > > > + FabricConfig, FabricEntry, > > > + }; > > > > > > /// A SDN Fabric config instance. > > > #[derive(Serialize, Deserialize)] > > > @@ -57,6 +70,203 @@ pub mod pve_rs_sdn_fabrics { > > > ) > > > } > > > > > > + /// Class method: Returns all fabrics and nodes from the configuration. > > > > ^ Regular `Method:` - all of them. > > Done. > > > > + /// Class method: Adds a new Fabric to the configuration. > > > + #[export] > > > + fn add_fabric(#[try_from_ref] this: &PerlFabricConfig, fabric: Fabric) -> Result<(), Error> { > > > + this.fabric_config > > > + .lock() > > > + .unwrap() > > > + .add_fabric(fabric) > > > > ^ If all we do is forward to an existing method, it would be nice to > > include a `See [...]` link in the method docs. > > (The `make doc/doc-open` make targets currently add > > `--external-html-root-url` parameters to `cargo doc` to make these links > > work (just updated to the new rustdoc layout). > > Added it, even though the function won't be visible in the docs because > it isn't pub. Ah yes, I forgot to check for that. It *should* be pub ;-) The function is exposed to perl, which means it *is* public (just not within rust) - the perl API is *supposed* to be documented. That's kind of the point of the `bindings` module, to have rustdoc generated an API documentation for perl. This is probably something perlmod should optionally check for: non-pub exports should need some kind of extra annotation. _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel