Skip to main content

bestool_alertd/http_server/
types.rs

1use serde::{Deserialize, Serialize};
2
3#[derive(Serialize, Deserialize)]
4pub struct StatusResponse {
5	pub name: String,
6	pub version: String,
7	pub started_at: String,
8	pub pid: u32,
9	/// Backups running on this daemon right now (empty when none, or when
10	/// backups aren't compiled in).
11	#[serde(default)]
12	pub backups_running: Vec<crate::RunningBackup>,
13	/// Backup types configured on this host (empty when none, or when backups
14	/// aren't compiled in).
15	#[serde(default)]
16	pub backups_configured: Vec<String>,
17}
18
19/// The `/health` response: the watchdog's view of the daemon's liveness.
20#[derive(Serialize, Deserialize)]
21pub struct HealthResponse {
22	/// Whether the daemon is within its watchdog window (always true when the
23	/// watchdog is disabled). The endpoint also signals this via the HTTP status.
24	pub healthy: bool,
25	/// Seconds since a background task last reported activity; `None` if none has
26	/// yet (freshly started).
27	pub last_activity_secs_ago: Option<i64>,
28	/// Seconds since the daemon started.
29	pub uptime_secs: i64,
30	/// The configured watchdog timeout in seconds; `None` when the watchdog is
31	/// disabled.
32	pub watchdog_timeout_secs: Option<u64>,
33}