lattice_sdk/api/types/health.rs
1pub use crate::prelude::*;
2
3/// General health of the entity as reported by the entity.
4#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash)]
5pub struct Health {
6 /// Status indicating whether the entity is able to communicate with Entity Manager.
7 #[serde(rename = "connectionStatus")]
8 #[serde(skip_serializing_if = "Option::is_none")]
9 pub connection_status: Option<HealthConnectionStatus>,
10 /// Top-level health status; typically a roll-up of individual component healths.
11 #[serde(rename = "healthStatus")]
12 #[serde(skip_serializing_if = "Option::is_none")]
13 pub health_status: Option<HealthHealthStatus>,
14 /// Health of individual components running on this Entity.
15 #[serde(skip_serializing_if = "Option::is_none")]
16 pub components: Option<Vec<ComponentHealth>>,
17 /// The update time for the top-level health information.
18 /// If this timestamp is unset, the data is assumed to be most recent
19 #[serde(rename = "updateTime")]
20 #[serde(skip_serializing_if = "Option::is_none")]
21 pub update_time: Option<DateTime<Utc>>,
22 /// Active alerts indicate a critical change in system state sent by the asset
23 /// that must be made known to an operator or consumer of the common operating picture.
24 /// Alerts are different from ComponentHealth messages--an active alert does not necessarily
25 /// indicate a component is in an unhealthy state. For example, an asset may trigger
26 /// an active alert based on fuel levels running low. Alerts should be removed from this list when their conditions
27 /// are cleared. In other words, only active alerts should be reported here.
28 #[serde(rename = "activeAlerts")]
29 #[serde(skip_serializing_if = "Option::is_none")]
30 pub active_alerts: Option<Vec<Alert>>,
31}