Class: Chef::Knife::VcNetworkShow

Inherits:
Chef::Knife show all
Includes:
VcCommon, VcNetworkCommon
Defined in:
lib/chef/knife/network/vc_network_show.rb

Instance Method Summary collapse

Methods included from VcNetworkCommon

#get_network

Methods included from VcCommon

#connection, #deprecation_msg, #generate_key, #get_password, included, #locate_config_value, #locate_org_option, #notice_msg, #out_msg, #pretty_symbol, #sort_by_key, #store_config, #store_password, #wait_task

Instance Method Details

#runObject



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

def run
  $stdout.sync = true

  network_arg = @name_args.shift
  connection.
  network = get_network(network_arg)
  connection.logout

  out_msg('ID', network[:id])
  out_msg('Name', network[:name])
  out_msg('Description', network[:description])
  out_msg('Gateway', network[:gateway])
  out_msg('Netmask', network[:netmask])
  out_msg('Fence mode', network[:fence_mode])
  out_msg('IP Range', "#{network[:start_address]} - #{network[:end_address]}")
end