move disks api to /node/<node>/disks

This commit is contained in:
Dietmar Maurer 2020-06-06 14:43:36 +02:00
parent 7fa2779559
commit ce8e3de401
3 changed files with 10 additions and 2 deletions

View File

@ -8,7 +8,6 @@ mod subscription;
pub mod types; pub mod types;
pub mod version; pub mod version;
pub mod pull; pub mod pull;
pub mod disks;
use proxmox::api::router::SubdirMap; use proxmox::api::router::SubdirMap;
use proxmox::api::Router; use proxmox::api::Router;
@ -21,7 +20,6 @@ pub const SUBDIRS: SubdirMap = &[
("admin", &admin::ROUTER), ("admin", &admin::ROUTER),
("backup", &backup::ROUTER), ("backup", &backup::ROUTER),
("config", &config::ROUTER), ("config", &config::ROUTER),
("disks", &disks::ROUTER),
("nodes", &NODES_ROUTER), ("nodes", &NODES_ROUTER),
("pull", &pull::ROUTER), ("pull", &pull::ROUTER),
("reader", &reader::ROUTER), ("reader", &reader::ROUTER),

View File

@ -10,8 +10,10 @@ mod journal;
mod services; mod services;
mod status; mod status;
mod rrd; mod rrd;
pub mod disks;
pub const SUBDIRS: SubdirMap = &[ pub const SUBDIRS: SubdirMap = &[
("disks", &disks::ROUTER),
("dns", &dns::ROUTER), ("dns", &dns::ROUTER),
("journal", &journal::ROUTER), ("journal", &journal::ROUTER),
("network", &network::ROUTER), ("network", &network::ROUTER),

View File

@ -11,10 +11,15 @@ use crate::tools::disks::{
get_disks, get_smart_data, get_disks, get_smart_data,
}; };
use crate::api2::types::NODE_SCHEMA;
#[api( #[api(
protected: true, protected: true,
input: { input: {
properties: { properties: {
node: {
schema: NODE_SCHEMA,
},
skipsmart: { skipsmart: {
description: "Skip smart checks.", description: "Skip smart checks.",
type: bool, type: bool,
@ -63,6 +68,9 @@ pub fn list_disks(
protected: true, protected: true,
input: { input: {
properties: { properties: {
node: {
schema: NODE_SCHEMA,
},
disk: { disk: {
description: "Block device name.", description: "Block device name.",
type: String, type: String,