Class: Chef::Knife::GlesysServerList

Inherits:
Chef::Knife show all
Includes:
GlesysBase
Defined in:
lib/chef/knife/glesys_server_list.rb

Instance Method Summary collapse

Methods included from GlesysBase

#color_state, #connection, included, #locate_config_value, #msg_pair, #validate!

Instance Method Details

#runObject



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/chef/knife/glesys_server_list.rb', line 17

def run

  server_list = [
    ui.color('ID', :bold),
    ui.color("Hostname", :bold),
    ui.color("Platform", :bold),
    ui.color("Datacenter", :bold),
  ].flatten.compact

  connection.servers.all.each do |server|
    server_list << server.serverid.to_s
    server_list << server.hostname
    server_list << server.platform
    server_list << server.datacenter
  end

  puts ui.list(server_list, :columns_across, 4)
end