Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Search Clustername - Hostname #27

Open
rafaelcarsetimo opened this issue Jul 28, 2017 · 0 comments
Open

Search Clustername - Hostname #27

rafaelcarsetimo opened this issue Jul 28, 2017 · 0 comments

Comments

@rafaelcarsetimo
Copy link

rafaelcarsetimo commented Jul 28, 2017

I'm trying to set up a query as follows:
Find all Cluster names and show all Host in each Cluster
CLUSTERNAME1-> HOSTNAME1
HOSTNAME2

CLUSTERNAME2- HOSTNAME3
HOSTNAME4

My initial query:

$vCenterConnection = new \Vmwarephp\Vhost(vcenter.example.com:443', '[email protected]', 'password_of_user_auth'); //$Clusters = $vCenterConnection->findAllManagedObjects('ClusterComputeResource', array('host','name')); $Clusters = $vCenterConnection->findAllManagedObjects('ClusterComputeResource', array('name','host'));

This result as follow:

array(3) { [0]=> object(stdClass)#12 (2) { ["host"]=> array(2) { [0]=> object(stdClass)#80 (0) { } [1]=> object(stdClass)#84 (0) { } } ["name"]=> string(16) "CLUSTERNAME1" } [1]=> object(stdClass)#81 (2) { ["host"]=> array(2) { [0]=> object(stdClass)#82 (0) { } [1]=> object(stdClass)#83 (0) { } } ["name"]=> string(19) "CLUSTERNAME2" } [2]=> object(stdClass)#99 (2) { ["host"]=> array(6) { [0]=> object(stdClass)#109 (0) { } [1]=> object(stdClass)#101 (0) { } [2]=> object(stdClass)#102 (0) { } [3]=> object(stdClass)#92 (0) { } [4]=> object(stdClass)#98 (0) { } [5]=> object(stdClass)#94 (0) { } } ["name"]=> string(12) "CLUSTERNAME3" } }
["host"] give to me object(stdClass)# where number, I believe it is the host identifier.
My question is: How to use this identifier to determine the host name.

Can someone help me?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant