mistral/mistral/api
Renat Akhmerov ae2c5fdbbb Add a workflow execution report endpoint
* This patch adds the first version of the REST endpoint that
  can generate a report for a workflow execution. Without any
  query parameters, GET method of the endpoint returns a tree-like
  structure that includes information about all execution objects
  associated with the specified workflow execution. The root object
  is the workflow execution itself, its children are task executions,
  each task execution has either action executions or workflow
  executions and so on. So the structure describes the entire set
  of execution objects regardless of how deep there are from the
  root object. This kind of data itself can be used to better
  understand and visualise the process related with a parent workflow,
  see what paths were taken while the workflow was running.
  If additional parameters are provided in a query string, the
  endpoint can give only a subset of the entire tree. Currently,
  the filters are:
    1. "errors_only" (boolean) to retain only all execution objects
        with the error state, meaning that only all error paths are
        present in the report. It is useful when we need to do a root
        cause analysis of the workflow failure. False by default.
    2. "max_depth" (integer) to limit how deep the algorithm can go
        into nested workflows. If set to 0, only the root workflow
        execution will be in the report. If set to 1, then the report
        will have only the root workflow execution and its direct
	children. And so on. If negative (by default) then no limit
        is set.
  Additionally, the report contains statistics about task executions
  examined while the report was being generated, like the number of
  tasks in the error state, number of tasks that successfully
  finished and so on.
* Added all main tests for the endpoint. Note that despite the fact
  that this test verifies a REST API endpoint, unlike the other API
  tests it runs a Mistral engine to run workflows. This is done to
  simplify the test implementation so that we don't have to mock
  everything with huge data structures like we do in other API tests.

Possible changes that may be made based on the feedback:
* Statistics can contain not only number of tasks in certain states.
  We can also add things like number of actions, depth of the tree,
  number of nested workflows, average task/action/workflow execution
  time etc.
* Additional query parameters to configure a generated report. For
  example, "statistics_only" just to get a general information about
  the workflow execution tree, not the tree itself. Another example
  is "running_only" to retain only not finished workflow paths.

Implements blueprint: mistral-error-analysis

Change-Id: Id3e17821e04b7a1b84dfea5126d223d90ad8e3c2
2019-02-11 15:03:35 +07:00
..
controllers Add a workflow execution report endpoint 2019-02-11 15:03:35 +07:00
hooks Fixing grammar mistake 2018-02-05 08:47:20 +00:00
__init__.py Adding pecan, wsme, oslo and adjusting packages 2013-11-21 13:47:42 +07:00
access_control.py Add entry point to allow for oslo.policy CLI usage 2018-09-19 16:25:33 +00:00
app.py Add a config option to disable cron triggers 2017-10-26 13:48:05 +03:00
service.py Fix Kombu RPC threading and use within multiprocess environment 2017-09-05 10:36:43 +00:00
wsgi.py Fix WSGI script for gunicorn 2017-05-10 21:31:42 +00:00