Project

Profile

Help

Story #1206

Updated by dkliban@redhat.com over 7 years ago

- Documentation on using the Group Task Status 
 - Add pulp/api/v2/task_groups/<group_id>/state_summary /pulp/api/v2/group-tasks/<group_id> in urls.py 
 - Add a view to handle the new endpoint 
 - The view should check the database for the status of all tasks that have the specific group_id and return a status based on that information. 
 - The view should return JSON structure that looks like: 

 <pre> 
 { 
  "_href": "/pulp/api/v2/task_groups/0fe4fcab-a040-11e1-a71c-00508d977dff/state_summary", "/pulp/api/v2/group-tasks/0fe4fcab-a040-11e1-a71c-00508d977dff/", 
  "finished": 4, "state": "running", # depends on whether or not all tasks finished running 
  "canceled": 0, "group_id": "0fe4fcab-a040-11e1-a71c-00508d977dff", 
  "error": 1, "task_type": "pulp.server.tasks.repository.applicability", 
  "running": 3, "progress_report": {}, # contents depend on the operation 
  "waiting": 0, "result": null, 
  "group_id": "0fe4fcab-a040-11e1-a71c-00508d977dff", "start_time": "2012-05-17T16:48:00Z", 
  "finish_time": null, 
  "exception": null, 
  "traceback": null, 
  "tags": [ 
    "pulp:repository:f16", 
    "pulp:action:repo_applicability" 
  ], 
  "child_tasks": [{"href": 
 "/pulp/api/v2/tasks/7744e2df-39b9-46f0-bb10-feffa2f7014b/", 
                     "task_id": "7744e2df-39b9-46f0-bb10-feffa2f7014b" }], 
  "error": null 
 } 
 </pre> 

 Note that the list of tasks are called child_tasks, unlike spawned_tasks. This 
 is to distinguish between tasks that should be monitored by katello (spawned) versus 
 tasks that are not to be monitored by katello (child).

Back