Skip to main content

proxmox_api/generated/nodes/node/ceph/osd/
osdid.rs

1pub mod in_name;
2pub mod lv_info;
3pub mod metadata;
4pub mod out;
5pub mod scrub;
6#[derive(Debug, Clone)]
7pub struct OsdidClient<T> {
8    client: T,
9    path: String,
10}
11impl<T> OsdidClient<T>
12where
13    T: crate::client::Client,
14{
15    pub fn new(client: T, parent_path: &str, osdid: &str) -> Self {
16        Self {
17            client,
18            path: format!("{}/{}", parent_path, osdid),
19        }
20    }
21}
22impl<T> OsdidClient<T>
23where
24    T: crate::client::Client,
25{
26    #[doc = "Destroy OSD"]
27    #[doc = ""]
28    pub async fn delete(&self, params: DeleteParams) -> Result<String, T::Error> {
29        let path = self.path.to_string();
30        self.client.delete(&path, &params).await
31    }
32}
33impl<T> OsdidClient<T>
34where
35    T: crate::client::Client,
36{
37    #[doc = "OSD index."]
38    #[doc = ""]
39    pub async fn get(&self) -> Result<Vec<GetOutputItems>, T::Error> {
40        let path = self.path.to_string();
41        let optional_vec: Option<Vec<GetOutputItems>> = self.client.get(&path, &()).await?;
42        Ok(optional_vec.unwrap_or_default())
43    }
44}
45#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize, Default)]
46pub struct DeleteParams {
47    #[serde(
48        serialize_with = "crate::types::serialize_bool_optional",
49        deserialize_with = "crate::types::deserialize_bool_optional"
50    )]
51    #[serde(skip_serializing_if = "Option::is_none", default)]
52    #[doc = "If set, we remove partition table entries."]
53    #[doc = ""]
54    pub cleanup: Option<bool>,
55    #[serde(
56        flatten,
57        default,
58        skip_serializing_if = "::std::collections::HashMap::is_empty"
59    )]
60    pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
61}
62#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize, Default)]
63pub struct GetOutputItems {
64    #[serde(
65        flatten,
66        default,
67        skip_serializing_if = "::std::collections::HashMap::is_empty"
68    )]
69    pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
70}
71impl<T> OsdidClient<T>
72where
73    T: crate::client::Client,
74{
75    pub fn metadata(&self) -> metadata::MetadataClient<T> {
76        metadata::MetadataClient::<T>::new(self.client.clone(), &self.path)
77    }
78}
79impl<T> OsdidClient<T>
80where
81    T: crate::client::Client,
82{
83    pub fn lv_info(&self) -> lv_info::LvInfoClient<T> {
84        lv_info::LvInfoClient::<T>::new(self.client.clone(), &self.path)
85    }
86}
87impl<T> OsdidClient<T>
88where
89    T: crate::client::Client,
90{
91    pub fn in_name(&self) -> in_name::InNameClient<T> {
92        in_name::InNameClient::<T>::new(self.client.clone(), &self.path)
93    }
94}
95impl<T> OsdidClient<T>
96where
97    T: crate::client::Client,
98{
99    pub fn out(&self) -> out::OutClient<T> {
100        out::OutClient::<T>::new(self.client.clone(), &self.path)
101    }
102}
103impl<T> OsdidClient<T>
104where
105    T: crate::client::Client,
106{
107    pub fn scrub(&self) -> scrub::ScrubClient<T> {
108        scrub::ScrubClient::<T>::new(self.client.clone(), &self.path)
109    }
110}