Skip to content

docs(monit): retire v1 alert rule endpoints, document public v2 contract - #379

Merged
UlricQin merged 1 commit into
mainfrom
docs/monit-rule-v2-public
Sep 9, 2026
Merged

docs(monit): retire v1 alert rule endpoints, document public v2 contract#379
UlricQin merged 1 commit into
mainfrom
docs/monit-rule-v2-public

Conversation

@UlricQin

@UlricQin UlricQin commented Sep 9, 2026

Copy link
Copy Markdown
Member

背景

monit-webapi 退役了 v1 告警规则接口(PR: flashcatcloud/monit-webapi#118),fc-pgy 同步将 v2 接口转为 app_key 公开(PR: flashcatcloud/fc-pgy#957)。本 PR 让公开文档与之对齐。

删除(5 个 path,monitors 模块文件 + 合并参考版同步)

  • /monit/rule/info/monit/rule/create/monit/rule/update —— v1 退役
  • /monit/rule/counter/node —— 退役
  • /monit/rule/dstypes —— 后端路由与网关注册早已不存在,死文档

连带清理:孤儿 schema(AlertRuleInfoResponse、RuleCounterNodeResponse、RuleDsTypesResponse、DSType),以及保留接口里对已删 dstypes 的悬挂引用。

新增(3 个 path,完整双语文档)

  • /monit/rule/v2/info/monit/rule/v2/create/monit/rule/v2/update
  • schema 提取自 monit-webapi 源码(AlertRuleV2 及 lifecycle v2 枚举),含速率限制、权限点(告警规则查看/管理)、审计说明和请求/响应示例

导航同步

  • docs.json:zh/en 两组 Monitors pages 删 5 加 3
  • zh/en/openapi/api-catalog.mdx:目录表删 5 行加 3 行

验证

python3 scripts/lint_openapi.py 通过(12 个文件无违规);4 个 JSON 可解析;zh/en 结构一致(path/operationId/schema key 相同)。

已知历史遗留(本 PR 未处理)

api-catalog.mdx 的 Monitors 折叠面板混入了 RUM 的 41 行、标题计数与实际不符,建议单独修。

建议合并顺序:monit-webapi#118 → fc-pgy#957 → 本 PR。

- Remove /monit/rule/info, /monit/rule/create, /monit/rule/update,
  /monit/rule/counter/node (retired in monit-webapi) and
  /monit/rule/dstypes (route and registry row no longer exist) from the
  monitors module spec and the consolidated reference copies.
- Add /monit/rule/v2/info, /monit/rule/v2/create, /monit/rule/v2/update
  with full bilingual operations and AlertRuleV2 schemas extracted from
  the monit-webapi Go types, including lifecycle v2 enums, rate limits,
  permission classes and request/response examples.
- Reconcile docs.json pages and the zh/en API catalog tables; drop
  orphaned schemas (AlertRuleInfoResponse, RuleCounterNodeResponse,
  RuleDsTypesResponse, DSType) and dangling references to the deleted
  dstypes endpoint.

Validated with scripts/lint_openapi.py (12 spec files, no violations).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant