Hi
Our WebClient plug-in starts workflows using the VRO REST api. Now we want to be able to schedule the execution of the workflow. I have seen that this functionality is availabe in the VRO itself, but can not find anything in the REST-api to do this.
Is this functionality available?
thanks
Cathy
Hi Cathy,
To schedule workflow execution, you need to do a POST request to https://{vroaddress}:8281/vco/api/tasks
In the request body, you need to provide schedule details. Here is a sample XML body showing how to schedule a simple workflow having no input parameters:
<task xmlns="http://www.vmware.com/vco">
<name>Schedule test</name>
<recurrence-cycle>one-time</recurrence-cycle>
<recurrence-start-date>2017-09-01T11:52:00+03:00</recurrence-start-date>
<workflow href="http://10.20.61.24:8281/vco/api/workflows/13fc268a-7a87-4c32-a6e6-93c825822f57/"></workflow>
<start-mode>normal</start-mode>
</task>
Hi Cathy,
To schedule workflow execution, you need to do a POST request to https://{vroaddress}:8281/vco/api/tasks
In the request body, you need to provide schedule details. Here is a sample XML body showing how to schedule a simple workflow having no input parameters:
<task xmlns="http://www.vmware.com/vco">
<name>Schedule test</name>
<recurrence-cycle>one-time</recurrence-cycle>
<recurrence-start-date>2017-09-01T11:52:00+03:00</recurrence-start-date>
<workflow href="http://10.20.61.24:8281/vco/api/workflows/13fc268a-7a87-4c32-a6e6-93c825822f57/"></workflow>
<start-mode>normal</start-mode>
</task>
You can find a lot of information of how to use the REST-api here:
Thanks for the answers guys,
Of course I checked the api documentation before I asked, but could not find any mention about it. Maybe I missed it.
Hi,
I am using below script to create schedule task. this will create schedule task for work which do not have common parameters, Can you please help me how can I provide common parameters using below script
Hi,
Parameters can be provided with <input-parameters> section. Here is an example showing a couple of input parameters - a datacenter object and a string (named myDatacenter and myString😞
<task xmlns="http://www.vmware.com/vco">
<name>Schedule test</name>
<recurrence-cycle>one-time</recurrence-cycle>
<recurrence-start-date>2017-12-21T11:52:00+03:00</recurrence-start-date>
<workflow href="http://10.20.61.24:8281/vco/api/workflows/13fc268a-7a87-4c32-a6e6-93c825822f57/"></workflow>
<start-mode>normal</start-mode>
<input-parameters>
<parameter type="VC:Datacenter" name="myDatacenter" scope="local">
<sdk-object type="VC:Datacenter" id="10.20.32.67/datacenter-2"/>
</parameter>
<parameter type="string" name="myString" scope="local">
<string>myString</string>
</parameter>
</input-parameters>
</task>
Of course, the number of parameters and their type depend on the workflow being scheduled. At a minimum, you must provide the parameters marked as required in the workflow presentation, the other parameters are optional.
Thank you. I will try this option and will let you know if I have any issues.