For IntelliJ IDEA and
Android Studio


private void myMethod () {Path p =
Class klass;klass.getAnnotation(Path.class)
Method method;method.getAnnotation(Path.class)
AnnotatedElement annotatedElement;annotatedElement.getAnnotation(Path.class)
- AI code suggestions by Codota
}
@GET @Path("{taskId}") @Produces(MediaType.APPLICATION_JSON) public synchronized TaskInfo getTaskInfo( @PathParam("taskId") final TaskId taskId, @HeaderParam(PRESTO_CURRENT_STATE) TaskState currentState, @HeaderParam(PRESTO_MAX_WAIT) Duration maxWait, @Context UriInfo uriInfo) { lastActivityNanos.set(System.nanoTime()); return buildTaskInfo(); }
@GET @Path("/available") @Timed @ApiOperation(value = "Get a list of all alarm callback types") @Produces(MediaType.APPLICATION_JSON) @Deprecated public AvailableAlarmCallbacksResponse available(@ApiParam(name = "streamid", value = "The id of the stream whose alarm callbacks we want.", required = true) @PathParam("streamid") String streamid) { checkPermission(RestPermissions.STREAMS_READ, streamid); return alarmCallbacksResource.available(); }
@GET @Timed @Path("/{indexSetId}") @ApiOperation(value = "Get current deflector status in index set") @RequiresPermissions(RestPermissions.DEFLECTOR_READ) @Produces(MediaType.APPLICATION_JSON) public DeflectorSummary deflector(@ApiParam(name = "indexSetId") @PathParam("indexSetId") String indexSetId) throws TooManyAliasesException { final IndexSet indexSet = getIndexSet(indexSetRegistry, indexSetId); return DeflectorSummary.create(indexSet.isUp(), indexSet.getActiveWriteIndex()); }
@GET @Timed @Path("/{indexSetId}/reopened") @ApiOperation(value = "Get a list of reopened indices, which will not be cleaned by retention cleaning") @Produces(MediaType.APPLICATION_JSON) public ClosedIndices indexSetReopened(@ApiParam(name = "indexSetId") @PathParam("indexSetId") String indexSetId) { final IndexSet indexSet = getIndexSet(indexSetRegistry, indexSetId); final Set<String> reopenedIndices = indices.getReopenedIndices(indexSet).stream() .filter(index -> isPermitted(RestPermissions.INDICES_READ, index)) .collect(Collectors.toSet()); return ClosedIndices.create(reopenedIndices, reopenedIndices.size()); }
@GET @Timed @ApiOperation(value = "Get detailed API documentation of a single resource") @Produces(MediaType.APPLICATION_JSON) @Path("/{route: .+}") public Response route(@ApiParam(name = "route", value = "Route to fetch. For example /system", required = true) @PathParam("route") String route, @Context HttpHeaders httpHeaders) { final URI baseUri = RestTools.buildExternalUri(httpHeaders.getRequestHeaders(), httpConfiguration.getHttpExternalUri()).resolve(HttpConfiguration.PATH_API); return buildSuccessfulCORSResponse(generator.generateForRoute(route, baseUri.toString())); }
@GET @Path("/{outputId}") @Timed @ApiOperation(value = "Get specific output") @Produces(MediaType.APPLICATION_JSON) @ApiResponses(value = { @ApiResponse(code = 404, message = "No such output on this node.") }) public OutputSummary get(@ApiParam(name = "outputId", value = "The id of the output we want.", required = true) @PathParam("outputId") String outputId) throws NotFoundException { checkPermission(RestPermissions.OUTPUTS_READ, outputId); final Output output = outputService.load(outputId); return OutputSummary.create(output.getId(), output.getTitle(), output.getType(), output.getCreatorUserId(), new DateTime(output.getCreatedAt()), output.getConfiguration(), output.getContentPack()); }
@POST @Path("rebase") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) public RebaseResponse rebase(RebaseRequest request) throws ApiException { try (GitConnection gitConnection = getGitConnection()) { return gitConnection.rebase(request.getOperation(), request.getBranch()); } }
@GET @Path("{id}/stackframedump") @Produces(MediaType.APPLICATION_JSON) public StackFrameDumpDto getStackFrameDump( @PathParam("id") String sessionId, @QueryParam("thread") @DefaultValue("-1") long threadId, @QueryParam("frame") @DefaultValue("-1") int frameIndex) throws DebuggerException { if (threadId == -1) { return asDto(debuggerManager.getDebugger(sessionId).dumpStackFrame()); } return asDto(debuggerManager.getDebugger(sessionId).getStackFrameDump(threadId, frameIndex)); }
@POST @Path("/document/{documentName}.json") @ApiOperation(value = "uploadAttachAndParseUserDocument", notes = "Uploads, parses, and attaches the document to the user's job application.", position = 509) public String uploadAttachAndParseUserDocument(@PathParam("documentName") final String documentName, @FormDataParam("document") final FormDataContentDisposition detail, @FormDataParam("document2") final FormDataBodyPart bodyPart, @FormDataParam("input") final InputStream input, @FormDataParam("id") final Integer id) throws Exception { return ""; } }
@GET @Timed @Path("/{filterId}") @ApiOperation("Get the existing blacklist filter") @Produces(MediaType.APPLICATION_JSON) public FilterDescription get(@ApiParam(name = "filterId", required = true) @PathParam("filterId") @NotEmpty String filterId) throws org.graylog2.database.NotFoundException { return filterService.load(filterId); }
@POST @Path("/connect") @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) public boolean connect(final RegistryCenterConfiguration config, final @Context HttpServletRequest request) { boolean isConnected = setRegistryCenterNameToSession(regCenterService.find(config.getName(), regCenterService.loadAll()), request.getSession()); if (isConnected) { regCenterService.load(config.getName()); } return isConnected; }
@GET @Path("branch") @Produces(MediaType.APPLICATION_JSON) public List<Branch> branchList(@QueryParam("listMode") String listMode) throws ApiException { try (GitConnection gitConnection = getGitConnection()) { return gitConnection.branchList(listMode == null ? null : BranchListMode.valueOf(listMode)); } catch (IllegalArgumentException exception) { throw new BadRequestException(exception.getMessage()); } }
@GET @Path("/{dataSourceName}") @Produces(MediaType.APPLICATION_JSON) @ResourceFilters(RulesResourceFilter.class) public Response getDatasourceRules( @PathParam("dataSourceName") final String dataSourceName, @QueryParam("full") final String full ) { if (full != null) { return Response.ok(databaseRuleManager.getRulesWithDefault(dataSourceName)) .build(); } return Response.ok(databaseRuleManager.getRules(dataSourceName)) .build(); }
@POST @Path("commit") @Consumes(MediaType.APPLICATION_JSON) @Produces({MediaType.APPLICATION_JSON, MediaType.TEXT_PLAIN}) public Revision commit(CommitRequest request) throws ApiException { try (GitConnection gitConnection = getGitConnection()) { return gitConnection.commit( CommitParams.create(request.getMessage()) .withFiles(request.getFiles()) .withAll(request.isAll()) .withAmend(request.isAmend())); } }
@POST @Path("/{dataSourceName}") @Consumes(MediaType.APPLICATION_JSON) @ResourceFilters(DatasourceResourceFilter.class) public Response enableDataSource( @PathParam("dataSourceName") final String dataSourceName ) { if (!databaseSegmentManager.enableDatasource(dataSourceName)) { return Response.noContent().build(); } return Response.ok().build(); }
@GET @Path("/{indexSetId}/open") @Timed @ApiOperation(value = "Get information of all open indices managed by Graylog and their shards.") @RequiresPermissions(RestPermissions.INDICES_READ) @Produces(MediaType.APPLICATION_JSON) public OpenIndicesInfo indexSetOpen(@ApiParam(name = "indexSetId") @PathParam("indexSetId") String indexSetId) { final IndexSet indexSet = getIndexSet(indexSetRegistry, indexSetId); final Set<IndexStatistics> indicesInfos = indices.getIndicesStats(indexSet).stream() .filter(indexStats -> isPermitted(RestPermissions.INDICES_READ, indexStats.index())) .collect(Collectors.toSet()); return getOpenIndicesInfo(indicesInfos); }