How to get Inventory of managedobject using sessionId?


After establishing connection to the vshpere server, I need to create Inventory of Managed Object say Datacenter.

Normally this can be done using following piece of code -


Connection con = new Connection(config);

Inventory inv = InventoryFactory.getInventory(con);

// find all Virtual machines

VirtualMachine[] virtualMachines = inv.findEntities(null, VirtualMachine.class);


To establish connection, we need username,password and other stuff. I want to bypass these thing as I already have established connection and my request is directing to some other servlet. Now using sessionId, how it is possible to get all these thing. Can some help me out.

0 Kudos
0 Replies