Skip to content

kafka get-leader

Get leader for Kafka topic partition

Description

Get Leader of a particular partition of kafka topic

Synopsis

kafka get-leader
    [--site <site>]
    [--cluster <cluster>]
    --topic <topic>
    <partition>

Arguments

site - (string)

     Site where this command will be executed
     Example: --site "site-1"
     Default: input.site      Attributes: optional

cluster - (string)

     Name of kafka cluster
     Example: --cluster "cluster-1"
     Default: default      Attributes: optional

topic - (string)

     Name of kafka topic
     Example: --topic "topic-1"
     Default: _None_      Attributes: required

partition - (int)

     Name of the partition
     Example: 1
     Default: _None_      Attributes: required

Examples

Input:

! kafka get-leader --topic "test-topic-1" 1
Output:
{
  "id": 1,
  "addr": "beehyv-H81M-S:9093"
}

Access Control

To use this command, you need access to the following:

Field Value
Action "read"
Service Type "kafka"
Service Instance cluster
Namespace
Object Type "topic"
Object ID topic

Please see Access Control for details.