feat: annuleren taak toegevoegd
This commit is contained in:
@@ -129,6 +129,40 @@ Response shape:
|
||||
}
|
||||
```
|
||||
|
||||
### `POST /api/tasks/{task_id}/cancel`
|
||||
Success for cancellable file-action task:
|
||||
```json
|
||||
{
|
||||
"id": "<uuid>",
|
||||
"operation": "copy",
|
||||
"status": "cancelling",
|
||||
"source": "2 items",
|
||||
"destination": "storage1/dest",
|
||||
"done_bytes": null,
|
||||
"total_bytes": null,
|
||||
"done_items": 0,
|
||||
"total_items": 2,
|
||||
"current_item": "storage1/a.txt",
|
||||
"failed_item": null,
|
||||
"error_code": null,
|
||||
"error_message": null,
|
||||
"created_at": "2026-03-10T10:00:00Z",
|
||||
"started_at": "2026-03-10T10:00:01Z",
|
||||
"finished_at": null
|
||||
}
|
||||
```
|
||||
|
||||
Not cancellable:
|
||||
```json
|
||||
{
|
||||
"error": {
|
||||
"code": "task_not_cancellable",
|
||||
"message": "Task cannot be cancelled",
|
||||
"details": { "task_id": "<uuid>", "status": "completed" }
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Task not found:
|
||||
```json
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user