Skip to content

[vtadmin] cell apis#10227

Merged
ajm188 merged 8 commits intovitessio:mainfrom
planetscale:andrew/vtadmin/cell-apis
May 9, 2022
Merged

[vtadmin] cell apis#10227
ajm188 merged 8 commits intovitessio:mainfrom
planetscale:andrew/vtadmin/cell-apis

Conversation

@ajm188
Copy link
Copy Markdown
Contributor

@ajm188 ajm188 commented May 6, 2022

Description

vtadmin variants of:

  • GetCellInfoNames (via /cells?names_only=true)
  • GetCellInfo
  • GetCellsAliases

Demo

➜  local git:(andrew/vtadmin/cell-apis) ✗ curl -s localhost:14200/api/cells\?cluster\=local | jq '.'
{
  "result": {
    "cell_infos": [
      {
        "cluster": {
          "id": "local",
          "name": "local"
        },
        "name": "zone1",
        "cell_info": {
          "server_address": "localhost:2379",
          "root": "/vitess/zone1"
        }
      }
    ]
  },
  "ok": true
}

Related Issue(s)

#8705

Checklist

  • "Backport me!" label has been added if this change should be backported
  • Tests were added or are not required -- TODO!
  • Documentation was added or is not required

Deployment Notes

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented May 6, 2022

Review Checklist

Hello reviewers! 👋 Please follow this checklist when reviewing this Pull Request.

General

  • Ensure that the Pull Request has the correct release notes label. release notes none should only be used for PRs that are so trivial that they need not be included.
  • If a new flag is being introduced, review whether it is really needed. The flag names should be clear and intuitive (as far as possible), and the flag's help should be descriptive.

Bug fixes

  • There should be at least one unit or end-to-end test.
  • The Pull Request description should either include a link to an issue that describes the bug OR an actual description of the bug and how to reproduce, along with a description of the fix.

Non-trivial changes

  • There should be some code comments as to why things are implemented the way they are.

New/Existing features

  • Should be documented, either by modifying the existing documentation or creating new documentation.
  • New features should have a link to a feature request issue or an RFC that documents the use cases, corner cases and test cases.

Backward compatibility

  • Protobuf changes should be wire-compatible.
  • Changes to _vt tables and RPCs need to be backward compatible.
  • vtctl command output order should be stable and awk-able.

Copy link
Copy Markdown
Contributor

@doeg doeg left a comment

Choose a reason for hiding this comment

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

Thank you for doing this!!! Obligatory blocking question about tests but otherwise this is :chef-kiss: and I super appreciate it.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Obligatory question of "do we need tests for either of these"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

yes and yes

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

annnd done

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Just a question about """idiomatic go""": isn't this the same as if namesOnly && len(req.Cells) != 0?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

yuppppp (i originally had An Thought about doing the early return namesOnly loop in this section too, but never came back here), thanks!

@ajm188
Copy link
Copy Markdown
Contributor Author

ajm188 commented May 9, 2022

i'm gonna wait for #10233 and rebase, because i added a Dial call here that'll need to get cleaned up, if that's okay with you!

Andrew Mason added 8 commits May 9, 2022 14:03
Signed-off-by: Andrew Mason <andrew@planetscale.com>
Signed-off-by: Andrew Mason <andrew@planetscale.com>
Signed-off-by: Andrew Mason <andrew@planetscale.com>
Signed-off-by: Andrew Mason <andrew@planetscale.com>
Signed-off-by: Andrew Mason <andrew@planetscale.com>
Signed-off-by: Andrew Mason <andrew@planetscale.com>
Signed-off-by: Andrew Mason <andrew@planetscale.com>
Signed-off-by: Andrew Mason <andrew@planetscale.com>
@ajm188 ajm188 force-pushed the andrew/vtadmin/cell-apis branch from 3591e48 to 93207d7 Compare May 9, 2022 18:03
@ajm188 ajm188 merged commit d1d2c30 into vitessio:main May 9, 2022
@ajm188 ajm188 deleted the andrew/vtadmin/cell-apis branch May 9, 2022 19:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants