@JsonCreator public static JsonTestRequest create(@JsonProperty("flatten") boolean flatten, @JsonProperty("list_separator") @NotEmpty String listSeparator, @JsonProperty("key_separator") @NotEmpty String keySeparator, @JsonProperty("kv_separator") @NotEmpty String kvSeparator, @JsonProperty("replace_key_whitespace") boolean replaceKeyWhitespace, @JsonProperty("key_whitespace_replacement") String keyWhitespaceReplacement, @JsonProperty("key_prefix") String keyPrefix, @JsonProperty("string") @NotEmpty String string) { return new AutoValue_JsonTestRequest(flatten, listSeparator, keySeparator, kvSeparator, replaceKeyWhitespace, keyWhitespaceReplacement, keyPrefix, string); } }
@JsonCreator public static WidgetPosition create(@JsonProperty("id") @NotEmpty String id, @JsonProperty("col") @Min(0) int col, @JsonProperty("row") @Min(0) int row, @JsonProperty("height") @Min(0) int height, @JsonProperty("width") @Min(0) int width) { return new AutoValue_WidgetPositionsRequest_WidgetPosition(id, col, row, height, width); } }
@JsonCreator public static AddOutputRequest create(@JsonProperty("outputs") @NotEmpty Set<String> outputs) { return new AutoValue_AddOutputRequest(outputs); } }
@JsonCreator public static ChangePasswordRequest create(@JsonProperty("old_password") @Nullable String oldPassword, @JsonProperty("password") @NotEmpty String password) { return new AutoValue_ChangePasswordRequest(oldPassword, password); } }
@JsonCreator public static RetentionStrategySummary create(@JsonProperty("strategy") @NotEmpty String strategy, @JsonProperty("config") @Valid @NotNull RetentionStrategyConfig config) { return new AutoValue_RetentionStrategySummary(strategy, config); } }
@JsonCreator public static RotationStrategySummary create(@JsonProperty("strategy") @NotEmpty String strategy, @JsonProperty("config") @Valid @NotNull RotationStrategyConfig config) { return new AutoValue_RotationStrategySummary(strategy, config); } }
@GET @Timed public GrokTesterResponse grokTest(@QueryParam("pattern") @NotEmpty String pattern, @QueryParam("string") @NotNull String string, @QueryParam("named_captures_only") @NotNull boolean namedCapturesOnly) throws GrokException { return doTestGrok(string, pattern, namedCapturesOnly); }
@GET @Timed @Path("/nodes/{nodeId}") @ApiOperation(value = "Information about a node.", notes = "This is returning information of a node in context to its state in the cluster. " + "Use the system API of the node itself to get system information.") @ApiResponses(value = { @ApiResponse(code = 404, message = "Node not found.") }) public NodeSummary node(@ApiParam(name = "nodeId", required = true) @PathParam("nodeId") @NotEmpty String nodeId) throws NodeNotFoundException { return nodeSummary(nodeService.byNodeId(nodeId)); }
@GET @Path("tables/{name}/query") @ApiOperation(value = "Query a lookup table") @RequiresPermissions(RestPermissions.LOOKUP_TABLES_READ) public LookupResult performLookup(@ApiParam(name = "name") @PathParam("name") @NotEmpty String name, @ApiParam(name = "key") @QueryParam("key") @NotEmpty String key) { return lookupTableService.newBuilder().lookupTable(name).build().lookup(key); }
@GET @Path("adapters/{idOrName}") @ApiOperation(value = "List the given data adapter") public DataAdapterApi getAdapter(@ApiParam(name = "idOrName") @PathParam("idOrName") @NotEmpty String idOrName) { Optional<DataAdapterDto> dataAdapterDto = dbDataAdapterService.get(idOrName); if (dataAdapterDto.isPresent()) { checkPermission(RestPermissions.LOOKUP_TABLES_READ, dataAdapterDto.get().id()); return DataAdapterApi.fromDto(dataAdapterDto.get()); } throw new NotFoundException(); }
@GET @Timed @Produces(MediaType.APPLICATION_JSON) public Map<String, String> naturalDateTester(@QueryParam("string") @NotEmpty String string) { try { return new NaturalDateParser().parse(string).asMap(); } catch (NaturalDateParser.DateNotParsableException e) { LOG.debug("Could not parse from natural date: " + string, e); throw new WebApplicationException(e, 422); } } }
@GET @Path("caches/{idOrName}") @ApiOperation(value = "List the given cache") public CacheApi getCache(@ApiParam(name = "idOrName") @PathParam("idOrName") @NotEmpty String idOrName) { Optional<CacheDto> cacheDto = dbCacheService.get(idOrName); if (cacheDto.isPresent()) { checkPermission(RestPermissions.LOOKUP_TABLES_READ, cacheDto.get().id()); return CacheApi.fromDto(cacheDto.get()); } throw new NotFoundException(); }
@PUT @Path("adapters/{idOrName}") @AuditEvent(type = AuditEventTypes.LOOKUP_ADAPTER_UPDATE) @ApiOperation(value = "Update the given data adapter settings") public DataAdapterApi updateAdapter(@ApiParam(name = "idOrName") @PathParam("idOrName") @NotEmpty String idOrName, @Valid @ApiParam DataAdapterApi toUpdate) { checkLookupAdapterId(idOrName, toUpdate); checkPermission(RestPermissions.LOOKUP_TABLES_EDIT, toUpdate.id()); DataAdapterDto saved = dbDataAdapterService.save(toUpdate.toDto()); return DataAdapterApi.fromDto(saved); }
@PUT @Path("tables/{idOrName}") @AuditEvent(type = AuditEventTypes.LOOKUP_TABLE_UPDATE) @ApiOperation(value = "Update the given lookup table") public LookupTableApi updateTable(@ApiParam(name = "idOrName") @PathParam("idOrName") @NotEmpty String idOrName, @Valid @ApiParam LookupTableApi toUpdate) { checkLookupTableId(idOrName, toUpdate); checkPermission(RestPermissions.LOOKUP_TABLES_EDIT, toUpdate.id()); LookupTableDto saved = dbTableService.save(toUpdate.toDto()); return LookupTableApi.fromDto(saved); }
@PUT @Path("caches/{idOrName}") @AuditEvent(type = AuditEventTypes.LOOKUP_CACHE_UPDATE) @ApiOperation(value = "Update the given cache settings") public CacheApi updateCache(@ApiParam(name = "idOrName") @PathParam("idOrName") @NotEmpty String idOrName, @ApiParam CacheApi toUpdate) { checkLookupCacheId(idOrName, toUpdate); checkPermission(RestPermissions.LOOKUP_TABLES_EDIT, toUpdate.id()); CacheDto saved = dbCacheService.save(toUpdate.toDto()); return CacheApi.fromDto(saved); }