Class: Chef::Knife::VsphereVlanList

Inherits:
BaseVsphereCommand show all
Defined in:
lib/chef/knife/vsphere_vlan_list.rb

Overview

Lists all known data stores in datacenter with sizes

Instance Method Summary collapse

Methods inherited from BaseVsphereCommand

#choose_datastore, #fatal_exit, #find_all_in_folder, #find_datastore, #find_datastorecluster, #find_datastores_regex, #find_device, #find_folder, #find_in_folder, #find_network, #find_pool, get_common_options, #get_config, #get_datacenter, #get_password, #get_path_to_object, #get_vim_connection, #get_vm, #get_vms, #tcp_test_port, #tcp_test_port_vm, #traverse_folders_for_dc, #traverse_folders_for_vm, #traverse_folders_for_vms

Instance Method Details

#runObject



27
28
29
30
31
32
33
34
35
# File 'lib/chef/knife/vsphere_vlan_list.rb', line 27

def run
  $stdout.sync = true

  vim = get_vim_connection
  dc = get_datacenter
  dc.network.each do |network|
    puts "#{ui.color("VLAN", :cyan)}: #{network.name}"
  end
end