Method: Rbeapi::Api::OspfInterfaces#getall

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

#getallnil, Hash<String, String>

Returns the collection of MLAG interfaces as a hash index by the interface name.

Example

{
  <name>: {
    network_type: <string>
  },
  <name>: {
    network_type: <string>
  },
  ...
}

Returns:

  • A Ruby hash that represents the MLAG interface configuration. A nil object is returned if no interfaces are configured.



419
420
421
422
423
424
425
# File 'lib/rbeapi/api/ospf.rb', line 419

def getall
  interfaces = config.scan(/(?<=interface\s)[Et|Po|Lo|Vl].+/)
  interfaces.each_with_object({}) do |intf, hsh|
    values = get(intf)
    hsh[intf] = values if values
  end
end