proxmox_api/generated/nodes/node/disks/
smart.rs1pub struct SmartClient<T> {
2 client: T,
3 path: String,
4}
5impl<T> SmartClient<T>
6where
7 T: crate::client::Client,
8{
9 pub fn new(client: T, parent_path: &str) -> Self {
10 Self {
11 client,
12 path: format!("{}{}", parent_path, "/smart"),
13 }
14 }
15}
16impl<T> SmartClient<T>
17where
18 T: crate::client::Client,
19{
20 #[doc = "Get SMART Health of a disk."]
21 pub fn get(&self, params: GetParams) -> Result<GetOutput, T::Error> {
22 let path = self.path.to_string();
23 self.client.get(&path, ¶ms)
24 }
25}
26impl GetOutput {
27 pub fn new(health: String) -> Self {
28 Self {
29 health,
30 attributes: Default::default(),
31 text: Default::default(),
32 ty: Default::default(),
33 additional_properties: Default::default(),
34 }
35 }
36}
37#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
38pub struct GetOutput {
39 #[serde(skip_serializing_if = "Option::is_none", default)]
40 pub attributes: Option<()>,
41 pub health: String,
42 #[serde(skip_serializing_if = "Option::is_none", default)]
43 pub text: Option<String>,
44 #[serde(rename = "type")]
45 #[serde(skip_serializing_if = "Option::is_none", default)]
46 pub ty: Option<String>,
47 #[serde(
48 flatten,
49 default,
50 skip_serializing_if = "::std::collections::HashMap::is_empty"
51 )]
52 pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
53}
54impl GetParams {
55 pub fn new(disk: String) -> Self {
56 Self {
57 disk,
58 healthonly: Default::default(),
59 additional_properties: Default::default(),
60 }
61 }
62}
63#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
64pub struct GetParams {
65 #[doc = "Block device name"]
66 pub disk: String,
67 #[serde(
68 serialize_with = "crate::types::serialize_bool_optional",
69 deserialize_with = "crate::types::deserialize_bool_optional"
70 )]
71 #[serde(skip_serializing_if = "Option::is_none", default)]
72 #[doc = "If true returns only the health status"]
73 pub healthonly: Option<bool>,
74 #[serde(
75 flatten,
76 default,
77 skip_serializing_if = "::std::collections::HashMap::is_empty"
78 )]
79 pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
80}