VMware {code} Community
Vikashtalanki
Contributor
Contributor

Getting started with vCO and PHP

Hi,

I am a newbie to vmware suite.Currently I am accessing vCloud director through PHP using vCloud SDK for PHP.

I am able to successfully login and look for some of the catalogs, vms etc (Ofcourse using Samples phps).

My next step is invoking a workflow in vCenter Orchestrator thruugh PHP.

As I am totally unaware of how to do the same, I request you to please let me know from scratch (any  plugins to be installed etc) all the steps in details to be done to invoke a workflow

0 Kudos
3 Replies
dvatov
VMware Employee
VMware Employee

You can use its SOAP API. From 5.1 there is also REST one.

0 Kudos
demhyt
Contributor
Contributor

You can use php to work with orchestrator, below this example

//parameters.inc

<?php

        $vco_server = "vco.lab.local";

        $vco_user = "administrator";

        $vco_pass = "administrator";

?>

//test.php

<?php

        include ("parameters.inc");

        $vco = new SoapClient('https://' . $vco_server . ':8281/vmware-vmo-webcontrol/webservice?WSDL');

        $param = array(username=>$vco_user,password=>$vco_pass);

        $result = $vco->getAllWorkflows($param);

        foreach ($result as $item)

        {

                foreach ($item as $work)

                {

                        echo $work->name;

                        echo "<br>";

                        echo "ID=";

                        echo $work->id;

                        echo "<br>";

                        echo "$work->description";

                        echo "<br>";

                        echo "<br>";

                }

        }

?>

Create two separate file test.php and parameters.inc, parameters,inc is your server ip / FQDN with username and password.....you can refer to orchestrator web services guide the web services reference API...

0 Kudos
Gregi44
Contributor
Contributor

Hi,

This threat is old, but i need.

I can't make it work.

I have this error in my php

Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Couldn't load from 'https://vco_ip:8281/vco/vmware-vmo-webcontrol/webservice?WSDL' : failed to load external entity "https://vco_ip:8281/vco/vmware-vmo-webcontrol/webservice?WSDL" in /var/www/html/GOP_intranet/test.php:8 Stack trace: #0 /var/www/html/GOP_intranet/test.php(8): SoapClient->SoapClient('https://....', Array) #1 {main} thrown in /var/www/html/GOP_intranet/test.php on line 8

But it work with other WDSL like paypal.

i haven't install and configure VCO so i don't knwo really where to find information, is there a security settings that allow some ip ?

Regards.

0 Kudos