VMware Cloud Community
BackOfficeTeam
Contributor
Contributor
Jump to solution

PowerShell script and the Orchestrator

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

Reply
0 Kudos
1 Solution

Accepted Solutions
tschoergez
Leadership
Leadership
Jump to solution

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

View solution in original post

Reply
0 Kudos
2 Replies
ivand
VMware Employee
VMware Employee
Jump to solution

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
Jump to solution

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

Reply
0 Kudos