public TreeMap<String, String> getMetadataClusterLevelParams(Cluster cluster, StackId stackId) throws AmbariException {
    TreeMap<String, String> clusterLevelParams = new TreeMap<>();
    clusterLevelParams.put(STACK_NAME, stackId.getStackName());
    clusterLevelParams.put(STACK_VERSION, stackId.getStackVersion());

    clusterLevelParams.putAll(getMetadataClusterLevelConfigsParams(cluster, stackId));
    clusterLevelParams.put(CLUSTER_NAME, cluster.getClusterName());
    clusterLevelParams.put(HOOKS_FOLDER, configs.getProperty(Configuration.HOOKS_FOLDER));

    return clusterLevelParams;
  }
Collects full metadata info about clusters for agent.
@return metadata info about clusters
@throws AmbariException
ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java