Project

Profile

Help

Story #6414

Updated by dkliban@redhat.com over 4 years ago

## User experience 

 A task that dispatches some number of tasks returns a list of created resources that includes at least one TaskGroup href.  

 The user can then perform a GET on the TaskGroup and receive a data structure that looks like this: 

 <pre> 
 { 
     "pulp_created": "2019-07-23T08:18:12.927007Z", 
     "pulp_href": "/pulp/api/v3/task-groups/59f8a786-c7d7-4e2b-ad07-701479d403c5/", 
     "description": "foo group of tasks", 
     "waiting": [], 
     "skipped": [], 
     "running": [], 
     "completed": ["/pulp/api/v3/tasks/55db2086-cf2e-438f-b5b7-cd0dbb7c8cf4/"], 
     "failed": ["/pulp/api/v3/tasks/abc56745-dcfe-549a-c6c8-df0ccb7c9b11/"], 
     "canceled": [] 
 } 
 </pre> 

 ## Implementation 

 TaskGroup model, viewset, and serializer need to be created. 

 Task model needs to have an optional 'task_group' foreign key added.  

 The enque_with_reservation[0] enque_with_reservation method needs to accept an optional 'task_group' keyword argument. When the 'task_group' is specified it is saved as a ForeignKey on the Task model that is created for tracking that task.  

 [0] https://github.com/pulp/pulpcore/blob/master/pulpcore/tasking/tasks.py#L148

Back