proxmox_api/generated/nodes/node/disks/
lvmthin.rs1pub mod name;
2pub struct LvmthinClient<T> {
3 client: T,
4 path: String,
5}
6impl<T> LvmthinClient<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, "/lvmthin"),
14 }
15 }
16}
17impl<T> LvmthinClient<T>
18where
19 T: crate::client::Client,
20{
21 #[doc = "List LVM thinpools"]
22 pub fn get(&self) -> Result<Vec<GetOutputItems>, T::Error> {
23 let path = self.path.to_string();
24 self.client.get(&path, &())
25 }
26}
27impl<T> LvmthinClient<T>
28where
29 T: crate::client::Client,
30{
31 #[doc = "Create an LVM thinpool"]
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 GetOutputItems {
38 pub fn new(
39 lv: String,
40 lv_size: u64,
41 metadata_size: u64,
42 metadata_used: u64,
43 used: u64,
44 vg: String,
45 ) -> Self {
46 Self {
47 lv,
48 lv_size,
49 metadata_size,
50 metadata_used,
51 used,
52 vg,
53 additional_properties: Default::default(),
54 }
55 }
56}
57#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
58pub struct GetOutputItems {
59 #[doc = "The name of the thinpool."]
60 pub lv: String,
61 #[serde(
62 serialize_with = "crate::types::serialize_int",
63 deserialize_with = "crate::types::deserialize_int"
64 )]
65 #[doc = "The size of the thinpool in bytes."]
66 pub lv_size: u64,
67 #[serde(
68 serialize_with = "crate::types::serialize_int",
69 deserialize_with = "crate::types::deserialize_int"
70 )]
71 #[doc = "The size of the metadata lv in bytes."]
72 pub metadata_size: u64,
73 #[serde(
74 serialize_with = "crate::types::serialize_int",
75 deserialize_with = "crate::types::deserialize_int"
76 )]
77 #[doc = "The used bytes of the metadata lv."]
78 pub metadata_used: u64,
79 #[serde(
80 serialize_with = "crate::types::serialize_int",
81 deserialize_with = "crate::types::deserialize_int"
82 )]
83 #[doc = "The used bytes of the thinpool."]
84 pub used: u64,
85 #[doc = "The associated volume group."]
86 pub vg: String,
87 #[serde(
88 flatten,
89 default,
90 skip_serializing_if = "::std::collections::HashMap::is_empty"
91 )]
92 pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
93}
94impl PostParams {
95 pub fn new(device: String, name: String) -> Self {
96 Self {
97 device,
98 name,
99 add_storage: Default::default(),
100 additional_properties: Default::default(),
101 }
102 }
103}
104#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
105pub struct PostParams {
106 #[serde(
107 serialize_with = "crate::types::serialize_bool_optional",
108 deserialize_with = "crate::types::deserialize_bool_optional"
109 )]
110 #[serde(skip_serializing_if = "Option::is_none", default)]
111 #[doc = "Configure storage using the thinpool."]
112 pub add_storage: Option<bool>,
113 #[doc = "The block device you want to create the thinpool on."]
114 pub device: String,
115 #[doc = "The storage identifier."]
116 pub name: String,
117 #[serde(
118 flatten,
119 default,
120 skip_serializing_if = "::std::collections::HashMap::is_empty"
121 )]
122 pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
123}
124impl<T> LvmthinClient<T>
125where
126 T: crate::client::Client,
127{
128 pub fn name(&self, name: &str) -> name::NameClient<T> {
129 name::NameClient::<T>::new(self.client.clone(), &self.path, name)
130 }
131}