flowserv.service.run.remote module
Implementation for the API service component provides methods that execute, access, and manipulate workflow runs and their results. The remote service API provides access to run resources at a RESTful API.
- class flowserv.service.run.remote.RemoteRunService(descriptor: flowserv.service.descriptor.ServiceDescriptor, labels: Optional[Dict] = None)
Bases:
flowserv.service.run.base.RunServiceAPI component that provides methods to start, access, and manipulate workflow runs and their resources at a remote RESTful API.
- 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
- 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
- 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
- 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
- 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
- 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
- start_run(group_id: str, arguments: List[Dict]) 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.
- Return type
dict