cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1297
Views
5
Helpful
2
Replies

Restconf apply-template dry-run

tsiemers1
Spotlight
Spotlight

Does the dry-run query work with the apply-template action? Trying to run via restconf and do something similar to this:

devices device lab1 apply-template template-name test
commit dry-run

https://<NSO_HOST>/restconf/data/tailf-ncs:devices/device=lab1/apply-template/?dryrun=native

 

Body:

 

{
"template-name": "test"
}

 

Commits the config and doesn't return a dry-run.

 

1 Accepted Solution

Accepted Solutions

vleijon
Cisco Employee
Cisco Employee
It will not work, an action is not an edit-config so commit parameters do not apply to them (and in general it is not clear that you would want it to).

I have seen a request in the past to add this capability to the apply-template action, but I have no idea if that is being actively planned.

It would be possible to create your own action wrapper if this is an urgent need for you.

View solution in original post

2 Replies 2

vleijon
Cisco Employee
Cisco Employee
It will not work, an action is not an edit-config so commit parameters do not apply to them (and in general it is not clear that you would want it to).

I have seen a request in the past to add this capability to the apply-template action, but I have no idea if that is being actively planned.

It would be possible to create your own action wrapper if this is an urgent need for you.

Thanks for the fast reply. I was just curious if this was possible. For our use case, we don't need it and I guess if you really did you could just use config-template and see the dry-run. Just nice sometimes to push commands via apply-template on the fly and the cli makes it easy to do a 'commit dry-run'.