src/api2.rs: move backup api to /backup
This commit is contained in:
parent
97eeea3b4a
commit
7773ccc11f
|
@ -1,6 +1,7 @@
|
|||
pub mod types;
|
||||
pub mod config;
|
||||
pub mod admin;
|
||||
pub mod backup;
|
||||
pub mod node;
|
||||
mod version;
|
||||
mod subscription;
|
||||
|
@ -16,6 +17,7 @@ pub fn router() -> Router {
|
|||
let route = Router::new()
|
||||
.subdir("access", access::router())
|
||||
.subdir("admin", admin::router())
|
||||
.subdir("backup", backup::router())
|
||||
.subdir("config", config::router())
|
||||
.subdir("nodes", nodes)
|
||||
.subdir("subscription", subscription::router())
|
||||
|
|
|
@ -20,7 +20,6 @@ use crate::server::WorkerTask;
|
|||
|
||||
mod pxar;
|
||||
mod upload;
|
||||
pub mod backup;
|
||||
|
||||
fn group_backups(backup_list: Vec<BackupInfo>) -> HashMap<String, Vec<BackupInfo>> {
|
||||
|
||||
|
@ -393,10 +392,6 @@ pub fn router() -> Router {
|
|||
"test-upload",
|
||||
Router::new()
|
||||
.upgrade(upload::api_method_upgrade_upload()))
|
||||
.subdir(
|
||||
"backup",
|
||||
Router::new()
|
||||
.upgrade(backup::api_method_upgrade_backup()))
|
||||
.subdir(
|
||||
"gc",
|
||||
Router::new()
|
||||
|
|
|
@ -26,6 +26,10 @@ use service::*;
|
|||
mod upload_chunk;
|
||||
use upload_chunk::*;
|
||||
|
||||
pub fn router() -> Router {
|
||||
Router::new()
|
||||
.upgrade(api_method_upgrade_backup())
|
||||
}
|
||||
|
||||
pub fn api_method_upgrade_backup() -> ApiAsyncMethod {
|
||||
ApiAsyncMethod::new(
|
|
@ -5,7 +5,7 @@ use proxmox_backup::api_schema::format::*;
|
|||
|
||||
fn main() -> Result<(), Error> {
|
||||
|
||||
let api = api2::admin::datastore::backup::backup_api();
|
||||
let api = api2::backup::backup_api();
|
||||
|
||||
dump_api(&mut std::io::stdout(), &api, ".", 0)?;
|
||||
|
||||
|
|
|
@ -258,9 +258,8 @@ impl HttpClient {
|
|||
debug: bool,
|
||||
) -> impl Future<Item=BackupClient, Error=Error> {
|
||||
|
||||
let path = format!("/api2/json/admin/datastore/{}/backup", datastore);
|
||||
let param = json!({"backup-type": backup_type, "backup-id": backup_id, "debug": debug});
|
||||
let mut req = Self::request_builder(&self.server, "GET", &path, Some(param)).unwrap();
|
||||
let param = json!({"backup-type": backup_type, "backup-id": backup_id, "store": datastore, "debug": debug});
|
||||
let mut req = Self::request_builder(&self.server, "GET", "/api2/json/backup", Some(param)).unwrap();
|
||||
|
||||
let login = self.auth.listen();
|
||||
|
||||
|
|
Loading…
Reference in New Issue