flowserv.client.cli.base module

Main module for the flowserv command line interface. Defines the top-level command group and the API context for all commands.

class flowserv.client.cli.base.EnvContext(vars: Dict)

Bases: object

Helper class to get default parameter values for from the environment. The different applications flowserv and rob historically use different environment variables to maintain the workflow and group identifier. This class is used to hide these details from the CLI commands.

access_token() str

Get the value for the user access token from the environment.

The environment variable that holds the token (FLOWSERV_ACCESS_TOKEN) is the same accross both applications.

Raises a missing configuration error if the value is not set.

Return type

string

get_group(params: Dict) str

Get the user group (submission) identifier from the parameters or the environment.

Attempts to get the group identifier from the list of parsed parameters. Assumes the the identifier is given by the parameter group. If no group identifier is present in the given parameter dictionary an attempt is made to get the identifier from the environment variable that is defined for user groups in this context. If that environment variable is not set an attempt is made to get the value from the environment variable for the workflow identifier. The latter is done since flowserv applications are installed with identical workflow and group identifier.

Raises a missing configuration error if the value is not set.

Parameters

params (dict) – Dictionary of parsed command-line parameters

Return type

string

get_workflow(params: Dict) str

Get the workflow identifier from the parameters or the environment.

Attempts to get the workflow identifier from the list of parsed parameters. Assumes the the identifier is given by the parameter workflow. If no workflow identifier is present in the given parameter dictionary an attempt is made to get the identifier from the environment variable that is defined for workflows in this context.

Raises a missing configuration error if the value is not set.

Parameters

params (dict) – Dictionary of parsed command-line parameters

Return type

string