28 lines
625 B
Python
28 lines
625 B
Python
"""
|
|
Schémas Pydantic pour les health checks.
|
|
"""
|
|
|
|
from typing import Optional
|
|
|
|
from pydantic import BaseModel
|
|
|
|
|
|
class HealthCheck(BaseModel):
|
|
"""Résultat d'un health check sur un hôte."""
|
|
host: str
|
|
ssh_ok: bool = False
|
|
ansible_ok: bool = False
|
|
sudo_ok: bool = False
|
|
reachable: bool = False
|
|
error_message: Optional[str] = None
|
|
response_time: Optional[float] = None
|
|
cached: bool = False
|
|
cache_age: int = 0
|
|
|
|
|
|
class GlobalHealthResponse(BaseModel):
|
|
"""Réponse du healthcheck global de l'API."""
|
|
status: str = "ok"
|
|
service: str = "homelab-automation-api"
|
|
timestamp: str
|