proxmox_api/generated/cluster/ha/status/
current.rs1#[derive(Debug, Clone)]
2pub struct CurrentClient<T> {
3 client: T,
4 path: String,
5}
6impl<T> CurrentClient<T>
7where
8 T: crate::client::Client,
9{
10 pub fn new(client: T, parent_path: &str) -> Self {
11 Self {
12 client,
13 path: format!("{}{}", parent_path, "/current"),
14 }
15 }
16}
17impl<T> CurrentClient<T>
18where
19 T: crate::client::Client,
20{
21 #[doc = "Get HA manger status."]
22 #[doc = ""]
23 #[doc = "Permission check: perm(\"/\", [\"Sys.Audit\"])"]
24 pub async fn get(&self) -> Result<Vec<GetOutputItems>, T::Error> {
25 let path = self.path.to_string();
26 let optional_vec: Option<Vec<GetOutputItems>> = self.client.get(&path, &()).await?;
27 Ok(optional_vec.unwrap_or_default())
28 }
29}
30impl GetOutputItems {
31 pub fn new(id: String, node: String, status: String) -> Self {
32 Self {
33 id,
34 node,
35 status,
36 crm_state: ::std::default::Default::default(),
37 failback: ::std::default::Default::default(),
38 max_relocate: ::std::default::Default::default(),
39 max_restart: ::std::default::Default::default(),
40 quorate: ::std::default::Default::default(),
41 request_state: ::std::default::Default::default(),
42 sid: ::std::default::Default::default(),
43 state: ::std::default::Default::default(),
44 timestamp: ::std::default::Default::default(),
45 additional_properties: ::std::default::Default::default(),
46 }
47 }
48}
49#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
50pub struct GetOutputItems {
51 #[serde(skip_serializing_if = "Option::is_none", default)]
52 #[doc = "For type 'service'. Service state as seen by the CRM."]
53 #[doc = ""]
54 pub crm_state: Option<String>,
55 #[serde(
56 serialize_with = "crate::types::serialize_bool_optional",
57 deserialize_with = "crate::types::deserialize_bool_optional"
58 )]
59 #[serde(skip_serializing_if = "Option::is_none", default)]
60 #[doc = "The HA resource is automatically migrated to the node with the highest priority according to their node affinity rule, if a node with a higher priority than the current node comes online."]
61 #[doc = ""]
62 pub failback: Option<bool>,
63 #[doc = "Status entry ID (quorum, master, lrm:\\\\<node\\\\>, service:\\\\<sid\\\\>)."]
64 #[doc = ""]
65 pub id: String,
66 #[serde(
67 serialize_with = "crate::types::serialize_int_optional",
68 deserialize_with = "crate::types::deserialize_int_optional"
69 )]
70 #[serde(skip_serializing_if = "Option::is_none", default)]
71 #[doc = "For type 'service'."]
72 #[doc = ""]
73 pub max_relocate: Option<i64>,
74 #[serde(
75 serialize_with = "crate::types::serialize_int_optional",
76 deserialize_with = "crate::types::deserialize_int_optional"
77 )]
78 #[serde(skip_serializing_if = "Option::is_none", default)]
79 #[doc = "For type 'service'."]
80 #[doc = ""]
81 pub max_restart: Option<i64>,
82 #[doc = "Node associated to status entry."]
83 #[doc = ""]
84 pub node: String,
85 #[serde(
86 serialize_with = "crate::types::serialize_bool_optional",
87 deserialize_with = "crate::types::deserialize_bool_optional"
88 )]
89 #[serde(skip_serializing_if = "Option::is_none", default)]
90 #[doc = "For type 'quorum'. Whether the cluster is quorate or not."]
91 #[doc = ""]
92 pub quorate: Option<bool>,
93 #[serde(skip_serializing_if = "Option::is_none", default)]
94 #[doc = "For type 'service'. Requested service state."]
95 #[doc = ""]
96 pub request_state: Option<String>,
97 #[serde(skip_serializing_if = "Option::is_none", default)]
98 #[doc = "For type 'service'. Service ID."]
99 #[doc = ""]
100 pub sid: Option<String>,
101 #[serde(skip_serializing_if = "Option::is_none", default)]
102 #[doc = "For type 'service'. Verbose service state."]
103 #[doc = ""]
104 pub state: Option<String>,
105 #[doc = "Status of the entry (value depends on type)."]
106 #[doc = ""]
107 pub status: String,
108 #[serde(
109 serialize_with = "crate::types::serialize_int_optional",
110 deserialize_with = "crate::types::deserialize_int_optional"
111 )]
112 #[serde(skip_serializing_if = "Option::is_none", default)]
113 #[doc = "For type 'lrm','master'. Timestamp of the status information."]
114 #[doc = ""]
115 pub timestamp: Option<i64>,
116 #[serde(
117 flatten,
118 default,
119 skip_serializing_if = "::std::collections::HashMap::is_empty"
120 )]
121 pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
122}