Should what API I use to get items in the inventory of VCServer tree?

Hello

I create the inventory tree (VCServer = > data center = > file = > Cluster) within a standalone dialog in my plugin. The view is ready and it works on an XML string that represents the hierarchy of objects (tested with simulated data) tree. Now I need objects real vSphere appears in my tree, and I was wondering what I should look for it's API. I found this utility class really handy that I think could help me achieve what I want

ServiceUtil (VMware vSphere Web Services SDK Java samples Documentation)

and here's a great example that does things I like (find Morefs in the tree of inventory by type) = > http://vlab-vwa.googlecode.com/svn/trunk/backend/apputils/vim25/VMUtils.java

Here's something I tried not working

/////////////////////////////////////////////////////////////////

UserSessionService service;

USession UserSession = service.getUserSession ();

ServerInfo [] info = uSession.serversInfo;

String sessionCookie = info [0] .sessionCookie;

ServiceUtil util = new ServiceUtil();

util.clientLoadSession (sessionCookie);

REF ManagedObjectReference = util.getDecendentMoRef (null, "Cluster", "C - 2");

/////////////////////////////////////////////////////////////////

The thing I don't understand is how to create a 'authenticated' version of ServiceUtil which will help me to call the methods getDescendentMoref() and similar calls. I have a reference to a UserSessionService and VimObjectReferenceService (authenticated) and I was wondering if I can retrieve an instance of a ServiceUtil that I can use.

Thank you

Concerning

See com.vmware.vise.usersession.UserSession, which has the property of serversInfo which is an array of ServerInfo.

Tags: VMware

Similar Questions

Maybe you are looking for