Class: Chef::Knife::OktawaveOciList

Inherits:
Chef::Knife show all
Includes:
OktawaveBase
Defined in:
lib/chef/knife/oktawave_oci_list.rb

Instance Method Summary collapse

Methods included from OktawaveBase

#api, #get_oci, included, #msg_pair, #oci_not_found, #print_oci_summary, #validate!

Instance Method Details

#runObject



8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/chef/knife/oktawave_oci_list.rb', line 8

def run
  validate!
  puts ui.list([
    ui.color('ID', :bold),
    ui.color('Name', :bold),
    ui.color('Class', :bold)
  ] + api.oci_list.map {|o| [
    o[:virtual_machine_id] || '',
    o[:virtual_machine_name],
    api.dive2name(o[:vm_class])[:item_name]
  ]}.flatten(1), :columns_across, 3)
end