Merge the TaskDetailsFromAgent and TaskUpdate API views
https://redmine.teklia.com/issues/7517
The TaskUpdate
API view provides UpdateTask
and PartialUpdateTask
, which only allow updating a task's state to stopping
or pending
. stopping
causes a single task to stop and pending
causes a task to restart. In the frontend, stopping and restarting a single task (instead of stopping and retrying a whole process) is only provided to instance admins, but any process admin can actually call the API endpoints.
The TaskDetailsFromAgent
API view provides RetrieveTaskFromAgent
(the only way to retrieve a single task, used by both agents and the frontend), UpdateTaskFromAgent
(never used) and PartialUpdateTaskFromAgent
(to update a task's state from an agent).
RetrieveTaskFromAgent
would be better named just RetrieveTask
since it is used not just by agents. Both of the update endpoints only allow updating a task's state, but they just allow it with different rules. We could merge both API endpoints to make them easier to understand and maintain.