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
If the user has the right to run the workflow, hasRights returns true. Otherwise, hasRights returns
false.
2 Set the workflow attributes in a WorkflowTokenAttribute object.
The Web services client passes WorkflowTokenAttributes arrays to a WorkflowToken object, which runs
the workflow.
WorkflowTokenAttribute[] attributes = new WorkflowTokenAttribute[1];
WorkflowTokenAttribute attribute = new WorkflowTokenAttribute();
attribute.setName("vm");
attribute.setType(finderResult.getType());
attribute.setValue(finderResult.getDunesUri());
attributes[0] = attribute;
The preceding example creates a WorkflowTokenAttribute object, then populates it with the following
information:
n
The name of the attribute, in this case, vm.
n
The type of attribute, as discovered in a FinderResult object defined elsewhere in the code.
n
The attribute value, which in this case is a dunesUri string, signifying that the value specifies an
object accessed through a plug-in.
3 Run the workflow by calling the executeWorkflow operation.
To run a workflow, you pass the workflow attributes to the executeWorkflow operation in the form of a
WorkflowTokenAttribute array.
Running a workflow creates a WorkflowToken object, which represents the instance of the workflow that
runs with the specific input parameters that it receives when it starts.
WorkflowToken token = vsoWebControl.executeWorkflow(workflowId, username, password,
attributes);
In the preceding example, the attributes property is the array of WorkflowTokenAttribute objects
created in Step 2.
Sometimes, workflows require input parameters during their run. In these cases, you can provide
attributes through a user interaction while the workflow is running. You can pass attributes to the
workflow during its run using the answerWorkflowInput operation.
You implemented operations in the Web service client that check user permissions, pass attributes to a
workflow, and run the workflow.
What to do next
Implement operations in the Web services client to interact with workflows while they run.
Interact with a Workflow While it Runs
After the workflow starts, the Web services client can perform various actions in response to events while
the workflow is running.
Prerequisites
You must have implemented operations in the Web service client to run workflows in the Orchestrator
server.
Developing a Web Services Client for VMware vCenter Orchestrator
64 VMware, Inc.