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
Property | Type | Required | Default | Description |
---|---|---|---|---|
id | Union[str, uuid.UUID] | false | None | ID of the function |
name | str | false | None | Name of the function |
project_id | Union[str, uuid.UUID] | false | None | ID of the project |
force_exact_match | bool | false | True | Search for exact match, False: Function includes the name |
force_distinct | bool | false | True | Raise exception if name is ambiguous, False: execute on first match |
arguments | dict | false | None | Function 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)