Class: Chef::Knife::SoftlayerDatacenterList

Inherits:
Chef::Knife
  • Object
show all
Includes:
SoftlayerBase
Defined in:
lib/chef/knife/softlayer_datacenter_list.rb

Constant Summary

Constants included from SoftlayerBase

Chef::Knife::SoftlayerBase::USER_AGENT

Instance Method Summary collapse

Methods included from SoftlayerBase

#compute, #connection, included, #locate_config_value, #msg_pair, #network

Instance Method Details

#runObject



18
19
20
21
22
23
24
# File 'lib/chef/knife/softlayer_datacenter_list.rb', line 18

def run
  $stdout.sync = true
  table_data = connection(:network).datacenters.map do |dc|
    {:name => dc.name, :long_name => dc.long_name }
  end
  puts Formatador.display_table(table_data, [:name, :long_name])
end