clientapi-pve 2026.5.24

Generated from apidoc.js. NOT an official Proxmox specification. See https://pve.proxmox.com/pve-docs/api-viewer/ for the upstream documentation.
Documentation
/*
 * Proxmox Virtual Environment API
 *
 * Generated from apidoc.js. NOT an official Proxmox specification. See https://pve.proxmox.com/pve-docs/api-viewer/ for the upstream documentation.
 *
 * The version of the OpenAPI document: 9.x
 * 
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct ClusterHaStatusResponseDataInner {

    /// For type 'fencing'. Whether HA is armed, on standby, disarming or disarmed.
    #[serde(rename = "armed-state", skip_serializing_if = "Option::is_none")]
    pub armed_state: Option<models::PveClusterHaArmedStateEnum>,

    /// HA resource may be migrated during automatic rebalancing.
    #[serde(rename = "auto-rebalance", skip_serializing_if = "Option::is_none")]
    pub auto_rebalance: Option<models::PveBoolean>,

    /// For type 'service'. Service state as seen by the CRM.
    #[serde(rename = "crm_state", skip_serializing_if = "Option::is_none")]
    pub crm_state: Option<String>,

    /// 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.
    #[serde(rename = "failback", skip_serializing_if = "Option::is_none")]
    pub failback: Option<models::PveBoolean>,

    /// Status entry ID (quorum, master, lrm:<node>, service:<sid>).
    #[serde(rename = "id")]
    pub id: String,

    /// For type 'service'.
    #[serde(rename = "max_relocate", skip_serializing_if = "Option::is_none")]
    pub max_relocate: Option<i64>,

    /// For type 'service'.
    #[serde(rename = "max_restart", skip_serializing_if = "Option::is_none")]
    pub max_restart: Option<i64>,

    /// Node associated to status entry.
    #[serde(rename = "node")]
    pub node: String,

    /// For type 'quorum'. Whether the cluster is quorate or not.
    #[serde(rename = "quorate", skip_serializing_if = "Option::is_none")]
    pub quorate: Option<models::PveBoolean>,

    /// For type 'service'. Requested service state.
    #[serde(rename = "request_state", skip_serializing_if = "Option::is_none")]
    pub request_state: Option<String>,

    /// For type 'fencing'. How resources are handled while disarmed.
    #[serde(rename = "resource_mode", skip_serializing_if = "Option::is_none")]
    pub resource_mode: Option<models::PveResourceModeEnum>,

    /// For type 'service'. Service ID.
    #[serde(rename = "sid", skip_serializing_if = "Option::is_none")]
    pub sid: Option<String>,

    /// For type 'service'. Verbose service state.
    #[serde(rename = "state", skip_serializing_if = "Option::is_none")]
    pub state: Option<String>,

    /// Status of the entry (value depends on type).
    #[serde(rename = "status")]
    pub status: String,

    /// For type 'lrm','master'. Timestamp of the status information.
    #[serde(rename = "timestamp", skip_serializing_if = "Option::is_none")]
    pub timestamp: Option<i64>,

    /// Type of status entry.
    #[serde(rename = "type")]
    pub r#type: Type,


}

impl ClusterHaStatusResponseDataInner {
    pub fn new(id: String, node: String, status: String, r#type: Type) -> ClusterHaStatusResponseDataInner {
        ClusterHaStatusResponseDataInner {
            
            armed_state: None,
            
            auto_rebalance: None,
            
            crm_state: None,
            
            failback: None,
            
            id,
            
            max_relocate: None,
            
            max_restart: None,
            
            node,
            
            quorate: None,
            
            request_state: None,
            
            resource_mode: None,
            
            sid: None,
            
            state: None,
            
            status,
            
            timestamp: None,
            
            r#type,
            
        }
    }
}

/// Type of status entry.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Type {
    #[serde(rename = "quorum")]
    Quorum,
    #[serde(rename = "master")]
    Master,
    #[serde(rename = "lrm")]
    Lrm,
    #[serde(rename = "service")]
    Service,
    #[serde(rename = "fencing")]
    Fencing,
}

impl Default for Type {
    fn default() -> Type {
        Self::Quorum
    }
}