Class: Chef::Knife::BmcsImageList

Inherits:
Chef::Knife show all
Includes:
BmcsCommonOptions, BmcsHelper
Defined in:
lib/chef/knife/bmcs_image_list.rb

Overview

List available images

Instance Method Summary collapse

Methods included from BmcsCommonOptions

included

Methods included from BmcsHelper

#bmcs_config, #check_can_access_instance, #compartment_id, #compute_client, #confirm, #display_list, #display_server_info, #error_and_exit, #identity_client, #network_client, #show_value, #validate_required_params, #warn_if_page_is_truncated

Instance Method Details

#runObject



24
25
26
27
28
29
30
31
32
33
# File 'lib/chef/knife/bmcs_image_list.rb', line 24

def run
  options = {}
  options[:limit] = config[:limit] if config[:limit]

  response = compute_client.list_images(compartment_id, options)

  display_list(response, ['Display Name', 'ID', 'OS', 'OS Version']) do |image|
    [image.display_name, image.id, image.operating_system, image.operating_system_version]
  end
end