From: Wolfgang Bumiller Date: Thu, 19 May 2022 07:57:20 +0000 (+0200) Subject: api: add some missing sorted macro calls X-Git-Tag: v2.3.1~324 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=8721b42e2f954d8846afe1dfe7224a6492f6d407;p=proxmox-backup.git api: add some missing sorted macro calls Signed-off-by: Wolfgang Bumiller --- diff --git a/src/api2/admin/mod.rs b/src/api2/admin/mod.rs index bbe88f6a..d8ffc106 100644 --- a/src/api2/admin/mod.rs +++ b/src/api2/admin/mod.rs @@ -2,6 +2,7 @@ use proxmox_router::list_subdirs_api_method; use proxmox_router::{Router, SubdirMap}; +use proxmox_sys::sortable; pub mod datastore; pub mod namespace; @@ -9,12 +10,13 @@ pub mod sync; pub mod traffic_control; pub mod verify; -const SUBDIRS: SubdirMap = &[ +#[sortable] +const SUBDIRS: SubdirMap = &sorted!([ ("datastore", &datastore::ROUTER), ("sync", &sync::ROUTER), ("traffic-control", &traffic_control::ROUTER), ("verify", &verify::ROUTER), -]; +]); pub const ROUTER: Router = Router::new() .get(&list_subdirs_api_method!(SUBDIRS)) diff --git a/src/api2/config/mod.rs b/src/api2/config/mod.rs index f36474ed..0c98edf2 100644 --- a/src/api2/config/mod.rs +++ b/src/api2/config/mod.rs @@ -2,6 +2,7 @@ use proxmox_router::list_subdirs_api_method; use proxmox_router::{Router, SubdirMap}; +use proxmox_sys::sortable; pub mod access; pub mod acme; @@ -16,7 +17,8 @@ pub mod tape_encryption_keys; pub mod traffic_control; pub mod verify; -const SUBDIRS: SubdirMap = &[ +#[sortable] +const SUBDIRS: SubdirMap = &sorted!([ ("access", &access::ROUTER), ("acme", &acme::ROUTER), ("changer", &changer::ROUTER), @@ -29,7 +31,7 @@ const SUBDIRS: SubdirMap = &[ ("tape-encryption-keys", &tape_encryption_keys::ROUTER), ("traffic-control", &traffic_control::ROUTER), ("verify", &verify::ROUTER), -]; +]); pub const ROUTER: Router = Router::new() .get(&list_subdirs_api_method!(SUBDIRS)) diff --git a/src/api2/config/remote.rs b/src/api2/config/remote.rs index ee7b9916..a86a74a7 100644 --- a/src/api2/config/remote.rs +++ b/src/api2/config/remote.rs @@ -503,13 +503,13 @@ pub async fn scan_remote_groups( } #[sortable] -const DATASTORE_SCAN_SUBDIRS: SubdirMap = &[ +const DATASTORE_SCAN_SUBDIRS: SubdirMap = &sorted!([ ("groups", &Router::new().get(&API_METHOD_SCAN_REMOTE_GROUPS)), ( "namespaces", &Router::new().get(&API_METHOD_SCAN_REMOTE_NAMESPACES), ), -]; +]); const DATASTORE_SCAN_ROUTER: Router = Router::new() .get(&list_subdirs_api_method!(DATASTORE_SCAN_SUBDIRS)) diff --git a/src/api2/mod.rs b/src/api2/mod.rs index 6e0a748e..2a83020c 100644 --- a/src/api2/mod.rs +++ b/src/api2/mod.rs @@ -1,5 +1,7 @@ //! The Proxmox Backup Server API +use proxmox_sys::sortable; + pub mod access; pub mod admin; pub mod backup; @@ -16,7 +18,8 @@ pub mod version; use proxmox_router::{list_subdirs_api_method, Router, SubdirMap}; -const SUBDIRS: SubdirMap = &[ +#[sortable] +const SUBDIRS: SubdirMap = &sorted!([ ("access", &access::ROUTER), ("admin", &admin::ROUTER), ("backup", &backup::ROUTER), @@ -28,7 +31,7 @@ const SUBDIRS: SubdirMap = &[ ("status", &status::ROUTER), ("tape", &tape::ROUTER), ("version", &version::ROUTER), -]; +]); pub const ROUTER: Router = Router::new() .get(&list_subdirs_api_method!(SUBDIRS))