private Set<ConfigurationResponse> getConfigurations(
      ConfigurationRequest request) throws AmbariException {
    if (request.getClusterName() == null) {
      throw new IllegalArgumentException("Invalid arguments, cluster name"
          + " should not be null");
    }

    Cluster cluster = clusters.getCluster(request.getClusterName());

    Set<ConfigurationResponse> responses = new HashSet<>();

    // !!! if only one, then we need full properties
    if (null != request.getType() && null != request.getVersionTag()) {
      Config config = cluster.getConfig(request.getType(),
          request.getVersionTag());
      if (null != config) {
        ConfigurationResponse response = new ConfigurationResponse(
            cluster.getClusterName(), config);
        responses.add(response);
      }
    }
    else {
      boolean includeProps = request.includeProperties();
      if (null != request.getType()) {
        Map<String, Config> configs = cluster.getConfigsByType(
            request.getType());

        if (null != configs) {
          for (Entry<String, Config> entry : configs.entrySet()) {
            Config config = entry.getValue();
            ConfigurationResponse response = new ConfigurationResponse(
                cluster.getClusterName(), config.getStackId(),
                request.getType(),
                config.getTag(), entry.getValue().getVersion(),
                includeProps ? config.getProperties() : new HashMap<>(),
                includeProps ? config.getPropertiesAttributes() : new HashMap<>(),
                config.getPropertiesTypes());
            responses.add(response);
          }
        }
      } else {
        // !!! all configuration
        Collection<Config> all = cluster.getAllConfigs();

        for (Config config : all) {
          ConfigurationResponse response = new ConfigurationResponse(
              cluster.getClusterName(), config.getStackId(), config.getType(),
              config.getTag(), config.getVersion(),
              includeProps ? config.getProperties() : new HashMap<>(),
              includeProps ? config.getPropertiesAttributes() : new HashMap<>(),
              config.getPropertiesTypes());

          responses.add(response);
        }
      }
    }

    return responses;

  }
Creates a configuration.
<p>
This implementation ensures the authenticated user is authorized to create the new configuration
based on the details of what properties are being changed and the authorizations the authenticated
user has been granted.
<p>
Example
<ul>
<li>
If the user is attempting to change a service-level configuration that user must be granted the
<code>SERVICE_MODIFY_CONFIGS</code> privilege (authorization)
</li>
<li>
If the user is attempting to change the cluster-wide value to enable or disable auto-start
(<code>cluster-env/recovery_enabled</code>), that user must be granted the
<code>CLUSTER_MANAGE_AUTO_START</code> privilege (authorization)
</li>
</ul>

@param request the request object which defines the configuration.
@throws AmbariException when the configuration cannot be created.
ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java