salt.proxy.restconf

Proxy Minion to manage RESTCONF Devices

codeauthor:

Jamie (Bear) Murphy <jamiemurphyit@gmail.com>

maturity:

new

platform:

any

Usage

Note

To be able to use this module you need to enable RESTCONF on your device and have https enabled.

Cisco Configuration example:

switch# conf t
switch(config)# restconf
switch(config)# ip http secure-server

Note

RESTCONF requires modern OS distributions. This plugin has been written specifically to use JSON RESTCONF endpoints

Pillar

The restconf proxy configuration requires the following parameters in order to connect to the network switch:

transport: https (str)

Specifies the type of connection transport to use. Valid values for the connection are https, and http. The RESTCONF standard explicitly requires https, but http is included as an option as some manufacturers have ignored this requirement.

hostname: (str)

The IP address or DNS host name of the RESTCONF device.

username: (str)

The username for the device to authenticate the RESTCONF requests.

password: (str)

The password for the device to authenticate the RESTCONF requests.

verify: True or False (str, optional, default:true)

Verify the RESTCONF SSL certificate?

When there is no certificate configuration on the device and this option is set as True (default), the commands will fail with the following error: SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed.

Warning

In this case, you either need to configure a proper certificate on the device (recommended), or bypass the checks setting this argument as False with all the security risks considered as you may be MITM'd.

Proxy Pillar Example

proxy:
  proxytype: restconf
  host: switch1.example.com
  username: example
  password: example
  verify: false
salt.proxy.restconf.connection_test()

Runs a connection test via http/https. Returns an array.

salt.proxy.restconf.init(opts)

Required. Initialize device config and test an initial connection

salt.proxy.restconf.initialized()

Connection finished initializing?

salt.proxy.restconf.ping()

Triggers connection test. Returns True or False

salt.proxy.restconf.request(path, method='GET', dict_payload=None)

Trigger http request to device

salt.proxy.restconf.shutdown(opts)

Closes connection with the device.