Class: Chef::Knife::OpennebulaServerList
- Inherits:
-
Chef::Knife
- Object
- Chef::Knife
- Chef::Knife::OpennebulaServerList
- Includes:
- OpennebulaBase
- Defined in:
- lib/chef/knife/opennebula_server_list.rb
Instance Method Summary collapse
Methods included from OpennebulaBase
#connection, included, #locate_config_value, #msg_pair, #opennebula_endpoint, #opennebula_password, #opennebula_username, #validate!
Instance Method Details
#run ⇒ Object
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/chef/knife/opennebula_server_list.rb', line 31 def run validate! server_list = [ ui.color('ID', :bold), ui.color('Name', :bold), ui.color('IP', :bold), ui.color('Memory', :bold), ui.color('State', :bold)] connection.servers.all.each do |server| server_list << "#{server.id.to_s}" server_list << server.name server_list << server.ip server_list << "#{server.memory.to_s}" server_list << server.state end puts ui.list(server_list, :uneven_columns_across, 5) end |