Task API
Routers
Section titled “Routers”router→ prefix/api/resource/Task(tags: Task)worker_router→ prefix/api/resource/Worker(tags: Worker)- method route
/api/method/shc.task.cancel
Hand-maintained notes against modules/task/router.go. Route inventory (generated): routes.md. Response models (generated): response-models/task.md.
| Method | Path | Permission |
|---|---|---|
GET | /api/resource/Task | — (any authenticated caller) |
GET | /api/resource/Task/{id} | platform:manage |
GET | /api/resource/Worker | — (any authenticated caller) |
POST | /api/method/shc.task.cancel | platform:manage |
GET /api/resource/Task
Section titled “GET /api/resource/Task”- query params:
status(comma-separated),node,dead,limit(default 50) - source:
modules/task/router.go
GET /api/resource/Task/{id}
Section titled “GET /api/resource/Task/{id}”- summary: one full task row (canonical id, timestamps, handler kwargs)
- permission:
platform:manage(the detail row exposes full handler kwargs). The local CLI (UDS) resolves as the synthetic admin. - errors:
X404404TSKNFDwhen no row matches - source:
modules/task/router.go
GET /api/resource/Worker
Section titled “GET /api/resource/Worker”- source:
modules/task/router.go
POST /api/method/shc.task.cancel
Section titled “POST /api/method/shc.task.cancel”- summary: marks a
PENDINGtaskFAILEDwith the given reason. OnlyPENDINGrows are eligible. - permission:
platform:manage(cross-principal mutation of the cron/backup/job pipeline). - body:
{ "id": "<task_id>", "reason": "<optional>" }(idrequired) - source:
modules/task/router.go
shc@docs:~$