Add an endpoint to track action/workflow executions belong to a certain task

Registered by Renat Akhmerov

We currently dont' have any support for tracking parent-child relationship between workflows. From DB model perspective there's the field "task_execution_id" for all executions (actions, workflows) that expresses this relationship. This field is also present in REST resources that we can get using /executions endpoint (to get workflow executions). This help us answer the question "What task do this workflow execution belong to?" (=> "What workflow does this workflow execution belong to?" or simply "What is the parent workflow execution of this workflow execution?".

However, practically we also need to be able to answer the question "What are the child workflow executions of this task execution?". It's needed to build a convenient UI (e.g. we see a task and would like to expand a tree associated with this task) and CLI commands.

Proposed solution:

* Add a new endpoint that would allow us to get all child executions of the given task execution

/tasks/<id>/executions

The result would be a list of objects of two possible types: 1) workflow executions (similar to /executions) in case if the task is configured to run workflow 2) action executions (similar to /action_executions) in case if the task is configured to run actions

* Modify /v2/tasks endpoint so that objects returned by it also include field "task_type" with two possible values: action, workflow. That would allow to know what type of objects to expect from new endpoint /tasks/<id>/executions

Blueprint information

Status:
Complete
Approver:
Renat Akhmerov
Priority:
High
Drafter:
Renat Akhmerov
Direction:
Approved
Assignee:
Michal Gershenzon
Definition:
Approved
Series goal:
Accepted for ocata
Implementation:
Implemented
Milestone target:
milestone icon ocata-1
Started by
Renat Akhmerov
Completed by
Renat Akhmerov

Related branches

Sprints

Whiteboard

Gerrit topic: https://review.openstack.org/#q,topic:bp/mistral-task-subexecutions-endpoint,n,z

Addressed by: https://review.openstack.org/344228
    WIP: moving REST resources to resources.py

Addressed by: https://review.openstack.org/344569
    Move the remainder of REST resources to resources.py

Addressed by: https://review.openstack.org/344167
    Add the new endpoint /v2/tasks/<id>/workflow_executions

renat: May be we even don't need this shortcut /executions endpoint but instead just add something like 'task_type' (action | workflow) into task itself so that on the client side we knew what exact subendpoint to call

Addressed by: https://review.openstack.org/382893
    Add type to tasks API

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.