cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1629
Views
0
Helpful
3
Replies

RESTCONF GET Issue with IOS-XE 5Gig Interfaces

EhsanVessal
Level 1
Level 1

Hey all, I'm having this issue with making REST GET calls. When I make a call in Postman or Python to this device, it works fine:

 

https://host/restconf/data/ietf-interfaces:interfaces/

 

 
 {
        "name": "FiveGigabitEthernet1/0/1",
        "type": "iana-if-type:ethernetCsmacd",
        "enabled": true,
        "ietf-ip:ipv4": {},
        "ietf-ip:ipv6": {}
      },
      {
        "name": "FiveGigabitEthernet1/0/10",
        "type": "iana-if-type:ethernetCsmacd",
        "enabled": true,
        "ietf-ip:ipv4": {},
        "ietf-ip:ipv6": {}
      },
...
...
 {
        "name": "Vlan219",
        "type": "iana-if-type:l3ipvlan",
        "enabled": true,
        "ietf-ip:ipv4": {
          "address": [
            {
              "ip": "10.46.219.60",
              "netmask": "255.255.255.128"
            }
          ]
        },

When I modify the REST URI to focus on a specific VLAN interface, it works fine too:
 
 
{
  "ietf-interfaces:interface": {
    "name": "Vlan219",
    "type": "iana-if-type:l3ipvlan",
    "enabled": true,
    "ietf-ip:ipv4": {
      "address": [
        {
          "ip": "10.46.219.60",
          "netmask": "255.255.255.128"
        }
      ]
    },
    "ietf-ip:ipv6": {}
  }
}
However, if I want to make a GET call to a specific physical interface, it doesn't work for some reason:
 
{
  "errors": {
    "error": [
      {
        "error-message": "uri keypath not found",
        "error-tag": "invalid-value",
        "error-type": "application"
      }
    ]
  }
}
The URI is calling the very first Fi1/0/1 interface that you saw in the very top output. Am I calling the interface incorrectly trying to get its output? What am I doing wrong here?
1 Accepted Solution

Accepted Solutions

EhsanVessal
Level 1
Level 1

Ok figured it out. You have to replace forward-slashes in a call "/" with "%2F", which is needed for URL encoding and is an ASCII character reference. Here is the final correct call:

https://host/restconf/data/ietf-interfaces:interfaces/interface="FiveGigabitEthernet1%2F0%2F10"

 

{
  "ietf-interfaces:interface": {
    "name": "FiveGigabitEthernet1/0/10",
    "type": "iana-if-type:ethernetCsmacd",
    "enabled": true,
    "ietf-ip:ipv4": {},
    "ietf-ip:ipv6": {}
  }
}

View solution in original post

3 Replies 3

EhsanVessal
Level 1
Level 1

Forgot to add, I'm running this on a Cisco 9300 on 16.9.5 code.

EhsanVessal
Level 1
Level 1

Just wanted to bump this and see if anyone had insights?

EhsanVessal
Level 1
Level 1

Ok figured it out. You have to replace forward-slashes in a call "/" with "%2F", which is needed for URL encoding and is an ASCII character reference. Here is the final correct call:

https://host/restconf/data/ietf-interfaces:interfaces/interface="FiveGigabitEthernet1%2F0%2F10"

 

{
  "ietf-interfaces:interface": {
    "name": "FiveGigabitEthernet1/0/10",
    "type": "iana-if-type:ethernetCsmacd",
    "enabled": true,
    "ietf-ip:ipv4": {},
    "ietf-ip:ipv6": {}
  }
}