src/api2/backup.rs: cleanup schema definitions

This commit is contained in:
Dietmar Maurer
2019-07-26 09:07:29 +02:00
parent ca5d0b61ca
commit bbf9e7e951
4 changed files with 47 additions and 34 deletions

View File

@ -67,4 +67,19 @@ lazy_static!{
StringSchema::new("Backup archive name.")
.format(FILENAME_FORMAT.clone()).into();
pub static ref BACKUP_TYPE_SCHEMA: Arc<Schema> =
StringSchema::new("Backup type.")
.format(Arc::new(ApiStringFormat::Enum(&["vm", "ct", "host"])))
.into();
pub static ref BACKUP_ID_SCHEMA: Arc<Schema> =
StringSchema::new("Backup ID.")
.format(FILENAME_FORMAT.clone())
.into();
pub static ref BACKUP_TIME_SCHEMA: Arc<Schema> =
IntegerSchema::new("Backup time (Unix epoch.)")
.minimum(1547797308)
.into();
}