Class RuleResource
java.lang.Object
org.graylog2.shared.rest.resources.RestResource
org.graylog.plugins.pipelineprocessor.rest.RuleResource
- All Implemented Interfaces:
PluginRestResource
@Path("/system/pipelines/rule")
@Consumes("application/json")
@Produces("application/json")
@RequiresAuthentication
public class RuleResource
extends RestResource
implements PluginRestResource
-
Field Summary
Fields inherited from class org.graylog2.shared.rest.resources.RestResource
configuration, userService
-
Constructor Summary
ConstructorDescriptionRuleResource
(RuleService ruleService, PipelineService pipelineService, RuleMetricsConfigService ruleMetricsConfigService, PipelineRuleParser pipelineRuleParser, PaginatedRuleService paginatedRuleService, FunctionRegistry functionRegistry, PipelineServiceHelper pipelineServiceHelper, ConfigurationStateUpdater configurationStateUpdater, StreamService streamService) -
Method Summary
Modifier and TypeMethodDescriptioncreateFromParser
(@NotNull RuleSource ruleSource) void
getAll()
getBulk
(BulkRuleRequest rules) parse
(@NotNull RuleSource ruleSource) simulate
(@NotNull SimulateRuleRequest request) update
(String id, @NotNull RuleSource update) Methods inherited from class org.graylog2.shared.rest.resources.RestResource
checkAnyPermission, checkPermission, checkPermission, getCurrentUser, getIndexSet, getSubject, getUriBuilderToSelf, isAnyPermitted, isAnyPermitted, isPermitted, isPermitted, setPrettyPrint
-
Constructor Details
-
RuleResource
@Inject public RuleResource(RuleService ruleService, PipelineService pipelineService, RuleMetricsConfigService ruleMetricsConfigService, PipelineRuleParser pipelineRuleParser, PaginatedRuleService paginatedRuleService, FunctionRegistry functionRegistry, PipelineServiceHelper pipelineServiceHelper, ConfigurationStateUpdater configurationStateUpdater, StreamService streamService)
-
-
Method Details
-
createFromParser
@POST @RequiresPermissions("pipeline_rule:create") public RuleSource createFromParser(@NotNull @NotNull RuleSource ruleSource) throws ParseException - Throws:
ParseException
-
parse
@POST @Path("/parse") public RuleSource parse(@NotNull @NotNull RuleSource ruleSource) throws ParseException - Throws:
ParseException
-
simulate
@POST @Consumes("application/json") @Path("/simulate") public Message simulate(@NotNull @NotNull SimulateRuleRequest request) throws NotFoundException - Throws:
NotFoundException
-
getAll
-
getPage
@GET @Path("/paginated") @Produces("application/json") @RequiresPermissions("pipeline_rule:read") public PaginatedResponse<RuleSource> getPage(@QueryParam("page") @DefaultValue("1") int page, @QueryParam("per_page") @DefaultValue("50") int perPage, @QueryParam("query") @DefaultValue("") String query, @DefaultValue("title") @QueryParam("sort") String sort, @DefaultValue("asc") @QueryParam("order") String order) -
get
- Throws:
NotFoundException
-
getBulk
-
update
@Path("/{id}") @PUT public RuleSource update(@PathParam("id") String id, @NotNull @NotNull RuleSource update) throws NotFoundException - Throws:
NotFoundException
-
delete
- Throws:
NotFoundException
-
functionDescriptors
-
metricsConfig
-
updateMetricsConfig
@Path("/config/metrics") @PUT public RuleMetricsConfigDto updateMetricsConfig(RuleMetricsConfigDto config)
-