Jennifer88huang commented on a change in pull request #4367:
[document][swagger]Update topics rest api document
URL: https://github.com/apache/pulsar/pull/4367#discussion_r291825125
##########
File path:
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/PersistentTopics.java
##########
@@ -410,24 +698,56 @@ public void resetCursor(@PathParam("tenant") String
tenant, @PathParam("namespac
@POST
@Path("/{tenant}/{namespace}/{topic}/subscription/{subName}/resetcursor")
@ApiOperation(value = "Reset subscription to message position closest to
given position.", notes = "It fence cursor and disconnects all active consumers
before reseting cursor.")
- @ApiResponses(value = { @ApiResponse(code = 403, message = "Don't have
admin permission"),
+ @ApiResponses(value = {
+ @ApiResponse(code = 401, message = "Don't have permission to
administrate resources on this tenant or" +
+ "subscriber is not authorized to access this operation"),
+ @ApiResponse(code = 403, message = "Don't have admin permission"),
@ApiResponse(code = 404, message = "Topic/Subscription does not
exist"),
- @ApiResponse(code = 405, message = "Not supported for partitioned
topics") })
- public void resetCursorOnPosition(@PathParam("tenant") String tenant,
@PathParam("namespace") String namespace,
- @PathParam("topic") @Encoded String encodedTopic,
@PathParam("subName") String encodedSubName,
- @QueryParam("authoritative") @DefaultValue("false") boolean
authoritative, MessageIdImpl messageId) {
+ @ApiResponse(code = 405, message = "Not supported for partitioned
topics"),
+ @ApiResponse(code = 412, message = "Unable to find position for
position specified"),
+ @ApiResponse(code = 500, message = "Internal server error"),
+ @ApiResponse(code = 503, message = "Failed to validate global
cluster configuration") })
+ public void resetCursorOnPosition(
+ @ApiParam(value = "Specify the tenant", required = true)
+ @PathParam("tenant") String tenant,
+ @ApiParam(value = "Specify the namespace", required = true)
+ @PathParam("namespace") String namespace,
+ @ApiParam(value = "Specify topic name", required = true)
+ @PathParam("topic") @Encoded String encodedTopic,
+ @ApiParam(name = "subName", value = "Subscription to reset
position on", required = true)
+ @PathParam("subName") String encodedSubName,
+ @ApiParam(value = "Is authentication required to perform this
operation")
+ @QueryParam("authoritative") @DefaultValue("false") boolean
authoritative,
+ @ApiParam(name = "messageId", value = "messageId to reset back to
(ledgerId:entryId)")
+ MessageIdImpl messageId) {
validateTopicName(tenant, namespace, encodedTopic);
internalResetCursorOnPosition(decode(encodedSubName), authoritative,
messageId);
}
@GET
@Path("/{tenant}/{namespace}/{topic}/subscription/{subName}/position/{messagePosition}")
@ApiOperation(value = "Peek nth message on a topic subscription.")
- @ApiResponses(value = { @ApiResponse(code = 403, message = "Don't have
admin permission"),
- @ApiResponse(code = 404, message = "Topic, subscription or the
message position does not exist") })
- public Response peekNthMessage(@PathParam("tenant") String tenant,
@PathParam("namespace") String namespace,
- @PathParam("topic") @Encoded String encodedTopic,
@PathParam("subName") String encodedSubName,
+ @ApiResponses(value = {
+ @ApiResponse(code = 401, message = "Don't have permission to
administrate resources on this tenant or" +
+ "subscriber is not authorized to access this operation"),
+ @ApiResponse(code = 403, message = "Don't have admin permission"),
+ @ApiResponse(code = 404, message = "Topic, subscription or the
message position does not exist"),
+ @ApiResponse(code = 405, message = "Skip messages on a
non-persistent topic is not allowed"),
Review comment:
Skipping
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services