public Map < String , String > getOsDescriptors ( HttpInputs httpInputs , VmInputs vmInputs , String delimiter ) throws Exception { ConnectionResources connectionResources = new ConnectionResources ( httpInputs , vmInputs ) ; try { ManagedObjectReference environmentBrowserMor = new MorObjectHandler ( ) . getEnvironmentBrowser ( connectionResources , ManagedObjectType . ENVIRONMENT_BROWSER . getValue ( ) ) ; VirtualMachineConfigOption configOptions = connectionResources . getVimPortType ( ) . queryConfigOption ( environmentBrowserMor , null , connectionResources . getHostMor ( ) ) ; List < GuestOsDescriptor > guestOSDescriptors = configOptions . getGuestOSDescriptor ( ) ; return ResponseUtils . getResultsMap ( ResponseUtils . getResponseStringFromCollection ( guestOSDescriptors , delimiter ) , Outputs . RETURN_CODE_SUCCESS ) ; } catch ( Exception ex ) { return ResponseUtils . getResultsMap ( ex . toString ( ) , Outputs . RETURN_CODE_FAILURE ) ; } finally { if ( httpInputs . isCloseSession ( ) ) { connectionResources . getConnection ( ) . disconnect ( ) ; clearConnectionFromContext ( httpInputs . getGlobalSessionObject ( ) ) ; } } }
Method used to connect to data center to retrieve a list with all the guest operating system descriptors supported by the host system .