From ce8e3de401e8d96a2e6b6488d5fa71414c308b60 Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Sat, 6 Jun 2020 14:43:36 +0200 Subject: [PATCH] move disks api to /node//disks --- src/api2.rs | 2 -- src/api2/node.rs | 2 ++ src/api2/{ => node}/disks.rs | 8 ++++++++ 3 files changed, 10 insertions(+), 2 deletions(-) rename src/api2/{ => node}/disks.rs (93%) diff --git a/src/api2.rs b/src/api2.rs index d4d85c2d..abcba8e3 100644 --- a/src/api2.rs +++ b/src/api2.rs @@ -8,7 +8,6 @@ mod subscription; pub mod types; pub mod version; pub mod pull; -pub mod disks; use proxmox::api::router::SubdirMap; use proxmox::api::Router; @@ -21,7 +20,6 @@ pub const SUBDIRS: SubdirMap = &[ ("admin", &admin::ROUTER), ("backup", &backup::ROUTER), ("config", &config::ROUTER), - ("disks", &disks::ROUTER), ("nodes", &NODES_ROUTER), ("pull", &pull::ROUTER), ("reader", &reader::ROUTER), diff --git a/src/api2/node.rs b/src/api2/node.rs index 0a6d894e..8ff8220d 100644 --- a/src/api2/node.rs +++ b/src/api2/node.rs @@ -10,8 +10,10 @@ mod journal; mod services; mod status; mod rrd; +pub mod disks; pub const SUBDIRS: SubdirMap = &[ + ("disks", &disks::ROUTER), ("dns", &dns::ROUTER), ("journal", &journal::ROUTER), ("network", &network::ROUTER), diff --git a/src/api2/disks.rs b/src/api2/node/disks.rs similarity index 93% rename from src/api2/disks.rs rename to src/api2/node/disks.rs index 8c9d6d11..b65b4d96 100644 --- a/src/api2/disks.rs +++ b/src/api2/node/disks.rs @@ -11,10 +11,15 @@ use crate::tools::disks::{ get_disks, get_smart_data, }; +use crate::api2::types::NODE_SCHEMA; + #[api( protected: true, input: { properties: { + node: { + schema: NODE_SCHEMA, + }, skipsmart: { description: "Skip smart checks.", type: bool, @@ -63,6 +68,9 @@ pub fn list_disks( protected: true, input: { properties: { + node: { + schema: NODE_SCHEMA, + }, disk: { description: "Block device name.", type: String,