flowserv.client.app.run module
Classes that wrap serialized run result dictionaries. The aim is to make it easier for a developer that uses the flowserv application object to access the results and resources of workflow runs.
- class flowserv.client.app.run.Run(doc: Dict, service: flowserv.service.api.APIFactory)
Bases:
objectWrapper around a serialized run result. Provides access to file objects for the result files that are generated by successful workflow runs.
- files() List[flowserv.client.app.data.DataFile]
Get list of file objects for run result files.
- Return type
list of flowserv.client.app.data.File
- get_file(key: str) flowserv.client.app.data.DataFile
Get result file object for the file with the given identifier.
- Parameters
key (string) – User-provided file identifier or the file source name.
- Return type
flowserv.client.app.data.File
- is_active() bool
Check if the run state is in an active state (either PENDING or RUNNING).
- Return type
bool
- is_canceled() bool
Check if the run state is CANCELED.
- Return type
bool
- is_error() bool
Check if the run state is ERROR.
- Return type
bool
- is_pending() bool
Check if the run state is PENDING.
- Return type
bool
- is_running() bool
Check if the run state is RUNNING.
- Return type
bool
- is_success() bool
Check if the run state is SUCCESS.
- Return type
bool
- messages() List[str]
Get list of error messages for runs that are in error state or that have been canceled. If the run is not in an error state the result is an empty list.
- Return type
list
- open_file(key: str) IO
Get result file object and return an opened file handles. This is a shortcut for opening result files.
- Parameters
key (string) – User-provided file identifier or the file source name.
- Return type
flowserv.client.app.data.File