7.1

Table Of Contents
Prerequisites
Verify that you have imported the sample workows package in Orchestrator. The package is included in
the Orchestrator sample applications ZIP le that you can download from the Orchestrator documentation
page.
Procedure
1 Make a GET request at the URL of the task that you want to modify:
GET https://{orchestrator_host}:{port}/vco/api/tasks/{task ID}/
2 Check the properties of the task in the response body of the request.
3 To modify the task, make a POST request at the URL of the task by providing the new properties of the
task in a task-data element in the request body.
If the POST request is successful, the API reruns a status code 200 and the updated task in the response body.
Example: Update the Send Hello Example Task
You can update the start and the end dates of a task. You can modify the example task that is introduced in
“Create a Task,” on page 29. You must make a POST request at the URL of the task by providing the new start
and end dates in the request body:
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<task-data xmlns="http://www.vmware.com/vco">
<recurrence-start-date>2012-02-01T14:00:00+02:00</recurrence-start-date>
<recurrence-end-date>2012-02-05T14:00:00+02:00</recurrence-end-date>
</task-data>
Check the State of a Task
You can check the state of the currently available tasks or check the state for all execution instancess of a
certain task.
Prerequisites
Verify that you have imported the sample workows package in Orchestrator. The package is included in
the Orchestrator sample applications ZIP le that you can download from the Orchestrator documentation
page.
Procedure
n
To check the status of all currently available tasks, make a GET request at the URL of the Task service:
GET https://{orchestrator_host}:{port}/vco/api/tasks/
The response body contains the denitions of the currently available tasks in Orchestrator. The state of
every task is available in an attribute element, whose name is state. Respectively, the value for the
element can be finished, pending, running and so on.
n
To check the status of all executions of a certain task, make a GET request at the URL where the task
executions reside:
GET https://{orchestrator_host}:{port}/vco/api/tasks/{taskID}/executions/
You receive a list of the available executions for the task in the response body. The state of every
execution is available in the state element of the task execution object.
Chapter 3 Using the vRealize Orchestrator REST API
VMware, Inc. 31