Hi, how do you get all esx hosts from a vcenter? I can navigate via MOB (/mob/?moid=HostProfileManager) which lists my clusters and I can then click through on those to see the hosts but I cant work out how to use the api to do this?
I dont need code examples just a top level of what method needs to be called will suffice!
As Laurent pointed out, open source vijava can help that with one line like the following:
ManagedEntity mes = new InventoryNavigator(rootFolder).searchManagedEntities("HostSystem");
Check out more with the Hello World sample:
For the support, you can try the commercial version vijavaNG:
Thanks for the answers, I'm using the WSDL API. Can I access the hosts using the SearchIndex managed object or do I have to use the HostSystem managed object? When I use searchIndex with FindByPath at the top level datacenter it only shows vms, templates etc never hosts