pub mod name;
pub struct MdsClient<T> {
client: T,
path: String,
}
impl<T> MdsClient<T>
where
T: crate::client::Client,
{
pub fn new(client: T, parent_path: &str) -> Self {
Self {
client,
path: format!("{}{}", parent_path, "/mds"),
}
}
}
impl<T> MdsClient<T>
where
T: crate::client::Client,
{
#[doc = "MDS directory index."]
pub fn get(&self) -> Result<Vec<GetOutputItems>, T::Error> {
let path = self.path.to_string();
self.client.get(&path, &())
}
}
impl GetOutputItems {
pub fn new(state: String) -> Self {
Self {
state,
addr: Default::default(),
host: Default::default(),
rank: Default::default(),
standby_replay: Default::default(),
additional_properties: Default::default(),
}
}
}
#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
pub struct GetOutputItems {
#[serde(skip_serializing_if = "Option::is_none", default)]
pub addr: Option<String>,
#[serde(skip_serializing_if = "Option::is_none", default)]
pub host: Option<String>,
#[serde(
serialize_with = "crate::types::serialize_int_optional",
deserialize_with = "crate::types::deserialize_int_optional"
)]
#[serde(skip_serializing_if = "Option::is_none", default)]
pub rank: Option<u64>,
#[serde(
serialize_with = "crate::types::serialize_bool_optional",
deserialize_with = "crate::types::deserialize_bool_optional"
)]
#[serde(skip_serializing_if = "Option::is_none", default)]
#[doc = "If true, the standby MDS is polling the active MDS for faster recovery (hot standby)."]
pub standby_replay: Option<bool>,
#[doc = "State of the MDS"]
pub state: String,
#[serde(
flatten,
default,
skip_serializing_if = "::std::collections::HashMap::is_empty"
)]
pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
}
impl<T> MdsClient<T>
where
T: crate::client::Client,
{
pub fn name(&self, name: &str) -> name::NameClient<T> {
name::NameClient::<T>::new(self.client.clone(), &self.path, name)
}
}