From 3d229a4a01b8a93c70ec0d826fc09840a580f2b5 Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Wed, 4 Dec 2019 14:18:11 +0100 Subject: [PATCH] Revert "test another api macro use" This reverts commit a9aa52e6a8aea4fb6db05ce697df684583f3e065. Because we do not want to use macros for the backup protocol for now. And because it crashes backup tasks for some unknown reason. --- src/api2/backup.rs | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/src/api2/backup.rs b/src/api2/backup.rs index abe247b9..13463716 100644 --- a/src/api2/backup.rs +++ b/src/api2/backup.rs @@ -6,7 +6,7 @@ use hyper::{Body, Response, StatusCode}; use serde_json::{json, Value}; use proxmox::{sortable, identity}; -use proxmox::api::{api, list_subdirs_api_method}; +use proxmox::api::list_subdirs_api_method; use proxmox::api::{ApiFuture, ApiHandler, ApiMethod, Router, RpcEnvironment}; use proxmox::api::router::SubdirMap; use proxmox::api::schema::*; @@ -216,18 +216,20 @@ pub const BACKUP_API_ROUTER: Router = Router::new() .get(&list_subdirs_api_method!(BACKUP_API_SUBDIRS)) .subdirs(BACKUP_API_SUBDIRS); -#[api( - input: { - properties: { - "archive-name": { - schema: crate::api2::types::BACKUP_ARCHIVE_NAME_SCHEMA, - }, - }, - }, -)] -/// Create dynamic chunk index file. +#[sortable] +pub const API_METHOD_CREATE_DYNAMIC_INDEX: ApiMethod = ApiMethod::new( + &ApiHandler::Sync(&create_dynamic_index), + &ObjectSchema::new( + "Create dynamic chunk index file.", + &sorted!([ + ("archive-name", false, &crate::api2::types::BACKUP_ARCHIVE_NAME_SCHEMA), + ]), + ) +); + fn create_dynamic_index( param: Value, + _info: &ApiMethod, rpcenv: &mut dyn RpcEnvironment, ) -> Result {