Class: Chef::Knife::RackspaceImageList

Inherits:
Chef::Knife show all
Includes:
RackspaceBase
Defined in:
lib/chef/knife/rackspace_image_list.rb

Instance Method Summary collapse

Methods included from RackspaceBase

#auth_endpoint, #connection, #connection_params, included, #ip_address, #locate_config_value, #msg_pair, #public_dns_name, #region_warning_for_v1

Methods inherited from Chef::Knife

#get_networks, #get_node_name

Instance Method Details

#runObject



29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'lib/chef/knife/rackspace_image_list.rb', line 29

def run
  image_list = [
    ui.color("ID", :bold),
    ui.color("Name", :bold),
  ]

  connection.images.sort_by(&:name).each do |image|
    image_list << image.id.to_s
    image_list << image.name
  end

  puts ui.list(image_list, :uneven_columns_across, 2)
end