src/api2/node/status.rs: rework api, implement reboot and shutdown

This commit is contained in:
Dietmar Maurer
2020-04-30 11:52:40 +02:00
parent ca9dfe5fa4
commit ed751dc2ab
2 changed files with 60 additions and 11 deletions

View File

@ -499,6 +499,17 @@ pub struct TaskListItem {
pub status: Option<String>,
}
#[api()]
#[derive(Debug, Copy, Clone, PartialEq, Serialize, Deserialize)]
#[serde(rename_all = "lowercase")]
/// Node Power command type.
pub enum NodePowerCommand {
/// Restart the server
Reboot,
/// Shutdown the server
Shutdown,
}
#[api()]
#[derive(Debug, Copy, Clone, PartialEq, Serialize, Deserialize)]
#[serde(rename_all = "lowercase")]