code: public Map<String, String> getVMDetails(HttpInputs httpInputs, VmInputs vmInputs) throws Exception {
          ConnectionResources connectionResources = new ConnectionResources(httpInputs, vmInputs);
          try {
              ManagedObjectReference vmMor = new MorObjectHandler().getMor(connectionResources,
                      ManagedObjectType.VIRTUAL_MACHINE.getValue(), vmInputs.getVirtualMachineName());
              ObjectContent[] objectContents = GetObjectProperties.getObjectProperties(connectionResources, vmMor,
                      new String[]{ManagedObjectType.SUMMARY.getValue()});
  
              if (objectContents != null) {
                  Map<String, String> vmDetails = new HashMap<>();
                  for (ObjectContent objectItem : objectContents) {
                      List<DynamicProperty> vmProperties = objectItem.getPropSet();
                      for (DynamicProperty propertyItem : vmProperties) {
                          VirtualMachineSummary virtualMachineSummary = (VirtualMachineSummary) propertyItem.getVal();
                          VirtualMachineConfigSummary virtualMachineConfigSummary = virtualMachineSummary.getConfig();
  
                          ResponseUtils.addDataToVmDetailsMap(vmDetails, virtualMachineSummary, virtualMachineConfigSummary);
                      }
                  }
                  String responseJson = ResponseUtils.getJsonString(vmDetails);
                  return ResponseUtils.getResultsMap(responseJson, Outputs.RETURN_CODE_SUCCESS);
              } else {
                  return ResponseUtils.getResultsMap("Could not retrieve the details for: [" +
                          vmInputs.getVirtualMachineName() + "] VM.", Outputs.RETURN_CODE_FAILURE);
              }
          } catch (Exception ex) {
              return ResponseUtils.getResultsMap(ex.toString(), Outputs.RETURN_CODE_FAILURE);
          } finally {
              if (httpInputs.isCloseSession()) {
                  connectionResources.getConnection().disconnect();
                  clearConnectionFromContext(httpInputs.getGlobalSessionObject());
              }
          }
      }
docs: Method used to connect to data center to retrieve details of a virtual machine identified by the inputs provided.
  
  @param httpInputs Object that has all the inputs necessary to made a connection to data center
  @param vmInputs   Object that has all the specific inputs necessary to identify the targeted virtual machine
  @return Map with String as key and value that contains returnCode of the operation, a JSON formatted string that
  contains details of the virtual machine or failure message and the exception if there is one
  @throws Exception