Skip to main content

clientapi_pve/models/
cluster_ha_status_response_data_inner.rs

1/*
2 * Proxmox Virtual Environment API
3 *
4 * Generated from apidoc.js. NOT an official Proxmox specification. See https://pve.proxmox.com/pve-docs/api-viewer/ for the upstream documentation.
5 *
6 * The version of the OpenAPI document: 9.x
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct ClusterHaStatusResponseDataInner {
16
17    /// For type 'fencing'. Whether HA is armed, on standby, disarming or disarmed.
18    #[serde(rename = "armed-state", skip_serializing_if = "Option::is_none")]
19    pub armed_state: Option<models::PveClusterHaArmedStateEnum>,
20
21    /// HA resource may be migrated during automatic rebalancing.
22    #[serde(rename = "auto-rebalance", skip_serializing_if = "Option::is_none")]
23    pub auto_rebalance: Option<models::PveBoolean>,
24
25    /// For type 'service'. Service state as seen by the CRM.
26    #[serde(rename = "crm_state", skip_serializing_if = "Option::is_none")]
27    pub crm_state: Option<String>,
28
29    /// 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.
30    #[serde(rename = "failback", skip_serializing_if = "Option::is_none")]
31    pub failback: Option<models::PveBoolean>,
32
33    /// Status entry ID (quorum, master, lrm:<node>, service:<sid>).
34    #[serde(rename = "id")]
35    pub id: String,
36
37    /// For type 'service'.
38    #[serde(rename = "max_relocate", skip_serializing_if = "Option::is_none")]
39    pub max_relocate: Option<i64>,
40
41    /// For type 'service'.
42    #[serde(rename = "max_restart", skip_serializing_if = "Option::is_none")]
43    pub max_restart: Option<i64>,
44
45    /// Node associated to status entry.
46    #[serde(rename = "node")]
47    pub node: String,
48
49    /// For type 'quorum'. Whether the cluster is quorate or not.
50    #[serde(rename = "quorate", skip_serializing_if = "Option::is_none")]
51    pub quorate: Option<models::PveBoolean>,
52
53    /// For type 'service'. Requested service state.
54    #[serde(rename = "request_state", skip_serializing_if = "Option::is_none")]
55    pub request_state: Option<String>,
56
57    /// For type 'fencing'. How resources are handled while disarmed.
58    #[serde(rename = "resource_mode", skip_serializing_if = "Option::is_none")]
59    pub resource_mode: Option<models::PveResourceModeEnum>,
60
61    /// For type 'service'. Service ID.
62    #[serde(rename = "sid", skip_serializing_if = "Option::is_none")]
63    pub sid: Option<String>,
64
65    /// For type 'service'. Verbose service state.
66    #[serde(rename = "state", skip_serializing_if = "Option::is_none")]
67    pub state: Option<String>,
68
69    /// Status of the entry (value depends on type).
70    #[serde(rename = "status")]
71    pub status: String,
72
73    /// For type 'lrm','master'. Timestamp of the status information.
74    #[serde(rename = "timestamp", skip_serializing_if = "Option::is_none")]
75    pub timestamp: Option<i64>,
76
77    /// Type of status entry.
78    #[serde(rename = "type")]
79    pub r#type: Type,
80
81
82}
83
84impl ClusterHaStatusResponseDataInner {
85    pub fn new(id: String, node: String, status: String, r#type: Type) -> ClusterHaStatusResponseDataInner {
86        ClusterHaStatusResponseDataInner {
87            
88            armed_state: None,
89            
90            auto_rebalance: None,
91            
92            crm_state: None,
93            
94            failback: None,
95            
96            id,
97            
98            max_relocate: None,
99            
100            max_restart: None,
101            
102            node,
103            
104            quorate: None,
105            
106            request_state: None,
107            
108            resource_mode: None,
109            
110            sid: None,
111            
112            state: None,
113            
114            status,
115            
116            timestamp: None,
117            
118            r#type,
119            
120        }
121    }
122}
123
124/// Type of status entry.
125#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
126pub enum Type {
127    #[serde(rename = "quorum")]
128    Quorum,
129    #[serde(rename = "master")]
130    Master,
131    #[serde(rename = "lrm")]
132    Lrm,
133    #[serde(rename = "service")]
134    Service,
135    #[serde(rename = "fencing")]
136    Fencing,
137}
138
139impl Default for Type {
140    fn default() -> Type {
141        Self::Quorum
142    }
143}
144