Skip to content

Add RESTful API endpoints for scheduler remote control#5765

Open
Tianming-Wu wants to merge 4 commits into
LmeSzinc:devfrom
Tianming-Wu:web-api
Open

Add RESTful API endpoints for scheduler remote control#5765
Tianming-Wu wants to merge 4 commits into
LmeSzinc:devfrom
Tianming-Wu:web-api

Conversation

@Tianming-Wu

Copy link
Copy Markdown
Contributor
  • GET /api/scheduler/list - List all instances with status
  • POST /api/scheduler/start - Start scheduler by config_name
  • POST /api/scheduler/stop - Stop scheduler by config_name
  • GET /api/scheduler/status - Query instance detailed status

Mount via Starlette Route in module/webui/fastapi.py, zero intrusion to PyWebIO WebSocket sessions.

This will allow third-party intergrations, like automation scripts, mobile applications and home automation services.

For example, turn the indicator light red whenever an error occurred.

- GET  /api/scheduler/list    - List all instances with status
- POST /api/scheduler/start   - Start scheduler by config_name
- POST /api/scheduler/stop    - Stop scheduler by config_name
- GET  /api/scheduler/status  - Query instance detailed status

Mount via Starlette Route in module/webui/fastapi.py,
zero intrusion to PyWebIO WebSocket sessions.
- Returns pending (tasks past their scheduled time) and waiting
  (tasks not yet due) lists categorized by the scheduler config.
- Reports scheduler process status via the �live field separately,
  leaving the running/pending interpretation to the caller.
@LmeSzinc

LmeSzinc commented Jul 1, 2026

Copy link
Copy Markdown
Owner

不是很赞成有这样的接口,感觉在套娃,脚本自动操作游戏,api自动操作脚本,XX自动操作api,堪比明朝皇帝用西厂杀东厂杀锦衣卫杀文武百官。脚本应该直接面向用户

另外,你完全绕过了密码登录的鉴权

@LmeSzinc LmeSzinc added the wontfix / 不做 This will not be worked on label Jul 1, 2026
@Tianming-Wu

Tianming-Wu commented Jul 1, 2026

Copy link
Copy Markdown
Contributor Author

脚本应该直接面向用户

这个东西是为了让用户可以在不打开 WebUI 的时候获得一定的操作能力,比如我处理完导致游戏卡住的问题要重新启动 alas 的时候不用费老半天连上 WebUI 就为了点一下启动按钮然后关掉。

另外,你完全绕过了密码登录的鉴权
我完全没有发现里面哪里有鉴权,我稍后去检查一遍

@Tianming-Wu

Copy link
Copy Markdown
Contributor Author

已经添加鉴权,密码通过请求头内嵌入:

curl -H "Authorization: Bearer mypassword" http://host:22267/api/scheduler/list

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

wontfix / 不做 This will not be worked on

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants