netconf_get_config

NETCONF get config.

Functions

netconf_get_config(→ nornir.core.task.Result)

Get configuration over Netconf from device.

Module Contents

netconf_get_config.netconf_get_config(task: nornir.core.task.Task, source: str | None = 'running', path: str | None = '', filter_type: str | None = 'xpath') nornir.core.task.Result

Get configuration over Netconf from device.

Parameters:
  • source (Optional[str]) – Configuration datastore to collect from. Defaults to running

  • path (Optional[str]) – Subtree or xpath to filter. Defaults to ‘’

  • filter_type (Optional[str]) – Type of filtering to use, ‘xpath’ or ‘subtree’. Defaults to xpath

Examples

Simple example:

> nr.run(task=netconf_get_config)

Collect startup config:

> nr.run(task=netconf_get_config, source="startup")

Passing options using xpath:

> xpath = "/devices/device"
> nr.run(task=netconf_get_config,
>        path=xpath)

Passing options using subtree:

> subtree = "<interfaces></interface>"
> nr.run(task=netconf_get_config,
>        filter_type="subtree",
>        path=subtree)
Returns:

Result object with the following attributes set:

* result (RpcResult): Rpc and Manager