cancel
Showing results forĀ 
Search instead forĀ 
Did you mean:Ā 
cancel
2720
Views
11
Helpful
4
Replies

Getting uri keypath not found error when trying to access Cisco-IOS-XE-native:native/interface API

mohanconnects
Level 1
Level 1

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"
      }
    ]
  }
}
since not getting individual interface interface response, unable to configure the interface. 
How to get the individual interface details &  configure interface ?
 
Thanks,
Mohan
1 Accepted Solution

Accepted Solutions

yangorelik
Spotlight
Spotlight

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

Yan Gorelik
YDK Solutions

View solution in original post

4 Replies 4

yangorelik
Spotlight
Spotlight

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

Yan Gorelik
YDK Solutions

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

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