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
What to do next
Use the solution user name of Orchestrator and your principal holder-of-key token to request a delegate
holder-of-key token from the vCenter Single Sign-On Server.
Using LDAP Authentication with the Orchestrator REST API
You must apply the Basic HTTP Authentication scheme if Orchestrator is configured with LDAP, or if you
use the Orchestrator server to access a third-party system that is configured with LDAP.
The Basic HTTP Authentication scheme allows you to authenticate against Orchestrator or a third-party
system by including an Authorization header in the API calls that you make. You must provide base64-
encoded credentials in the Authorization header. Orchestrator uses the same credentials to authenticate on
your behalf against third-party systems that are configured with LDAP.
For details about the Basic HTTP Authentication, see RFC 2617.
Example: Obtain a Session in LDAP Mode
The following example code obtains a session in LDAP mode.
URI uri = URI.create("https://vco-server:8283/vco/api");
VcoSessionFactory sessionFactory = new DefaultVcoSessionFactory(uri);
//provide LDAP credentials
Authentication auth = new UsernamePasswordAuthentication("username", "password");
VcoSession session = sessionFactory.newSession(auth);
//use session here
Accessing the Reference Documentation for the Orchestrator REST
API
The reference documentation for the Orchestrator REST API contains information about the RESTful Web
services of the API, the data model that is applicable for the API, the response codes that are valid for the
API, code examples, and so on.
The reference documentation of the Orchestrator REST API is installed together with Orchestrator. The
reference documentation is available at https://vcoHost:port/vco/api/docs/.
Using the Java REST SDK
You can use a Java SDK library to call operations on the Orchestrator REST API in Java applications and
work directly with objects.
Every RESTful Web service of the Orchestrator REST SDK has a wrapping Java class with methods that
correspond to the operations that can be run by using the service.
The Java REST SDK is installed together with Orchestrator. The Java client library, reference documentation,
and examples are available at https://vcoHost:port/vco/api/docs/downloads.html.
Example: Run a Workflow and Wait for Its Completion
The following example code runs a workflow and waits for it to complete.
//start a new session to Orchestrator by using specified credentials
VcoSession session = DefaultVcoSessionFactory.newLdapSession(new URI("https://vco-server:
8281/vco/api/"), "username", "password");
Developing a Web Services Client for VMware vCenter Orchestrator
14 VMware, Inc.