proxmox_api/generated/cluster/ceph/
metadata.rs

1pub struct MetadataClient<T> {
2    client: T,
3    path: String,
4}
5impl<T> MetadataClient<T>
6where
7    T: crate::client::Client,
8{
9    pub fn new(client: T, parent_path: &str) -> Self {
10        Self {
11            client,
12            path: format!("{}{}", parent_path, "/metadata"),
13        }
14    }
15}
16impl<T> MetadataClient<T>
17where
18    T: crate::client::Client,
19{
20    #[doc = "Get ceph metadata."]
21    pub fn get(&self, params: GetParams) -> Result<GetOutput, T::Error> {
22        let path = self.path.to_string();
23        self.client.get(&path, &params)
24    }
25}
26impl GetOutput {
27    pub fn new(
28        mds: MdsGetOutputMds,
29        mgr: MgrGetOutputMgr,
30        mon: MonGetOutputMon,
31        node: NodeGetOutputNode,
32    ) -> Self {
33        Self {
34            mds,
35            mgr,
36            mon,
37            node,
38            additional_properties: Default::default(),
39        }
40    }
41}
42#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
43pub struct GetOutput {
44    #[doc = "Metadata servers configured in the cluster and their properties."]
45    pub mds: MdsGetOutputMds,
46    #[doc = "Managers configured in the cluster and their properties."]
47    pub mgr: MgrGetOutputMgr,
48    #[doc = "Monitors configured in the cluster and their properties."]
49    pub mon: MonGetOutputMon,
50    #[doc = "Ceph version installed on the nodes."]
51    pub node: NodeGetOutputNode,
52    #[serde(
53        flatten,
54        default,
55        skip_serializing_if = "::std::collections::HashMap::is_empty"
56    )]
57    pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
58}
59#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize, Default)]
60pub struct GetParams {
61    #[serde(skip_serializing_if = "Option::is_none", default)]
62    pub scope: Option<Scope>,
63    #[serde(
64        flatten,
65        default,
66        skip_serializing_if = "::std::collections::HashMap::is_empty"
67    )]
68    pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
69}
70impl IdGetOutputMdsId {
71    pub fn new(
72        addr: String,
73        ceph_release: String,
74        ceph_version: String,
75        ceph_version_short: String,
76        hostname: String,
77        mem_swap_kb: u64,
78        mem_total_kb: u64,
79        name: String,
80    ) -> Self {
81        Self {
82            addr,
83            ceph_release,
84            ceph_version,
85            ceph_version_short,
86            hostname,
87            mem_swap_kb,
88            mem_total_kb,
89            name,
90            additional_properties: Default::default(),
91        }
92    }
93}
94#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
95pub struct IdGetOutputMdsId {
96    #[doc = "Bind addresses and ports."]
97    pub addr: String,
98    #[doc = "Ceph release codename currently used."]
99    pub ceph_release: String,
100    #[doc = "Version info currently used by the service."]
101    pub ceph_version: String,
102    #[doc = "Short version (numerical) info currently used by the service."]
103    pub ceph_version_short: String,
104    #[doc = "Hostname on which the service is running."]
105    pub hostname: String,
106    #[serde(
107        serialize_with = "crate::types::serialize_int",
108        deserialize_with = "crate::types::deserialize_int"
109    )]
110    #[doc = "Memory of the service currently in swap."]
111    pub mem_swap_kb: u64,
112    #[serde(
113        serialize_with = "crate::types::serialize_int",
114        deserialize_with = "crate::types::deserialize_int"
115    )]
116    #[doc = "Memory consumption of the service."]
117    pub mem_total_kb: u64,
118    #[doc = "Name of the service instance."]
119    pub name: String,
120    #[serde(
121        flatten,
122        default,
123        skip_serializing_if = "::std::collections::HashMap::is_empty"
124    )]
125    pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
126}
127impl IdGetOutputMgrId {
128    pub fn new(
129        addr: String,
130        ceph_release: String,
131        ceph_version: String,
132        ceph_version_short: String,
133        hostname: String,
134        mem_swap_kb: u64,
135        mem_total_kb: u64,
136        name: String,
137    ) -> Self {
138        Self {
139            addr,
140            ceph_release,
141            ceph_version,
142            ceph_version_short,
143            hostname,
144            mem_swap_kb,
145            mem_total_kb,
146            name,
147            additional_properties: Default::default(),
148        }
149    }
150}
151#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
152pub struct IdGetOutputMgrId {
153    #[doc = "Bind address"]
154    pub addr: String,
155    #[doc = "Ceph release codename currently used."]
156    pub ceph_release: String,
157    #[doc = "Version info currently used by the service."]
158    pub ceph_version: String,
159    #[doc = "Short version (numerical) info currently used by the service."]
160    pub ceph_version_short: String,
161    #[doc = "Hostname on which the service is running."]
162    pub hostname: String,
163    #[serde(
164        serialize_with = "crate::types::serialize_int",
165        deserialize_with = "crate::types::deserialize_int"
166    )]
167    #[doc = "Memory of the service currently in swap."]
168    pub mem_swap_kb: u64,
169    #[serde(
170        serialize_with = "crate::types::serialize_int",
171        deserialize_with = "crate::types::deserialize_int"
172    )]
173    #[doc = "Memory consumption of the service."]
174    pub mem_total_kb: u64,
175    #[doc = "Name of the service instance."]
176    pub name: String,
177    #[serde(
178        flatten,
179        default,
180        skip_serializing_if = "::std::collections::HashMap::is_empty"
181    )]
182    pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
183}
184impl IdGetOutputMonId {
185    pub fn new(
186        addrs: String,
187        ceph_release: String,
188        ceph_version: String,
189        ceph_version_short: String,
190        hostname: String,
191        mem_swap_kb: u64,
192        mem_total_kb: u64,
193        name: String,
194    ) -> Self {
195        Self {
196            addrs,
197            ceph_release,
198            ceph_version,
199            ceph_version_short,
200            hostname,
201            mem_swap_kb,
202            mem_total_kb,
203            name,
204            additional_properties: Default::default(),
205        }
206    }
207}
208#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
209pub struct IdGetOutputMonId {
210    #[doc = "Bind addresses and ports."]
211    pub addrs: String,
212    #[doc = "Ceph release codename currently used."]
213    pub ceph_release: String,
214    #[doc = "Version info currently used by the service."]
215    pub ceph_version: String,
216    #[doc = "Short version (numerical) info currently used by the service."]
217    pub ceph_version_short: String,
218    #[doc = "Hostname on which the service is running."]
219    pub hostname: String,
220    #[serde(
221        serialize_with = "crate::types::serialize_int",
222        deserialize_with = "crate::types::deserialize_int"
223    )]
224    #[doc = "Memory of the service currently in swap."]
225    pub mem_swap_kb: u64,
226    #[serde(
227        serialize_with = "crate::types::serialize_int",
228        deserialize_with = "crate::types::deserialize_int"
229    )]
230    #[doc = "Memory consumption of the service."]
231    pub mem_total_kb: u64,
232    #[doc = "Name of the service instance."]
233    pub name: String,
234    #[serde(
235        flatten,
236        default,
237        skip_serializing_if = "::std::collections::HashMap::is_empty"
238    )]
239    pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
240}
241impl MdsGetOutputMds {
242    pub fn new(_id: IdGetOutputMdsId) -> Self {
243        Self {
244            _id,
245            additional_properties: Default::default(),
246        }
247    }
248}
249#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
250pub struct MdsGetOutputMds {
251    #[serde(rename = "{id}")]
252    #[doc = "Useful properties are listed, but not the full list."]
253    pub _id: IdGetOutputMdsId,
254    #[serde(
255        flatten,
256        default,
257        skip_serializing_if = "::std::collections::HashMap::is_empty"
258    )]
259    pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
260}
261impl MgrGetOutputMgr {
262    pub fn new(_id: IdGetOutputMgrId) -> Self {
263        Self {
264            _id,
265            additional_properties: Default::default(),
266        }
267    }
268}
269#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
270pub struct MgrGetOutputMgr {
271    #[serde(rename = "{id}")]
272    #[doc = "Useful properties are listed, but not the full list."]
273    pub _id: IdGetOutputMgrId,
274    #[serde(
275        flatten,
276        default,
277        skip_serializing_if = "::std::collections::HashMap::is_empty"
278    )]
279    pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
280}
281impl MonGetOutputMon {
282    pub fn new(_id: IdGetOutputMonId) -> Self {
283        Self {
284            _id,
285            additional_properties: Default::default(),
286        }
287    }
288}
289#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
290pub struct MonGetOutputMon {
291    #[serde(rename = "{id}")]
292    #[doc = "Useful properties are listed, but not the full list."]
293    pub _id: IdGetOutputMonId,
294    #[serde(
295        flatten,
296        default,
297        skip_serializing_if = "::std::collections::HashMap::is_empty"
298    )]
299    pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
300}
301impl NodeGetOutputNode {
302    pub fn new(_node: NodeGetOutputNodeNode) -> Self {
303        Self {
304            _node,
305            additional_properties: Default::default(),
306        }
307    }
308}
309#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
310pub struct NodeGetOutputNode {
311    #[serde(rename = "{node}")]
312    pub _node: NodeGetOutputNodeNode,
313    #[serde(
314        flatten,
315        default,
316        skip_serializing_if = "::std::collections::HashMap::is_empty"
317    )]
318    pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
319}
320impl NodeGetOutputNodeNode {
321    pub fn new(buildcommit: String, version: VersionGetOutputNodeNodeVersion) -> Self {
322        Self {
323            buildcommit,
324            version,
325            additional_properties: Default::default(),
326        }
327    }
328}
329#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
330pub struct NodeGetOutputNodeNode {
331    #[doc = "GIT commit used for the build."]
332    pub buildcommit: String,
333    #[doc = "Version info."]
334    pub version: VersionGetOutputNodeNodeVersion,
335    #[serde(
336        flatten,
337        default,
338        skip_serializing_if = "::std::collections::HashMap::is_empty"
339    )]
340    pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
341}
342impl VersionGetOutputNodeNodeVersion {
343    pub fn new(str: String) -> Self {
344        Self {
345            str,
346            additional_properties: Default::default(),
347        }
348    }
349}
350#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
351pub struct VersionGetOutputNodeNodeVersion {
352    #[doc = "Version as single string."]
353    pub str: String,
354    #[serde(
355        flatten,
356        default,
357        skip_serializing_if = "::std::collections::HashMap::is_empty"
358    )]
359    pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
360}
361#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
362pub enum Scope {
363    #[serde(rename = "all")]
364    All,
365    #[serde(rename = "versions")]
366    Versions,
367}
368impl Default for Scope {
369    fn default() -> Self {
370        Self::All
371    }
372}