Method: Rbeapi::Api::Bgp#get

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

#getnil, Hash<Symbol, Object>

get returns the BGP routing configuration from the nodes current configuration.

Returns:

  • (nil, Hash<Symbol, Object>)

    Returns the BGP resource as a Hash.



56
57
58
59
60
61
62
63
64
65
66
# File 'lib/rbeapi/api/bgp.rb', line 56

def get
  config = get_block('^router bgp .*')
  return {} unless config

  response = Bgp.parse_bgp_as(config)
  response.merge!(parse_router_id(config))
  response.merge!(parse_shutdown(config))
  response.merge!(parse_networks(config))
  response[:neighbors] = @neighbors.getall
  response
end