Files
z-docs/docs/admin-apis/overview.md

62 lines
1.2 KiB
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.

---
sidebar_position: 0
title: 管理接口概览
description: ZHub 服务管理接口总览
---
# ZHub 管理接口概览
管理接口通过 HTTP 访问,默认端口 `711`
**配置**:在 `app.ini` 中修改 `[service]` 部分的 `watch` 参数
## 接口列表
**核心接口**
- `GET /_/info` - 查看服务状态
- `GET /_/cleanup` - 清理内存
- `GET /timer/reload` - 重载定时配置
- `GET /auth/reload` - 重载权限配置
**辅助接口**
- `GET /_/version` - 查看版本信息
- `POST /message/send` - HTTP 发送消息
- `GET /topic/delay` - 查看延时消息状态
## 使用示例
```bash
# 查看服务状态
curl http://127.0.0.1:711/_/info
# 清理内存
curl http://127.0.0.1:711/_/cleanup
# 重载配置
curl http://127.0.0.1:711/timer/reload
curl http://127.0.0.1:711/auth/reload
# 查看版本
curl http://127.0.0.1:711/_/version
```
## 配置管理
**端口配置**
```ini
[service]
watch = 0.0.0.0:711 # 管理端口
```
## 安全注意事项
- 管理接口默认监听所有网络接口
- 生产环境建议添加认证机制
- 避免在公网环境暴露管理接口
## 监控建议
- 定期检查服务状态:`/_/info`
- 监控内存使用,必要时执行清理
- 修改配置后及时执行 reload 接口