Skip to content

Commit

Permalink
Continued work on health checks/alarms
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelklishin committed Dec 22, 2024
1 parent f101482 commit b201ae6
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/responses.rs
Original file line number Diff line number Diff line change
Expand Up @@ -598,29 +598,34 @@ pub enum HealthCheckFailureDetails {
NodeIsQuorumCritical(QuorumCriticalityCheckDetails),
}

impl HealthCheckFailureDetails {
pub fn reason(&self) -> String {
match self {
HealthCheckFailureDetails::AlarmCheck(details) => details.reason.clone(),
HealthCheckFailureDetails::NodeIsQuorumCritical(details) => details.reason.clone(),
}
}
}

#[derive(Debug, Deserialize, Clone, Eq, PartialEq)]
#[cfg_attr(feature = "tabled", derive(Tabled))]
pub struct ClusterAlarmCheckDetails {
pub reason: String,
pub alarms: Vec<ResourceAlarm>,
}

#[derive(Debug, Deserialize, Clone, Eq, PartialEq)]
#[cfg_attr(feature = "tabled", derive(Tabled))]
pub struct ResourceAlarm {
pub node: String,
pub resource: String,
}

#[derive(Debug, Deserialize, Clone, Eq, PartialEq)]
#[cfg_attr(feature = "tabled", derive(Tabled))]
pub struct QuorumCriticalityCheckDetails {
pub reason: String,
pub queues: Vec<QuorumEndangeredQueue>,
}

#[derive(Debug, Deserialize, Clone, Eq, PartialEq)]
#[cfg_attr(feature = "tabled", derive(Tabled))]
pub struct QuorumEndangeredQueue {
pub name: String,
#[serde(rename(deserialize = "virtual_host"))]
Expand Down

0 comments on commit b201ae6

Please sign in to comment.