1. Process Data Streams

Manage Functions

StreamNative Cloud enables you to manage Pulsar Functions by using a variety of tools, including pulsarctl, pulsar-admin, REST API, and Terraform.

Note

If you want to update or delete functions using pulsarctl or pulsar-admin, make sure you have set up your client tool. For more information, see set up client tools.

Update a function

When you want to modify configurations or update resources for functions, you can update functions using multiple tools.

The following example shows how to update the parallelism of the Java exclamation function exclamation to 2 using different tools.

pulsarctl functions update \
--name exclamation \
--parallelism 2

You should see the following output:

Updated successfully

And you can further check the status:

pulsarctl functions status --name exclamation

{
  "numInstances": 2,
  "numRunning": 2,
  "instances": [
    {
      "instanceId": 0,
      "status": {
        "running": true,
        "error": "",
        "numRestarts": 0,
        "numReceivedFromSource": 1799,
        "numSystemExceptions": 0,
        "latestSystemExceptions": [],
        "numSourceExceptions": 0,
        "latestSourceExceptions": [],
        "numWritten": 1799,
        "lastReceivedTime": 1693946327331,
        "workerId": "test"
      }
    },
    {
      "instanceId": 1,
      "status": {
        "running": true,
        "error": "",
        "numRestarts": 0,
        "numReceivedFromSource": 689,
        "numSystemExceptions": 0,
        "latestSystemExceptions": [],
        "numSourceExceptions": 0,
        "latestSourceExceptions": [],
        "numWritten": 689,
        "lastReceivedTime": 1693946327129,
        "workerId": "test"
      }
    }
  ]
}

Delete a function

The following example shows how to delete the Java exclamation function exclamation using different tools.

To delete the function exclamation, use the following command.

pulsarctl functions delete --tenant public --namespace default --name exclamation

You should see the following output:

Deleted exclamation successfully

If you want to verify whether the function has been deleted successfully, run the following command.

pulsarctl functions get --tenant public --namespace default --name exclamation

You should see the following output:

[]  code: 500 reason: failed to perform the request: responseCode: 404, responseMessage: functions.compute.functionmesh.io "exclamation-XXXXX" not found

What’s next?

Previous
Develop WASM Functions