public Set<String> getServices() throws IOException, AmbariHttpException {
    Set<String> services = new HashSet<>();
    String path = this.clusterPath + "?fields=services/ServiceInfo/service_name";
    JsonElement config = configurationCache.getUnchecked(path);

    if (config != null && config.isJsonObject()) {
      JsonElement items = config.getAsJsonObject().get("services");
      if (items != null && items.isJsonArray()) {
        for (JsonElement item : items.getAsJsonArray()) {
          JsonElement serviceInfo = item.getAsJsonObject().get("ServiceInfo");
          if (serviceInfo != null && serviceInfo.isJsonObject()) {
            String serviceName = serviceInfo.getAsJsonObject().get("service_name").getAsString();
            services.add(serviceName);
          }
        }
      }
    }

    return services;
  }
Get list of services installed on the remote cluster

@return list of services Available on cluster
ambari-server/src/main/java/org/apache/ambari/server/view/RemoteAmbariCluster.java