protected Map<String, Map<String, Map<String, String>>> calculateConfigurations(Cluster cluster, String serviceName)
      throws AmbariException {
    Map<String, Map<String, Map<String, String>>> configurations = new HashMap<>();
    Service service = cluster.getService(serviceName);

    StackId stackId = service.getDesiredStackId();
    ServiceInfo serviceInfo = ambariMetaInfo.getService(stackId.getStackName(),
        stackId.getStackVersion(), serviceName);

    List<String> requiredConfigTypes = serviceInfo.getConfigDependenciesWithComponents();
    Map<String, DesiredConfig> desiredConfigs = cluster.getDesiredConfigs();
    Map<String, DesiredConfig> requiredDesiredConfigs = new HashMap<>();
    for (String requiredConfigType : requiredConfigTypes) {
      if (desiredConfigs.containsKey(requiredConfigType)) {
        requiredDesiredConfigs.put(requiredConfigType, desiredConfigs.get(requiredConfigType));
      }
    }
    for (Map.Entry<String, DesiredConfig> requiredDesiredConfigEntry : requiredDesiredConfigs.entrySet()) {
      Config config = cluster.getConfig(requiredDesiredConfigEntry.getKey(), requiredDesiredConfigEntry.getValue().getTag());
      configurations.put(requiredDesiredConfigEntry.getKey(), Collections.singletonMap("properties", config.getProperties()));
    }
    return configurations;
  }
Parse the user contex for the call. Typical structure
{ "operation" : "createCluster" }
{ "operation" : "addService", "services" : "Atlas,Ranger" }
@param request
@return
ambari-server/src/main/java/org/apache/ambari/server/controller/internal/StackAdvisorResourceProvider.java