cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1090
Views
5
Helpful
1
Replies

call get-modification on instance using restconf

Hello team,

how could I call "get-modications" on an instance using resconf api?

 

regards.

 

 

1 Accepted Solution

Accepted Solutions

Nabsch
Spotlight
Spotlight

Hello Mamadou,

 

I give an example using l3vpn package

 

 

vpn l3vpn test-nestim
endpoint A
as-number 64512
ce device NETSIM-TEST-1
pe device NETSIM-TEST-0
!
!
admin@ncs# show running-config vpn l3vpn | display restconf
/restconf/data/l3vpn:vpn/l3vpn=test-nestim/endpoint=A/as-number 64512
/restconf/data/l3vpn:vpn/l3vpn=test-nestim/endpoint=A/ce/device NETSIM-TEST-1
/restconf/data/l3vpn:vpn/l3vpn=test-nestim/endpoint=A/pe/device NETSIM-TEST-0
 
You have to replace /data by /operations and add /get-modifcations at the end of the URL .  In order to use the operations , you should use the POST Method 

 

 

curl -X POST -u admin:admin http://localhost:8080/restconf/operations/l3vpn:vpn/l3vpn=test-nestim/get-modifications
<output xmlns='http://com/example/l3vpn'>
<cli>
<local-node>
<data> devices {
device NETSIM-TEST-0 {
config {
vrf {
+ definition test-nestim {
+ rd 64512:1;
+ route-target {
+ export 64512:1;
+ import 64512:1;
+ }
+ }
}
}
}
device NETSIM-TEST-1 {
config {
router {
+ bgp 64512 {
+ redistribute {
+ connected {
+ }
+ }
+ }
}
}
}
}
</data>
</local-node>
</cli>
</output>
 
Best Regards,
 
Nabil

View solution in original post

1 Reply 1

Nabsch
Spotlight
Spotlight

Hello Mamadou,

 

I give an example using l3vpn package

 

 

vpn l3vpn test-nestim
endpoint A
as-number 64512
ce device NETSIM-TEST-1
pe device NETSIM-TEST-0
!
!
admin@ncs# show running-config vpn l3vpn | display restconf
/restconf/data/l3vpn:vpn/l3vpn=test-nestim/endpoint=A/as-number 64512
/restconf/data/l3vpn:vpn/l3vpn=test-nestim/endpoint=A/ce/device NETSIM-TEST-1
/restconf/data/l3vpn:vpn/l3vpn=test-nestim/endpoint=A/pe/device NETSIM-TEST-0
 
You have to replace /data by /operations and add /get-modifcations at the end of the URL .  In order to use the operations , you should use the POST Method 

 

 

curl -X POST -u admin:admin http://localhost:8080/restconf/operations/l3vpn:vpn/l3vpn=test-nestim/get-modifications
<output xmlns='http://com/example/l3vpn'>
<cli>
<local-node>
<data> devices {
device NETSIM-TEST-0 {
config {
vrf {
+ definition test-nestim {
+ rd 64512:1;
+ route-target {
+ export 64512:1;
+ import 64512:1;
+ }
+ }
}
}
}
device NETSIM-TEST-1 {
config {
router {
+ bgp 64512 {
+ redistribute {
+ connected {
+ }
+ }
+ }
}
}
}
}
</data>
</local-node>
</cli>
</output>
 
Best Regards,
 
Nabil

Polls
AI-powered tools for network troubleshooting are likely to be part of everyone’s workflow sooner or later. What is the single biggest challenge or concern you see with adopting these tools in your organization?