Class: Chef::Knife::OneandoneServerSizeList
- Inherits:
-
Chef::Knife
- Object
- Chef::Knife
- Chef::Knife::OneandoneServerSizeList
- Includes:
- OneandoneBase
- Defined in:
- lib/chef/knife/oneandone_server_size_list.rb
Instance Method Summary collapse
Methods included from OneandoneBase
#formated_output, included, #init_client
Instance Method Details
#run ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/chef/knife/oneandone_server_size_list.rb', line 10 def run $stdout.sync = true init_client response = OneAndOne::Server.new.list_fixed formated_output(response, true) sizes = [ ui.color('ID', :bold), ui.color('Name', :bold), ui.color('RAM (GB)', :bold), ui.color('Processor No.', :bold), ui.color('Cores per Processor', :bold), ui.color('Disk Size (GB)', :bold) ] response.each do |fs| sizes << fs['id'] sizes << fs['name'] sizes << fs['hardware']['ram'].to_s sizes << fs['hardware']['vcore'].to_s sizes << fs['hardware']['cores_per_processor'].to_s sizes << fs['hardware']['hdds'][0]['size'].to_s end puts ui.list(sizes, :uneven_columns_across, 6) end |