State transitions of a task
| Current State | Event | Next State |
|---|---|---|
| Pending | ScheduleEvent | Scheduled |
| Pending | ScheduleEvent | Failed |
| Scheduled | StartTask | Running |
| Scheduled | StartTask | Failed |
| Running | StopTask | Completed |
Worker API Routes
| Method | Route | Description |
|---|---|---|
| GET | /tasks | get a list of all tasks |
| POST | /tasks | create a task |
| DELETE | /tasks/{taskID} | stop the task identified by taskID |
| Method | Route | Description | Request Body | Response Body | Status code |
|---|---|---|---|---|---|
| GET | /tasks | get a list of all tasks | none | list of tasks | 200 |
| POST | /tasks | create a task | JSON-encoded task.TaskEvent | none | 201 |
| DELETE | /tasks/{taskID} | stop the task identified by taskID | none | none | 204 |