[improve][rest] Add lookup REST Api swagger docs describe
*/
package org.apache.pulsar.broker.lookup.v2;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import javax.ws.rs.DefaultValue;
@@ -34,9 +36,11 @@ import javax.ws.rs.core.MediaType;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.apache.pulsar.broker.lookup.TopicLookupBase;
+import org.apache.pulsar.common.lookup.data.LookupData;
import org.apache.pulsar.common.naming.TopicName;
@Path("/v2/topic")
+@Api(value = "lookup", tags = "lookup")
@Slf4j
public class TopicLookup extends TopicLookupBase {
@@ -45,6 +49,10 @@ public class TopicLookup extends TopicLookupBase {
@GET
@Path("{topic-domain}/{tenant}/{namespace}/{topic}")
@Produces(MediaType.APPLICATION_JSON)
+ @ApiOperation(
+ value = "Get the owner broker of the given topic.",
+ response = LookupData.class
+ )
@ApiResponses(value = { @ApiResponse(code = 307,
message = "Current broker doesn't serve the namespace of this topic") })
public void lookupTopicAsync(
@@ -72,6 +80,10 @@ public class TopicLookup extends TopicLookupBase {
@GET
@Path("{topic-domain}/{tenant}/{namespace}/{topic}/bundle")
@Produces(MediaType.APPLICATION_JSON)
+ @ApiOperation(
+ value = "Get the namespace bundle which the given topic belongs to.",
+ response = String.class
+ )
@ApiResponses(value = { @ApiResponse(code = 403, message = "Don't have admin permission"),
@ApiResponse(code = 405, message = "Invalid topic domain type") })
public String getNamespaceBundle(@PathParam("topic-domain") String topicDomain,
