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

cluster: add JSON output option for display #1358

Merged
merged 1 commit into from
May 12, 2021

Conversation

dveeden
Copy link
Contributor

@dveeden dveeden commented May 11, 2021

What problem does this PR solve?

This adds JSON output for the tiup cluster display command. This makes it easier to parse the output and use it in other programs.

#1355

What is changed and how it works?

This puts the info in a struct and uses encoding/json to format this as JSON

Check List

Tests

  • Manual test (add detailed scripts or steps below)

tiup cluster display mycluster
tiup cluster display --json mycluster

Side effects

  • Increased code complexity

Related changes

  • Need to update the documentation

Release notes:

Support JSON output for the `tiup cluster display` command

@ti-chi-bot ti-chi-bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label May 11, 2021
@ti-chi-bot ti-chi-bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label May 11, 2021
@dveeden dveeden changed the title cluster: fix wrong data_dir for imported drainer instances (#1346) cluster: add JSON output option for display May 11, 2021
@dveeden dveeden force-pushed the display_json branch 2 times, most recently from 8d19108 to 5e7f8ed Compare May 11, 2021 06:53
@dveeden dveeden marked this pull request as ready for review May 11, 2021 06:54
@ti-chi-bot ti-chi-bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label May 11, 2021
@AstroProfundis
Copy link
Contributor

AstroProfundis commented May 11, 2021

releated to #1208

might be releated to #1172 as well

@AstroProfundis AstroProfundis added this to the v1.5.0 milestone May 11, 2021
@ti-chi-bot ti-chi-bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels May 11, 2021
Copy link
Contributor

@AstroProfundis AstroProfundis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There seems to be an empty file with no filename added in the PR, and need to be removed if it's not by intend.

And the tests are failing, you may use make check and make test to run static checks and unit tests at your local environment.

TLSCACert string `json:"tls_ca_cert"`
TLSClientCert string `json:"tls_client_cert"`
TLSClientKey string `json:"tls_client_key"`
URL string `json:"url"`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's better be dashboard_url, as it's the URL of our builtin dashboard in PD, we may have other URLs or links to something else. (there is no such thing as a general "URL" for a TiDB cluster)

@ti-chi-bot
Copy link
Member

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • AstroProfundis

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

The full list of commands accepted by this bot can be found here.

Reviewer can indicate their review by writing /lgtm in a comment.
Reviewer can cancel approval by writing /lgtm cancel in a comment.

@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label May 12, 2021
@AstroProfundis
Copy link
Contributor

/merge

@ti-chi-bot
Copy link
Member

This pull request has been accepted and is ready to merge.

Commit hash: 42ee4cf

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label May 12, 2021
@ti-chi-bot ti-chi-bot merged commit 5abe200 into pingcap:master May 12, 2021
@dveeden dveeden mentioned this pull request May 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/L Denotes a PR that changes 100-499 lines, ignoring generated files. status/can-merge Indicates a PR has been approved by a committer. status/LGT1 Indicates that a PR has LGTM 1.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants