RFC: schema: make enums static
I don't see a reason to allow these to be dynamically modifiable. Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
@ -33,7 +33,7 @@ pub fn api_method_upgrade_backup() -> ApiAsyncMethod {
|
||||
ObjectSchema::new("Upgraded to backup protocol.")
|
||||
.required("store", StringSchema::new("Datastore name."))
|
||||
.required("backup-type", StringSchema::new("Backup type.")
|
||||
.format(Arc::new(ApiStringFormat::Enum(vec!["vm".into(), "ct".into(), "host".into()]))))
|
||||
.format(Arc::new(ApiStringFormat::Enum(&["vm", "ct", "host"]))))
|
||||
.required("backup-id", StringSchema::new("Backup ID."))
|
||||
)
|
||||
}
|
||||
|
@ -130,7 +130,7 @@ pub fn api_method_upload_pxar() -> ApiAsyncMethod {
|
||||
.required("store", StringSchema::new("Datastore name."))
|
||||
.required("archive-name", StringSchema::new("Backup archive name."))
|
||||
.required("backup-type", StringSchema::new("Backup type.")
|
||||
.format(Arc::new(ApiStringFormat::Enum(vec!["ct".into(), "host".into()]))))
|
||||
.format(Arc::new(ApiStringFormat::Enum(&["ct", "host"]))))
|
||||
.required("backup-id", StringSchema::new("Backup ID."))
|
||||
.required("backup-time", IntegerSchema::new("Backup time (Unix epoch.)")
|
||||
.minimum(1547797308))
|
||||
@ -194,7 +194,7 @@ pub fn api_method_download_pxar() -> ApiAsyncMethod {
|
||||
.required("store", StringSchema::new("Datastore name."))
|
||||
.required("archive-name", StringSchema::new("Backup archive name."))
|
||||
.required("backup-type", StringSchema::new("Backup type.")
|
||||
.format(Arc::new(ApiStringFormat::Enum(vec!["ct".into(), "host".into()]))))
|
||||
.format(Arc::new(ApiStringFormat::Enum(&["ct", "host"]))))
|
||||
.required("backup-id", StringSchema::new("Backup ID."))
|
||||
.required("backup-time", IntegerSchema::new("Backup time (Unix epoch.)")
|
||||
.minimum(1547797308))
|
||||
|
Reference in New Issue
Block a user