You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
1.0 KiB
Python
29 lines
1.0 KiB
Python
from pydantic import BaseModel, Field
|
|
|
|
|
|
class DependencyStatus(BaseModel):
|
|
"""依赖状态"""
|
|
|
|
status: int = Field(..., description="状态(0:异常 1:正常)")
|
|
latency_ms: float | None = Field(default=None, description="延迟(毫秒)")
|
|
|
|
|
|
class HealthOut(BaseModel):
|
|
"""基础健康检查响应"""
|
|
|
|
status: int = Field(..., description="状态(0:异常 1:正常)")
|
|
timestamp: str = Field(..., description="时间戳")
|
|
version: str = Field(..., description="版本号")
|
|
uptime_seconds: float = Field(..., description="运行时间(秒)")
|
|
|
|
|
|
class ReadinessOut(BaseModel):
|
|
"""就绪探针响应"""
|
|
|
|
status: int = Field(..., description="状态(0:异常 1:正常)")
|
|
timestamp: str = Field(..., description="时间戳")
|
|
version: str = Field(..., description="版本号")
|
|
uptime_seconds: float = Field(..., description="运行时间(秒)")
|
|
dependencies: dict[str, DependencyStatus] = Field(..., description="依赖状态")
|
|
disk_usage: float = Field(..., description="磁盘使用率")
|