Class: Gojira::Command::Cluster

Inherits:
Base
  • Object
show all
Defined in:
lib/gojira/command/cluster.rb

Constant Summary collapse

REQUIRED_CLASS_OPTIONS =
%i[tls_enabled]

Instance Method Summary collapse

Methods inherited from Base

banner, subcommand_prefix

Instance Method Details

#diffObject

Raises:

  • (Thor::Error)


31
32
33
34
35
36
37
38
# File 'lib/gojira/command/cluster.rb', line 31

def diff
  validate_options
  deck = Gojira::Deck::Gateway.new('deck', get_control_plane)
  deck.diff(options[:kong_state_file])
  raise Thor::Error, deck.error if deck.error.any?

  print(deck.output.first)
end

#dumpObject

Raises:

  • (Thor::Error)


61
62
63
64
65
66
67
68
# File 'lib/gojira/command/cluster.rb', line 61

def dump
  validate_options
  deck = Gojira::Deck::Gateway.new('deck', get_control_plane)
  deck.dump(options[:kong_state_file])
  raise Thor::Error, deck.error if deck.error.any?

  print(deck.output.first)
end

#syncObject

Raises:

  • (Thor::Error)


46
47
48
49
50
51
52
53
54
# File 'lib/gojira/command/cluster.rb', line 46

def sync
  require 'pry'; binding.pry
  validate_options
  deck = Gojira::Deck::Gateway.new('deck', get_control_plane)
  deck.sync(options[:kong_state_file])
  raise Thor::Error, deck.error if deck.error.any?

  print(deck.output.first)
end

#validateObject

Raises:

  • (Thor::Error)


16
17
18
19
20
21
22
23
# File 'lib/gojira/command/cluster.rb', line 16

def validate
  validate_options
  deck = Gojira::Deck::Gateway.new('deck', get_control_plane)
  deck.validate(options[:kong_state_file])
  raise Thor::Error, deck.error if deck.error.any?

  print("Kong state file validated successfully")
end