feat: add ImmichSnapshot, BackrestSnapshot, extend HA/UptimeKuma models
This commit is contained in:
@@ -39,31 +39,30 @@ class BeszelSystemSnapshot(APIModel):
|
|||||||
disks: list[BeszelDiskMetric] = Field(default_factory=list)
|
disks: list[BeszelDiskMetric] = Field(default_factory=list)
|
||||||
|
|
||||||
|
|
||||||
class DockerContainerSummary(APIModel):
|
class DockerContainer(APIModel):
|
||||||
id: str
|
id: str
|
||||||
name: str
|
name: str
|
||||||
state: DockerContainerState
|
|
||||||
status_text: str
|
|
||||||
image: str
|
image: str
|
||||||
health: str | None = None
|
state: DockerContainerState
|
||||||
|
status: str
|
||||||
|
|
||||||
|
|
||||||
class DockerSnapshot(APIModel):
|
class DockerSnapshot(APIModel):
|
||||||
source_name: str = "docker"
|
source_name: str = "docker"
|
||||||
source_status: SourceStatus = "offline"
|
source_status: SourceStatus = "offline"
|
||||||
|
containers: list[DockerContainer] = Field(default_factory=list)
|
||||||
running: int = 0
|
running: int = 0
|
||||||
stopped: int = 0
|
stopped: int = 0
|
||||||
unhealthy: int = 0
|
unhealthy: int = 0
|
||||||
total: int = 0
|
total: int = 0
|
||||||
containers: list[DockerContainerSummary] = Field(default_factory=list)
|
|
||||||
|
|
||||||
|
|
||||||
class UptimeKumaMonitor(APIModel):
|
class UptimeKumaMonitor(APIModel):
|
||||||
id: str
|
id: int
|
||||||
name: str
|
name: str
|
||||||
status: OverallStatus
|
status: str = "unknown" # "online" | "offline" | "degraded" | "unknown"
|
||||||
latency_ms: int | None = None
|
uptime_24h: float = 0.0
|
||||||
monitor_type: str | None = None
|
heartbeats: list[int] = Field(default_factory=list) # 1=up, 0=down, last 20
|
||||||
|
|
||||||
|
|
||||||
class UptimeKumaSnapshot(APIModel):
|
class UptimeKumaSnapshot(APIModel):
|
||||||
@@ -83,6 +82,11 @@ class HomeAssistantSnapshot(APIModel):
|
|||||||
version: str | None = None
|
version: str | None = None
|
||||||
response_time_ms: int | None = None
|
response_time_ms: int | None = None
|
||||||
last_checked: datetime | None = None
|
last_checked: datetime | None = None
|
||||||
|
lights_on: int = 0
|
||||||
|
lights_total: int = 0
|
||||||
|
climate_active: int = 0
|
||||||
|
doors_open: int = 0
|
||||||
|
alerts: int = 0
|
||||||
|
|
||||||
|
|
||||||
class AdGuardSnapshot(APIModel):
|
class AdGuardSnapshot(APIModel):
|
||||||
@@ -98,6 +102,7 @@ class ScrutinyDevice(APIModel):
|
|||||||
name: str
|
name: str
|
||||||
model: str
|
model: str
|
||||||
status: str = "unknown" # "passed" | "failed" | "unknown"
|
status: str = "unknown" # "passed" | "failed" | "unknown"
|
||||||
|
temperature: int | None = None
|
||||||
|
|
||||||
|
|
||||||
class ScrutinySnapshot(APIModel):
|
class ScrutinySnapshot(APIModel):
|
||||||
@@ -107,3 +112,20 @@ class ScrutinySnapshot(APIModel):
|
|||||||
devices: list[ScrutinyDevice] = Field(default_factory=list)
|
devices: list[ScrutinyDevice] = Field(default_factory=list)
|
||||||
failed_count: int = 0
|
failed_count: int = 0
|
||||||
total_count: int = 0
|
total_count: int = 0
|
||||||
|
|
||||||
|
|
||||||
|
class ImmichSnapshot(APIModel):
|
||||||
|
source_name: str = "immich"
|
||||||
|
source_status: SourceStatus = "offline"
|
||||||
|
photos: int = 0
|
||||||
|
videos: int = 0
|
||||||
|
storage_gb: float = 0.0
|
||||||
|
|
||||||
|
|
||||||
|
class BackrestSnapshot(APIModel):
|
||||||
|
source_name: str = "backrest"
|
||||||
|
source_status: SourceStatus = "offline"
|
||||||
|
repo_count: int = 0
|
||||||
|
last_backup_age_hours: float | None = None
|
||||||
|
last_backup_status: str = "unknown" # "ok" | "error" | "unknown"
|
||||||
|
error_count: int = 0
|
||||||
|
|||||||
Reference in New Issue
Block a user