Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Junos "| display json" in cli method #1500

Closed
1 task done
seismiccollision opened this issue Sep 24, 2021 · 0 comments · Fixed by #1663
Closed
1 task done

Junos "| display json" in cli method #1500

seismiccollision opened this issue Sep 24, 2021 · 0 comments · Fixed by #1663

Comments

@seismiccollision
Copy link

Description of Issue/Question

I would like to be able to run arbitrary show commands on junos and get the JSON or XML data back instead of stdout
It seems like junos.py isn't setup for handling "| display" and just drops it
Is that something you'd consider adding support for?

The way NX-OS SSH works I am able to do the above equivalent

Note: Please check https://guides.github.com/features/mastering-markdown/
to see how to properly format your request.

Did you follow the steps from https://github.com/napalm-automation/napalm#faq

(Place an x between the square brackets where applicable)

  • Yes
  • [] No

Setup

napalm version

(Paste verbatim output from pip freeze | grep napalm between quotes below)

napalm==3.3.1

Network operating system version

(Paste verbatim output from show version - or equivalent - between quotes below)

Junos: 20.2R3-S2.5

Steps to Reproduce the Issue

If I run "show lacp interfaces | display json" it doesn't honor the format request

>>> device.cli(['show lacp interfaces | display json'])
{'show lacp interfaces | display json': '\nAggregated interface: ae10\n    LACP state:       Role   Exp   Def  Dist  Col  Syn  Aggr  Timeout  Activity\n      xe-1/2/0       Actor    No    No   Yes  Yes  Yes   Yes     Fast    Active\n      xe-1/2/0     Partner    No    No   Yes  Yes  Yes   Yes     Fast    Active\n      xe-1/2/1       Actor    No    No   Yes  Yes  Yes   Yes     Fast    Active\n      xe-1/2/1     Partner    No    No   Yes  Yes  Yes   Yes     Fast    Active\n      xe-0/2/0       Actor    No    No   Yes  Yes  Yes   Yes     Fast    Active\n      xe-0/2/0     Partner    No    No   Yes  Yes  Yes   Yes     Fast    Active\n      xe-0/2/1       Actor    No    No   Yes  Yes  Yes   Yes     Fast    Active\n      xe-0/2/1     Partner    No    No   Yes  Yes  Yes   Yes     Fast    Active\n      xe-2/2/0       Actor    No    No   Yes  Yes  Yes   Yes     Fast    Active\n      xe-2/2/0     Partner    No    No   Yes  Yes  Yes   Yes     Fast    Active\n      xe-2/2/1       Actor    No    No   Yes  Yes  Yes   Yes     Fast    Active\n      xe-2/2/1     Partner    No    No   Yes  Yes  Yes   Yes     Fast    Active\n    LACP protocol:        Receive State  Transmit State          Mux State \n      xe-1/2/0                  Current   Fast periodic Collecting distributing\n      xe-1/2/1                  Current   Fast periodic Collecting distributing\n      xe-0/2/0                  Current   Fast periodic Collecting distributing\n      xe-0/2/1                  Current   Fast periodic Collecting distributing\n      xe-2/2/0                  Current   Fast periodic Collecting distributing\n      xe-2/2/1                  Current   Fast periodic Collecting distributing\n'}

Error Traceback

(Paste the complete traceback of the exception between quotes below)


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants