From 47d14e1aed40dfc2b6bc9c1e9cf30c828e563880 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20Gr=C3=BCnbichler?= Date: Fri, 29 Apr 2022 13:48:54 +0200 Subject: [PATCH] api: add NS_MAX_DEPTH_SCHEMA MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fabian Grünbichler [ T: renamed from NAMESPACE_RECURSION_DEPTH_SCHEMA & moved to from jobs to datastore ] Signed-off-by: Thomas Lamprecht --- pbs-api-types/src/datastore.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pbs-api-types/src/datastore.rs b/pbs-api-types/src/datastore.rs index 1a68c356..010fcc6e 100644 --- a/pbs-api-types/src/datastore.rs +++ b/pbs-api-types/src/datastore.rs @@ -84,6 +84,13 @@ pub const BACKUP_NAMESPACE_SCHEMA: Schema = StringSchema::new("Namespace.") .max_length(MAX_BACKUP_NAMESPACE_LENGTH) // 256 .schema(); +pub const NS_MAX_DEPTH_SCHEMA: Schema = + IntegerSchema::new("How many levels of namespaces should be operated on (0 == no recursion)") + .minimum(0) + .maximum(MAX_NAMESPACE_DEPTH as isize) + .default(0) + .schema(); + pub const DATASTORE_SCHEMA: Schema = StringSchema::new("Datastore name.") .format(&PROXMOX_SAFE_ID_FORMAT) .min_length(3)