You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2019/06/17 06:08:19 UTC

[GitHub] [pulsar] yjshen commented on a change in pull request #4521: [improve doc] Update source rest api doc

yjshen commented on a change in pull request #4521: [improve doc] Update source rest api doc
URL: https://github.com/apache/pulsar/pull/4521#discussion_r294146207
 
 

 ##########
 File path: pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/SourcesBase.java
 ##########
 @@ -63,20 +61,78 @@ public WorkerService get() {
     @POST
     @ApiOperation(value = "Creates a new Pulsar Source in cluster mode")
     @ApiResponses(value = {
-            @ApiResponse(code = 403, message = "The requester doesn't have admin permissions"),
-            @ApiResponse(code = 400, message = "Invalid request (function already exists, etc.)"),
-            @ApiResponse(code = 408, message = "Request timeout"),
-            @ApiResponse(code = 200, message = "Pulsar Function successfully created")
+            @ApiResponse(code = 200, message = "Pulsar Function successfully created"),
+            @ApiResponse(code = 400, message = "Invalid request (Function already exists or Tenant, Namespace or Name is not provided, etc.)"),
+            @ApiResponse(code = 401, message = "Client is not authorize to perform operation"),
+            @ApiResponse(code = 500, message = "Internal Server Error"),
+            @ApiResponse(code = 503, message = "Function worker service is now initializing. Please try again later.")
+
     })
     @Path("/{tenant}/{namespace}/{sourceName}")
     @Consumes(MediaType.MULTIPART_FORM_DATA)
-    public void registerSource(final @PathParam("tenant") String tenant,
-                               final @PathParam("namespace") String namespace,
-                               final @PathParam("sourceName") String sourceName,
-                               final @FormDataParam("data") InputStream uploadedInputStream,
-                               final @FormDataParam("data") FormDataContentDisposition fileDetail,
-                               final @FormDataParam("url") String functionPkgUrl,
-                               final @FormDataParam("sourceConfig") String sourceConfigJson) {
+    public void registerSource(
+            @ApiParam(value = "The name of tenant")
+            final @PathParam("tenant") String tenant,
+            @ApiParam(value = "The name of namespace")
+            final @PathParam("namespace") String namespace,
+            @ApiParam(value = "The name of source")
+            final @PathParam("sourceName") String sourceName,
+            final @FormDataParam("data") InputStream uploadedInputStream,
+            final @FormDataParam("data") FormDataContentDisposition fileDetail,
+            final @FormDataParam("url") String functionPkgUrl,
+            @ApiParam(
+                    value = "A JSON value presenting source configuration payload. An example of the expected functions can be found here.  \n" +
+                            "tenant  \n" +
 
 Review comment:
   I think tenant, namespace, and name are already encoded in the Path?

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services