code: public Map<String, String> listVMsAndTemplates(HttpInputs httpInputs, VmInputs vmInputs, String delimiter) throws Exception {
          ConnectionResources connectionResources = new ConnectionResources(httpInputs, vmInputs);
          try {
              Map<String, ManagedObjectReference> virtualMachinesMorMap = new MorObjectHandler()
                      .getSpecificObjectsMap(connectionResources, ManagedObjectType.VIRTUAL_MACHINE.getValue());
              Set<String> virtualMachineNamesList = virtualMachinesMorMap.keySet();
  
              if (virtualMachineNamesList.size() > 0) {
                  return ResponseUtils.getResultsMap(ResponseUtils
                          .getResponseStringFromCollection(virtualMachineNamesList, delimiter), Outputs.RETURN_CODE_SUCCESS);
              } else {
                  return ResponseUtils.getResultsMap("No VM found in datacenter.", 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 a list with all the virtual machines and templates within.
  
  @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 data center
  @param delimiter  String that represents the delimiter needed in the result list
  @return Map with String as key and value that contains returnCode of the operation, a list that contains all the
  virtual machines and templates within the data center or failure message and the exception if there is one
  @throws Exception