BackOfficeTeam
Contributor
Contributor

PowerShell script and the Orchestrator

Jump to solution

Hi Guys

We managed to configure PowerShell script to run a job in the Orchestrator, only problem is that we can’t pass input parameter

$vCOuser = "xxxxxxxx"

$vCOpass = "zzzzzzzz"

$vCOparm = "C:\orchestrator\Test.html"

# Connect to vCO and generate Proxy $vcoWS

$vcoWS = New-WebServiceProxy -Uri http://<server>:8280/vmware-vmo-webcontrol/webservice?WSDL

# Print Result

$vcoWS

# Find Workflow

$workflow = $vcoWS.getWorkflowsWithName("Create a simple XML document" ,$vCOuser ,$vCOpass)

# Print Result

$workflow

foreach ($element in $workflow)

{

$element.id

# ... and execute

$workflowToken = $vcoWS.executeWorkflow($element.id, $vCOuser ,$vCOpass, inParameters)

# Print Result

$workflowToken

}

Any help would be appreciated

0 Kudos
1 Solution

Accepted Solutions
tschoergez
Leadership
Leadership

Hi!

You can specify an array of WorkflowtokenAttribute-Objects and pass it to the executeWorkflow-Method:

$inparams += New-Object -TypeName VCO.WorkflowTokenAttribute
$inparams[0].name = "inputString"
$inparams[0].type = "String"
$inparams[0].value = "Hello World"

$inparams

# ... and exectue (use $null instead on $inparams if Workflow has no input parameters
# ... und ausführen
$workflowToken = $vcoWS.executeWorkflow($workflow.id, "vcoadmin1" , "VMware2010", $inparams)
$workflowToken

See the full example here:

http://www.vcoportal.de/2011/06/updated-calling-vco-workflows-from-powershell/

http://www.vcoportal.de/examples/powershell-vco/

Regards,

Joerg

www.vcoportal.de - Orchestrate. Your Cloud.

View solution in original post

0 Kudos
2 Replies
ivand
VMware Employee
VMware Employee

There is a stub class called WorkflowTokenAttribute. Your input parameters should be of that type and inParameters should be an array of that type, containing your inputs. The output parameters will be of the same type.

There is a section in develpment documentation (https://www.vmware.com/pdf/vco_410_developers_guide.pdf, chapter 'Developing a Web Services Client') that describes how to create a web services client for vCO in Java.

Regards

Ivan

tschoergez
Leadership
Leadership

Hi!

You can specify an array of WorkflowtokenAttribute-Objects and pass it to the executeWorkflow-Method:

$inparams += New-Object -TypeName VCO.WorkflowTokenAttribute
$inparams[0].name = "inputString"
$inparams[0].type = "String"
$inparams[0].value = "Hello World"

$inparams

# ... and exectue (use $null instead on $inparams if Workflow has no input parameters
# ... und ausführen
$workflowToken = $vcoWS.executeWorkflow($workflow.id, "vcoadmin1" , "VMware2010", $inparams)
$workflowToken

See the full example here:

http://www.vcoportal.de/2011/06/updated-calling-vco-workflows-from-powershell/

http://www.vcoportal.de/examples/powershell-vco/

Regards,

Joerg

www.vcoportal.de - Orchestrate. Your Cloud.

View solution in original post

0 Kudos