-
Notifications
You must be signed in to change notification settings - Fork 447
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
Jsonify show neighbor,adj-rib-in,adj-rib-out cmds output #1240
Conversation
@@ -73,99 +63,98 @@ class Neighbor(object): | |||
summary_template = '%-15s %-7s %9s %-12s %10d %10d' | |||
|
|||
@classmethod | |||
def as_dict(cls, answer): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as_dict should not be inlined. It would be better to have as _string added and use two functions for clarity.
Thank you for this PR, I can not accept it as it but I have no objection to adding the feature. |
I will massage this patch into shape as there is too much to fix and explain. |
c52c374
to
29994c0
Compare
following an attempt with #1240 this code provide all the glue code to make it easier to convert all the api call to json
following the changes pushed above, it should be easier to add json support to any command.
The JSON generated should NOT try to match the text version but instead use suitable dict structures that are easy to parse (as it is often done in the code). __
|
My patch is wrong as it mixes json payload with json formatting of answers. I will fix it. |
if you want to see what you need and I missed, please open a new PR and I will help. |
This PR updates ExaBGP to optionally provide JSON output for API commands such as show neighbor, adj-rib-in, and adj-rib-out.
Existing Commands:
Example Usage for JSON Output:
Examples:
This should also resolve the issue detailed in #909