api: add NS_MAX_DEPTH_SCHEMA

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
 [ T: renamed from NAMESPACE_RECURSION_DEPTH_SCHEMA & moved to from
   jobs to datastore ]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Fabian Grünbichler 2022-04-29 13:48:54 +02:00 committed by Thomas Lamprecht
parent e687d1b8ee
commit 08aa5fe7aa
1 changed files with 7 additions and 0 deletions

View File

@ -84,6 +84,13 @@ pub const BACKUP_NAMESPACE_SCHEMA: Schema = StringSchema::new("Namespace.")
.max_length(MAX_BACKUP_NAMESPACE_LENGTH) // 256 .max_length(MAX_BACKUP_NAMESPACE_LENGTH) // 256
.schema(); .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.") pub const DATASTORE_SCHEMA: Schema = StringSchema::new("Datastore name.")
.format(&PROXMOX_SAFE_ID_FORMAT) .format(&PROXMOX_SAFE_ID_FORMAT)
.min_length(3) .min_length(3)