src/api2/types.rs: factor out DATASTORE_SCHEMA

This commit is contained in:
Dietmar Maurer
2019-12-11 13:45:23 +01:00
parent 567d3e00fb
commit 66c49c21c3
6 changed files with 20 additions and 17 deletions

View File

@ -6,6 +6,7 @@ use serde_json::{json, Value};
use proxmox::api::{ApiHandler, ApiMethod, Router, RpcEnvironment};
use proxmox::api::schema::*;
use crate::api2::types::*;
use crate::backup::*;
use crate::config::datastore;
@ -30,7 +31,7 @@ pub const POST: ApiMethod = ApiMethod::new(
&ObjectSchema::new(
"Create new datastore.",
&[
("name", false, &StringSchema::new("Datastore name.").schema()),
("name", false, &DATASTORE_SCHEMA),
("path", false, &StringSchema::new("Directory path (must exist).").schema()),
],
)
@ -71,7 +72,7 @@ pub const DELETE: ApiMethod = ApiMethod::new(
&ObjectSchema::new(
"Remove a datastore configuration.",
&[
("name", false, &StringSchema::new("Datastore name.").schema()),
("name", false, &DATASTORE_SCHEMA),
],
)
);