proxmox_api/generated/cluster/
status.rs

1pub struct StatusClient<T> {
2    client: T,
3    path: String,
4}
5impl<T> StatusClient<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, "/status"),
13        }
14    }
15}
16impl<T> StatusClient<T>
17where
18    T: crate::client::Client,
19{
20    #[doc = "Get cluster status information."]
21    pub fn get(&self) -> Result<Vec<GetOutputItems>, T::Error> {
22        let path = self.path.to_string();
23        self.client.get(&path, &())
24    }
25}
26impl GetOutputItems {
27    pub fn new(id: String, name: String, ty: Type) -> Self {
28        Self {
29            id,
30            name,
31            ty,
32            ip: Default::default(),
33            level: Default::default(),
34            local: Default::default(),
35            nodeid: Default::default(),
36            nodes: Default::default(),
37            online: Default::default(),
38            quorate: Default::default(),
39            version: Default::default(),
40            additional_properties: Default::default(),
41        }
42    }
43}
44#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
45pub struct GetOutputItems {
46    pub id: String,
47    #[serde(skip_serializing_if = "Option::is_none", default)]
48    #[doc = "[node] IP of the resolved nodename."]
49    pub ip: Option<String>,
50    #[serde(skip_serializing_if = "Option::is_none", default)]
51    #[doc = "[node] Proxmox VE Subscription level, indicates if eligible for enterprise support as well as access to the stable Proxmox VE Enterprise Repository."]
52    pub level: Option<String>,
53    #[serde(
54        serialize_with = "crate::types::serialize_bool_optional",
55        deserialize_with = "crate::types::deserialize_bool_optional"
56    )]
57    #[serde(skip_serializing_if = "Option::is_none", default)]
58    #[doc = "[node] Indicates if this is the responding node."]
59    pub local: Option<bool>,
60    pub name: String,
61    #[serde(
62        serialize_with = "crate::types::serialize_int_optional",
63        deserialize_with = "crate::types::deserialize_int_optional"
64    )]
65    #[serde(skip_serializing_if = "Option::is_none", default)]
66    #[doc = "[node] ID of the node from the corosync configuration."]
67    pub nodeid: Option<u64>,
68    #[serde(
69        serialize_with = "crate::types::serialize_int_optional",
70        deserialize_with = "crate::types::deserialize_int_optional"
71    )]
72    #[serde(skip_serializing_if = "Option::is_none", default)]
73    #[doc = "[cluster] Nodes count, including offline nodes."]
74    pub nodes: Option<u64>,
75    #[serde(
76        serialize_with = "crate::types::serialize_bool_optional",
77        deserialize_with = "crate::types::deserialize_bool_optional"
78    )]
79    #[serde(skip_serializing_if = "Option::is_none", default)]
80    #[doc = "[node] Indicates if the node is online or offline."]
81    pub online: Option<bool>,
82    #[serde(
83        serialize_with = "crate::types::serialize_bool_optional",
84        deserialize_with = "crate::types::deserialize_bool_optional"
85    )]
86    #[serde(skip_serializing_if = "Option::is_none", default)]
87    #[doc = "[cluster] Indicates if there is a majority of nodes online to make decisions"]
88    pub quorate: Option<bool>,
89    #[serde(rename = "type")]
90    #[doc = "Indicates the type, either cluster or node. The type defines the object properties e.g. quorate available for type cluster."]
91    pub ty: Type,
92    #[serde(
93        serialize_with = "crate::types::serialize_int_optional",
94        deserialize_with = "crate::types::deserialize_int_optional"
95    )]
96    #[serde(skip_serializing_if = "Option::is_none", default)]
97    #[doc = "[cluster] Current version of the corosync configuration file."]
98    pub version: Option<u64>,
99    #[serde(
100        flatten,
101        default,
102        skip_serializing_if = "::std::collections::HashMap::is_empty"
103    )]
104    pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
105}
106#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
107pub enum Type {
108    #[serde(rename = "cluster")]
109    Cluster,
110    #[serde(rename = "node")]
111    Node,
112}