Class: Rbeapi::Api::VlanInterface
- Inherits:
-
BaseInterface
- Object
- Entity
- BaseInterface
- Rbeapi::Api::VlanInterface
- Defined in:
- lib/rbeapi/api/interfaces.rb
Overview
The VlanInterface class manages all Vlan interfaces on an EOS node.
Constant Summary
Constants inherited from BaseInterface
BaseInterface::DEFAULT_INTF_DESCRIPTION, BaseInterface::DEFAULT_INTF_ENCAPSULATION, BaseInterface::DEFAULT_LOAD_INTERVAL
Instance Attribute Summary
Attributes inherited from Entity
Instance Method Summary collapse
-
#get(name) ⇒ nil, Hash<String, String>
Returns the Vlan interface configuration as a Ruby hash of key/value pairs from the nodes running configuration.
-
#set_autostate(name, opts = {}) ⇒ Boolean
set_autostate configures the autostate on a vlan interface.
Methods inherited from BaseInterface
#create, #default, #delete, #set_description, #set_encapsulation, #set_load_interval, #set_shutdown
Methods inherited from Entity
#command_builder, #configure, #configure_interface, #get_block, #initialize, instance
Constructor Details
This class inherits a constructor from Rbeapi::Api::Entity
Instance Method Details
#get(name) ⇒ nil, Hash<String, String>
Returns the Vlan interface configuration as a Ruby hash of key/value pairs from the nodes running configuration. This method extends the BaseInterface get method and adds the Vlan specific attributes to the hash.
1483 1484 1485 1486 1487 1488 1489 1490 1491 |
# File 'lib/rbeapi/api/interfaces.rb', line 1483 def get(name) config = get_block("interface #{name}") return nil unless config response = super(name) response[:type] = 'vlan' response.merge!(parse_autostate(config)) response end |
#set_autostate(name, opts = {}) ⇒ Boolean
set_autostate configures the autostate on a vlan interface. Default value is true, if set to false ‘no autostate’ is configured on the interface.
1530 1531 1532 1533 1534 1535 1536 1537 |
# File 'lib/rbeapi/api/interfaces.rb', line 1530 def set_autostate(name, opts = {}) commands = if opts[:value] == :false command_builder('no autostate') else command_builder('autostate') end configure_interface(name, commands) end |