src/client/http_client.rs: cleanup h2 backup client

This commit is contained in:
Dietmar Maurer
2019-05-22 13:05:51 +02:00
parent a55fcd740f
commit 6ab34afa88
2 changed files with 82 additions and 30 deletions

View File

@ -13,8 +13,7 @@ fn upload_speed() -> Result<usize, Error> {
let mut client = HttpClient::new(host, username)?;
let param = json!({"backup-type": "host", "backup-id": "speedtest" });
let upgrade = client.h2upgrade(&format!("/api2/json/admin/datastore/{}/backup", datastore), Some(param));
let upgrade = client.start_backup(datastore, "host", "speedtest");
let res = upgrade.and_then(|h2| {
println!("start upload speed test");