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

NSO RESTCONF API end-points to create dry-run reverse native configuration

beasleyjon
Level 1
Level 1

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"
                }
            ]
        }
    }
}
Now I want to call the end-point to generated the reverse native config.
What query parameters in the URL should I use to do this?
2 Replies 2

gmuloche
Cisco Employee
Cisco Employee

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

 

Thankyou for your reply.

I checked it out and it works - thanks.