Skip to content

Instantly share code, notes, and snippets.

@lennartkoopmann
Created January 9, 2014 13:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lennartkoopmann/8334267 to your computer and use it in GitHub Desktop.
Save lennartkoopmann/8334267 to your computer and use it in GitHub Desktop.
Graylog2 REST resource method head
@RequiresAuthentication
@Api(value = "Streams", description = "Manage streams")
@Path("/streams")
public class StreamResource extends RestResource {
...
@PUT @Timed
@Path("/{streamId}")
@ApiOperation(value = "Update a stream")
@RequiresPermissions(RestPermissions.STREAMS_EDIT)
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@ApiResponses(value = {
@ApiResponse(code = 404, message = "Stream not found."),
@ApiResponse(code = 400, message = "Invalid ObjectId.")
})
public Response update(@ApiParam(title = "JSON body", required = true) String body, @ApiParam(title = "streamId", required = true) @PathParam("streamId") String streamId) {
// do the magic
}
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment