nanog mailing list archives

[NANOG] Re: The Network CLI -- Love it ? Hate it? Needed?


From: Mark Prosser via NANOG <nanog () lists nanog org>
Date: Thu, 20 Mar 2025 09:31:59 -0400

On 2025-03-20 09:23, jeffm--- via NANOG wrote:

Yes, all of this, but it's probably worth noting that there, at least in
the past, have been some JunOS management cli commands that just ran a
shell command and dumped the output, therefore not supporting "| display
json". A lot of the NTP commands used to be this way, though I think in
later releases they've updated that to support the json display on them.
Are there other commands that still do this?  I'm personally not aware of
anything, but it's posslbe.

Additionally, that static transform into JSON from XML results in some
really horrendous json to work with. It is workable, but it's not fun.
This only applies to state data, the json rendering of config info "show
config ... | display json" is as you would expect. There is a config
switch that purports to output "compact" json for state commands, but it
generates (usually) invalid json (doesn't put lists into "[...]").

I've noticed this as well. When I'm working with the piped outputs, I typically prefer xml & then utilize `xmltodict` and `jsonata` to get something workable for my use case.

Warm regards,

--
Mark Prosser
// E: mark () zealnetworks ca
// W: https://zealnetworks.ca
_______________________________________________
NANOG mailing list https://lists.nanog.org/archives/list/nanog () lists nanog org/message/Z2TZPIUWBXPTD5JNN2JPI6VWGZ54M7KJ/

Current thread: