flowserv.service.run.argument module

Helper functions for run arguments.

flowserv.service.run.argument.deserialize_arg(doc: Dict) Tuple[str, Any]

Get the parameter name and argument value from a run argument.

Parameters

doc (dict) – User-provided argument value for a run parameter.

Return type

string, any

flowserv.service.run.argument.deserialize_fh(doc: Dict) Tuple[str, str]

Get the file identifier and optional target path from an input file argument.

Parameters

doc (dict) – Input file argument value.

Return type

string, string

flowserv.service.run.argument.is_fh(value: Any) bool

Check whether an argument value is a serialization of an input file. Expects a dictionary with the following schema:

{‘type’: ‘$file’, ‘value’: {‘fileId’: ‘string’, ‘targetPath’: ‘string’}}

The target path is optional.

Parameters

value (any) – User provided argument value.

Return type

bool

flowserv.service.run.argument.serialize_arg(name: str, value: Any) Dict

Get serialization for a run argument.

Parameters
  • name (string) – Unique parameter identifier.

  • value (any) – Argument value.

Return type

dict

flowserv.service.run.argument.serialize_fh(file_id: str, target: Optional[str] = None) Dict

Get the file identifier and optional target path from an input file argument.

Parameters

doc (dict) – Input file argument value.

Return type

dict