Class: Karafka::Cli::Topics

Inherits:
Base
  • Object
show all
Includes:
Helpers::Colorize
Defined in:
lib/karafka/cli/topics.rb

Overview

CLI actions related to Kafka cluster topics management

Instance Attribute Summary

Attributes inherited from Base

#cli

Instance Method Summary collapse

Methods included from Helpers::Colorize

#green, #red, #yellow

Methods inherited from Base

bind_to, desc, #initialize, load, option

Constructor Details

This class inherits a constructor from Karafka::Cli::Base

Instance Method Details

#call(action = 'missing') ⇒ Object

Parameters:

  • action (String) (defaults to: 'missing')

    action we want to take



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/karafka/cli/topics.rb', line 11

def call(action = 'missing')
  case action
  when 'create'
    create
  when 'delete'
    delete
  when 'reset'
    reset
  when 'repartition'
    repartition
  when 'migrate'
    migrate
  else
    raise ::ArgumentError, "Invalid topics action: #{action}"
  end
end