protected void populateStackHierarchy(ObjectNode root) {
    ObjectNode version = (ObjectNode) root.get("Versions");
    TextNode stackName = (TextNode) version.get("stack_name");
    TextNode stackVersion = (TextNode) version.get("stack_version");
    ObjectNode stackHierarchy = version.putObject("stack_hierarchy");
    stackHierarchy.put("stack_name", stackName);
    ArrayNode parents = stackHierarchy.putArray("stack_versions");
    for (String parentVersion : metaInfo.getStackParentVersions(stackName.asText(), stackVersion.asText())) {
      parents.add(parentVersion);
    }
  }
Retrieves the Ambari configuration if exists and adds it to services.json

@param root The JSON document that will become service.json when passed to the stack advisor engine
ambari-server/src/main/java/org/apache/ambari/server/api/services/stackadvisor/commands/StackAdvisorCommand.java