Class: VCenterDriver::NetworkFolder
- Inherits:
-
Object
- Object
- VCenterDriver::NetworkFolder
- Defined in:
- lib/network.rb
Overview
Class NetworkFolder
Instance Attribute Summary collapse
-
#item ⇒ Object
Returns the value of attribute item.
-
#items ⇒ Object
Returns the value of attribute items.
Instance Method Summary collapse
-
#fetch! ⇒ Hash
Builds a hash with Network-Ref / Network to be used as a cache.
-
#get(ref) ⇒ Object
Returns a Network.
-
#initialize(item) ⇒ NetworkFolder
constructor
A new instance of NetworkFolder.
Constructor Details
#initialize(item) ⇒ NetworkFolder
Returns a new instance of NetworkFolder.
31 32 33 34 |
# File 'lib/network.rb', line 31 def initialize(item) @item = item @items = {} end |
Instance Attribute Details
#item ⇒ Object
Returns the value of attribute item.
29 30 31 |
# File 'lib/network.rb', line 29 def item @item end |
#items ⇒ Object
Returns the value of attribute items.
29 30 31 |
# File 'lib/network.rb', line 29 def items @items end |
Instance Method Details
#fetch! ⇒ Hash
Builds a hash with Network-Ref / Network to be used as a cache
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
# 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 |