protected StackAdvisorData adjust(StackAdvisorData data, StackAdvisorRequest request) {
    try {
      ObjectNode root = (ObjectNode) this.mapper.readTree(data.servicesJSON);

      populateStackHierarchy(root);
      populateComponentHostsMap(root, request.getComponentHostsMap());
      populateServiceAdvisors(root);
      populateConfigurations(root, request);
      populateConfigGroups(root, request);
      populateAmbariServerInfo(root);
      populateAmbariConfiguration(root);
      data.servicesJSON = mapper.writeValueAsString(root);
    } catch (Exception e) {
      // should not happen
      String message = "Error parsing services.json file content: " + e.getMessage();
      LOG.warn(message, e);
      throw new WebApplicationException(Response.status(Status.BAD_REQUEST).entity(message).build());
    }

    return data;
  }
Name with the result JSON, e.g. "component-layout.json" or
"validations.json" .

@return the file name
ambari-server/src/main/java/org/apache/ambari/server/api/services/stackadvisor/commands/StackAdvisorCommand.java