optional: true,
schema: BACKUP_NAMESPACE_SCHEMA,
},
+ "max-depth": {
+ optional: true,
+ schema: crate::NS_MAX_DEPTH_SCHEMA,
+ },
}
)]
#[derive(Serialize, Deserialize, Updater)]
#[serde(skip_serializing_if = "Option::is_none", default)]
/// on which backup namespace to run the verification recursively
pub ns: Option<BackupNamespace>,
+ #[serde(skip_serializing_if = "Option::is_none", default)]
+ /// how deep the verify should go from the `ns` level downwards. Passing 0 verifies only the
+ /// snapshots on the same level as the passed `ns`, or the datastore root if none.
+ pub max_depth: Option<usize>,
}
#[api(
OutdatedAfter,
/// Delete namespace property, defaulting to root namespace then.
Ns,
+ /// Delete max-depth property, defaulting to full recursion again
+ MaxDepth,
}
#[api(
DeletableProperty::Ns => {
data.ns = None;
}
+ DeletableProperty::MaxDepth => {
+ data.max_depth = None;
+ }
}
}
}
data.ns = Some(ns);
}
}
+ if let Some(max_depth) = update.max_depth {
+ if max_depth <= pbs_api_types::MAX_NAMESPACE_DEPTH {
+ data.max_depth = Some(max_depth);
+ }
+ }
config.set_data(&id, "verification", &data)?;
&verify_worker,
worker.upid(),
ns,
- None,
+ verification_job.max_depth,
None,
Some(&move |manifest| {
verify_filter(ignore_verified_snapshots, outdated_after, manifest)