Class: Rbeapi::Api::Mlag
Overview
The Mlag class provides a configuration instance for working with the global MLAG configuration of the node.
Constant Summary collapse
- DEFAULT_DOMAIN_ID =
''.freeze
- DEFAULT_LOCAL_INTF =
''.freeze
- DEFAULT_PEER_ADDR =
''.freeze
- DEFAULT_PEER_LINK =
''.freeze
Instance Attribute Summary
Attributes inherited from Entity
Instance Method Summary collapse
-
#get ⇒ nil, Hash<Symbol, Object] returns the nodes current running configuration as a Hash. If mlag is not configured on the node this method will return nil.
get scans the current nodes configuration and returns the values as a Hash describing the current state.
-
#set_domain_id(opts = {}) ⇒ Boolean
set_domain_id configures the mlag domain-id value in the current nodes running configuration.
-
#set_local_interface(opts = {}) ⇒ Boolean
set_local_interface configures the mlag local-interface value in the current nodes running configuration.
-
#set_mlag_id(name, opts = {}) ⇒ Boolean
set_mlag_id configures the mlag id on the interface in the nodes current running configuration.
-
#set_peer_address(opts = {}) ⇒ Boolean
set_peer_address configures the mlag peer-address value in the current nodes running configuration.
-
#set_peer_link(opts = {}) ⇒ Boolean
set_peer_link configures the mlag peer-link value in the current nodes running configuration.
-
#set_shutdown(opts = {}) ⇒ Boolean
set_shutdown configures the administrative state of the mlag process on the current node.
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 ⇒ nil, Hash<Symbol, Object] returns the nodes current running configuration as a Hash. If mlag is not configured on the node this method will return nil.
get scans the current nodes configuration and returns the values as a Hash describing the current state.
78 79 80 81 82 83 84 85 86 87 88 89 |
# File 'lib/rbeapi/api/mlag.rb', line 78 def get config = get_block('mlag configuration') global = {} global.merge!(parse_domain_id(config)) global.merge!(parse_local_interface(config)) global.merge!(parse_peer_address(config)) global.merge!(parse_peer_link(config)) global.merge!(parse_shutdown(config)) { global: global, interfaces: parse_interfaces } end |
#set_domain_id(opts = {}) ⇒ Boolean
set_domain_id configures the mlag domain-id value in the current nodes running configuration. If the enable keyword is false, the the domain-id is configured with the no keyword. If the default keyword is provided, the configuration is defaulted using the default keyword. The default keyword takes precedence over the enable keyword if both options are specified.
Commands
mlag configuration
domain-id <value>
no domain-id
default domain-id
232 233 234 235 236 |
# File 'lib/rbeapi/api/mlag.rb', line 232 def set_domain_id(opts = {}) cmd = command_builder('domain-id', opts) cmds = ['mlag configuration', cmd] configure(cmds) end |
#set_local_interface(opts = {}) ⇒ Boolean
set_local_interface configures the mlag local-interface value in the current nodes running configuration. If the enable keyword is false, the local-interface is configured with the no keyword. If the default keyword is provided, the configuration is defaulted using the default keyword. The default keyword takes precedence over the enable keyword if both options are specified
Commands
mlag configuration
local-interface <value>
no local-interface
default local-interface
267 268 269 270 271 |
# File 'lib/rbeapi/api/mlag.rb', line 267 def set_local_interface(opts = {}) cmd = command_builder('local-interface', opts) cmds = ['mlag configuration', cmd] configure(cmds) end |
#set_mlag_id(name, opts = {}) ⇒ Boolean
set_mlag_id configures the mlag id on the interface in the nodes current running configuration. If the enable keyword is false, then the interface mlag id is configured using the no keyword. If the default keyword is provided and set to true, the interface mlag id is configured using the default keyword. The default keyword takes precedence over the enable keyword if both options are specified
Commands
interface <name>
mlag <value>
no mlag
default mlag
411 412 413 414 |
# File 'lib/rbeapi/api/mlag.rb', line 411 def set_mlag_id(name, opts = {}) cmd = command_builder('mlag', opts) configure_interface(name, cmd) end |
#set_peer_address(opts = {}) ⇒ Boolean
set_peer_address configures the mlag peer-address value in the current nodes running configuration. If the enable keyword is false, then the peer-address is configured with the no keyword. If the default keyword is provided, the configuration is defaulted using the default keyword. The default keyword takes precedence over the enable keyword if both options are specified
Commands
mlag configuration
peer-address <value>
no peer-address
default peer-address
337 338 339 340 341 |
# File 'lib/rbeapi/api/mlag.rb', line 337 def set_peer_address(opts = {}) cmd = command_builder('peer-address', opts) cmds = ['mlag configuration', cmd] configure(cmds) end |
#set_peer_link(opts = {}) ⇒ Boolean
set_peer_link configures the mlag peer-link value in the current nodes running configuration. If enable keyword is false, then the peer-link is configured with the no keyword. If the default keyword is provided, the configuration is defaulted using the default keyword. The default keyword takes precedence over the enable keyword if both options are specified.
Commands
mlag configuration
peer-link <value>
no peer-link
default peer-link
302 303 304 305 306 |
# File 'lib/rbeapi/api/mlag.rb', line 302 def set_peer_link(opts = {}) cmd = command_builder('peer-link', opts) cmds = ['mlag configuration', cmd] configure(cmds) end |
#set_shutdown(opts = {}) ⇒ Boolean
set_shutdown configures the administrative state of the mlag process on the current node. If the enable keyword is true, then mlag is enabled and if the enable keyword is false, then mlag is disabled. If the default keyword is provided, the configuration is defaulted using the default keyword. The default keyword takes precedence over the enable keyword if both options are specified
Commands
mlag configuration
shutdown
no shutdown
default shutdown
369 370 371 372 373 374 375 376 377 |
# File 'lib/rbeapi/api/mlag.rb', line 369 def set_shutdown(opts = {}) raise 'set_shutdown has the value option set' if opts[:value] # Shutdown semantics are opposite of enable semantics so invert enable value = !opts[:enable] opts[:enable] = value cmd = command_builder('shutdown', opts) cmds = ['mlag configuration', cmd] configure(cmds) end |