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/12 15:32:33 UTC
[GitHub] [pulsar] jerrypeng commented on a change in pull request #4521:
[improve doc] Update source rest api doc
jerrypeng commented on a change in pull request #4521: [improve doc] Update source rest api doc
URL: https://github.com/apache/pulsar/pull/4521#discussion_r292980872
##########
File path: pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/SourcesBase.java
##########
@@ -63,20 +61,76 @@ 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")
})
@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" +
+ "archive \n" +
+ " The path to the NAR archive for the Source. It also supports url-path " +
+ " [http/https/file (file protocol assumes that file already exists on worker host)] " +
+ " from which worker can download the package. \n" +
+ "classname \n" +
+ " The source's class name if archive is file-url-path (file://). \n" +
+ "cpu \n" +
+ " The CPU (in cores) that needs to be allocated per source instance (applicable only to Docker runtime). \n" +
+ "deserialization-classname \n" +
+ " The SerDe classname for the source. \n" +
+ "destination-topic-name \n" +
+ " The Pulsar topic to which data is sent. \n" +
+ "disk \n" +
+ " The disk (in bytes) that need to be allocated per source instance (applicable only to Docker runtime). \n" +
+ "name \n" +
+ " The name of source. \n" +
+ "namespace \n" +
+ " The namespace of source. \n" +
+ "parallelism \n" +
+ " The source's parallelism factor (i.e. the number of source instances to run). \n" +
+ "processing-guarantees \n" +
+ " The processing guarantees (aka delivery semantics) applied to the source " +
+ " Possible Values: [ATLEAST_ONCE, ATMOST_ONCE, EFFECTIVELY_ONCE] \n" +
+ "ram \n" +
+ " The RAM (in bytes) that need to be allocated per source instance " +
+ " (applicable only to the process and Docker runtimes). \n" +
+ "schema-type \n" +
+ " The schema type (either a builtin schema like 'avro', 'json', etc.. or " +
+ " custom Schema class name to be used to encode messages emitted from the source \n" +
+ "source-config \n" +
+ " Source config key/values \n" +
+ "source-config-file \n" +
Review comment:
this field doesn't exist
----------------------------------------------------------------
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