FuncApi (Function APIs)

executeFunction

Execute a specific Trillo function by providing its parameters.​

FuncApi.executeFunction(functionName, params)

or

FuncApi.executeFunction(appName, functionName, params)

parameters:

functionName: name of the function as str
params:   dictionary representing the parameters
appName: str

Sample Code

functionParameters = {}
result = FuncApi.executeFunction("FUNCTION_NAME", functionParameters)

Returns:

Dictionary containing the result of the function execution.

executeFunctionWithMethod

Executes a function with a specific method and parameters.

FuncApi.executeFunctionWithMethod(functionName, methodName, params)

or

FuncApi.executeFunctionWithMethod(appName, functionName, methodName, params)

Parameters

functionName: str
methodName: str
params: dictionary
appName: str

Sample Code

functionParameters = {}
result = FuncApi.executeFunctionWithMethod("FUNCTION_NAME", "METHOD_NAME", functionParameters)

Returns

Dictionary containing the result of the function execution with method.

executeSSH

Execute a remote ssh command on a server whose keys are known to the workbench.​ Generally the SSH server is a companion server of the workbench.

FuncApi.executeSSH(hostName, command)

or

FuncApi.executeSSH(hostName, command, async)

or

FuncApi.executeSSH(command, async)

parameters:

hostName: the str name of the companion server
command:   the command needed to be executed as str
async:     execute command immediately and wait or run it in the background

Returns:

Dictionary containing the result of the SSH command execution.

pingTask

Ping an asynchronous task by id​ and returns it's last time stamp

FuncApi.pingTask(id)

parameters:

id: task name (str)

Sample Code

result = FuncApi.pingTask("id");

Returns:

Dictionary containing the result of the ping operation.

createTask

Creates a task for a function.

FuncApi.createTask(taskName, taskType, functionName, params)

or

FuncApi.createTask(taskName, taskType, appName, functionName, params)

Parameters

taskName: str
taskType: str
functionName: str
params: dictionary
appName: str

Sample Code

result = FuncApi.pingTask("id")

Returns

Dictionary containing the result of the task creation.

createTaskBySourceUid

Creates a task for a function using source UID.

FuncApi.createTaskBySourceUid(taskName, taskType, sourceUid, functionName, params)

or

FuncApi.createTaskBySourceUid(taskName, taskType, sourceUid, appName, functionName, params)

Parameters

taskName: str
taskType: str
sourceUid: str
functionName: str
params: dictionary
appName: str

Sample Code

functionParameters = {}
result = FuncApi.createTaskBySourceUid("upsertTask", "CURD", "Job1123", "FUNCTION_NAME", functionParameters)

Returns

Dictionary containing the result of the task creation.

Last updated