|
1 | 1 | API Design |
2 | 2 |
|
3 | | -| REST verb | URI | Note | |
4 | | -| --------- | --------------------- | ------------------------ | |
5 | | -| GET | /login | 进入登陆页面 | |
6 | | -| POST | /session | 登陆验证 | |
7 | | -| DELETE | /session | 注销登陆 | |
8 | | -| GET | /report/catalog | 获取所有巡检结果的文件名 | |
9 | | -| GET | /report/id/{id} | 获取指定的某次结果 | |
10 | | -| GET | /report/latest | 获取最后一次巡检结果 | |
11 | | -| GET | /report/meta | 获取巡检结果元信息 | |
12 | | -| POST | /report | 执行一次巡检 | |
13 | | -| GET | /report/download/all | 下载所有巡检报告 | |
14 | | -| GET | /report/download/{id} | 下载指定的巡检报告 | |
| 3 | +| REST verb | URI | Note | |
| 4 | +| --------- | ---------------------------- | ------------------------ | |
| 5 | +| GET | /login | 进入登陆页面 | |
| 6 | +| POST | /session | 登陆验证 | |
| 7 | +| DELETE | /session | 注销登陆 | |
| 8 | +| GET | /report/catalog | 获取所有巡检结果的文件名 | |
| 9 | +| GET | /report/id/{id} | 获取指定的某次结果 | |
| 10 | +| GET | /report/latest | 获取最后一次巡检结果 | |
| 11 | +| GET | /report/meta | 获取巡检结果元信息 | |
| 12 | +| POST | /report | 执行一次巡检 | |
| 13 | +| GET | /report/download/all | 下载所有巡检报告 | |
| 14 | +| GET | /report/download/{id} | 下载指定的巡检报告 | |
| 15 | +| GET | /script/local | 查看所有远程仓库脚本 | |
| 16 | +| GET | /script/remote | 查看所有远程仓库脚本 | |
| 17 | +| GET | /script/remote/readme/:name | 查看指定脚本名的介绍 | |
| 18 | +| POST | /script/remote/download/:name| 下载远程仓库的脚本到本地 | |
15 | 19 |
|
16 | 20 | ### 登陆验证 |
17 | 21 |
|
@@ -229,3 +233,81 @@ Response Body: |
229 | 233 | "check_time": 20211221063030 |
230 | 234 | } |
231 | 235 | ``` |
| 236 | + |
| 237 | +### 查看本地脚本列表 |
| 238 | + |
| 239 | +`GET /script/local` |
| 240 | + |
| 241 | +- Request Query Param |
| 242 | +``` |
| 243 | + // The start default value is 0 |
| 244 | + // The length default value is 10 |
| 245 | + ?start=0&length=2 |
| 246 | +``` |
| 247 | + |
| 248 | +- Response Body |
| 249 | + |
| 250 | +```json |
| 251 | +{ |
| 252 | + "total": 2, |
| 253 | + "script_list": [ |
| 254 | + { |
| 255 | + "name": "alive_pd_number" |
| 256 | + },{ |
| 257 | + "name": "alive_tidb_number" |
| 258 | + } |
| 259 | + ] |
| 260 | +} |
| 261 | +``` |
| 262 | + |
| 263 | +### 查看所有远程仓库脚本 |
| 264 | + |
| 265 | +`GET /script/remote` |
| 266 | + |
| 267 | +- Request Query Param |
| 268 | +``` |
| 269 | + // The start default value is 0 |
| 270 | + // The length default value is 10 |
| 271 | + ?start=0&length=2 |
| 272 | +``` |
| 273 | +- |
| 274 | +- Response Body : |
| 275 | + |
| 276 | +```json |
| 277 | +{ |
| 278 | + "total": 2, |
| 279 | + "script_list": [ |
| 280 | + { |
| 281 | + "name": "alive_pd_number", |
| 282 | + "download": true |
| 283 | + },{ |
| 284 | + "name": "alive_tidb_number", |
| 285 | + "download": false |
| 286 | + } |
| 287 | + ] |
| 288 | +} |
| 289 | +``` |
| 290 | + |
| 291 | +### 查看指定脚本名的介绍 |
| 292 | + |
| 293 | +`GET /script/remote/readme/:name` |
| 294 | + |
| 295 | +- Response Body : |
| 296 | + |
| 297 | +```json |
| 298 | +{ |
| 299 | + "readme": "" |
| 300 | +} |
| 301 | +``` |
| 302 | + |
| 303 | +### 下载远程仓库的脚本到本地 |
| 304 | + |
| 305 | +`POST /script/remote/download/:name` |
| 306 | + |
| 307 | +- Response Body : |
| 308 | + |
| 309 | +```json |
| 310 | +{ |
| 311 | + "status": "ok" |
| 312 | +} |
| 313 | +``` |
0 commit comments