Skip to main content

proxmox_api/generated/nodes/node/
scan.rs

1pub mod cifs;
2pub mod iscsi;
3pub mod lvm;
4pub mod lvmthin;
5pub mod nfs;
6pub mod pbs;
7pub mod zfs;
8#[derive(Debug, Clone)]
9pub struct ScanClient<T> {
10    client: T,
11    path: String,
12}
13impl<T> ScanClient<T>
14where
15    T: crate::client::Client,
16{
17    pub fn new(client: T, parent_path: &str) -> Self {
18        Self {
19            client,
20            path: format!("{}{}", parent_path, "/scan"),
21        }
22    }
23}
24impl<T> ScanClient<T>
25where
26    T: crate::client::Client,
27{
28    #[doc = "Index of available scan methods"]
29    #[doc = ""]
30    pub async fn get(&self) -> Result<Vec<GetOutputItems>, T::Error> {
31        let path = self.path.to_string();
32        let optional_vec: Option<Vec<GetOutputItems>> = self.client.get(&path, &()).await?;
33        Ok(optional_vec.unwrap_or_default())
34    }
35}
36impl GetOutputItems {
37    pub fn new(method: String) -> Self {
38        Self {
39            method,
40            additional_properties: ::std::default::Default::default(),
41        }
42    }
43}
44#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
45pub struct GetOutputItems {
46    pub method: 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<T> ScanClient<T>
55where
56    T: crate::client::Client,
57{
58    pub fn nfs(&self) -> nfs::NfsClient<T> {
59        nfs::NfsClient::<T>::new(self.client.clone(), &self.path)
60    }
61}
62impl<T> ScanClient<T>
63where
64    T: crate::client::Client,
65{
66    pub fn cifs(&self) -> cifs::CifsClient<T> {
67        cifs::CifsClient::<T>::new(self.client.clone(), &self.path)
68    }
69}
70impl<T> ScanClient<T>
71where
72    T: crate::client::Client,
73{
74    pub fn pbs(&self) -> pbs::PbsClient<T> {
75        pbs::PbsClient::<T>::new(self.client.clone(), &self.path)
76    }
77}
78impl<T> ScanClient<T>
79where
80    T: crate::client::Client,
81{
82    pub fn iscsi(&self) -> iscsi::IscsiClient<T> {
83        iscsi::IscsiClient::<T>::new(self.client.clone(), &self.path)
84    }
85}
86impl<T> ScanClient<T>
87where
88    T: crate::client::Client,
89{
90    pub fn lvm(&self) -> lvm::LvmClient<T> {
91        lvm::LvmClient::<T>::new(self.client.clone(), &self.path)
92    }
93}
94impl<T> ScanClient<T>
95where
96    T: crate::client::Client,
97{
98    pub fn lvmthin(&self) -> lvmthin::LvmthinClient<T> {
99        lvmthin::LvmthinClient::<T>::new(self.client.clone(), &self.path)
100    }
101}
102impl<T> ScanClient<T>
103where
104    T: crate::client::Client,
105{
106    pub fn zfs(&self) -> zfs::ZfsClient<T> {
107        zfs::ZfsClient::<T>::new(self.client.clone(), &self.path)
108    }
109}