proxmox_api/generated/nodes/node/ceph/
mgr.rs1pub mod id;
2#[derive(Debug, Clone)]
3pub struct MgrClient<T> {
4 client: T,
5 path: String,
6}
7impl<T> MgrClient<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, "/mgr"),
15 }
16 }
17}
18impl<T> MgrClient<T>
19where
20 T: crate::client::Client,
21{
22 #[doc = "MGR 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 additional_properties: ::std::default::Default::default(),
39 }
40 }
41}
42#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
43pub struct GetOutputItems {
44 #[serde(skip_serializing_if = "Option::is_none", default)]
45 pub addr: Option<String>,
46 #[serde(skip_serializing_if = "Option::is_none", default)]
47 pub host: Option<String>,
48 #[doc = "The name (ID) for the MGR"]
49 #[doc = ""]
50 pub name: String,
51 #[doc = "State of the MGR"]
52 #[doc = ""]
53 pub state: String,
54 #[serde(
55 flatten,
56 default,
57 skip_serializing_if = "::std::collections::HashMap::is_empty"
58 )]
59 pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
60}
61impl<T> MgrClient<T>
62where
63 T: crate::client::Client,
64{
65 pub fn id(&self, id: &str) -> id::IdClient<T> {
66 id::IdClient::<T>::new(self.client.clone(), &self.path, id)
67 }
68}