src/api2/admin/datastore.rs: implement API to return last GC status

This commit is contained in:
Dietmar Maurer
2019-04-11 12:04:25 +02:00
parent 8d76e8b773
commit f2b99c34f7
3 changed files with 21 additions and 4 deletions

View File

@ -323,10 +323,13 @@ fn garbage_collection_status(
let store = param["store"].as_str().unwrap();
let datastore = DataStore::lookup_datastore(&store)?;
println!("Garbage collection status on store {}", store);
Ok(json!(null))
let status = datastore.last_gc_status();
Ok(serde_json::to_value(&status)?)
}
pub fn api_method_garbage_collection_status() -> ApiMethod {
@ -391,7 +394,7 @@ pub fn router() -> Router {
{"subdir": "gc" },
{"subdir": "groups" },
{"subdir": "snapshots" },
{"subdir": "status" },
//{"subdir": "status" },
{"subdir": "prune" },
])),
ObjectSchema::new("Directory index.")