Class LookupTableResource
java.lang.Object
org.graylog2.shared.rest.resources.RestResource
org.graylog2.rest.resources.system.lookup.LookupTableResource
@RequiresAuthentication
@Path("/system/lookup")
@Produces("application/json")
@Consumes("application/json")
public class LookupTableResource
extends RestResource
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
static class
static class
-
Field Summary
Fields inherited from class org.graylog2.shared.rest.resources.RestResource
userService
-
Constructor Summary
ConstructorDescriptionLookupTableResource
(DBLookupTableService dbTableService, DBDataAdapterService dbDataAdapterService, DBCacheService dbCacheService, Map<String, LookupCache.Factory> cacheTypes, Map<String, LookupDataAdapter.Factory> dataAdapterTypes, Map<String, LookupDataAdapter.Factory2> dataAdapterTypes2, LookupTableService lookupTableService, LookupDataAdapterValidationContext lookupDataAdapterValidationContext, javax.validation.Validator validator, Configuration configuration) -
Method Summary
Modifier and TypeMethodDescriptioncreateAdapter
(@Valid DataAdapterApi newAdapter) createCache
(CacheApi newCache) createTable
(LookupTableApi lookupTable) deleteAdapter
(@NotEmpty String idOrName) deleteCache
(@NotEmpty String idOrName) errorStates
(@Valid ErrorStatesRequest request) getAdapter
(@NotEmpty String idOrName) performAdapterLookup
(@NotEmpty String name, @NotEmpty String key) performLookup
(@NotEmpty String name, @NotEmpty String key) void
performPurge
(@NotEmpty String idOrName, String key) NOTE: Must NOT be called directly by clients.removeTable
(@NotEmpty String idOrName) updateAdapter
(@NotEmpty String idOrName, @Valid DataAdapterApi toUpdate) updateCache
(@NotEmpty String idOrName, CacheApi toUpdate) updateTable
(@NotEmpty String idOrName, @Valid LookupTableApi toUpdate) validateAdapter
(DataAdapterApi toValidate) validateCache
(CacheApi toValidate) validateTable
(LookupTableApi toValidate) Methods inherited from class org.graylog2.shared.rest.resources.RestResource
checkAnyPermission, checkPermission, checkPermission, getCurrentUser, getIndexSet, getSubject, getUriBuilderToSelf, isAnyPermitted, isAnyPermitted, isPermitted, isPermitted, setPrettyPrint
-
Constructor Details
-
LookupTableResource
@Inject public LookupTableResource(DBLookupTableService dbTableService, DBDataAdapterService dbDataAdapterService, DBCacheService dbCacheService, Map<String, LookupCache.Factory> cacheTypes, Map<String, LookupDataAdapter.Factory> dataAdapterTypes, Map<String, LookupDataAdapter.Factory2> dataAdapterTypes2, LookupTableService lookupTableService, LookupDataAdapterValidationContext lookupDataAdapterValidationContext, javax.validation.Validator validator, Configuration configuration)
-
-
Method Details
-
performLookup
@GET @Path("tables/{name}/query") @RequiresPermissions("lookuptables:read") public LookupResult performLookup(@PathParam("name") @NotEmpty @NotEmpty String name, @QueryParam("key") @NotEmpty @NotEmpty String key) -
performPurge
@POST @Path("tables/{idOrName}/purge") @RequiresPermissions("lookuptables:read") public void performPurge(@PathParam("idOrName") @NotEmpty @NotEmpty String idOrName, @QueryParam("key") String key) NOTE: Must NOT be called directly by clients. Consider callingClusterLookupTableResource.performPurge(String, String)
instead! -
tables
@GET @Path("tables") @RequiresPermissions("lookuptables:read") public LookupTableResource.LookupTablePage tables(@QueryParam("page") @DefaultValue("1") int page, @QueryParam("per_page") @DefaultValue("50") int perPage, @DefaultValue("title") @QueryParam("sort") String sort, @DefaultValue("desc") @QueryParam("order") String order, @QueryParam("query") String query, @QueryParam("resolve") @DefaultValue("false") boolean resolveObjects) -
get
@GET @Path("tables/{idOrName}") public LookupTableResource.LookupTablePage get(@PathParam("idOrName") @NotEmpty @NotEmpty String idOrName, @QueryParam("resolve") @DefaultValue("false") boolean resolveObjects) -
createTable
@POST @Path("tables") @RequiresPermissions("lookuptables:create") public LookupTableApi createTable(LookupTableApi lookupTable) -
updateTable
@PUT @Path("tables/{idOrName}") public LookupTableApi updateTable(@PathParam("idOrName") @NotEmpty @NotEmpty String idOrName, @Valid @Valid LookupTableApi toUpdate) -
removeTable
@DELETE @Path("tables/{idOrName}") public LookupTableApi removeTable(@PathParam("idOrName") @NotEmpty @NotEmpty String idOrName) -
validateTable
@POST @Path("tables/validate") @RequiresPermissions("lookuptables:read") public ValidationResult validateTable(LookupTableApi toValidate) -
adapters
@GET @Path("adapters") @RequiresPermissions("lookuptables:read") public LookupTableResource.DataAdapterPage adapters(@QueryParam("page") @DefaultValue("1") int page, @QueryParam("per_page") @DefaultValue("50") int perPage, @DefaultValue("title") @QueryParam("sort") String sort, @DefaultValue("desc") @QueryParam("order") String order, @QueryParam("query") String query) -
availableAdapterTypes
@GET @Path("types/adapters") @RequiresPermissions("lookuptables:read") public Map<String,LookupDataAdapter.Descriptor> availableAdapterTypes() -
errorStates
@POST @Path("errorstates") @RequiresPermissions("lookuptables:read") public ErrorStates errorStates(@Valid @Valid ErrorStatesRequest request) -
getAdapter
@GET @Path("adapters/{idOrName}") public DataAdapterApi getAdapter(@PathParam("idOrName") @NotEmpty @NotEmpty String idOrName) -
performAdapterLookup
@GET @Path("adapters/{name}/query") @RequiresPermissions("lookuptables:read") public LookupResult performAdapterLookup(@PathParam("name") @NotEmpty @NotEmpty String name, @QueryParam("key") @NotEmpty @NotEmpty String key) -
createAdapter
@POST @Path("adapters") @RequiresPermissions("lookuptables:create") public DataAdapterApi createAdapter(@Valid @Valid DataAdapterApi newAdapter) -
deleteAdapter
@DELETE @Path("adapters/{idOrName}") public DataAdapterApi deleteAdapter(@PathParam("idOrName") @NotEmpty @NotEmpty String idOrName) -
updateAdapter
@PUT @Path("adapters/{idOrName}") public DataAdapterApi updateAdapter(@PathParam("idOrName") @NotEmpty @NotEmpty String idOrName, @Valid @Valid DataAdapterApi toUpdate) -
validateAdapter
@POST @Path("adapters/validate") @RequiresPermissions("lookuptables:read") public ValidationResult validateAdapter(DataAdapterApi toValidate) -
caches
@GET @Path("caches") @RequiresPermissions("lookuptables:read") public LookupTableResource.CachesPage caches(@QueryParam("page") @DefaultValue("1") int page, @QueryParam("per_page") @DefaultValue("50") int perPage, @DefaultValue("title") @QueryParam("sort") String sort, @DefaultValue("desc") @QueryParam("order") String order, @QueryParam("query") String query) -
availableCacheTypes
@GET @Path("types/caches") @RequiresPermissions("lookuptables:read") public Map<String,LookupCache.Descriptor> availableCacheTypes() -
getCache
-
createCache
-
deleteCache
-
updateCache
-
validateCache
@POST @Path("caches/validate") @RequiresPermissions("lookuptables:read") public ValidationResult validateCache(CacheApi toValidate)
-