api: rename h2upload to backup

This commit is contained in:
Dietmar Maurer 2019-05-08 12:35:15 +02:00
parent d906b1124f
commit ca60c371e2
3 changed files with 6 additions and 6 deletions

View File

@ -20,7 +20,7 @@ use crate::server::WorkerTask;
mod pxar; mod pxar;
mod upload; mod upload;
mod h2upload; mod backup;
fn group_backups(backup_list: Vec<BackupInfo>) -> HashMap<String, Vec<BackupInfo>> { fn group_backups(backup_list: Vec<BackupInfo>) -> HashMap<String, Vec<BackupInfo>> {
@ -405,9 +405,9 @@ pub fn router() -> Router {
Router::new() Router::new()
.upgrade(upload::api_method_upgrade_upload())) .upgrade(upload::api_method_upgrade_upload()))
.subdir( .subdir(
"h2upload", "backup",
Router::new() Router::new()
.upgrade(h2upload::api_method_upgrade_h2upload())) .upgrade(backup::api_method_upgrade_backup()))
.subdir( .subdir(
"gc", "gc",
Router::new() Router::new()

View File

@ -17,10 +17,10 @@ use crate::api_schema::*;
use crate::server::formatter::*; use crate::server::formatter::*;
use crate::server::WorkerTask; use crate::server::WorkerTask;
pub fn api_method_upgrade_h2upload() -> ApiAsyncMethod { pub fn api_method_upgrade_backup() -> ApiAsyncMethod {
ApiAsyncMethod::new( ApiAsyncMethod::new(
upgrade_h2upload, upgrade_h2upload,
ObjectSchema::new("Experimental h2 server") ObjectSchema::new("Upgraded to backup protocol.")
.required("store", StringSchema::new("Datastore name.")), .required("store", StringSchema::new("Datastore name.")),
) )
} }

View File

@ -50,7 +50,7 @@ fn run() -> Result<(), Error> {
let mut client = HttpClient::new(host, username)?; let mut client = HttpClient::new(host, username)?;
let h2client = client.h2upgrade("/api2/json/admin/datastore/store2/h2upload"); let h2client = client.h2upgrade("/api2/json/admin/datastore/store2/backup");
let res = h2client.and_then(|mut h2| { let res = h2client.and_then(|mut h2| {
println!("start http2"); println!("start http2");