Method: Rbeapi::Api::OspfInterfaces#get

Defined in:
lib/rbeapi/api/ospf.rb

#get(name) ⇒ nil, Hash<String, String>

Returns a single MLAG interface configuration.

Example

{
   network_type: <string>
}

Parameters:

  • name (String)

    The interface name to return the configuration values for. This must be the full interface identifier.

Returns:

  • (nil, Hash<String, String>)

    A Ruby hash that represents the MLAG interface configuration. A nil object is returned if the specified interface is not configured



388
389
390
391
392
393
394
395
396
397
398
399
# File 'lib/rbeapi/api/ospf.rb', line 388

def get(name)
  config = get_block("interface #{name}")
  return nil unless config
  unless /no switchport$/ =~ config || /^interface (Lo|Vl)/ =~ config
    return nil
  end

  response = {}
  nettype = /ip ospf network point-to-point/ =~ config
  response[:network_type] = nettype.nil? ? 'broadcast' : 'point-to-point'
  response
end