Module: PuppetX::NetDev::EosApi::CommonMethods

Included in:
PuppetX::NetDev::EosApi
Defined in:
lib/puppet_x/net_dev/eos_api/common_methods.rb

Overview

CommonMethods implements common methods, such as returning the running config. This separation makes it easier to provide documentation and introspect where methods come from given an api instance.

Instance Method Summary collapse

Instance Method Details

#running_configString

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns the text of the running configuration.

Returns:

  • (String)

    the text of the running configuration



17
18
19
20
21
22
23
# File 'lib/puppet_x/net_dev/eos_api/common_methods.rb', line 17

def running_config
  prefix = %w(enable)
  cmd = 'show running-config'
  msg = 'show running configuration'
  result = eapi_action([*prefix, cmd], msg, format: 'text')
  result.last['output']
end