sijie commented on a change in pull request #4368: [Improve DOC] Update
functions rest api doc
URL: https://github.com/apache/pulsar/pull/4368#discussion_r287562136
##########
File path:
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/FunctionsBase.java
##########
@@ -94,14 +172,96 @@ public void registerFunction(final @PathParam("tenant")
String tenant,
})
@Path("/{tenant}/{namespace}/{functionName}")
@Consumes(MediaType.MULTIPART_FORM_DATA)
- public void updateFunction(final @PathParam("tenant") String tenant,
- final @PathParam("namespace") String namespace,
- final @PathParam("functionName") String
functionName,
- final @FormDataParam("data") InputStream
uploadedInputStream,
- final @FormDataParam("data")
FormDataContentDisposition fileDetail,
- final @FormDataParam("url") String
functionPkgUrl,
- final @FormDataParam("functionConfig") String
functionConfigJson,
- final @FormDataParam("updateOptions")
UpdateOptions updateOptions) throws IOException {
+ public void updateFunction(
+ @ApiParam(value = "The function's tenant")
+ final @PathParam("tenant") String tenant,
+ @ApiParam(value = "The function's namespace")
+ final @PathParam("namespace") String namespace,
+ @ApiParam(value = "The function's name")
+ final @PathParam("functionName") String functionName,
+ final @FormDataParam("data") InputStream uploadedInputStream,
+ final @FormDataParam("data") FormDataContentDisposition fileDetail,
+ final @FormDataParam("url") String functionPkgUrl,
+ @ApiParam(
+ value = "A JSON value presenting a functions config
playload. An example of the expected functions can be found down here. \n" +
+ "--auto-ack \n" +
+ " Whether or not the framework will automatically
acknowledge messages \n" +
+ "--classname \n" +
+ " The function's class name \n" +
+ "--cpu \n" +
+ " The cpu in cores that need to be allocated per
function instance(applicable only to docker runtime) \n" +
+ "--custom-schema-inputs \n" +
+ " The map of input topics to Schema class names
(as a JSON string) \n" +
+ "--custom-serde-inputs \n" +
+ " The map of input topics to SerDe class names
(as a JSON string) \n" +
+ "--dead-letter-topic \n" +
+ " The topic where all messages which could not be
processed successfully are sent \n" +
+ "--disk \n" +
+ " The disk in bytes that need to be allocated per
function instance(applicable only to docker runtime) \n" +
+ "--fqfn \n" +
+ " The Fully Qualified Function Name (FQFN) for
the function \n" +
+ "--function-config-file \n" +
+ " The path to a YAML config file specifying the
function's configuration \n" +
+ "--inputs \n" +
+ " The function's input topic or topics (multiple
topics can be specified as a comma-separated list) \n" +
+ "--jar \n" +
+ " Path to the jar file for the function (if the
function is written in Java). " +
+ " 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" +
+ "--log-topic \n" +
+ " The topic to which the function's logs are
produced \n" +
+ "--max-message-retries \n" +
+ " How many times should we try to process a
message before giving up \n" +
+ "--output \n" +
+ " The function's output topic (If none is
specified, no output is written) \n" +
+ "--output-serde-classname \n" +
+ " The SerDe class to be used for messages output
by the function \n" +
+ "--parallelism \n" +
+ " The function's parallelism factor (i.e. the
number of function instances to run) \n" +
+ "--processing-guarantees \n" +
+ " The processing guarantees (aka delivery
semantics) applied to the function" +
+ " Possible Values: [ATLEAST_ONCE, ATMOST_ONCE,
EFFECTIVELY_ONCE] \n" +
+ "--ram \n" +
+ " The ram in bytes that need to be allocated per
function instance(applicable only to process/docker runtime) \n" +
+ "--retain-ordering \n" +
+ " Function consumes and processes messages in
order \n" +
+ "--schema-type \n" +
+ " The builtin schema type or custom schema class
name to be used for messages output by the function" +
+ " Default: <empty string> \n" +
+ "--sliding-interval-count \n" +
+ " The number of messages after which the window
slides \n" +
+ "--sliding-interval-duration-ms \n" +
+ " The time duration after which the window slides
\n" +
+ "--subs-name \n" +
+ " Pulsar source subscription name if user wants a
specific subscription-name for input-topic consumer \n" +
+ "--timeout-ms \n" +
+ " The message timeout in milliseconds \n" +
+ "--topics-pattern \n" +
+ " The topic pattern to consume from list of
topics under a namespace that match the pattern." +
+ " [--input] and [--topic-pattern] are mutually
exclusive. Add SerDe class name for a " +
+ " pattern in --custom-serde-inputs (supported for
java fun only) \n" +
+ "--update-auth-data \n" +
+ " Whether or not to update the auth data.
Default: false \n" +
+ "--user-config \n" +
+ " User-defined config key/values \n" +
+ "--window-length-count \n" +
+ " The number of messages per window \n" +
+ "--window-length-duration-ms \n" +
+ " The time duration of the window in milliseconds
\n",
+ examples = @Example(
+ value = @ExampleProperty(
+ mediaType = MediaType.APPLICATION_JSON,
+ value = "{\"inputs\":
\"persistent://public/default/input-topic\", " +
+ "\"parallelism\": \" 4 \", " +
+ "\"output\":
\"persistent://public/default/output-topic\", " +
+ "\"jar\": \"
java-function-1.0-SNAPSHOT.jar \", " +
+ "\"classname\": \"
org.example.test.ExclamationFunction \", " +
+ "\"log-topic\": \"
persistent://public/default/log-topic \"}"
+ )
+ )
+ )
+ final @FormDataParam("functionConfig") String functionConfigJson,
+ final @FormDataParam("updateOptions") UpdateOptions updateOptions)
throws IOException {
Review comment:
document `UpdateOptions`?
----------------------------------------------------------------
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