flowserv.config module
Collection of configuration parameters for different components of flowserv.
The module contains helper classes to get configuration values from environment variables and to customize the configuration settings.
- flowserv.config.API_DEFAULTDIR() str
The default API base directory is a subfolder in the users data cache directory.
The default user cache directory is different for different OS’s. We use appdirs.user_cache_dir to get the directory.
- Return type
string
- flowserv.config.API_URL(env: Dict) str
Get the base URL for the API from the respective environment variables ‘FLOWSERV_API_HOST’, ‘FLOWSERV_API_PATH’, and ‘FLOWSERV_API_PORT’ in the given configuration dictionary.
- Parameters
env (dict) – Configuration object that provides access to configuration parameters in the environment.
- Return type
string
- flowserv.config.APP() str
Get the value for the FLOWSERV_APP variable from the environment. Raises a missing configuration error if the value is not set. :rtype: string
- flowserv.config.AUTH_OPEN = 'open'
Default user.
- class flowserv.config.Config(defaults: Optional[Dict] = None)
Bases:
dictHelper class that extends a dictionary with dedicated methods to set individual parameters in the flowserv configuration.
Methods with lower case names are setters for configuration parameters. All setters return a reference to the configuration object itself to allows chanining the setter calls.
- auth() flowserv.config.Config
Set the authentication method to the default value that requires authentication.
- Return type
- basedir(path: str) flowserv.config.Config
Set the flowserv base directory.
- Parameters
path (string) – Path to the base directory for all workflow files.
- Return type
- database(url: str) flowserv.config.Config
Set the database connect Url.
- Parameters
url (string) – Database connect Url.
- Return type
- multiprocess_engine() flowserv.config.Config
Set configuration to use the serial multi-porcess workflow controller as the default backend.
- Return type
- open_access() flowserv.config.Config
Set the authentication method to open access.
- Return type
- run_async() flowserv.config.Config
Set the run asynchronous flag to True.
- Return type
- run_sync() flowserv.config.Config
Set the run asynchronous flag to False.
- Return type
- token_timeout(timeout: int) flowserv.config.Config
Set the authentication token timeout interval.
- Return type
- volume(config: dict) flowserv.config.Config
Set configuration object for the file storage volume.
- Parameters
config (dict) – Volume configuration information for the storage volume factory.
- Return type
- webapp() flowserv.config.Config
Set the web app flag to True.
- Return type
- flowserv.config.DEFAULT_POLL_INTERVAL = 2
Environment variables for the command line interface.
- flowserv.config.DEFAULT_USER = '00000000'
Environment variables that control the configuration of the workflow controllers.
- flowserv.config.FLOWSERV_API_PROTOCOL = 'FLOWSERV_API_PROTOCOL'
Default values for environment variables.
- flowserv.config.FLOWSERV_AUTH = 'FLOWSERV_AUTH'
Default values for environment variables.
- flowserv.config.FLOWSERV_WEBAPP = 'FLOWSERV_WEBAPP'
Environment variables that are used to configure the file store that is used to maintain files for workflow templates, user group uploads, and workflow runs.
- flowserv.config.REMOTE_CLIENT = 'remote'
Environment variable that contains the database connection string.
- flowserv.config.env() flowserv.config.Config
Get configuration parameters from the environment.
- flowserv.config.read_config_obj(filename: Union[str, Dict]) Dict
Read configuration object from a file.
This function only attempts to read an object from disk if the type of the filename argument is string.
- Parameters
filename (str or dict) – Path to file on disk.
- Return type
dict
- flowserv.config.to_bool(value: Any) bool
Convert given value to Boolean. Only of the string matches ‘True’ (ignoring case) the result will be True.
- Parameters
value (any) – Expects a string representation of a Boolean value.
- Return type
bool
- flowserv.config.to_float(value: Any) float
Convert given value to float.
- Parameters
value (any) – Expects an integer, float, or a string representation of an integer or float value.
- Return type
int
- flowserv.config.to_int(value: Any) int
Convert given value to integer.
- Parameters
value (any) – Expects an integer value or a string representation of an integer value.
- Return type
int