feat: add health check endpoint for agent authentication status
This commit is contained in:
@@ -2,6 +2,8 @@
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from uuid import UUID
|
||||
|
||||
from pydantic import Field
|
||||
from sqlmodel import SQLModel
|
||||
|
||||
@@ -13,3 +15,29 @@ class HealthStatusResponse(SQLModel):
|
||||
description="Indicates whether the probe check succeeded.",
|
||||
examples=[True],
|
||||
)
|
||||
|
||||
|
||||
class AgentHealthStatusResponse(HealthStatusResponse):
|
||||
"""Agent-authenticated liveness payload for agent route probes."""
|
||||
|
||||
agent_id: UUID = Field(
|
||||
description="Authenticated agent id derived from `X-Agent-Token`.",
|
||||
examples=["aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa"],
|
||||
)
|
||||
board_id: UUID | None = Field(
|
||||
default=None,
|
||||
description="Board scope for the authenticated agent, when applicable.",
|
||||
examples=["bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb"],
|
||||
)
|
||||
gateway_id: UUID = Field(
|
||||
description="Gateway owning the authenticated agent.",
|
||||
examples=["cccccccc-cccc-cccc-cccc-cccccccccccc"],
|
||||
)
|
||||
status: str = Field(
|
||||
description="Current persisted lifecycle status for the authenticated agent.",
|
||||
examples=["online", "healthy", "updating"],
|
||||
)
|
||||
is_board_lead: bool = Field(
|
||||
description="Whether the authenticated agent is the board lead.",
|
||||
examples=[False],
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user