Provided Methods

  • Run an OD function by ID/name

Method documentation

All the examples expect that there is already a OneDataApi object initialized and assigned to a variable called "onedata_api".

### Creation of the ONE DATA Api ###
onedata_api = OneDataApi(base_url=base_url, username=user, password=pw, verify=False, timeout=999)

execute

Description

Executes the function with the given ID or with the name and the given project ID. Execute by name can be configured with force_exact_match and force_distinct. Use arguments, if the function relies on them.

Optional request options (request_transformers, response_transformers, timeout, verify, sleep_after_response_millis, deserializer) can be specified.

Returns: FunctionExecutionResult

Parameters

PropertyTypeRequiredDefaultDescription
idUnion[str, uuid.UUID]falseNoneID of the function
namestrfalseNoneName of the function
project_idUnion[str, uuid.UUID]falseNoneID of the project
force_exact_matchboolfalseTrueSearch for exact match, False: Function includes the name
force_distinctboolfalseTrueRaise exception if name is ambiguous, False: execute on first match
argumentsdictfalseNoneFunction arguments

Usage

### Execution of production line by id ###
result: FunctionExecutionResult = onedata_api.functions.execute(id=function_id,
                                                                arguments={"text": "I <3 Python"})

### Execution of production line by name ###
result: FunctionExecutionResult = onedata_api.functions.execute(name=function_name,
                                                                project_id=project_id,
                                                                arguments={"text": "Please execute me by name"},
                                                                force_exact_match=True)