2 Replies Latest reply on Jan 4, 2015 8:09 PM by Nivetha

    Is there a way to get the List of Hosts and its belonging Clusters at the vCenter Folder level in vsphere web client 5.5 plugin development ?

    Nivetha Novice
    VMware Employees

      Hi,

      I need to get the list of all hosts and its belonging clusters at the vcenter folder level.

      1. I created a view giving the extension point: vsphere.core.folder.monitorViews.

      2. After this step, I have written the below constraint in my Mediator class,

      var ListConstraint:Constraint =

                  QuerySpecUtil.createConstraintForRelationship( _contextObject,"childEntity");

      I expected a list of all child entities like hosts,dc,cluster.. But I've got only the immediate child object that is only the datacenter as my result.

      Is there a way to get all the hosts and Clusters at vCenter Folder level since I need the entire list at vCenter (top most level).

      Other Info:

      Folder Object has only two properties:

        1. childEntity - List of ManagedEntities

        2. childType - Type of folder ("Virtual Machine","Datacenter"...)

      Is there a way to write a constraint specifying what list of childEntities I need using childType.

      Example: Get me childEntities which has a childType of "Host" and "Cluster" but ChildType doesnt have these two types.

       

      Also, at this level I could see the "Related Objects" tab that has all the information I need, like Clusters and Hosts in Cluster tab and Host tab respectively.

      So I believe its possible to get this list at vCenter Folder level.

      I have attached a screenshot representing the need. Kindly ignore the naming Conventions in it since I have edited the sample program shipped with sdk.


      Query:

      1. How can I get the Host and Cluster list (relation table) at vCenter Folder level or even at vise.global.view level ?

      2. Once I get that list, is it possible for me to manipulate that list and send the new list to UI ?

      3. Is there any other way to do the same without using Mediator and Model classes ?


      Any pointers to this will be very helpful.