create SYNC_SCHEDULE_SCHEMA to adapt description for sync jobs

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
Dominik Csapak 2020-05-29 10:53:34 +02:00 committed by Dietmar Maurer
parent f5d00373f3
commit 2888b27f4c
3 changed files with 8 additions and 3 deletions

View File

@ -60,7 +60,7 @@ pub fn list_sync_jobs(
}, },
schedule: { schedule: {
optional: true, optional: true,
schema: GC_SCHEDULE_SCHEMA, schema: SYNC_SCHEDULE_SCHEMA,
}, },
}, },
}, },
@ -154,7 +154,7 @@ pub enum DeletableProperty {
}, },
schedule: { schedule: {
optional: true, optional: true,
schema: GC_SCHEDULE_SCHEMA, schema: SYNC_SCHEDULE_SCHEMA,
}, },
delete: { delete: {
description: "List of properties to delete.", description: "List of properties to delete.",

View File

@ -291,6 +291,11 @@ pub const DATASTORE_SCHEMA: Schema = StringSchema::new("Datastore name.")
.max_length(32) .max_length(32)
.schema(); .schema();
pub const SYNC_SCHEDULE_SCHEMA: Schema = StringSchema::new(
"Run sync job at specified schedule.")
.format(&ApiStringFormat::VerifyFn(crate::tools::systemd::time::verify_calendar_event))
.schema();
pub const GC_SCHEDULE_SCHEMA: Schema = StringSchema::new( pub const GC_SCHEDULE_SCHEMA: Schema = StringSchema::new(
"Run garbage collection job at specified schedule.") "Run garbage collection job at specified schedule.")
.format(&ApiStringFormat::VerifyFn(crate::tools::systemd::time::verify_calendar_event)) .format(&ApiStringFormat::VerifyFn(crate::tools::systemd::time::verify_calendar_event))

View File

@ -46,7 +46,7 @@ lazy_static! {
}, },
schedule: { schedule: {
optional: true, optional: true,
schema: GC_SCHEDULE_SCHEMA, schema: SYNC_SCHEDULE_SCHEMA,
}, },
} }
)] )]