windmill_api/models/
health_status_response.rs1use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct HealthStatusResponse {
17 #[serde(rename = "status")]
19 pub status: Status,
20 #[serde(rename = "checked_at")]
22 pub checked_at: String,
23 #[serde(rename = "database_healthy")]
25 pub database_healthy: bool,
26 #[serde(rename = "workers_alive")]
28 pub workers_alive: i64,
29}
30
31impl HealthStatusResponse {
32 pub fn new(status: Status, checked_at: String, database_healthy: bool, workers_alive: i64) -> HealthStatusResponse {
34 HealthStatusResponse {
35 status,
36 checked_at,
37 database_healthy,
38 workers_alive,
39 }
40 }
41}
42#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
44pub enum Status {
45 #[serde(rename = "healthy")]
46 Healthy,
47 #[serde(rename = "degraded")]
48 Degraded,
49 #[serde(rename = "unhealthy")]
50 Unhealthy,
51}
52
53impl Default for Status {
54 fn default() -> Status {
55 Self::Healthy
56 }
57}
58