Trillo Workbench Python SDK
  • Introduction
    • Sample Example
  • BaseApi (Basic APIs)
  • LogApi (Logging APIs)
  • DSApi (Database APIs)
    • Overview
    • Retrieve APIs
    • Create and Update API
    • Delete APIs
    • Empty Table
    • Sample Functions Using API
  • FuncApi (Function APIs)
  • TaskApi (Task APIs)
  • CacheApi (Memory Cache APIs)
    • Delete APIs
    • Create and Update API
    • Retrieve APIs
  • StorageApi
  • CallLogger (Logging Level APIs)
  • CommandApi
  • OAuth1Api
  • Google Cloud APIs
    • BigQueryApi (BigQuery APIs)
    • GCSApi (Cloud Storage APIs)
    • GCPAuthApi
    • GCPRestApi
    • GCPTokenInfo
  • Metadata API (MetaApi)
    • Create and Update API
    • All Retrieve-Only
  • UMApi (User, Tenant, Roles APIs)
  • HttpApi (HTTP APIs)
  • SFTPApi
  • FileUtil
  • CSVApi
  • EmailApi (Email APIs)
  • DLPApi
  • DocApi
  • FolderApi
  • GCPGenApi
  • Util
Powered by GitBook
On this page
  • executeFunction
  • executeFunctionWithMethod
  • executeSSH
  • pingTask
  • createTask
  • createTaskBySourceUid

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.
PreviousSample Functions Using APINextTaskApi (Task APIs)

Last updated 1 year ago