Open jean-christophe-manciot opened 6 years ago
That doesn't look healthy. I'll investigate.
Cheers,
Einar
Jean-Christophe,
I've had a chance to try out NX-OS 7.0(3)I6(2) on a real N9K, and below is the result of a get against openconfig-interfaces, which, as you can see, looks ok. There is one problem, however, which is the Accept MIME type. I had to use application/yang.data+json
, whereas the RFC defines application/yang-data+json
, which is a pain.
The developers told me that some fixes to the JSON output have gone in. When I look at the output you have above, my first thought was that it was a simple translation of the XML output to JSON.
Are you able to use a newer release?
Cheers,
Einar
22:16 $ curl -k --silent "https://172.19.193.156:443/restconf/data/openconfig-interfaces:interfaces?content=config" -H 'Accept: application/yang.data+json' -u 'admin:cisco'
{
"interfaces" : {
"xmlns" : "http://openconfig.net/yang/interfaces",
"interface" : [
{
"config" : {
"description" : "",
"name" : "vlan1"
},
"name" : "vlan1",
"subinterfaces" : {
"subinterface" : [
{
"index" : "0"
}
]
}
},
{
"config" : {
"description" : "",
"name" : "eth1/39"
},
"name" : "eth1/39",
"subinterfaces" : {
"subinterface" : [
{
"index" : "0"
}
]
}
},
{
"config" : {
"description" : "",
"name" : "eth1/48"
},
"name" : "eth1/48",
"subinterfaces" : {
"subinterface" : [
{
"index" : "0"
}
]
}
},
{
"config" : {
"description" : "",
"name" : "eth1/42"
},
"name" : "eth1/42",
"subinterfaces" : {
"subinterface" : [
{
"index" : "0"
}
]
}
},
{
"config" : {
"description" : "",
"name" : "eth1/37"
},
"name" : "eth1/37",
"subinterfaces" : {
"subinterface" : [
{
"index" : "0"
}
]
}
},
{
"config" : {
"description" : "",
"name" : "eth1/35"
},
"name" : "eth1/35",
"subinterfaces" : {
"subinterface" : [
{
"index" : "0"
}
]
}
},
{
"config" : {
"description" : "",
"name" : "eth1/27"
},
"name" : "eth1/27",
"subinterfaces" : {
"subinterface" : [
{
"index" : "0"
}
]
}
},
{
"config" : {
"description" : "",
"name" : "eth1/3"
},
"name" : "eth1/3",
"subinterfaces" : {
"subinterface" : [
{
"index" : "0"
}
]
}
},
{
"config" : {
"description" : "",
"name" : "eth2/4"
},
"name" : "eth2/4",
"subinterfaces" : {
"subinterface" : [
{
"index" : "0"
}
]
}
},
{
"config" : {
"description" : "",
"name" : "eth2/6"
},
"name" : "eth2/6",
"subinterfaces" : {
"subinterface" : [
{
"index" : "0"
}
]
}
},
{
"config" : {
"description" : "",
"name" : "eth2/10"
},
"name" : "eth2/10",
"subinterfaces" : {
"subinterface" : [
{
"index" : "0"
}
]
}
},
{
"config" : {
"description" : "",
"name" : "eth1/4"
},
"name" : "eth1/4",
"subinterfaces" : {
"subinterface" : [
{
"index" : "0"
}
]
}
},
{
"config" : {
"description" : "",
"name" : "eth1/29"
},
"name" : "eth1/29",
"subinterfaces" : {
"subinterface" : [
{
"index" : "0"
}
]
}
},
{
"config" : {
"description" : "",
"name" : "eth1/47"
},
"name" : "eth1/47",
"subinterfaces" : {
"subinterface" : [
{
"index" : "0"
}
]
}
},
{
"config" : {
"description" : "",
"name" : "eth1/14"
},
"name" : "eth1/14",
"subinterfaces" : {
"subinterface" : [
{
"index" : "0"
}
]
}
},
{
"config" : {
"description" : "",
"name" : "eth1/9"
},
"name" : "eth1/9",
"subinterfaces" : {
"subinterface" : [
{
"index" : "0"
}
]
}
},
{
"config" : {
"description" : "",
"name" : "eth1/7"
},
"name" : "eth1/7",
"subinterfaces" : {
"subinterface" : [
{
"index" : "0"
}
]
}
},
{
"config" : {
"description" : "",
"name" : "eth1/8"
},
"name" : "eth1/8",
"subinterfaces" : {
"subinterface" : [
{
"index" : "0"
}
]
}
},
{
"config" : {
"description" : "",
"name" : "eth1/25"
},
"name" : "eth1/25",
"subinterfaces" : {
"subinterface" : [
{
"index" : "0"
}
]
}
},
{
"config" : {
"description" : "",
"name" : "eth1/18"
},
"name" : "eth1/18",
"subinterfaces" : {
"subinterface" : [
{
"index" : "0"
}
]
}
},
{
"config" : {
"description" : "",
"name" : "eth1/40"
},
"name" : "eth1/40",
"subinterfaces" : {
"subinterface" : [
{
"index" : "0"
}
]
}
},
{
"config" : {
"description" : "",
"name" : "eth1/12"
},
"name" : "eth1/12",
"subinterfaces" : {
"subinterface" : [
{
"index" : "0"
}
]
}
},
{
"config" : {
"description" : "",
"name" : "eth1/36"
},
"name" : "eth1/36",
"subinterfaces" : {
"subinterface" : [
{
"index" : "0"
}
]
}
},
{
"config" : {
"description" : "",
"name" : "eth1/16"
},
"name" : "eth1/16",
"subinterfaces" : {
"subinterface" : [
{
"index" : "0"
}
]
}
},
{
"config" : {
"description" : "",
"name" : "eth1/1"
},
"name" : "eth1/1",
"subinterfaces" : {
"subinterface" : [
{
"index" : "0"
}
]
}
},
{
"config" : {
"description" : "",
"name" : "eth1/10"
},
"name" : "eth1/10",
"subinterfaces" : {
"subinterface" : [
{
"index" : "0"
}
]
}
},
{
"config" : {
"description" : "",
"name" : "eth2/1"
},
"name" : "eth2/1",
"subinterfaces" : {
"subinterface" : [
{
"index" : "0"
}
]
}
},
{
"config" : {
"description" : "",
"name" : "eth1/31"
},
"name" : "eth1/31",
"subinterfaces" : {
"subinterface" : [
{
"index" : "0"
}
]
}
},
{
"config" : {
"description" : "",
"name" : "eth2/5"
},
"name" : "eth2/5",
"subinterfaces" : {
"subinterface" : [
{
"index" : "0"
}
]
}
},
{
"config" : {
"description" : "",
"name" : "eth1/19"
},
"name" : "eth1/19",
"subinterfaces" : {
"subinterface" : [
{
"index" : "0"
}
]
}
},
{
"config" : {
"description" : "",
"name" : "eth1/38"
},
"name" : "eth1/38",
"subinterfaces" : {
"subinterface" : [
{
"index" : "0"
}
]
}
},
{
"config" : {
"description" : "",
"name" : "eth2/8"
},
"name" : "eth2/8",
"subinterfaces" : {
"subinterface" : [
{
"index" : "0"
}
]
}
},
{
"config" : {
"description" : "",
"name" : "eth1/43"
},
"name" : "eth1/43",
"subinterfaces" : {
"subinterface" : [
{
"index" : "0"
}
]
}
},
{
"config" : {
"description" : "",
"name" : "eth1/44"
},
"name" : "eth1/44",
"subinterfaces" : {
"subinterface" : [
{
"index" : "0"
}
]
}
},
{
"config" : {
"description" : "",
"name" : "eth1/5"
},
"name" : "eth1/5",
"subinterfaces" : {
"subinterface" : [
{
"index" : "0"
}
]
}
},
{
"config" : {
"description" : "",
"name" : "eth1/34"
},
"name" : "eth1/34",
"subinterfaces" : {
"subinterface" : [
{
"index" : "0"
}
]
}
},
{
"config" : {
"description" : "",
"name" : "eth1/23"
},
"name" : "eth1/23",
"subinterfaces" : {
"subinterface" : [
{
"index" : "0"
}
]
}
},
{
"config" : {
"description" : "",
"name" : "eth1/21"
},
"name" : "eth1/21",
"subinterfaces" : {
"subinterface" : [
{
"index" : "0"
}
]
}
},
{
"config" : {
"description" : "",
"name" : "eth1/28"
},
"name" : "eth1/28",
"subinterfaces" : {
"subinterface" : [
{
"index" : "0"
}
]
}
},
{
"config" : {
"description" : "",
"name" : "eth1/22"
},
"name" : "eth1/22",
"subinterfaces" : {
"subinterface" : [
{
"index" : "0"
}
]
}
},
{
"config" : {
"description" : "",
"name" : "eth1/24"
},
"name" : "eth1/24",
"subinterfaces" : {
"subinterface" : [
{
"index" : "0"
}
]
}
},
{
"config" : {
"description" : "",
"name" : "eth2/7"
},
"name" : "eth2/7",
"subinterfaces" : {
"subinterface" : [
{
"index" : "0"
}
]
}
},
{
"config" : {
"description" : "",
"name" : "eth1/33"
},
"name" : "eth1/33",
"subinterfaces" : {
"subinterface" : [
{
"index" : "0"
}
]
}
},
{
"config" : {
"description" : "",
"name" : "eth1/11"
},
"name" : "eth1/11",
"subinterfaces" : {
"subinterface" : [
{
"index" : "0"
}
]
}
},
{
"config" : {
"description" : "",
"name" : "eth1/41"
},
"name" : "eth1/41",
"subinterfaces" : {
"subinterface" : [
{
"index" : "0"
}
]
}
},
{
"config" : {
"description" : "",
"name" : "eth1/13"
},
"name" : "eth1/13",
"subinterfaces" : {
"subinterface" : [
{
"index" : "0"
}
]
}
},
{
"config" : {
"description" : "",
"name" : "eth1/45"
},
"name" : "eth1/45",
"subinterfaces" : {
"subinterface" : [
{
"index" : "0"
}
]
}
},
{
"config" : {
"description" : "",
"name" : "eth1/2"
},
"name" : "eth1/2",
"subinterfaces" : {
"subinterface" : [
{
"index" : "0"
}
]
}
},
{
"config" : {
"description" : "",
"name" : "eth2/12"
},
"name" : "eth2/12",
"subinterfaces" : {
"subinterface" : [
{
"index" : "0"
}
]
}
},
{
"config" : {
"description" : "",
"name" : "eth1/17"
},
"name" : "eth1/17",
"subinterfaces" : {
"subinterface" : [
{
"index" : "0"
}
]
}
},
{
"config" : {
"description" : "",
"name" : "eth2/11"
},
"name" : "eth2/11",
"subinterfaces" : {
"subinterface" : [
{
"index" : "0"
}
]
}
},
{
"config" : {
"description" : "",
"name" : "eth1/46"
},
"name" : "eth1/46",
"subinterfaces" : {
"subinterface" : [
{
"index" : "0"
}
]
}
},
{
"config" : {
"description" : "",
"name" : "eth2/2"
},
"name" : "eth2/2",
"subinterfaces" : {
"subinterface" : [
{
"index" : "0"
}
]
}
},
{
"config" : {
"description" : "",
"name" : "eth1/20"
},
"name" : "eth1/20",
"subinterfaces" : {
"subinterface" : [
{
"index" : "0"
}
]
}
},
{
"config" : {
"description" : "",
"name" : "eth2/9"
},
"name" : "eth2/9",
"subinterfaces" : {
"subinterface" : [
{
"index" : "0"
}
]
}
},
{
"config" : {
"description" : "",
"name" : "eth1/6"
},
"name" : "eth1/6",
"subinterfaces" : {
"subinterface" : [
{
"index" : "0"
}
]
}
},
{
"config" : {
"description" : "",
"name" : "eth1/26"
},
"name" : "eth1/26",
"subinterfaces" : {
"subinterface" : [
{
"index" : "0"
}
]
}
},
{
"config" : {
"description" : "",
"name" : "eth2/3"
},
"name" : "eth2/3",
"subinterfaces" : {
"subinterface" : [
{
"index" : "0"
}
]
}
},
{
"config" : {
"description" : "",
"name" : "eth1/15"
},
"name" : "eth1/15",
"subinterfaces" : {
"subinterface" : [
{
"index" : "0"
}
]
}
},
{
"config" : {
"description" : "",
"name" : "eth1/32"
},
"name" : "eth1/32",
"subinterfaces" : {
"subinterface" : [
{
"index" : "0"
}
]
}
},
{
"config" : {
"description" : "",
"name" : "eth1/30"
},
"name" : "eth1/30",
"subinterfaces" : {
"subinterface" : [
{
"index" : "0"
}
]
}
}
]
}
}
22:17 $
Hey Einar, Thanks for taking a look at this issue. Unfortunately, I have no access to physical NX-OS, and my NX-OSv 9k rely on VIRL releases. Due to a current issue with VIRL, I am currently unable to upgrade it to get the latest NX-OSv 9k image. (VIRL has been recently upgraded to a new version which is incompatible with the previous one, the latter being now unusable). Since there is also no NX-OSv 9k image available in the download section of the VIRL account, I am stuck with the old 7.0(3)I6(1).
Hello @einarnn With: NX-OSv9K 7.0(3)I6(1)
If I list OpenConfig interfaces with a RESTconf GET at
restconf/data/openconfig-interfaces:interfaces?content=config
, I get:When saving the data to nice yaml or nice json with ansible, it appears that there may be duplicate keys so that only the last fields are kept:
The whole discussion is available here about what I originally thought to be an ansible issue.