Class: Chef::Knife::ProfitbricksIpblockList
- Inherits:
-
Chef::Knife
- Object
- Chef::Knife
- Chef::Knife::ProfitbricksIpblockList
- Includes:
- ProfitbricksBase
- Defined in:
- lib/chef/knife/profitbricks_ipblock_list.rb
Instance Method Summary collapse
Methods included from ProfitbricksBase
#connection, #error_and_exit, #get_image, included, #msg_pair, #validate_required_params
Instance Method Details
#run ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/chef/knife/profitbricks_ipblock_list.rb', line 10 def run $stdout.sync = true ipblock_list = [ ui.color('ID', :bold), ui.color('Location', :bold), ui.color('IP Addresses', :bold), ] connection ProfitBricks::IPBlock.list.each do |ipblock| ipblock_list << ipblock.id ipblock_list << ipblock.properties['location'] ipblock_list << ipblock.properties['ips'].join(", ").to_s end puts ui.list(ipblock_list, :uneven_columns_across, 3) end |