Method: Rbeapi::Api::BaseInterface#set_encapsulation
- Defined in:
- lib/rbeapi/api/interfaces.rb
#set_encapsulation(name, opts = {}) ⇒ Boolean
set_encapsulation configures the VLAN ID value for the specified interface name in the nodes running configuration. If the enable keyword is false then the encapsulation value is negated using the no keyword. If the default keyword is set to true, then the encapsulation value is defaulted using the default keyword. The default keyword takes precedence over the enable keyword if both are provided.
373 374 375 376 377 378 379 380 381 382 383 384 |
# File 'lib/rbeapi/api/interfaces.rb', line 373 def set_encapsulation(name, opts = {}) unless name =~ /\./ raise ArgumentError, 'Parameter encapsulation can be set only on '\ 'subinterfaces' end unless name.downcase =~ /et|po/ raise ArgumentError, 'Parameter encapsulation can be set only on '\ 'Ethernet and PostChannel interfaces' end commands = command_builder('encapsulation dot1q vlan', opts) configure_interface(name, commands) end |