45 lines
1.0 KiB
Python
45 lines
1.0 KiB
Python
from __future__ import annotations
|
|
|
|
from app.models.common import APIModel, OverallStatus, SourceStatus, TimestampedResponse
|
|
|
|
|
|
class OverviewServicesSummary(APIModel):
|
|
online: int
|
|
degraded: int
|
|
offline: int
|
|
total: int
|
|
|
|
|
|
class OverviewDockerSummary(APIModel):
|
|
running: int
|
|
stopped: int
|
|
unhealthy: int
|
|
total: int
|
|
source_status: SourceStatus
|
|
|
|
|
|
class OverviewSystemSummary(APIModel):
|
|
cpu_percent: float
|
|
ram_percent: float
|
|
root_storage_percent: float
|
|
network_rx_mbps: float
|
|
network_tx_mbps: float
|
|
uptime_seconds: int
|
|
|
|
|
|
class OverviewHomeAssistantSummary(APIModel):
|
|
status: SourceStatus
|
|
label: str
|
|
version: str | None = None
|
|
response_time_ms: int | None = None
|
|
last_checked: str | None = None
|
|
|
|
|
|
class OverviewResponse(TimestampedResponse):
|
|
overall_status: OverallStatus
|
|
refresh_hint_seconds: int
|
|
services: OverviewServicesSummary
|
|
docker: OverviewDockerSummary
|
|
system: OverviewSystemSummary
|
|
home_assistant: OverviewHomeAssistantSummary
|