Module: Junos::Ez::Vlans

Defined in:
lib/junos-ez/vlans.rb

Defined Under Namespace

Classes: Provider

Constant Summary collapse

PROPERTIES =
[
   :vlan_id,                  # Fixnum, [ 1 .. 4094 ]
   :description,              # String, description
   :no_mac_learning,          # [ true | nil ] - used to disable MAC-address learning
   :interfaces,               # READ-ONLY, array of bound interface names
]

Class Method Summary collapse

Class Method Details

.Provider(ndev, varsym) ⇒ Object



12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/junos-ez/vlans.rb', line 12

def self.Provider( ndev, varsym )        
  newbie = case ndev.fact :switch_style
  when :VLAN, :VLAN_NG
    Junos::Ez::Vlans::Provider::VLAN.new( ndev )
  when :BRIDGE_DOMAIN
    Junos::Ez::Vlans::Provider::BRIDGE_DOMAIN.new( ndev )     
  else
    raise Junos::Ez::NoProviderError, "target does not support vlan bridges"
  end      
  newbie.properties = Junos::Ez::Provider::PROPERTIES + PROPERTIES
  Junos::Ez::Provider.attach_instance_variable( ndev, varsym, newbie )
end