Class: BBGAPI::LB_Easy

Inherits:
Object
  • Object
show all
Defined in:
lib/bbgapi/lb_easy.rb

Class Method Summary collapse

Class Method Details

.haproxy_loginObject



20
21
22
23
24
25
26
27
# File 'lib/bbgapi/lb_easy.rb', line 20

def self.
  haproxy = BBGAPI::LB_Services.haproxyinfo
  puts "-----Needs improvement but should work for now"
  haproxy.each {|x|
    puts "#{x["name"]} - URL: #{x["status_url"]} #{x["status_username"]}:#{x["status_password"]} "
  }
  puts "------------------"
end

.machines_in_poolObject



29
30
31
32
33
34
# File 'lib/bbgapi/lb_easy.rb', line 29

def self.machines_in_pool
  nodes = BBGAPI::LB_Backends.raw
  puts "\nNodes in Pool:\n"
  nodes.first["lb_machines"].each {|x| puts "#{x["hostname"]}"}
  puts "\n"
end


4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/bbgapi/lb_easy.rb', line 4

def self.menulist(config)
  @@config = config
  #["bluebox_customer_id"]
  puts BBGAPI.dnssuffix
  choose do |menu|
    puts "Load Balancer Easy Functions"
    puts "----------------------------------------"
    menu.prompt = "Which Action?"

    menu.choices(:get_haproxy_login) {self.}
    menu.choices(:find_machines_in_pool) {self.machines_in_pool}
    menu.choices(:remove_machine_in_pool) {self.remove_machine_in_pool}

  end
end

.remove_machine_in_poolObject



36
37
38
# File 'lib/bbgapi/lb_easy.rb', line 36

def self.remove_machine_in_pool
  puts "Not yet implemented."
end