VPSHUB/README.md

52 lines
1.6 KiB
Markdown
Raw Permalink 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.

## 核云IDC服务商VPS自动监测重启程序
### API接口信息
- **获取登录Token**
`https://www.heyunidc.cn/v1/login_api?account={phone number/email acc}&password={API KEY}`
备注POST方法
- **获取VPS列表**
`https://www.heyunidc.cn/v1/hosts?page=1&limit=100`
备注GET方法使用"Authorization: JWT {Token}"进行认证
注意若您的VPS数量超过100需要更改limit数量
- **获取VPS状态**
`https://www.heyunidc.cn/v1/hosts/{id}/module/status?type=host`
备注GET方法使用"Authorization: JWT {Token}"进行认证
- **操作VPS**
`PUT https://www.heyunidc.cn/v1/hosts/:id/module/hard_reboot`
备注PUT方法使用"Authorization: JWT {Token}"进行认证
操作类型hard_reboot - 硬重启on - 开机off - 关机reboot - 重启
### 使用方法
#### 获取API_KEY
如图所示:
![API_KEY](./src/api.png)
#### Web端
将web目录部分部署到服务器上分配域名或直接IP访问即可
首次使用会进入配置页依次输入API_PASSACCOUNTAPI_KEY其中API_PASS是您自定义的网站访问密码支持大小写字母以及数字
随后访问`http://example.com/?pass=API_PASS`即可
切记切勿将app部分放置于网站目录下
#### 监控端
**安装:**
1. chmod +x ./install.sh
2. ./install.sh
系统将自动注册名为idc-monitor的system服务
注意若您的服务器必须要求禁ping程序可能无法正常运行在安装脚本前请手动将config.yml中的WAY改为http然后再启动安装脚本
**卸载:**
1. chmod +x ./uninstall.sh
2. ./uninstall.sh