@CliCommand(value = {CliStrings.EXPORT_CONFIG}, help = CliStrings.EXPORT_CONFIG__HELP)
  @CliMetaData(
      interceptor = "org.apache.geode.management.internal.cli.commands.ExportConfigCommand$Interceptor",
      relatedTopic = {CliStrings.TOPIC_GEODE_CONFIG})
  @ResourceOperation(resource = ResourcePermission.Resource.CLUSTER,
      operation = ResourcePermission.Operation.READ)
  @SuppressWarnings("deprecation")
  public ResultModel exportConfig(
      @CliOption(key = {CliStrings.MEMBER, CliStrings.MEMBERS},
          optionContext = ConverterHint.ALL_MEMBER_IDNAME,
          help = CliStrings.EXPORT_CONFIG__MEMBER__HELP) String[] member,
      @CliOption(key = {CliStrings.GROUP, CliStrings.GROUPS},
          optionContext = ConverterHint.MEMBERGROUP,
          help = CliStrings.EXPORT_CONFIG__GROUP__HELP) String[] group,
      @CliOption(key = {CliStrings.EXPORT_CONFIG__DIR},
          help = CliStrings.EXPORT_CONFIG__DIR__HELP) String dir) {

    ResultModel crm = new ResultModel();
    InfoResultModel infoData = crm.addInfo(ResultModel.INFO_SECTION);

    Set<DistributedMember> targetMembers = findMembers(group, member);
    if (targetMembers.isEmpty()) {
      ResultModel.createError(CliStrings.NO_MEMBERS_FOUND_MESSAGE);
      return crm;
    }

    ResultCollector<?, ?> rc =
        ManagementUtils.executeFunction(exportConfigFunction, null, targetMembers);
    List<CliFunctionResult> results = CliFunctionResult.cleanResults((List<?>) rc.getResult());

    for (CliFunctionResult result : results) {
      if (result.getThrowable() != null) {
        infoData.addLine(CliStrings.format(CliStrings.EXPORT_CONFIG__MSG__EXCEPTION,
            result.getMemberIdOrName(), result.getThrowable()));
      } else if (result.isSuccessful()) {
        String cacheFileName = result.getMemberIdOrName() + "-cache.xml";
        String propsFileName = result.getMemberIdOrName() + "-gf.properties";
        String[] fileContent = (String[]) result.getSerializables();
        crm.addFile(cacheFileName, fileContent[0]);
        crm.addFile(propsFileName, fileContent[1]);
      }
    }

    return crm;
  }
Export the cache configuration in XML format.

@param member Member for which to write the configuration
@param group Group or groups for which to write the configuration
@return Results of the attempt to write the configuration
geode-gfsh/src/main/java/org/apache/geode/management/internal/cli/commands/ExportConfigCommand.java