use of org.graylog2.messageprocessors.MessageProcessorsConfig in project graylog2-server by Graylog2.
the class MessageProcessorsResource method config.
@GET
@Timed
@ApiOperation(value = "Get message processor configuration")
@Path("config")
public MessageProcessorsConfigWithDescriptors config() {
checkPermission(RestPermissions.CLUSTER_CONFIG_ENTRY_READ);
final MessageProcessorsConfig config = clusterConfigService.getOrDefault(MessageProcessorsConfig.class, MessageProcessorsConfig.defaultConfig());
return MessageProcessorsConfigWithDescriptors.fromConfig(config.withProcessors(processorClassNames), processorDescriptors);
}
use of org.graylog2.messageprocessors.MessageProcessorsConfig in project graylog2-server by Graylog2.
the class MessageProcessorsResource method updateConfig.
@PUT
@Timed
@ApiOperation(value = "Update message processor configuration")
@Path("config")
@AuditEvent(type = AuditEventTypes.MESSAGE_PROCESSOR_CONFIGURATION_UPDATE)
public MessageProcessorsConfigWithDescriptors updateConfig(@ApiParam(name = "config", required = true) final MessageProcessorsConfigWithDescriptors configWithDescriptors) {
checkPermission(RestPermissions.CLUSTER_CONFIG_ENTRY_EDIT);
final MessageProcessorsConfig config = configWithDescriptors.toConfig();
clusterConfigService.write(config.withProcessors(processorClassNames));
return configWithDescriptors;
}
Aggregations