1use clap::{Parser, Subcommand};
2use expression_format::ex_format;
3use nethsm::SystemState::{Locked, Operational, Unprovisioned};
4
5#[derive(Debug, Subcommand)]
6#[command(
7 about = "Retrieve health information for a device",
8 long_about = "Retrieve health information for a device
9
10Retrieve alive, ready and state information."
11)]
12pub enum HealthCommand {
13 Alive(AliveCommand),
14 Ready(ReadyCommand),
15 State(StateCommand),
16}
17
18#[derive(Debug, Parser)]
19#[command(
20 about = "Check whether a device is in locked or unprovisioned state",
21 long_about = ex_format!("Check whether a device is in locked or unprovisioned state
22
23Returns an error if the target device is not in state \"{Locked}\" or \"{Unprovisioned}\".
24
25Requires no authentication."
26 )
27)]
28pub struct AliveCommand;
29
30#[derive(Debug, Parser)]
31#[command(
32 about = "Check whether a device is in operational state",
33 long_about = ex_format!("Check whether a device is in operational state
34
35Returns an error if the target device is not state \"{Operational}\".
36
37Requires no authentication.")
38)]
39pub struct ReadyCommand;
40
41#[derive(Debug, Parser)]
42#[command(
43 about = "Retrieve the state for a device",
44 long_about = ex_format!("Retrieve the state for a device
45
46* \"{Operational}\" if the target device is in operational state
47* \"{Locked}\" if the target device is locked
48* \"{Unprovisioned}\" if the target device is not yet provisioned
49
50Requires no authentication.")
51)]
52pub struct StateCommand;