4.0

You are viewing documentation for an older version of Lenses.io View latest documentation here

SQL Processors

The CLI can create, modify, pause, restart and remove Lenses SQL Processors.

View processors 

View all processors registered, optionally filter by name, cluster and namespace.

lenses-cli processors
# filter by namespace
lenses-cli processors --namespace lenses-sql

Create processors 

For IN_PROC you only need the name, for KUBERNETES all three. Creating an IN_PROC processor, will start it automatically. This is not the case for Kubernetes deployments, a start command (see below) is required once created.

The following flags are valid for all processor actions:

  • ––id (required if –name) is missing
  • ––name (required if –id is missing)
  • ––cluster-name (should be passed if KUBERNETES)
  • ––namespace (should be passed if KUBERNETES)
  • —runners (number of times to deploy while in KUBERNETES)
lenses-cli processor create \
    --name="processorName" \
    --runners=1 \
    --cluster-name="clusterName" \
    --namespace="ns" \
    --pipeline="prod" \
    --sql="SET defaults.topic.autocreate=true;INSERT INTO topicB SELECT STREAM * FROM topic1"

From a file.

lenses-cli processor create ./processor.yaml

name: processorName
runners: 1
sql: |-
    SET defaults.topic.autocreate=true;INSERT INTO topicB SELECT STREAM * FROM topic1

Stop a processor 

For IN_PROC you only need the name, for KUBERNETES all three:

lenses-cli processor stop \
    --cluster-name="clusterName?" \
    --namespace="namespace?" \
    --name="processorName"

Start a processor 

For IN_PROC you only need the name, for KUBERNETES all three:

lenses-cli processor start \
    --cluster-name="clusterName?" \
    --namespace="namespace?" \
    --name="processorName"

Update a processor runners 

Update a processor from the command line flags or file. This is not applicable for IN_PROC only for KUBERNETES:

lenses-cli processor update \
    --cluster-name="clusterName?" \
    --namespace="namespace" \
    --name="processorName" \
    --runners=2

From a file.

lenses-cli processor update ./processor.yaml

name: processorName
runners: 1
sql: |-
    SET defaults.topic.autocreate=true;INSERT INTO topicB SELECT STREAM * FROM topic1

Delete a processor 

Delete a processor by name, cluster and namespace. For IN_PROC you only need the name, for CONNECT the name and cluster, for KUBERNETES all three.

lenses-cli processor delete \
    --namespace="namespace" \
    --cluster-name="clusterName" \
    --name="processorName

View processors logs 

Available only for KUBERNETES.

lenses-cli processors logs \
    --cluster-name=clusterName \
    --namespace=nameSpace \
    --podName=runnerStateID [--follow --lines]