proxmox_api/generated/nodes/node/ceph/
mds.rs1pub mod name;
2#[derive(Debug, Clone)]
3pub struct MdsClient<T> {
4 client: T,
5 path: String,
6}
7impl<T> MdsClient<T>
8where
9 T: crate::client::Client,
10{
11 pub fn new(client: T, parent_path: &str) -> Self {
12 Self {
13 client,
14 path: format!("{}{}", parent_path, "/mds"),
15 }
16 }
17}
18impl<T> MdsClient<T>
19where
20 T: crate::client::Client,
21{
22 #[doc = "MDS directory index."]
23 #[doc = ""]
24 #[doc = "Permission check: perm(\"/\", [\"Sys.Audit\", \"Datastore.Audit\"], any)"]
25 pub async fn get(&self) -> Result<Vec<GetOutputItems>, T::Error> {
26 let path = self.path.to_string();
27 let optional_vec: Option<Vec<GetOutputItems>> = self.client.get(&path, &()).await?;
28 Ok(optional_vec.unwrap_or_default())
29 }
30}
31impl GetOutputItems {
32 pub fn new(name: String, state: String) -> Self {
33 Self {
34 name,
35 state,
36 addr: ::std::default::Default::default(),
37 host: ::std::default::Default::default(),
38 rank: ::std::default::Default::default(),
39 standby_replay: ::std::default::Default::default(),
40 additional_properties: ::std::default::Default::default(),
41 }
42 }
43}
44#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
45pub struct GetOutputItems {
46 #[serde(skip_serializing_if = "Option::is_none", default)]
47 pub addr: Option<String>,
48 #[serde(skip_serializing_if = "Option::is_none", default)]
49 pub host: Option<String>,
50 #[doc = "The name (ID) for the MDS"]
51 #[doc = ""]
52 pub name: String,
53 #[serde(
54 serialize_with = "crate::types::serialize_int_optional",
55 deserialize_with = "crate::types::deserialize_int_optional"
56 )]
57 #[serde(skip_serializing_if = "Option::is_none", default)]
58 pub rank: Option<i64>,
59 #[serde(
60 serialize_with = "crate::types::serialize_bool_optional",
61 deserialize_with = "crate::types::deserialize_bool_optional"
62 )]
63 #[serde(skip_serializing_if = "Option::is_none", default)]
64 #[doc = "If true, the standby MDS is polling the active MDS for faster recovery (hot standby)."]
65 #[doc = ""]
66 pub standby_replay: Option<bool>,
67 #[doc = "State of the MDS"]
68 #[doc = ""]
69 pub state: String,
70 #[serde(
71 flatten,
72 default,
73 skip_serializing_if = "::std::collections::HashMap::is_empty"
74 )]
75 pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
76}
77impl<T> MdsClient<T>
78where
79 T: crate::client::Client,
80{
81 pub fn name(&self, name: &str) -> name::NameClient<T> {
82 name::NameClient::<T>::new(self.client.clone(), &self.path, name)
83 }
84}