api: verify: support namespaces

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht
2022-05-10 19:04:17 +02:00
parent 8e82cc807c
commit 59229bd7f1
6 changed files with 79 additions and 51 deletions

View File

@ -155,6 +155,8 @@ pub enum DeletableProperty {
Schedule,
/// Delete outdated after property.
OutdatedAfter,
/// Delete namespace property, defaulting to root namespace then.
Ns,
}
#[api(
@ -234,6 +236,9 @@ pub fn update_verification_job(
DeletableProperty::Schedule => {
data.schedule = None;
}
DeletableProperty::Ns => {
data.ns = None;
}
}
}
}
@ -268,6 +273,11 @@ pub fn update_verification_job(
if update.schedule.is_some() {
data.schedule = update.schedule;
}
if let Some(ns) = update.ns {
if !ns.is_root() {
data.ns = Some(ns);
}
}
config.set_data(&id, "verification", &data)?;