All pages
Powered by GitBook
1 of 4

Loading...

Loading...

Loading...

Loading...

ACLs

This page describes to commands to manage Kafka ACLs in Lenses via the CLI.

View all ACLs

lenses-cli acls

Update ACLs

lenses-cli acl set \
    --resource-type="Topic" \
    --resource-name="transactions" \
    --principal="principalType:principalName" \
    --permission-type="Allow" \
    --acl-host="*" \
    --operation="Read" \
    --pattern-type="literal"

ACLs can also be created from a file:

lenses-cli acl create ./file.yaml

Example file:

Delete ACLs

ACLs can also be deleted from a file:

resourceType: Topic
resourceName: transactions
principal: principalType:principalName
permissionType: Allow
host: "*"
operation: Read
patternType: literal
lenses-cli acl delete \
    --resource-type="Topic" \
    --resource-name="transactions" \
    --principal="principalType:principalName" \
    --permission-type="Allow" \
    --acl-host="*" \
    --operation="Read" \
    --pattern-type="literal"
lenses-cli acl delete ./file.yaml

Consumers

This page describes the commands for managing Kafka consumers in Lenses via the CLI.

Commands for updating consumer groups offsets.

Flags --group and --topic are mandatory and specify the consumer group ID and topic name respectively.

To affect all topics use the —all-topics flag.

Flag
Description

-g, --group

Set the Consumer Group ID

-t, --topic

update-single-partition accepts only one --topic flag while update-multiple-partitions may accept multiple.

Update a single topic’s partition offset to the specified value

Update to the earliest offset available

Update to the latest offset available

Update given topics for all their partition offsets to the specified date time

Reset given topics for all their partition offsets to the earliest offset possible

Reset given topics for all their partition offsets to the latest offset possible

Reset offsets for all topics of this consumer group

Manage Kafka

Set the topic name

--all-topics

Select implicitly all the topics

--topics

The topic to reset offsets for

--partition

Set the partition ID

--to-earliest

Reset partition offset to earliest offset

--to-latest

Reset partition offset to latest offset

--to-offset

Reset the partition offset to the provided value

lenses-cli consumers \
    offsets \
    update-single-partition \
    --group <group_name> \
    --topic <topic_name> \
    --partition <partition_id> \
    --to-offset <offset_id>
lenses-cli consumers \
    offsets \
    update-single-partition \
    --group <group_name> \
    --topic <topic_name> \
    --partition <partition_id> \
    --to-earliest
lenses-cli consumers \
    offsets \
    update-single-partition \
    --group <group_name> \
    --topic <topic_name> \
    --partition <partition_id> \
    --to-latest
lenses-cli consumers \
    offsets \
    update-multiple-partitions \
    --group <group_name> \
    --topic <topic_name> \
    --to-datetime <datetime>
lenses-cli consumers \
    offsets \
    update-multiple-partitions \
    --group <group_name> \
    --topic <topic_name> \
    --to-earliest
lenses-cli consumers \
    offsets \
    update-multiple-partitions \
    --group <group_name> \
    --topic <topic_name> \
    --to-latest
lenses-cli consumers \
    offsets \
    update-multiple-partitions \
    --group <group_name> \
    --all-topics \
    --to-latest

Quotas

This page describes the commands for mamaging Kafka quotas in Lenses via the CLI.

View quotas

Create and update quotas for users

From a file.

File example:

Create and update quotas for clients

From a file.

Example file.

Remove user quota config’s specific properties

Delete the default user quota

Delete for a specific user quota

Delete for a specific user and client

Remove client quota config’s specific properties

If empty then all properties will be passed on automatically and the client quota will be removed entirely.

Delete the default client quota

Delete for a specific client quota

Delete for a specific client quota’s property

lenses-cli quotas [--output json/table/yaml]
lenses-cli quota users set [--quota-user="user"] [--quota-client=""] \
    --quota-config="{\"producer_byte_rate\": \"100000\",\"consumer_byte_rate\": \"200000\",\"request_percentage\": \"75\"}"
lenses-cli quota users set ./quota.yaml
user: user
clientID: "*"
config:
  ProducerByteRate: "100000"
  ConsumerByteRate: "200000"
  RequestPercentage: "75"
lenses-cli quota clients set [--quota-client=""] \
    --quota-config="{\"producer_byte_rate\": \"100000\",\"consumer_byte_rate\": \"200000\",\"request_percentage\": \"75\""
lenses-cli quota clients set ./quota-clients.yaml
clientID: "*"
config:
  ProducerByteRate: "100000"
  ConsumerByteRate: "200000"
  RequestPercentage: "75"
lenses-cli quota users delete [--quota-client=""] [--quota-user=""] \
    producer_byte_rate consumer_byte_rate request_percentage
lenses-cli quota users delete
lenses-cli quota users delete \
    --quota-user="user"
lenses-cli quota users delete \
    --quota-user="user" \
    --quota-client="clientID"
lenses-cli quota users delete \
    --quota-user="user" \
    request_percentage
lenses-cli quota clients delete [--quota-client=""] \
    producer_byte_rate consumer_byte_rate request_percentage
lenses-cli quota clients delete
lenses-cli quota clients delete \
    --quota-client="clientID"
lenses-cli quota clients delete \
    --quota-client="clientID" \
    request_percentage