class VCenterDriver::NetworkFolder
Class NetworkFolder
Attributes
Public Class Methods
Public Instance Methods
Source
# File lib/network.rb, line 41 def fetch! VIClient.get_entities(@item, 'Network').each do |item| item_name = item._ref @items[item_name.to_sym] = PortGroup.new(item) end VIClient .get_entities( @item, 'DistributedVirtualPortgroup' ).each do |item| item_name = item._ref @items[item_name.to_sym] = DistributedPortGroup.new(item) end VIClient .get_entities( @item, 'VmwareDistributedVirtualSwitch' ).each do |item| item_name = item._ref @items[item_name.to_sym] = DistributedVirtualSwitch.new(item) end VIClient.get_entities(@item, 'OpaqueNetwork').each do |item| item_name = item._ref @items[item_name.to_sym] = OpaqueNetwork.new(item) end end
Builds a hash with Network-Ref / Network
to be used as a cache @return [Hash] in the form
{ ds_ref [Symbol] => Network object }
Source
# File lib/network.rb, line 76 def get(ref) if !@items[ref.to_sym] rbvmomi_net = RbVmomi::VIM::Network.new(@item._connection, ref) @items[ref.to_sym] = Network.new(rbvmomi_net) end @items[ref.to_sym] end
Returns a Network
. Uses the cache if available. @param ref [Symbol] the vcenter ref @return Network