Add RESTful API endpoints for scheduler remote control#5765
Open
Tianming-Wu wants to merge 4 commits into
Open
Add RESTful API endpoints for scheduler remote control#5765Tianming-Wu wants to merge 4 commits into
Tianming-Wu wants to merge 4 commits into
Conversation
- 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.
Owner
|
不是很赞成有这样的接口,感觉在套娃,脚本自动操作游戏,api自动操作脚本,XX自动操作api,堪比明朝皇帝用西厂杀东厂杀锦衣卫杀文武百官。脚本应该直接面向用户 另外,你完全绕过了密码登录的鉴权 |
Contributor
Author
这个东西是为了让用户可以在不打开 WebUI 的时候获得一定的操作能力,比如我处理完导致游戏卡住的问题要重新启动 alas 的时候不用费老半天连上 WebUI 就为了点一下启动按钮然后关掉。
|
Contributor
Author
|
已经添加鉴权,密码通过请求头内嵌入: curl -H "Authorization: Bearer mypassword" http://host:22267/api/scheduler/list |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.