-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add update cmd for Pulsar Functions #33
Conversation
Signed-off-by: xiaolong.ran <ranxiaolong716@gmail.com>
Signed-off-by: xiaolong.ran <ranxiaolong716@gmail.com>
Signed-off-by: xiaolong.ran <ranxiaolong716@gmail.com>
Signed-off-by: xiaolong.ran <ranxiaolong716@gmail.com>
Signed-off-by: xiaolong.ran <ranxiaolong716@gmail.com>
Signed-off-by: xiaolong.ran <ranxiaolong716@gmail.com>
Signed-off-by: xiaolong.ran <ranxiaolong716@gmail.com>
Signed-off-by: xiaolong.ran <ranxiaolong716@gmail.com>
Signed-off-by: xiaolong.ran <ranxiaolong716@gmail.com>
} | ||
examples = append(examples, update) | ||
|
||
updateWithConf := pulsar.Example{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update a Pulsar Function using a function config yaml file
pkg/ctl/functions/update.go
Outdated
examples = append(examples, updateWithLogTopic) | ||
|
||
updateWithDeadLetterTopic := pulsar.Example{ | ||
Desc: "Update dead letter topic of Pulsar Function", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change the dead letter topic of a Pulsar Function
} | ||
examples = append(examples, updateWithDeadLetterTopic) | ||
|
||
updateWithUserConfig := pulsar.Example{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update the user configs of a Pulsar Function
Please change Pulsar Function
to a Pulsar Function
in other places.
pkg/ctl/functions/update.go
Outdated
examples = append(examples, updateWithCustomSchemasInputs) | ||
|
||
updateWithSchema := pulsar.Example{ | ||
Desc: "Update schema type of output topic for Pulsar Function", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is for input topic, not for output topic, no?
If it is for input topic, change it to Change the schema type of the input topic for a Pulsar Function
.
} | ||
examples = append(examples, updateWithSchema) | ||
|
||
updateWithParallelism := pulsar.Example{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change the parallelism of a Pulsar Function
pkg/ctl/functions/update.go
Outdated
examples = append(examples, updateWithParallelism) | ||
|
||
updateWithResource := pulsar.Example{ | ||
Desc: "Update resource of Pulsar Function", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change the resource usage for a Pulsar Function
pkg/ctl/functions/update.go
Outdated
examples = append(examples, updateWithResource) | ||
|
||
updateWithWindowFunctions := pulsar.Example{ | ||
Desc: "Update window functions config of Pulsar Function", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update the window configurations for a Pulsar Function
pkg/ctl/functions/update.go
Outdated
var out []pulsar.Output | ||
successOut := pulsar.Output{ | ||
Desc: "normal output", | ||
Out: "Updated successfully", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't we have the function name in the output?
Signed-off-by: xiaolong.ran <ranxiaolong716@gmail.com>
@sijie PTAL again |
Add update cmd for Pulsar Functions, output as follows: ``` USED FOR: Update a Pulsar Function that has been deployed to a Pulsar cluster. REQUIRED PERMISSION: This command requires super-user permissions. EXAMPLES: #Update output topic of Pulsar Function pulsarctl functions update --tenant public --namespace default --name update-function --output test-output-topic #Update function config yaml file of Pulsar Function pulsarctl functions update --function-config-file <the path of function config yaml file> --jar <the path of user code jar> #Update log topic of Pulsar Function pulsarctl functions update --log-topic persistent://public/default/test-log-topic # Other function parameters #Update dead letter topic of Pulsar Function pulsarctl functions update --dead-letter-topic persistent://public/default/test-dead-letter-topic --max-message-retries 10 # Other function parameters #Update user config of Pulsar Function pulsarctl functions update --user-config "{"publishTopic":"publishTopic", "key":"pulsar"}" # Other function parameters #Update custom schema of inputs topic for Pulsar Function pulsarctl functions update --custom-schema-inputs "{"topic-1":"schema.STRING", "topic-2":"schema.JSON"}" # Other function parameters #Update schema type of output topic for Pulsar Function pulsarctl functions update --schema-type schema.STRING # Other function parameters #Update parallelism of Pulsar Function pulsarctl functions update --parallelism 1 # Other function parameters #Update resource of Pulsar Function pulsarctl functions update --ram 5656565656 --disk 8080808080808080 --cpu 5.0 # Other function parameters #Update window functions config of Pulsar Function pulsarctl functions update --window-length-count 10 --window-length-duration-ms 1000 --sliding-interval-count 3 --sliding-interval-duration-ms 1000 # Other function parameters OUTPUT: #normal output Updated successfully #Update contains no change [✖] code: 400 reason: Update contains no change #The name of Pulsar Functions doesn't exist, please check the --name args [✖] code: 404 reason: Function <your function name> doesn't exist Usage: pulsarctl functions update [flags] Aliases: update, update ```
Add update cmd for Pulsar Functions, output as follows: ``` USED FOR: Update a Pulsar Function that has been deployed to a Pulsar cluster. REQUIRED PERMISSION: This command requires super-user permissions. EXAMPLES: #Update output topic of Pulsar Function pulsarctl functions update --tenant public --namespace default --name update-function --output test-output-topic #Update function config yaml file of Pulsar Function pulsarctl functions update --function-config-file <the path of function config yaml file> --jar <the path of user code jar> #Update log topic of Pulsar Function pulsarctl functions update --log-topic persistent://public/default/test-log-topic # Other function parameters #Update dead letter topic of Pulsar Function pulsarctl functions update --dead-letter-topic persistent://public/default/test-dead-letter-topic --max-message-retries 10 # Other function parameters #Update user config of Pulsar Function pulsarctl functions update --user-config "{"publishTopic":"publishTopic", "key":"pulsar"}" # Other function parameters #Update custom schema of inputs topic for Pulsar Function pulsarctl functions update --custom-schema-inputs "{"topic-1":"schema.STRING", "topic-2":"schema.JSON"}" # Other function parameters #Update schema type of output topic for Pulsar Function pulsarctl functions update --schema-type schema.STRING # Other function parameters #Update parallelism of Pulsar Function pulsarctl functions update --parallelism 1 # Other function parameters #Update resource of Pulsar Function pulsarctl functions update --ram 5656565656 --disk 8080808080808080 --cpu 5.0 # Other function parameters #Update window functions config of Pulsar Function pulsarctl functions update --window-length-count 10 --window-length-duration-ms 1000 --sliding-interval-count 3 --sliding-interval-duration-ms 1000 # Other function parameters OUTPUT: #normal output Updated successfully #Update contains no change [✖] code: 400 reason: Update contains no change #The name of Pulsar Functions doesn't exist, please check the --name args [✖] code: 404 reason: Function <your function name> doesn't exist Usage: pulsarctl functions update [flags] Aliases: update, update ```
Add update cmd for Pulsar Functions, output as follows: