proxy-pool/docs/api/admin.md

19 lines
991 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Admin API
Admin API 使用独立监听器与权限,契约位于 `api/openapi/admin.yaml`。公网部署
不得与 Distribution 复用认证 Token推荐只绑定管理网段或回环地址。
## 端点
- `GET /api/v1/status`:返回配置/快照版本、Upstream 聚合计数和 Worker 状态。
- `POST /api/v1/upstreams/{name}/enable`:启用 Upstream。
- `POST /api/v1/upstreams/{name}/disable`:停止新 Fetch/分配并自然 Drain。
- `POST /api/v1/routing/{name}/switch`:用 expectedCurrent 做 CAS 手工切换。
- `POST /api/v1/config/reload`:严格解析并原子发布新配置。
所有写操作写审计记录并返回最终 Request ID 与版本。Enable/Disable 对目标状态
幂等Routing Switch 必须携带 `expectedCurrent`,避免并发操作跳过多个供应商。
配置重载校验失败返回 422旧配置继续运行。Status 只返回低基数聚合信息,
不得返回 Proxy 地址、凭据、Client 标识或完整 Provider URL。