Spider 中間件在獨立管理模式下提供豐富的 RESTful API,支持運行時動態查詢路由、下游節點、客戶端連接、發布/代理服務、性能指標、拓撲樹等,並內置 Web 管理控制台。本文匯總所有已實現的接口,供運維與開發快速查閱。
| 功能 | 服務號 | RESTful 地址 |
|---|---|---|
| 查詢路由信息 | 00000001 | https://ip:port/spider/routes.html |
| 查詢下游服務器集群 | 00000002 | https://ip:port/spider/clusters.html |
| 查詢客戶端連接 | 00000003 | https://ip:port/spider/clients.html |
| 查詢發布的服務 | 00000004 | https://ip:port/spider/exports.html |
| 查詢代理的服務 | 00000005 | https://ip:port/spider/proxies.html |
| 查詢當前節點概述 | 00000006 | https://ip:port/spider/myinfo.html |
| 查詢動態路由緩存 | 00000007 | https://ip:port/spider/dyn-route-caches.html |
| 查詢服務運行時性能指標 | 00000014 | https://ip:port/spider/metrics.html |
| 查詢可信模式待處理請求隊列 | 00000015 | https://ip:port/spider/queues.html |
| 清空服務運行時性能指標 | 00000016 | https://ip:port/spider/metric/reset-metrics.html |
| Spider 管理控制台入口 | — | https://ip:port/spider/spider.html |
| 生成 License 文件 | — | https://ip:port/spider/generate-license-key.html |
| 待返回給客戶端的請求 | — | https://ip:port/spider/pending-requests.html |
| Spider 拓撲樹 | — | https://ip:port/spider/node-tree.html |
GET 請求,返回 HTML/JSON 格式(具體視實現)。ip:port 為 Spider 節點綁定的管理端口(spider.xml 中 pluginId="spider.localService" 下 server.port)。metrics.html)包含 QPS、延遲分位數、錯誤率、線程池狀態等,定期 reset-metrics 便於觀測近期窗口。node-tree.html)可視化展示整個集群節點關係,排查路由環路、孤立節點利器。/exports.html 確認服務已發布,/routes.html 驗證路由生效。/metrics.html 觀察 QPS/延遲,/clients.html 定位高頻調用方。/clusters.html 檢查工作節點存活狀態,/dyn-route-caches.html 核對動態路由緩存。/generate-license-key.html 生成新授權,分發至節點。