-
Notifications
You must be signed in to change notification settings - Fork 712
Pr json support queue watermark and persistent-watermark #3875
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
base: master
Are you sure you want to change the base?
Pr json support queue watermark and persistent-watermark #3875
Conversation
Added json output support for queue watermark and persistent-watermark
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
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.
Pull Request Overview
This PR adds JSON output support for queue watermark and persistent-watermark commands, allowing users to view the output in JSON format via a new command-line flag.
- Added a new click option (--json/-j) in the unicast, multicast, and all queues commands.
- Updated the watermarkstat script and related methods to support JSON output.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
File | Description |
---|---|
show/main.py | Added a JSON flag to queue watermark CLI subcommands |
scripts/watermarkstat | Modified command execution and output formatting to support JSON output |
show/main.py
Outdated
@@ -826,11 +826,14 @@ def watermark(): | |||
show_default=True, | |||
help='Namespace name or all', | |||
callback=multi_asic_util.multi_asic_namespace_validation_callback) | |||
def wm_q_uni(namespace): | |||
@click.option('--json','-j','json_output', is_flag=True, default=False, show_default=True, help="Display JSON output") |
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.
[nitpick] Consider using a consistent help message for the JSON flag across all commands. For example, aligning with other modules by using 'Display JSON output' uniformly.
Copilot uses AI. Check for mistakes.
@@ -324,8 +330,9 @@ class Watermarkstat(object): | |||
@click.option('-p', '--persistent', is_flag=True, help='Do the operations on the persistent watermark') | |||
@click.option('-t', '--type', 'wm_type', type=click.Choice(['pg_headroom', 'pg_shared', 'q_shared_uni', 'q_shared_multi', 'buffer_pool', 'headroom_pool', 'q_shared_all']), help='The type of watermark', required=True) | |||
@click.option('-n', '--namespace', type=click.Choice(multi_asic.get_namespace_list()), help='Namespace name or skip for all', default=None) | |||
@click.option('--json','-j','json_output', is_flag=True, default=False, show_default=True, help="Display output in JSON format") |
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.
[nitpick] Consider using a consistent help message for the JSON flag across all commands. For example, align this with the 'Display JSON output' help text used elsewhere.
@click.option('--json','-j','json_output', is_flag=True, default=False, show_default=True, help="Display output in JSON format") | |
@click.option('--json','-j','json_output', is_flag=True, default=False, show_default=True, help="Display JSON output") |
Copilot uses AI. Check for mistakes.
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
Work json support queue watermark
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
What I did
Added json output supoort for
How I did it
How to verify it
Previous command output (if the output of a command-line utility has changed)
New command output (if the output of a command-line utility has changed)