v3-heartbeat.yaml 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. # 由 openapi/scripts/generate.php 生成,请勿手改;补充写到 overrides/v3-heartbeat.yaml
  2. get:
  3. summary: 心跳
  4. tags:
  5. - heartbeat
  6. operationId: get_api_v3_heartbeat
  7. description: |-
  8. 取代 `GET /v2/heartbeat`(`HeartbeatController@index`)。v2 那份在
  9. dashboard-v4 下线前原样保留,不要改动。
  10. **这不是健康检查。** 它不查数据库、不查 OpenSearch / RabbitMQ / Cache,
  11. 只回答一件事:进程还在服务吗、是不是被运维停机了。供前端与负载均衡做
  12. 存活探测(liveness)用,开销接近零,可以高频调用。
  13. 真正的健康检查是 `GET /v2/health-check`(会逐项探测外部依赖并返回 checks
  14. 明细),将来单独迁为 `/v3/health-check`,与本端点是两件事,不要混用。
  15. 仓库根目录存在 `.stop` 文件时返回 503(运维停机开关),此时响应体是
  16. RFC 9457 Problem Details 而非正常结构。
  17. 实现:`V3\HeartbeatController@show`
  18. security:
  19. - { }
  20. -
  21. bearerAuth: []
  22. responses:
  23. 200:
  24. description: 成功
  25. content:
  26. application/json:
  27. schema:
  28. type: object
  29. properties:
  30. data:
  31. type: object
  32. properties:
  33. status:
  34. type: string
  35. checked_at:
  36. type: string
  37. 503:
  38. description: 服务已进入停机维护状态
  39. content:
  40. application/problem+json:
  41. schema:
  42. $ref: '../../main.yaml#/components/schemas/ProblemDetails'