5.5.1
Table Of Contents
- Developing a Web Services Client for VMware vCenter Orchestrator
- Contents
- Developing Web Services Client for VMware vCenter Orchestrator
- Developing a Web Services Client
- Using the vCenter Orchestrator REST API
- Authenticating Against Orchestrator and Third-Party Systems
- Accessing the Reference Documentation for the Orchestrator REST API
- Using the Java REST SDK
- Operations with Workflows
- Working with Tasks
- Finding Objects in the Orchestrator Inventory
- Importing and Exporting Orchestrator Objects
- Deleting Orchestrator Objects
- Setting Permissions on Orchestrator Objects
- REST API Permissions
- Retrieve the Permissions of a Workflow
- Delete the Permissions of a Workflow
- Set the Permissions for a Workflow
- Retrieve the Permissions of an Action
- Delete the Permissions of an Action
- Set the Permissions for an Action
- Retrieve the Permissions of a Package
- Delete the Permissions of a Package
- Set the Permissions for a Package
- Retrieve the Permissions of a Resource
- Delete the Permissions of a Resource
- Set the Permissions for a Resource
- Retrieve the Permissions of a Configuration Element
- Delete the Permissions of a Configuration Element
- Set the Permissions for a Configuration Element
- Performing Operations with Plug-Ins
- Performing Server Configuration Operations
- Performing Tagging Operations
- Writing a Client Application for the Orchestrator SOAP Service
- Process for Creating an Orchestrator Web Service Client Application
- Web Service Endpoint
- Generating the Orchestrator Web Service Stubs
- Accessing the Server from Web Service Clients
- Create a Web Service Client
- Connect to the Orchestrator Web Service
- Find Objects in the Orchestrator Server
- Find Objects by Using the find Operation
- Find Objects by Using the findForId Operation
- Find Objects by Using the findRelation Operation
- Find Workflows in the Orchestrator Server
- Find Workflows by Using the getAllWorkflows Operation
- Retrieve the ID of a Workflow
- Find Workflows by Using the getWorkflowsWithName Operation
- Find Workflows by Using the getWorkflowForID Operation
- Run Workflows from a Web Service Client
- Interact with a Workflow While it Runs
- Obtain Workflow Results
- Time Zones and Running Workflows Through Web Services
- Web Service Application Examples
- Web Service API Object Reference
- Web Service API Operation Reference
- answerWorkflowInput Operation
- cancelWorkflow Operation
- echo Operation
- echoWorkflow Operation
- executeWorkflow Operation
- find Operation
- findForId Operation
- findRelation Operation
- getAllPlugins Operation
- getAllWorkflows Operation
- getWorkflowForId Operation
- getWorkflowInputForId Operation
- getWorkflowInputForWorkflowTokenId Operation
- getWorkflowsWithName Operation
- getWorkflowTokenBusinessState Operation
- getWorkflowTokenForId Operation
- getWorkflowTokenResult Operation
- getWorkflowTokenStatus Operation
- hasChildrenInRelation Operation
- hasRights Operation
- sendCustomEvent Operation
- simpleExecuteWorkflow Operation
- Index
9 Find Workflows by Using the getWorkflowsWithName Operation on page 62
If you know the name of a particular workflow, as it is defined in the Orchestrator client, the Web
service application can obtain this workflow using its name or part of its name.
10 Find Workflows by Using the getWorkflowForID Operation on page 63
If you know a particular workflow ID, a Web service application can obtain this workflow by using
the getWorkflowForID operation.
11 Run Workflows from a Web Service Client on page 63
The main purpose of a Web services client is to run workflows across a network.
12 Interact with a Workflow While it Runs on page 64
After the workflow starts, the Web services client can perform various actions in response to events
while the workflow is running.
13 Obtain Workflow Results on page 66
After the workflow completes its run, you can retrieve the results by calling the
getWorkflowTokenResult( ) operation.
Connect to the Orchestrator Web Service
Web service applications use the HTTPS protocol to establish connections to the Orchestrator server through
simple object access protocol (SOAP) binding.
Prerequisites
n
Verify that you have generated the Orchestrator Web service client and server stubs from the
Orchestrator WSDL definition.
n
Verify that you have created a Web service client application class that implements the VSOWebControl
interface.
Procedure
1 In your Web service client application class, create a VSOWebControl instance that connects to the Web
service endpoint.
The default HTTPS port is 8281. The URL is also a default.
The following example shows how to create a connection to the Web service.
String urlprefix = "https://10.0.0.1:8281/vco" ;
URL url = new URL(urlprefix + "/vmware-vmo-webcontrol/webservice");
vsoWebControl = new VSOWebControlServiceLocator().getwebservice(url);
2 Check the server connections by calling the echo operation.
The following example shows how you can call the echo operation.
vsoWebControl.echo(string);
The call to the echo operation returns the String object that you provided as an argument.
3 (Optional) To check which plug-ins are running on the Orchestrator server, call the getAllPlugins
operation.
The following example shows how you can call the getAllPlugins operation.
ModuleInfo[] modules = vsoWebControl.getAllPlugins(username, password);
The preceding call to the getAllPlugins operation returns an array of ModuleInfo objects, each of which
contains the name and version information about a plug-in running in the Orchestrator server.
Chapter 3 Writing a Client Application for the Orchestrator SOAP Service
VMware, Inc. 57