and it will fetch which ever you want including HostSystem for all your hosts in your vCenter inventoryġ) If you have 1 host in your environment, you need to iterate through the return $ret array differently than if you had more than 2 hosts, because only with above 2 hosts, the $ret array become an array of arrays of hostĢ) Not all host attributes are present in all hosts, therefore when you looking for name information about your host, it may be in array index 4 for one host and 5, so you may want use a function similar to the one I've included below called "getObjectPropertyByName", it will return the appropriate array which you can iterate to find your info. This may have come late in the piece for you but if you use the following code and just change where it says HostSystem to ComputeResource, Datacenter, VirtualMachine etc. $soapmsg = new soapval('obj', false, $dataCenter, false, false, array("type" => "Datacenter")) $temp = $this->process("RetrieveProperties", $soapmsg) ![]() $soapmsg = new soapval('obj', false, $this->session_result, false, false, array("type" => "Folder")) $soapVal = new soapval('_this', false, $this->session_result, false, false, array("type" => "Propert圜ollector")) this section is used to navigate to the VM folder for a datacenter (if you have an easier way, please, let me know) $ret = $this->process("RetrieveProperties", $soapmsg) $soapmsg = new soapval('obj', false, $vm, false, false, array("type" => "VirtualMachine")) $soapmsg = new soapval('_this', false, $this->session_result, false, false, array("type" => "Propert圜ollector")) $this->debug("error", "We got a error!") $ret = $this->process("Login", $soapmsg) $soapmsg = new soapval('_this', false, $this->session_result, false, false, array("type" => "SessionManager")) Version 2.0.0 Added support for ACLs (Access Control Lists) - Registered version only Version 1.0.2 Fixed a bug when the system root volume is selected as starting point. $this->debug("send", htmlspecialchars($this->myconnection->request, ENT_QUOTES)) PropEdit-2.1.0.dmg (2.6 MB / ) Requires Mac OS X 10.6 / Fully compatible with Mac OS X 10.7 Lion Release notes Version 2.1.0 Permissions can now be set in octal. ![]() $result = $this->myconnection->call($call, $msg, $this->namespace) $ret = $this->process("RetrieveServiceContent", $soapmsg) $soapmsg = new soapval('_this', false, 'ServiceInstance', false, false, array("type" => "ServiceInstance")) Private $session_result, $myconnection, $namespace Please can any one tell me how to get the CPU's count using PHP. But when i try to get properties of 'HostSystem'. When i google it i found this useful URL. I'm trying to take properties of HostCPUInfo ( numCpuPackages, numCpuCores, numCpuThread) using PHP and SOAP Client.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |