proxmox_api/generated/cluster/ha/status/
current.rs

1pub struct CurrentClient<T> {
2    client: T,
3    path: String,
4}
5impl<T> CurrentClient<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, "/current"),
13        }
14    }
15}
16impl<T> CurrentClient<T>
17where
18    T: crate::client::Client,
19{
20    #[doc = "Get HA manger status."]
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, node: String, status: String) -> Self {
28        Self {
29            id,
30            node,
31            status,
32            crm_state: Default::default(),
33            max_relocate: Default::default(),
34            max_restart: Default::default(),
35            quorate: Default::default(),
36            request_state: Default::default(),
37            sid: Default::default(),
38            state: Default::default(),
39            timestamp: Default::default(),
40            additional_properties: 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    #[doc = "For type 'service'. Service state as seen by the CRM."]
48    pub crm_state: Option<String>,
49    #[doc = "Status entry ID (quorum, master, lrm:\\<node\\>, service:\\<sid\\>)."]
50    pub id: String,
51    #[serde(
52        serialize_with = "crate::types::serialize_int_optional",
53        deserialize_with = "crate::types::deserialize_int_optional"
54    )]
55    #[serde(skip_serializing_if = "Option::is_none", default)]
56    #[doc = "For type 'service'."]
57    pub max_relocate: Option<u64>,
58    #[serde(
59        serialize_with = "crate::types::serialize_int_optional",
60        deserialize_with = "crate::types::deserialize_int_optional"
61    )]
62    #[serde(skip_serializing_if = "Option::is_none", default)]
63    #[doc = "For type 'service'."]
64    pub max_restart: Option<u64>,
65    #[doc = "Node associated to status entry."]
66    pub node: String,
67    #[serde(
68        serialize_with = "crate::types::serialize_bool_optional",
69        deserialize_with = "crate::types::deserialize_bool_optional"
70    )]
71    #[serde(skip_serializing_if = "Option::is_none", default)]
72    #[doc = "For type 'quorum'. Whether the cluster is quorate or not."]
73    pub quorate: Option<bool>,
74    #[serde(skip_serializing_if = "Option::is_none", default)]
75    #[doc = "For type 'service'. Requested service state."]
76    pub request_state: Option<String>,
77    #[serde(skip_serializing_if = "Option::is_none", default)]
78    #[doc = "For type 'service'. Service ID."]
79    pub sid: Option<String>,
80    #[serde(skip_serializing_if = "Option::is_none", default)]
81    #[doc = "For type 'service'. Verbose service state."]
82    pub state: Option<String>,
83    #[doc = "Status of the entry (value depends on type)."]
84    pub status: String,
85    #[serde(
86        serialize_with = "crate::types::serialize_int_optional",
87        deserialize_with = "crate::types::deserialize_int_optional"
88    )]
89    #[serde(skip_serializing_if = "Option::is_none", default)]
90    #[doc = "For type 'lrm','master'. Timestamp of the status information."]
91    pub timestamp: Option<u64>,
92    #[serde(
93        flatten,
94        default,
95        skip_serializing_if = "::std::collections::HashMap::is_empty"
96    )]
97    pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
98}