feat: expose deployment build identity
This commit is contained in:
@@ -89,7 +89,7 @@ def ready(db: Db) -> JSONResponse:
|
||||
)
|
||||
return JSONResponse(
|
||||
status_code=200 if is_ready else 503,
|
||||
content={"status": "ready" if is_ready else "not_ready", "components": components},
|
||||
content={"status": "ready" if is_ready else "not_ready", "version": settings.app_version, "revision": settings.app_revision, "components": components},
|
||||
)
|
||||
|
||||
|
||||
@@ -257,6 +257,11 @@ def _admin(authorization: Annotated[str | None, Header()] = None) -> str:
|
||||
return "admin"
|
||||
|
||||
|
||||
@app.get("/api/v1/admin/diagnostics")
|
||||
def admin_diagnostics(_: Annotated[str, Depends(_admin)]) -> dict[str, str]:
|
||||
return {"version": settings.app_version, "revision": settings.app_revision, "environment": settings.deployment_environment}
|
||||
|
||||
|
||||
@app.get("/api/v1/imports", response_model=list[ImportRunOut])
|
||||
def imports(db: Db, limit: int = Query(20, ge=1, le=100), offset: int = Query(0, ge=0)) -> list[OfficialRecordImport]:
|
||||
return list(db.scalars(select(OfficialRecordImport).order_by(OfficialRecordImport.started_at.desc(), OfficialRecordImport.id.desc()).offset(offset).limit(limit)))
|
||||
|
||||
Reference in New Issue
Block a user