diff --git a/pbs-api-types/src/datastore.rs b/pbs-api-types/src/datastore.rs index 47813cbd..1212ff89 100644 --- a/pbs-api-types/src/datastore.rs +++ b/pbs-api-types/src/datastore.rs @@ -90,6 +90,12 @@ pub const NS_MAX_DEPTH_SCHEMA: Schema = .default(0) .schema(); +pub const NS_MAX_DEPTH_REDUCED_SCHEMA: Schema = +IntegerSchema::new("How many levels of namespaces should be operated on (0 == no recursion, empty == automatic full recursion, namespace depths reduce maximum allowed value)") + .minimum(0) + .maximum(MAX_NAMESPACE_DEPTH as isize) + .schema(); + pub const DATASTORE_SCHEMA: Schema = StringSchema::new("Datastore name.") .format(&PROXMOX_SAFE_ID_FORMAT) .min_length(3) diff --git a/pbs-api-types/src/jobs.rs b/pbs-api-types/src/jobs.rs index 56d87e2b..2df19cfb 100644 --- a/pbs-api-types/src/jobs.rs +++ b/pbs-api-types/src/jobs.rs @@ -9,7 +9,8 @@ use proxmox_schema::*; use crate::{ Authid, BackupNamespace, BackupType, RateLimitConfig, Userid, BACKUP_GROUP_SCHEMA, BACKUP_NAMESPACE_SCHEMA, DATASTORE_SCHEMA, DRIVE_NAME_SCHEMA, MEDIA_POOL_NAME_SCHEMA, - NS_MAX_DEPTH_SCHEMA, PROXMOX_SAFE_ID_FORMAT, REMOTE_ID_SCHEMA, SINGLE_LINE_COMMENT_SCHEMA, + NS_MAX_DEPTH_REDUCED_SCHEMA, PROXMOX_SAFE_ID_FORMAT, REMOTE_ID_SCHEMA, + SINGLE_LINE_COMMENT_SCHEMA, }; const_regex! { @@ -436,7 +437,7 @@ pub const GROUP_FILTER_LIST_SCHEMA: Schema = optional: true, }, "max-depth": { - schema: NS_MAX_DEPTH_SCHEMA, + schema: NS_MAX_DEPTH_REDUCED_SCHEMA, optional: true, }, comment: {