Skip to main content

proxmox_api/generated/nodes/node/
disks.rs

1pub mod directory;
2pub mod initgpt;
3pub mod list;
4pub mod lvm;
5pub mod lvmthin;
6pub mod smart;
7pub mod wipedisk;
8pub mod zfs;
9#[derive(Debug, Clone)]
10pub struct DisksClient<T> {
11    client: T,
12    path: String,
13}
14impl<T> DisksClient<T>
15where
16    T: crate::client::Client,
17{
18    pub fn new(client: T, parent_path: &str) -> Self {
19        Self {
20            client,
21            path: format!("{}{}", parent_path, "/disks"),
22        }
23    }
24}
25impl<T> DisksClient<T>
26where
27    T: crate::client::Client,
28{
29    #[doc = "Node index."]
30    #[doc = ""]
31    pub async fn get(&self) -> Result<Vec<GetOutputItems>, T::Error> {
32        let path = self.path.to_string();
33        let optional_vec: Option<Vec<GetOutputItems>> = self.client.get(&path, &()).await?;
34        Ok(optional_vec.unwrap_or_default())
35    }
36}
37#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize, Default)]
38pub struct GetOutputItems {
39    #[serde(
40        flatten,
41        default,
42        skip_serializing_if = "::std::collections::HashMap::is_empty"
43    )]
44    pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
45}
46impl<T> DisksClient<T>
47where
48    T: crate::client::Client,
49{
50    pub fn lvm(&self) -> lvm::LvmClient<T> {
51        lvm::LvmClient::<T>::new(self.client.clone(), &self.path)
52    }
53}
54impl<T> DisksClient<T>
55where
56    T: crate::client::Client,
57{
58    pub fn lvmthin(&self) -> lvmthin::LvmthinClient<T> {
59        lvmthin::LvmthinClient::<T>::new(self.client.clone(), &self.path)
60    }
61}
62impl<T> DisksClient<T>
63where
64    T: crate::client::Client,
65{
66    pub fn directory(&self) -> directory::DirectoryClient<T> {
67        directory::DirectoryClient::<T>::new(self.client.clone(), &self.path)
68    }
69}
70impl<T> DisksClient<T>
71where
72    T: crate::client::Client,
73{
74    pub fn zfs(&self) -> zfs::ZfsClient<T> {
75        zfs::ZfsClient::<T>::new(self.client.clone(), &self.path)
76    }
77}
78impl<T> DisksClient<T>
79where
80    T: crate::client::Client,
81{
82    pub fn list(&self) -> list::ListClient<T> {
83        list::ListClient::<T>::new(self.client.clone(), &self.path)
84    }
85}
86impl<T> DisksClient<T>
87where
88    T: crate::client::Client,
89{
90    pub fn smart(&self) -> smart::SmartClient<T> {
91        smart::SmartClient::<T>::new(self.client.clone(), &self.path)
92    }
93}
94impl<T> DisksClient<T>
95where
96    T: crate::client::Client,
97{
98    pub fn initgpt(&self) -> initgpt::InitgptClient<T> {
99        initgpt::InitgptClient::<T>::new(self.client.clone(), &self.path)
100    }
101}
102impl<T> DisksClient<T>
103where
104    T: crate::client::Client,
105{
106    pub fn wipedisk(&self) -> wipedisk::WipediskClient<T> {
107        wipedisk::WipediskClient::<T>::new(self.client.clone(), &self.path)
108    }
109}