salt.proxy.napalm

NAPALM

Proxy minion for managing network devices via NAPALM library.

codeauthor:Mircea Ulinic <mircea@cloudflare.com> & Jerome Fleury <jf@cloudflare.com>
maturity:new
depends:napalm
platform:linux

Pillar

The napalm proxy configuration requires four mandatory parameters in order to connect to the network device:

  • driver: specifies the network device operating system. For a complete list of the supported operating systems please refer to the NAPALM Read the Docs page.
  • host: hostname
  • username: username to be used when connecting to the device
  • passwd: the password needed to establish the connection

Example:

proxy:
    proxytype: napalm
    driver: junos
    host: core05.nrt02
    username: my_username
    passwd: my_password

NAPALM Salt documentation

For futher documentation and usage examples, please check the dedicated NAPALM Salt reference in NAPALM Automation community.

salt.proxy.napalm.call(method, **params)

Calls a specific method from the network driver instance. Please check the readthedocs page for the updated list of getters.

Parameters:
  • method -- specifies the name of the method to be called
  • params -- contains the mapping between the name and the values of the parameters needed to call the method
Returns:

A dictionary with three keys:

  • result (True/False): if the operation succeeded
  • out (object): returns the object as-is from the call
  • comment (string): provides more details in case the call failed

Example:

__proxy__['napalm.call']('cli'
                         **{
                            'commands': [
                                'show version',
                                'show chassis fan'
                            ]
                         })
salt.proxy.napalm.init(opts)

Opens the connection with the network device.

salt.proxy.napalm.ping()

Connection open successfully?

salt.proxy.napalm.shutdown(opts)

Closes connection with the device.