cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
299
Views
0
Helpful
2
Replies

Pipeing a to restconf-json / netconf-xml format return an empty output

Gioacchino
Level 1
Level 1

Hi all,

I tried to retrieve info in either format but when applied to the following command,

show ap status

the only output is this

 

 

 

 

wlc1#sh ap status | format restconf-json
{
"data": {
}
}
wlc1#sh ap status | format netconf-xml
<config xmlns="http://tail-f.com/ns/config/1.0">
</config>

 

 

 

 

Is that normal?

Otherwise is there a page that documents which output can be formatted in either formats?

TIA, Gio

2 Replies 2

Rich R
VIP
VIP

What version of IOS-XE are you using?

The only documentation I can find on the command:
https://www.cisco.com/c/en/us/td/docs/ios-xml/ios/prog/configuration/1712/b_1712_programmability_cg/m_1712_prog_restconf.html
Note: "The translation of IOS commands into a structured format is disabled by default. You must initially configure NETCONF-YANG, and once the data model interfaces (DMIs) are initialized, use the appropriate format option to translate the commands."
and https://www.ciscolive.com/c/dam/r/ciscolive/global-event/docs/2022/pdf/BRKEWN-2730.pdf
"This new CLI addition to “show run | format” brings additional visibility into the YANG modelled configuration, either for NETCONF with XML or JSON with RESTCONF"

All the examples refer to "show run" and config - I suspect it only works for device configuration, not operational show commands.

Hi @Rich R ,

it should be 17.9.3. I fear the xml/json format is simpler to apply to the "show conf" because afaik "show conf" is part of the NETCONF RFC. Hence once you have the XML is "easy" to convert to json.

For outher outputs, it might be more difficult to determine the structure, therefore the formtter doesn't work.

Thanks, Gio