From: "Laurențiu Leahu-Vlăducu" <l.leahu-vladucu@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [pbs-devel] [PATCH proxmox v2 1/1] pbs-api-types: Added changer schema for automatic drive assignment
Date: Thu, 6 Feb 2025 13:28:31 +0100 [thread overview]
Message-ID: <20250206122833.171965-2-l.leahu-vladucu@proxmox.com> (raw)
In-Reply-To: <20250206122833.171965-1-l.leahu-vladucu@proxmox.com>
While the current changer schema is technically able to do the same
checks as the new one, the new schema has been added to improve the
description of the changer parameter for this specific use case,
in order to have proper documentation for the proxmox-tape CLI tool,
making it clear to the user what the parameter is supposed to do.
Signed-off-by: Laurențiu Leahu-Vlăducu <l.leahu-vladucu@proxmox.com>
---
pbs-api-types/src/tape/changer.rs | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/pbs-api-types/src/tape/changer.rs b/pbs-api-types/src/tape/changer.rs
index df3823cf..704ef989 100644
--- a/pbs-api-types/src/tape/changer.rs
+++ b/pbs-api-types/src/tape/changer.rs
@@ -8,12 +8,22 @@ use proxmox_schema::{
use crate::{OptionalDeviceIdentification, PROXMOX_SAFE_ID_FORMAT};
+const TAPE_CHANGER_MIN_LENGTH: usize = 3;
+const TAPE_CHANGER_MAX_LENGTH: usize = 32;
+
pub const CHANGER_NAME_SCHEMA: Schema = StringSchema::new("Tape Changer Identifier.")
.format(&PROXMOX_SAFE_ID_FORMAT)
- .min_length(3)
- .max_length(32)
+ .min_length(TAPE_CHANGER_MIN_LENGTH)
+ .max_length(TAPE_CHANGER_MAX_LENGTH)
.schema();
+pub const CHANGER_NAME_SCHEMA_AUTOMATIC_DRIVE_ASSIGNMENT: Schema =
+ StringSchema::new("Tape Changer Identifier to be used for automatic tape drive assignment.")
+ .format(&PROXMOX_SAFE_ID_FORMAT)
+ .min_length(TAPE_CHANGER_MIN_LENGTH)
+ .max_length(TAPE_CHANGER_MAX_LENGTH)
+ .schema();
+
pub const SCSI_CHANGER_PATH_SCHEMA: Schema =
StringSchema::new("Path to Linux generic SCSI device (e.g. '/dev/sg4')").schema();
--
2.39.5
_______________________________________________
pbs-devel mailing list
pbs-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel
next prev parent reply other threads:[~2025-02-06 12:29 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-06 12:28 [pbs-devel] [PATCH proxmox/proxmox-backup v2] Automatically select a drive (if part of a changer) when loading tapes Laurențiu Leahu-Vlăducu
2025-02-06 12:28 ` Laurențiu Leahu-Vlăducu [this message]
2025-02-06 12:28 ` [pbs-devel] [PATCH proxmox-backup v2 1/2] proxmox-backup-api/proxy: Add proxmox-product-config as dependency Laurențiu Leahu-Vlăducu
2025-02-17 11:49 ` Dominik Csapak
2025-02-06 12:28 ` [pbs-devel] [PATCH proxmox-backup v2 2/2] Automatically select a drive (if part of a changer) when loading tapes Laurențiu Leahu-Vlăducu
2025-02-17 11:49 ` Dominik Csapak
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=20250206122833.171965-2-l.leahu-vladucu@proxmox.com \
--to=l.leahu-vladucu@proxmox.com \
--cc=pbs-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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal