07-06-2021 06:57 PM
Using postman I created a post request with to the url https://ios-xe-mgmt.cisco.com:9443/restconf/data/ieft-interfaces:interfaces with basic authentication of username: developer, password: C1sco12345, header of Content-Type: application/yang-data+json, and a body of {
"ieft-interfaces:interface": {
"name": "Loopback100",
"description": "What's up",
"type": "iana-if-type:softwareLoopback",
"enabled": true,
"ietf-ip:ipv4": {
"address": [
{
"ip": "172.16.100.1",
"netmask": "255.255.255.255"
}
]
}
}
}
but I get a URI keypath not found error
{
"errors": {
"error": [
{
"error-message": "uri keypath not found",
"error-tag": "invalid-value",
"error-type": "application"
}
]
}
}
Any help would be much appreciated
Solved! Go to Solution.
07-07-2021 06:11 AM
@dmyooran71221 I ran a POST request using
https://ios-xe-mgmt.cisco.com:9443/restconf/data/ietf-interfaces:interfaces
The error you have would indicate that you have a misinformed or wrong URI, but from what you have pasted this looks ok.
{ "ieft-interfaces:interface": { "name": "Loopback100", "description": "What's up", "type": "iana-if-type:softwareLoopback", "enabled": true, "ietf-ip:ipv4": { "address": [ { "ip": "172.16.100.1", "netmask": "255.255.255.255" } ] } } }
csr1000v-1#sh ip int brief Interface IP-Address OK? Method Status Protocol GigabitEthernet1 10.10.20.48 YES NVRAM up up GigabitEthernet2 unassigned YES NVRAM administratively down down GigabitEthernet3 unassigned YES NVRAM administratively down down Loopback100 172.16.100.1 YES other up up csr1000v-1# csr1000v-1# csr1000v-1#sh run int lo100 Building configuration... Current configuration : 93 bytes ! interface Loopback100 description What's up ip address 172.16.100.1 255.255.255.255 end
I could remove this with
https://ios-xe-mgmt.cisco.com:9443/restconf/data/ietf-interfaces:interfaces/interface=Loopback100
csr1000v-1#sh ip int brief Interface IP-Address OK? Method Status Protocol GigabitEthernet1 10.10.20.48 YES NVRAM up up GigabitEthernet2 unassigned YES NVRAM administratively down down GigabitEthernet3 unassigned YES NVRAM administratively down down
Hope this helps.
07-07-2021 06:11 AM
@dmyooran71221 I ran a POST request using
https://ios-xe-mgmt.cisco.com:9443/restconf/data/ietf-interfaces:interfaces
The error you have would indicate that you have a misinformed or wrong URI, but from what you have pasted this looks ok.
{ "ieft-interfaces:interface": { "name": "Loopback100", "description": "What's up", "type": "iana-if-type:softwareLoopback", "enabled": true, "ietf-ip:ipv4": { "address": [ { "ip": "172.16.100.1", "netmask": "255.255.255.255" } ] } } }
csr1000v-1#sh ip int brief Interface IP-Address OK? Method Status Protocol GigabitEthernet1 10.10.20.48 YES NVRAM up up GigabitEthernet2 unassigned YES NVRAM administratively down down GigabitEthernet3 unassigned YES NVRAM administratively down down Loopback100 172.16.100.1 YES other up up csr1000v-1# csr1000v-1# csr1000v-1#sh run int lo100 Building configuration... Current configuration : 93 bytes ! interface Loopback100 description What's up ip address 172.16.100.1 255.255.255.255 end
I could remove this with
https://ios-xe-mgmt.cisco.com:9443/restconf/data/ietf-interfaces:interfaces/interface=Loopback100
csr1000v-1#sh ip int brief Interface IP-Address OK? Method Status Protocol GigabitEthernet1 10.10.20.48 YES NVRAM up up GigabitEthernet2 unassigned YES NVRAM administratively down down GigabitEthernet3 unassigned YES NVRAM administratively down down
Hope this helps.
07-07-2021 02:05 PM
Tried it again today and it worked might be an issue with postman I think. Thanks for your help!!
07-07-2021 10:42 AM
Can you try this with YANGSuite-RESTCONF plugin instead of Postman ? Is the same happen ?
07-07-2021 02:52 PM - edited 07-07-2021 02:55 PM
I was actually wondering how I can get the YANGSuite-RESTCONF plugin the install only come with the NETCONF plugin and I don't see it available to install under admin->manage plugins. I download YANGSuite through pip on windows.
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