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

http: add http api for get db and table info that is related to the tableID #8256

Merged
merged 4 commits into from
Nov 22, 2018

Conversation

crazycs520
Copy link
Contributor

@crazycs520 crazycs520 commented Nov 9, 2018

What problem does this PR solve?

add http api to get db and table info that is related to the tableID.
This is for the flash use.

curl http://{TiDBIP}:10080/db-table/{tableID}

This will return below now:

type dbTableInfo struct {
	DBInfo        *model.DBInfo    `json:"db_info"`
	TableInfo     *model.TableInfo `json:"table_info"`
	SchemaVersion int64            `json:"schema_version"`
}

What is changed and how it works?

Check List

Tests

Code changes

  • Has exported function/method change

Side effects

Related changes


This change is Reviewable

@crazycs520
Copy link
Contributor Author

@zanmato1984 PTAL

server/http_handler.go Show resolved Hide resolved
server/http_handler.go Outdated Show resolved Hide resolved
server/http_handler.go Outdated Show resolved Hide resolved
@zanmato1984
Copy link
Contributor

LGTM. I think you might need another approve from some TiDB team member?

@crazycs520
Copy link
Contributor Author

@winkyao @ciscoxll PTAL

@jackysp
Copy link
Member

jackysp commented Nov 12, 2018

I think we could get the table info by

curl http://{TiDBIP}:10080/schema?table_id={tableID}

So could we append some DB info to the old API?
btw: when we get the table info, I think we could get the DB info in the other way. I'm not sure why we need to append the DB info in the same API.

@jackysp jackysp closed this Nov 12, 2018
@jackysp jackysp reopened this Nov 12, 2018
server/http_handler.go Outdated Show resolved Hide resolved
@winkyao
Copy link
Contributor

winkyao commented Nov 12, 2018

I think to add a new api is better, if you change the return format, will cause compatibility issues.

@crazycs520 crazycs520 force-pushed the http-db-table branch 2 times, most recently from 14706fa to d30d7d9 Compare November 13, 2018 05:35
@crazycs520
Copy link
Contributor Author

@winkyao PTAL

Copy link
Contributor

@zimulala zimulala left a comment

Choose a reason for hiding this comment

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

LGTM

@crazycs520
Copy link
Contributor Author

@winkyao PTAL

Copy link
Contributor

@winkyao winkyao left a comment

Choose a reason for hiding this comment

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

LGTM

@crazycs520 crazycs520 merged commit bb1f239 into pingcap:master Nov 22, 2018
crazycs520 added a commit to crazycs520/tidb that referenced this pull request Feb 21, 2019
…ableID (pingcap#8256)

* http: add http api for get db and table info that is related to the tableID
@you06 you06 added the sig/sql-infra SIG: SQL Infra label Mar 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sig/sql-infra SIG: SQL Infra
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants