cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1316
Views
2
Helpful
3
Replies
guthrie
Enthusiast

UCS Director Cloupia Script Methods?

Can someone point me to better documentation that describes what the default included methods and variables are in the following Cloupia script objects:

ctxt

logger

util

input

output

metadata

I see that same javadocs zipfile is included in the SDK for both OA and CS but I seem to be bumping into walls just trying to get stuff to work.  I can find a ton of references to importpackages where the class listed as 'model' but it will not get past the importpackages area if I don't change 'model' to 'service'.

3 REPLIES 3
Geevarghese Cheria
Cisco Employee

Hi Jeremy,

The Cloupia script is a combination of JavaScript and Cloupia libraries, which you can execute from within
the Cloupia server platform. You can access subset of Cloupia Java APIs and objects from the script. The
Cloupia script supports all JavaScript syntax. However, browser-based objects are not supported because the
Cloupia script contains a server-side scripting.

Three predefined top-level implicit variables or objects are in any Cloupia script:
• ctxt—This variable or object points to the Cloupia Workflow Execution context. Using this object, the
script can access information about the current workflow, task, input, output and can access the Cloupia
APIs. Using the Cloupia APIs, you can invoke the create, read, update, and delete (CRUD) operations,
workflow tasks, and expose other REST APIs. The ctxt object maps to the platform API:
com.cloupia.service.cIM.inframgr.customactions.CustomActionTriggerContext.

• logger—This variable or object points to the Cloupia workflow logger object. All scripts must add
reasonable amount of logging statements, which will be logged into the Service Request log. The logger
implicit object maps to the platform API:
com.cloupia.service.cIM.inframgr.customactions.CustomActionLogger.

• util—Few built-in utility concepts can be accessed using this variable or object. The util implicit object
maps to the platform API: com.cloupia.lib.util.managedreports.APIFunctions.

Reference - https://developer.cisco.com/fileMedia/download/dc4fbebc-f485-483f-bd00-df85c54b8a19

Thanks and Regards,

Geevarghese

Gotcha.  In further examples it seems like more is available but not readily documented:

e.g.

Cisco UCS Director Cloupia Script Configuration Guide, Release 4.1  - Cloupia Script Samples [Cisco UCS Director] - Cisc…

The above URL has a section for "Sending Emails from the Cloupia Script".  You can see it is calling importPackage yet there is no indication in the javadocs that these are available to be imported.  I have tried importPackage for a few other items listed in the javadocs yet it either ignores the lines or errors out.  Is there more documentation elsewhere about what is allowed to be imported into cloupiascript for use?

Have you found any good ways to dig deeper into Cloupia?  I am starting out myself and am finding the documentation lacking as well.

Content for Community-Ad

This widget could not be displayed.