Class: Chef::Knife::BmcsShapeList

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

Overview

List available shapes

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



32
33
34
35
36
37
38
39
40
41
42
43
# File 'lib/chef/knife/bmcs_shape_list.rb', line 32

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

  response = compute_client.list_shapes(compartment_id, options)

  display_list(response, []) do |item, list|
    [item.shape] unless list.include? item.shape
  end
end