public List<RepositoryInfo> getRepositories(String stackName,
                                              String version, String osType) throws AmbariException {

    StackInfo stack = getStack(stackName, version);
    List<RepositoryInfo> repositories = stack.getRepositories();

    List<RepositoryInfo> repositoriesResult = new ArrayList<>();
    for (RepositoryInfo repository : repositories) {
      if (repository.getOsType().equals(osType)) {
        repositoriesResult.add(repository);
      }
    }
    return repositoriesResult;
  }
Gets repositories that are keyed by operating system type.
@param stackName the stack name
@param version   the stack version
@return
@throws AmbariException
ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariMetaInfo.java