You write, edit, and test custom tasks from within Cisco UCS Director. You must have administrator privileges to write custom tasks.
You write custom tasks using CloupiaScript, a version of JavaScript with Cisco UCS Director Java libraries that enable orchestration operations. You then use your custom tasks like any other task, including them in
workflows to orchestrate work on your components.
CloupiaScript supports all JavaScript syntax. CloupiaScript also supports access to a subset of the Cisco UCS Director Java libraries, enabling custom tasks access to Cisco UCS Director components. Because CloupiaScript runs only on the server, client-side objects are not supported.
CloupiaScript uses the
Nashorn script engine. For more details about Nashorn, see the technical notes
on Oracle's website at
https://docs.oracle.com/javase/8/docs/technotes/guides/scripting/nashorn/api.htm.
Implicit
Variables in Custom Tasks
Three predefined
top-level variables are included automatically in any custom task:
Variable
|
Description
|
ctxt
|
The workflow execution context. This context object contains information about the current workflow, the current task, and
available inputs and outputs. It also has access to the Cisco UCS Director Java APIs, with which you can perform create, read, update, and delete (CRUD) operations, invoke other tasks, and call other
API methods. The ctxt variable is an instance of the platform API class com.cloupia.service.cIM.inframgr.customactions.
CustomActionTriggerContext .
|
logger
|
The
workflow
logger object. The workflow logger writes to the
service request (SR) log. The
logger variable is an instance of the platform API
class
com.cloupia.service.cIM.inframgr.customactions.CustomActionLogger .
|
util
|
An object
that provides access to utility methods. The
util variable is an instance of the platform API class
com.cloupia.lib.util.managedreports.APIFunctions .
|
For more information about the API classes of the implicit variables, see the CloupiaScript Javadoc included in the Cisco UCS Director script bundle.