pages

Thursday, May 19, 2011

PHP - how to establish a vCO webservice client

Discussing about the vCO webservice clients with Jason Miles at the PSO training I decide to show up how simple it is to build a webservice portal. With this you can easily establish web integration if the customer already has a web portal, for example.

The PHP script has two components (.inc and .php):
  • parameters.inc
  • findWorkflows.php
  • findWorkflowsWithName.php
The first file holds the vCO servername/ip address, the username and the password, the second is the actual script. With "findWorkflowsWithName.php" I want to show how easy the parameter handover from a HTML form is.

At first I create the "parameters.inc" to change the credentials in a central way.



 












After including the right credentials for the vCO connection I create the findWorkflows.php:
















After saving the work the test in the browser shows up all workflows of my vCenter Orchestrator Server.















So the first example is done. The connect works and the first method: "getAllWorkflows" from the vCenter Orchestrator WSDL is running. But in most cases customers want to give data from an external website to the vCenter Orchestrator. I show this with the "getWorflowsWithName" method in another script (findWorkflowsWithName.php).
















With this the user can search for a workflow by name.
















So, get your feet on the street and start building you own web portal :-)

WARNING - when developing this I found out that the input parameter for "getWorkflowsWithName" isn´t only "name", it is "workflowName"! - WARNING









So, sometimes there are some little traps but we try to fix that!

Monday, May 9, 2011

VMworld 2011 - Unveil the vCO secrets and VOTE!

Our fellow Christophe here at VMware has posted the VMworld sessions for the vCenter Orchestrator automation and orchestration sessions:

http://www.vcoteam.info/newsflash/vmworld-2011-help-to-reveal-vmware-best-kept-secret.html

If you want to know more about the exciting capabilities of the vCenter Orchestrator and the automation from infrastructure to the cloud, please vote.

Thanks! Hope to see you at the VMworld 2011!

Monday, May 2, 2011

vCO - convert decimal net mask to decimal octet

I had to calculate the dotted subnet mask from normal formatted network string like:

192.168.12.0/23 --> 255.255.254.0

In vCO pow(x,y) is not available, so I had to build an action which transform the decimal part (here 23) into a dotted format by using a function to calculate pow(2,x).
Because the decimal part was got by .split("/") the input parameter is also string. You an easily rewrite this action for number input usage.


Feel free to leave a comment - Regards, Andreas