12-10-2020 05:25 AM - edited 12-10-2020 04:05 PM
Hello,
Learning about configuring cat9k switch using RESTCONF protocol using below document
Session Presentation (ciscolive.com)
Using postman tool for sending request.
Stuck at configuring interface, below provided steps followed
I could able to get the list of interfaces using below API
https://192.168.43.2/restconf/data/Cisco-IOS-XE-native:native/interface
{ "Cisco-IOS-XE-native:interface": { "GigabitEthernet": [ { "name": "0/0", "vrf": { "forwarding": "Mgmt-vrf" }, "ip": { "address": { "primary": { "address": "192.168.43.2", "mask": "255.255.255.0" } } }, "Cisco-IOS-XE-ethernet:negotiation": { "auto": true }, "Cisco-IOS-XE-ethernet:speed": { "value-1000": [ null ] } }, { "name": "1/0/1", "switchport-conf": { "switchport": false }, "ip": { "address": { "primary": { "address": "192.168.43.5", "mask": "255.255.255.0" } } } }, { "name": "1/0/10" }, { "name": "1/0/11", "switchport-conf": { "switchport": false }, "ip": { "address": { "primary": { "address": "10.1.1.2", "mask": "255.255.255.0" } } } }, "ip": { "address": { "primary": { "address": "30.1.1.1", "mask": "255.255.255.0" } }, "Cisco-IOS-XE-flow:flow": { "monitor": [ { "name": "monitor-nfv9", "input": [ null ] } ] } } } ], "TenGigabitEthernet": [ { "name": "1/1/1" }, { "name": "1/1/2" } ], "FortyGigabitEthernet": [ { "name": "1/1/1" }, { "name": "1/1/2" } ], "Vlan": [ { "name": 1, "shutdown": [ null ], "ip": { "no-address": { "address": false } } } ] } }
So to drill down and view interface 0/0 details, used below GET request in postman
https://192.168.43.2/restconf/data/Cisco-IOS-XE-native:native/interface/GigabitEthernet=0/0
but getting uri keypath not found error.
{ "errors": { "error": [ { "error-message": "uri keypath not found", "error-tag": "invalid-value", "error-type": "application" } ] } }
Solved! Go to Solution.
12-10-2020 04:16 PM
Hi Mohan
The issue here is that your parameter "0/0" contains special character '/', which is treated in URL as separator. In this case it must be replaced with corresponding sequence "%2F". Hence your command should be:
https://192.168.43.2/restconf/data/Cisco-IOS-XE-native:native/interface/GigabitEthernet=0%2F0
More about special characters you can find in RFC-3986.
12-10-2020 04:16 PM
Hi Mohan
The issue here is that your parameter "0/0" contains special character '/', which is treated in URL as separator. In this case it must be replaced with corresponding sequence "%2F". Hence your command should be:
https://192.168.43.2/restconf/data/Cisco-IOS-XE-native:native/interface/GigabitEthernet=0%2F0
More about special characters you can find in RFC-3986.
12-10-2020 04:56 PM
Hi Yan Gorelik,
That worked great, please share if there any Cisco document available for how to create URI from yang model for all methods
Thanks,
Mohan
09-20-2022 10:25 AM
Hello Sir, I am facing a problem , please help me.
I want to configure DHCP server , but its showing "uri path not found"
using this url
09-21-2022 03:31 PM
Based on IOS XE native model, the URI should be:
https://192.168.231.192/restconf/data/Cisco-IOS-XE-native:native/ip/dhcp
or
https://192.168.231.192/restconf/data/Cisco-IOS-XE-native:native/ipv6/dhcp
Yan
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