10-01-2019 02:34 AM
Hi,
I am using the RESTCONF API of NSO to create dry-run configurations in the native device format.
For example, using postman, the following call to my service end-points works fine:
http://localhost:8080/restconf/data/services/attachment/pe=asr9006a/tagged-attachment/interface=GigabitEthernet,0%2F3%2F0%2F8?dryrun=native
And produces the following JSON output:
{ "dryrun-result": { "native": { "device": [ { "name": "asr9006a", "data": "interface GigabitEthernet 0/3/0/8\n mtu 1500\nexit\n" } ] } } }
10-02-2019 01:26 AM
Hello,
there is a query parameter you can use: dry-run-reverse.
According to the documentation (you can find it in REST Query Parameter):
Used together with the dry-run=native parameter to display the device commands for getting back to the current running state in the network if the commit is successfully executed. Beware that if any changes are done later on the same data the reverse device commands returned are invalid.
Your request would look like:
http://localhost:8080/restconf/data/services/attachment/pe=asr9006a/tagged-attachment/interface=GigabitEthernet,0%2F3%2F0%2F8?dry-run=native&dry-run-reverse
Note: while dryrun seems to work in your example I have seen dry-run in the documentation
10-02-2019 11:57 AM
Thankyou for your reply.
I checked it out and it works - thanks.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide