proxmox_api/generated/nodes/node/disks/
lvm.rs1pub mod name;
2pub struct LvmClient<T> {
3 client: T,
4 path: String,
5}
6impl<T> LvmClient<T>
7where
8 T: crate::client::Client,
9{
10 pub fn new(client: T, parent_path: &str) -> Self {
11 Self {
12 client,
13 path: format!("{}{}", parent_path, "/lvm"),
14 }
15 }
16}
17impl<T> LvmClient<T>
18where
19 T: crate::client::Client,
20{
21 #[doc = "List LVM Volume Groups"]
22 pub fn get(&self) -> Result<GetOutput, T::Error> {
23 let path = self.path.to_string();
24 self.client.get(&path, &())
25 }
26}
27impl<T> LvmClient<T>
28where
29 T: crate::client::Client,
30{
31 #[doc = "Create an LVM Volume Group"]
32 pub fn post(&self, params: PostParams) -> Result<String, T::Error> {
33 let path = self.path.to_string();
34 self.client.post(&path, ¶ms)
35 }
36}
37impl ChildrenGetOutputChildrenItems {
38 pub fn new(free: u64, leaf: bool, name: String, size: u64) -> Self {
39 Self {
40 free,
41 leaf,
42 name,
43 size,
44 children: Default::default(),
45 additional_properties: Default::default(),
46 }
47 }
48}
49#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
50pub struct ChildrenGetOutputChildrenItems {
51 #[serde(skip_serializing_if = "::std::vec::Vec::is_empty", default)]
52 #[doc = "The underlying physical volumes"]
53 pub children: Vec<ChildrenGetOutputChildrenItemsChildrenItems>,
54 #[serde(
55 serialize_with = "crate::types::serialize_int",
56 deserialize_with = "crate::types::deserialize_int"
57 )]
58 #[doc = "The free bytes in the volume group"]
59 pub free: u64,
60 #[serde(
61 serialize_with = "crate::types::serialize_bool",
62 deserialize_with = "crate::types::deserialize_bool"
63 )]
64 pub leaf: bool,
65 #[doc = "The name of the volume group"]
66 pub name: String,
67 #[serde(
68 serialize_with = "crate::types::serialize_int",
69 deserialize_with = "crate::types::deserialize_int"
70 )]
71 #[doc = "The size of the volume group in bytes"]
72 pub size: u64,
73 #[serde(
74 flatten,
75 default,
76 skip_serializing_if = "::std::collections::HashMap::is_empty"
77 )]
78 pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
79}
80impl ChildrenGetOutputChildrenItemsChildrenItems {
81 pub fn new(free: u64, leaf: bool, name: String, size: u64) -> Self {
82 Self {
83 free,
84 leaf,
85 name,
86 size,
87 additional_properties: Default::default(),
88 }
89 }
90}
91#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
92pub struct ChildrenGetOutputChildrenItemsChildrenItems {
93 #[serde(
94 serialize_with = "crate::types::serialize_int",
95 deserialize_with = "crate::types::deserialize_int"
96 )]
97 #[doc = "The free bytes in the physical volume"]
98 pub free: u64,
99 #[serde(
100 serialize_with = "crate::types::serialize_bool",
101 deserialize_with = "crate::types::deserialize_bool"
102 )]
103 pub leaf: bool,
104 #[doc = "The name of the physical volume"]
105 pub name: String,
106 #[serde(
107 serialize_with = "crate::types::serialize_int",
108 deserialize_with = "crate::types::deserialize_int"
109 )]
110 #[doc = "The size of the physical volume in bytes"]
111 pub size: u64,
112 #[serde(
113 flatten,
114 default,
115 skip_serializing_if = "::std::collections::HashMap::is_empty"
116 )]
117 pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
118}
119impl GetOutput {
120 pub fn new(children: Vec<ChildrenGetOutputChildrenItems>, leaf: bool) -> Self {
121 Self {
122 children,
123 leaf,
124 additional_properties: Default::default(),
125 }
126 }
127}
128#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
129pub struct GetOutput {
130 #[serde(skip_serializing_if = "::std::vec::Vec::is_empty", default)]
131 pub children: Vec<ChildrenGetOutputChildrenItems>,
132 #[serde(
133 serialize_with = "crate::types::serialize_bool",
134 deserialize_with = "crate::types::deserialize_bool"
135 )]
136 pub leaf: bool,
137 #[serde(
138 flatten,
139 default,
140 skip_serializing_if = "::std::collections::HashMap::is_empty"
141 )]
142 pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
143}
144impl PostParams {
145 pub fn new(device: String, name: String) -> Self {
146 Self {
147 device,
148 name,
149 add_storage: Default::default(),
150 additional_properties: Default::default(),
151 }
152 }
153}
154#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
155pub struct PostParams {
156 #[serde(
157 serialize_with = "crate::types::serialize_bool_optional",
158 deserialize_with = "crate::types::deserialize_bool_optional"
159 )]
160 #[serde(skip_serializing_if = "Option::is_none", default)]
161 #[doc = "Configure storage using the Volume Group"]
162 pub add_storage: Option<bool>,
163 #[doc = "The block device you want to create the volume group on"]
164 pub device: String,
165 #[doc = "The storage identifier."]
166 pub name: String,
167 #[serde(
168 flatten,
169 default,
170 skip_serializing_if = "::std::collections::HashMap::is_empty"
171 )]
172 pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
173}
174impl<T> LvmClient<T>
175where
176 T: crate::client::Client,
177{
178 pub fn name(&self, name: &str) -> name::NameClient<T> {
179 name::NameClient::<T>::new(self.client.clone(), &self.path, name)
180 }
181}