4.1

Table Of Contents
Using the Orchestrator API
The Orchestrator API exposes as JavaScript objects and methods all of the objects and functions of the
technologies that Orchestrator accesses through its plug-ins.
For example, you can access JavaScript implementations of the vCenter Server API through the Orchestrator
API, to include vCenter operations in scripted elements that you create. You can also access JavaScript
implementations of objects from all of the other plug-ins you install in the Orchestrator server. If you create a
custom plug-in to a third-party application, you map the objects from its API to JavaScript objects that the
Orchestrator API then exposes.
Procedure
1 Access the Scripting Engine from the Workflow Editor on page 114
The Orchestrator scripting engine uses the Mozilla Rhino 1.6 JavaScript engine to help you write scripts
for scripted elements in workflows. You access the scripting engine for scripted workflow elements from
the Scripting tab in the workflow editor.
2 Access the Scripting Engine from the Action or Policy Editor on page 114
The Orchestrator scripting engine uses the Mozilla Rhino JavaScript engine to help you write scripts for
actions or policies. You access the scripting engine for actions and policies from the Scripting tabs in the
action and policy editors.
3 Access the Orchestrator API Explorer on page 114
Orchestrator provides an API Explorer to allow you to search the Orchestrator API and see the
documentation of JavaScript objects that you can use in scripted elements.
4 Use the Orchestrator API Explorer to Find Objects on page 115
The Orchestrator API exposes the API of all plugged-in technologies, including the entire vCenter Server
API. The Orchestrator API Explorer helps you find the objects you need to add to scripts.
5 Writing Scripts on page 116
The Orchestrator scripting engine helps you to write scripts. Automatic insertion of functions and
automatic completion of lines of scripting accelerates the scripting process and minimizes the potential
for writing errors in scripts.
6 Add Parameters to Scripts on page 117
The Orchestrator scripting engine helps you to import available parameters into scripts.
7 Accessing the Orchestrator Server File System from JavaScript and Workflows on page 118
Orchestrator limits access to the Orchestrator server file system from JavaScript and Workflows to specific
directories.
8 Accessing Java Classes from JavaScript on page 118
By default, Orchestrator restricts JavaScript access to a limited set of Java classes. If you require JavaScript
access to a wider range of Java classes, you must set an Orchestrator system property to allow this access.
9 Accessing Operating System Commands from JavaScript on page 118
The Orchestrator API provides a scripting class, Command, that runs commands in the Orchestrator server
host operating system. To prevent unauthorized access to the Orchestrator server host, by default,
Orchestrator applications do not have permission to run the Command class.
Chapter 4 Scripting
VMware, Inc. 113