flowserv.service.run.base module

Interface for the API service component provides methods that execute, access, and manipulate workflow runs and their results.

class flowserv.service.run.base.RunService

Bases: object

API component that provides methods to start, access, and manipulate workflow runs and their resources.

abstract cancel_run(run_id: str, reason: Optional[str] = None) Dict

Cancel the run with the given identifier. Returns a serialization of the handle for the canceled run.

Raises an unauthorized access error if the user does not have the necessary access rights to cancel the run.

Parameters
  • run_id (string) – Unique run identifier

  • reason (string, optional) – Optional text describing the reason for cancelling the run

Return type

dict

abstract delete_run(run_id: str) Dict

Delete the run with the given identifier.

Raises an unauthorized access error if the user does not have the necessary access rights to delete the run.

Parameters
  • run_id (string) – Unique run identifier

  • flowserv.error.InvalidRunStateError

abstract get_result_archive(run_id: str) IO

Get compressed tar-archive containing all result files that were generated by a given workflow run. If the run is not in sucess state a unknown resource error is raised.

Raises an unauthorized access error if the user does not have read access to the run.

Parameters

run_id (string) – Unique run identifier

Return type

io.BytesIO

abstract get_result_file(run_id: str, file_id: str) IO

Get file handle for a resource file that was generated as the result of a successful workflow run.

Raises an unauthorized access error if the user does not have read access to the run.

Parameters
  • run_id (string) – Unique run identifier.

  • file_id (string) – Unique result file identifier.

Return type

flowserv.model.files.FileHandle

abstract get_run(run_id: str) Dict

Get handle for the given run.

Raises an unauthorized access error if the user does not have read access to the run.

Parameters

run_id (string) – Unique run identifier

Return type

dict

abstract list_runs(group_id: str, state: Optional[str] = None)

Get a listing of all run handles for the given workflow group.

Raises an unauthorized access error if the user does not have read access to the workflow group.

Parameters
  • group_id (string) – Unique workflow group identifier

  • state (string, default=None) – State identifier query

Return type

dict

abstract start_run(group_id: str, arguments: List[Dict], config: Optional[Dict] = None) Dict

Start a new workflow run for the given group. The user provided arguments are expected to be a list of (key,value)-pairs. The key value identifies the template parameter. The data type of the value depends on the type of the parameter.

Returns a serialization of the handle for the started run.

Raises an unauthorized access error if the user does not have the necessary access to modify the workflow group.

Parameters
  • group_id (string) – Unique workflow group identifier

  • arguments (list(dict)) – List of user provided arguments for template parameters.

  • config (dict, default=None) – Optional implementation-specific configuration settings that can be used to overwrite settings that were initialized at object creation.

Return type

dict