api3/config/datastore.rs: create datastore files

This commit is contained in:
root 2018-12-13 14:41:14 +01:00
parent 7f4e639b37
commit 15b64d4606

View File

@ -3,7 +3,9 @@ use failure::*;
use crate::api::schema::*;
use crate::api::router::*;
use crate::backup::chunk_store::*;
use serde_json::{json, Value};
use std::path::{Path, PathBuf};
use crate::config::datastore;
@ -41,6 +43,9 @@ fn create_datastore(param: Value, _info: &ApiMethod) -> Result<Value, Error> {
bail!("datastore '{}' already exists.", name);
}
let path: PathBuf = param["path"].as_str().unwrap().into();
let _store = ChunkStore::create(path)?;
let datastore = json!({
"path": param["path"]
});