netconf_edit_config

NETCONF edit config.

Functions

netconf_edit_config(→ nornir.core.task.Result)

Edit configuration of the device using Netconf.

Module Contents

netconf_edit_config.netconf_edit_config(task: nornir.core.task.Task, config: str, target: str | None = 'running', manager: ncclient.manager.Manager | None = None, default_operation: str | None = 'merge') nornir.core.task.Result

Edit configuration of the device using Netconf.

Parameters:
  • config (str) – Configuration snippet to apply

  • target (str) – Target configuration store

  • manager (Manager) – NETCONF Manager

  • default_operation (str) – merge or replace

Examples

Simple example:

> nr.run(task=netconf_edit_config, config=desired_config)

Changing Default Operation:

> nr.run(task=netconf_edit_config, config=desired_config, default_operation="replace")

Changing Default Target of running to candidate:

> nr.run(task=netconf_edit_config, target="candidate", config=desired_config, default_operation="replace")
Returns:

Result object with the following attributes set:

* result (RpcResult): Rpc and Manager