proxmox_api/generated/nodes/node/disks/zfs/
name.rs1pub struct NameClient<T> {
2 client: T,
3 path: String,
4}
5impl<T> NameClient<T>
6where
7 T: crate::client::Client,
8{
9 pub fn new(client: T, parent_path: &str, name: &str) -> Self {
10 Self {
11 client,
12 path: format!("{}/{}", parent_path, name),
13 }
14 }
15}
16impl<T> NameClient<T>
17where
18 T: crate::client::Client,
19{
20 #[doc = "Destroy a ZFS pool."]
21 pub fn delete(&self, params: DeleteParams) -> Result<String, T::Error> {
22 let path = self.path.to_string();
23 self.client.delete(&path, ¶ms)
24 }
25}
26impl<T> NameClient<T>
27where
28 T: crate::client::Client,
29{
30 #[doc = "Get details about a zpool."]
31 pub fn get(&self) -> Result<GetOutput, T::Error> {
32 let path = self.path.to_string();
33 self.client.get(&path, &())
34 }
35}
36impl ChildrenGetOutputChildrenItems {
37 pub fn new(msg: String, name: String) -> Self {
38 Self {
39 msg,
40 name,
41 cksum: Default::default(),
42 read: Default::default(),
43 state: Default::default(),
44 write: Default::default(),
45 additional_properties: Default::default(),
46 }
47 }
48}
49#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
50pub struct ChildrenGetOutputChildrenItems {
51 #[serde(
52 serialize_with = "crate::types::serialize_number_optional",
53 deserialize_with = "crate::types::deserialize_number_optional"
54 )]
55 #[serde(skip_serializing_if = "Option::is_none", default)]
56 pub cksum: Option<f64>,
57 #[doc = "An optional message about the vdev."]
58 pub msg: String,
59 #[doc = "The name of the vdev or section."]
60 pub name: String,
61 #[serde(
62 serialize_with = "crate::types::serialize_number_optional",
63 deserialize_with = "crate::types::deserialize_number_optional"
64 )]
65 #[serde(skip_serializing_if = "Option::is_none", default)]
66 pub read: Option<f64>,
67 #[serde(skip_serializing_if = "Option::is_none", default)]
68 #[doc = "The state of the vdev."]
69 pub state: Option<String>,
70 #[serde(
71 serialize_with = "crate::types::serialize_number_optional",
72 deserialize_with = "crate::types::deserialize_number_optional"
73 )]
74 #[serde(skip_serializing_if = "Option::is_none", default)]
75 pub write: Option<f64>,
76 #[serde(
77 flatten,
78 default,
79 skip_serializing_if = "::std::collections::HashMap::is_empty"
80 )]
81 pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
82}
83#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize, Default)]
84pub struct DeleteParams {
85 #[serde(rename = "cleanup-config")]
86 #[serde(
87 serialize_with = "crate::types::serialize_bool_optional",
88 deserialize_with = "crate::types::deserialize_bool_optional"
89 )]
90 #[serde(skip_serializing_if = "Option::is_none", default)]
91 #[doc = "Marks associated storage(s) as not available on this node anymore or removes them from the configuration (if configured for this node only)."]
92 pub cleanup_config: Option<bool>,
93 #[serde(rename = "cleanup-disks")]
94 #[serde(
95 serialize_with = "crate::types::serialize_bool_optional",
96 deserialize_with = "crate::types::deserialize_bool_optional"
97 )]
98 #[serde(skip_serializing_if = "Option::is_none", default)]
99 #[doc = "Also wipe disks so they can be repurposed afterwards."]
100 pub cleanup_disks: Option<bool>,
101 #[serde(
102 flatten,
103 default,
104 skip_serializing_if = "::std::collections::HashMap::is_empty"
105 )]
106 pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
107}
108impl GetOutput {
109 pub fn new(
110 children: Vec<ChildrenGetOutputChildrenItems>,
111 errors: String,
112 name: String,
113 state: String,
114 ) -> Self {
115 Self {
116 children,
117 errors,
118 name,
119 state,
120 action: Default::default(),
121 scan: Default::default(),
122 status: Default::default(),
123 additional_properties: Default::default(),
124 }
125 }
126}
127#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
128pub struct GetOutput {
129 #[serde(skip_serializing_if = "Option::is_none", default)]
130 #[doc = "Information about the recommended action to fix the state."]
131 pub action: Option<String>,
132 #[serde(skip_serializing_if = "::std::vec::Vec::is_empty", default)]
133 #[doc = "The pool configuration information, including the vdevs for each section (e.g. spares, cache), may be nested."]
134 pub children: Vec<ChildrenGetOutputChildrenItems>,
135 #[doc = "Information about the errors on the zpool."]
136 pub errors: String,
137 #[doc = "The name of the zpool."]
138 pub name: String,
139 #[serde(skip_serializing_if = "Option::is_none", default)]
140 #[doc = "Information about the last/current scrub."]
141 pub scan: Option<String>,
142 #[doc = "The state of the zpool."]
143 pub state: String,
144 #[serde(skip_serializing_if = "Option::is_none", default)]
145 #[doc = "Information about the state of the zpool."]
146 pub status: Option<String>,
147 #[serde(
148 flatten,
149 default,
150 skip_serializing_if = "::std::collections::HashMap::is_empty"
151 )]
152 pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
153}