private void populateConfigGroups(ObjectNode root,
                                    StackAdvisorRequest request) {
    if (request.getConfigGroups() != null &&
        !request.getConfigGroups().isEmpty()) {
      JsonNode configGroups = mapper.valueToTree(request.getConfigGroups());
      root.put(CONFIG_GROUPS_PROPERTY, configGroups);
    }
  }
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