edit_config
nornir_scrapli.tasks.netconf_edit_config
netconf_edit_config(task: Task, config: str, dry_run: Optional[bool] = None, diff: bool = False, target: str = 'running') -> Result
¶
Edit config from the device with scrapli_netconf
Parameters:
Name | Type | Description | Default |
---|---|---|---|
task |
Task
|
nornir task object |
required |
config |
str
|
configuration to send to device |
required |
dry_run |
Optional[bool]
|
if True config will be pushed and then discarded; will discard anything already pushed that has not been committed already, so be careful! :D; also note that this will only work if there is a candidate datastore -- meaning that, for example, with IOSXE with a target of "running" there is no way to discard the configuration as it will already have been written to the running datastore |
None
|
diff |
bool
|
capture/set diff of target datastore xml text of before/after edit config operation |
False
|
target |
str
|
configuration source to target; running|startup|candidate |
'running'
|
Returns:
Name | Type | Description |
---|---|---|
Result |
Result
|
nornir result object with Result.result value set the string result of the get_config operation |
Source code in tasks/netconf/edit_config.py
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 |
|