proxmox_api/generated/cluster/config/
nodes.rs1pub mod node;
2#[derive(Debug, Clone)]
3pub struct NodesClient<T> {
4 client: T,
5 path: String,
6}
7impl<T> NodesClient<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, "/nodes"),
15 }
16 }
17}
18impl<T> NodesClient<T>
19where
20 T: crate::client::Client,
21{
22 #[doc = "Corosync node list."]
23 #[doc = ""]
24 #[doc = "Permission check: perm(\"/\", [\"Sys.Audit\"])"]
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(node: String) -> Self {
33 Self {
34 node,
35 additional_properties: ::std::default::Default::default(),
36 }
37 }
38}
39#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
40pub struct GetOutputItems {
41 pub node: String,
42 #[serde(
43 flatten,
44 default,
45 skip_serializing_if = "::std::collections::HashMap::is_empty"
46 )]
47 pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
48}
49impl<T> NodesClient<T>
50where
51 T: crate::client::Client,
52{
53 pub fn node(&self, node: &str) -> node::NodeClient<T> {
54 node::NodeClient::<T>::new(self.client.clone(), &self.path, node)
55 }
56}