24 lines
735 B
Python
24 lines
735 B
Python
from __future__ import annotations
|
|
|
|
from datetime import datetime
|
|
from typing import Literal
|
|
|
|
from pydantic import BaseModel, ConfigDict
|
|
|
|
|
|
SourceStatus = Literal["online", "offline", "unsupported"]
|
|
OverallStatus = Literal["online", "degraded", "offline"]
|
|
HealthStatus = Literal["healthy", "warning", "offline"]
|
|
DiskStatus = Literal["online", "warning", "critical", "offline"]
|
|
ServiceKind = Literal["core", "service"]
|
|
ServiceSource = Literal["home_assistant", "uptime_kuma", "docker", "manual"]
|
|
DockerContainerState = Literal["running", "stopped", "unhealthy", "unknown"]
|
|
|
|
|
|
class APIModel(BaseModel):
|
|
model_config = ConfigDict(extra="ignore", populate_by_name=True)
|
|
|
|
|
|
class TimestampedResponse(APIModel):
|
|
generated_at: datetime
|