Skip to content

How to upload a Pulsar Functions jar package in Python with the REST API #23519

Answered by lhotari
engineer537 asked this question in Q&A
Discussion options

You must be logged in to vote

Here's an example of using the REST API:
#22266 (comment)

this is the way curl can be used to create functions from a jar/nar file:

cat >/tmp/functionconfig.json <<EOF
{
  "tenant": "public",
  "namespace": "default",
  "name": "myfunction",
  "className": "MyFunction",
  "runtime": "JAVA",
  "inputs": [
    "public/default/input-topic"
  ],
  "output": "public/default/output-topic",
  "autoAck": true,
  "parallelism": 1
}
EOF

curl -H "Authorization: Bearer $(cat token)" -v -X POST \
  -F "functionConfig=@/tmp/functionconfig.json;type=application/json" \
  -F "[email protected];type=application/octet-stream" \
  http://pulsar-function-worker:6750/admin/v3/functions/public/default/myfunc…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by lhotari
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants