Class: Cumulus::ELB::Commands

Inherits:
Common::Commands show all
Defined in:
lib/elb/Commands.rb

Class Method Summary collapse

Methods inherited from Common::Commands

banner_message, format_message, help_message, manager_name, parse, usage_message, valid_options, verify

Class Method Details

.command_detailsObject



6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/elb/Commands.rb', line 6

def self.command_details
  format_message [
    ["diff", "print out differences between local configuration and AWS (supplying the name of the elb will diff only that elb)"],
    ["list", "list the locally defined ELBs"],
    ["sync", "sync local ELB definitions with AWS (supplying the name of the elb will sync only that elb)"],
    ["migrate", "migrate AWS configuration to Cumulus"],
    format_message([
      ["default-policies", "migrate default ELB policies from AWS to Cumulus"],
      ["elbs", "migrate the current ELB configuration from AWS to Cumulus"],
    ], indent: 1),
  ]
end

.execute(arguments) ⇒ Object



24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/elb/Commands.rb', line 24

def self.execute(arguments)
  if arguments[0] == "migrate"
    if arguments[1] == "default-policies"
      manager.migrate_default_policies
    elsif arguments[1] == "elbs"
      manager.migrate_elbs
    else
      puts "Usage: cumulus elb migrate [default-policies|elbs]"
    end
  else
    super(arguments)
  end
end

.managerObject



19
20
21
22
# File 'lib/elb/Commands.rb', line 19

def self.manager
  require "elb/manager/Manager"
  Cumulus::ELB::Manager.new
end