all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Christoph Heiss <c.heiss@proxmox.com>
To: pdm-devel@lists.proxmox.com
Subject: [pdm-devel] [PATCH proxmox 03/13] network-types: implement api type for Fqdn
Date: Thu,  4 Dec 2025 13:51:12 +0100	[thread overview]
Message-ID: <20251204125122.945961-4-c.heiss@proxmox.com> (raw)
In-Reply-To: <20251204125122.945961-1-c.heiss@proxmox.com>

Pretty straight-forward, as we already got a fitting regex defined for a
FQDN.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
---
 proxmox-network-types/src/fqdn.rs | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/proxmox-network-types/src/fqdn.rs b/proxmox-network-types/src/fqdn.rs
index 9582639d..3c1bd475 100644
--- a/proxmox-network-types/src/fqdn.rs
+++ b/proxmox-network-types/src/fqdn.rs
@@ -2,6 +2,9 @@
 
 use std::{fmt, str::FromStr};
 
+#[cfg(feature = "api-types")]
+use proxmox_schema::UpdaterType;
+
 use serde::Deserialize;
 
 /// Possible errors that might occur when parsing FQDNs.
@@ -55,6 +58,7 @@ impl fmt::Display for FqdnParseError {
 /// [RFC4343]: <https://www.ietf.org/rfc/rfc4343.txt>
 /// [hostname(7)]: <https://manpages.debian.org/stable/manpages/hostname.7.en.html>
 #[derive(Clone, Debug, Eq)]
+#[cfg_attr(feature = "api-types", derive(UpdaterType))]
 pub struct Fqdn {
     parts: Vec<String>,
 }
@@ -132,6 +136,16 @@ impl Fqdn {
     }
 }
 
+#[cfg(feature = "api-types")]
+impl proxmox_schema::ApiType for Fqdn {
+    const API_SCHEMA: proxmox_schema::Schema =
+        proxmox_schema::StringSchema::new("Fully-qualified domain name")
+            .format(&proxmox_schema::ApiStringFormat::Pattern(
+                &proxmox_schema::api_types::DNS_NAME_REGEX,
+            ))
+            .schema();
+}
+
 impl FromStr for Fqdn {
     type Err = FqdnParseError;
 
-- 
2.51.2



_______________________________________________
pdm-devel mailing list
pdm-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pdm-devel


  parent reply	other threads:[~2025-12-04 12:51 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-04 12:51 [pdm-devel] [PATCH proxmox/datacenter-manager 00/13] initial auto-installer integration Christoph Heiss
2025-12-04 12:51 ` [pdm-devel] [PATCH proxmox 01/13] api-macro: allow $ in identifier name Christoph Heiss
2025-12-04 12:51 ` [pdm-devel] [PATCH proxmox 02/13] network-types: move `Fqdn` type from proxmox-installer-common Christoph Heiss
2025-12-04 12:51 ` Christoph Heiss [this message]
2025-12-04 12:51 ` [pdm-devel] [PATCH proxmox 04/13] network-types: add api wrapper type for std::net::IpAddr Christoph Heiss
2025-12-04 12:51 ` [pdm-devel] [PATCH proxmox 05/13] installer-types: add common types used by the installer Christoph Heiss
2025-12-04 12:51 ` [pdm-devel] [PATCH proxmox 06/13] installer-types: add types used by the auto-installer Christoph Heiss
2025-12-04 12:51 ` [pdm-devel] [PATCH proxmox 07/13] installer-types: implement api type for all externally-used types Christoph Heiss
2025-12-04 12:51 ` [pdm-devel] [PATCH datacenter-manager 08/13] api-types: add api types for auto-installer integration Christoph Heiss
2025-12-04 12:51 ` [pdm-devel] [PATCH datacenter-manager 09/13] config: add auto-installer configuration module Christoph Heiss
2025-12-04 12:51 ` [pdm-devel] [PATCH datacenter-manager 10/13] acl: wire up new /system/auto-installation acl path Christoph Heiss
2025-12-04 12:51 ` [pdm-devel] [PATCH datacenter-manager 11/13] server: api: add auto-installer integration module Christoph Heiss
2025-12-04 12:51 ` [pdm-devel] [PATCH datacenter-manager 12/13] ui: auto-installer: add installations overview panel Christoph Heiss
2025-12-04 12:51 ` [pdm-devel] [PATCH datacenter-manager 13/13] ui: auto-installer: add prepared answer configuration panel Christoph Heiss
2025-12-04 14:17 ` [pdm-devel] [PATCH proxmox/datacenter-manager 00/13] initial auto-installer integration Lukas Wagner
2025-12-04 15:06   ` Christoph Heiss
2025-12-05 11:26 ` Christoph Heiss

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251204125122.945961-4-c.heiss@proxmox.com \
    --to=c.heiss@proxmox.com \
    --cc=pdm-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal