ConfigurationBundle bundle = bundleService.export(exportBundleRequest);
response().setContentType(MediaType.JSON_UTF_8.toString());
response().setHeader("Content-Disposition", "attachment; filename=content_pack.json");
ObjectMapper m = new ObjectMapper();
ObjectWriter ow = m.writer().withDefaultPrettyPrinter();
return ok(ow.writeValueAsString(bundle));
} catch (IOException e) {
flash("error", "Could not reach Graylog2 server");
} catch (Exception e) {
flash("error", "Unexpected error exporting configuration bundle, please try again later");