Skip to content

Commit

Permalink
docs: get table schema by "table_id" not "tableid" (#5527)
Browse files Browse the repository at this point in the history
  • Loading branch information
jackysp authored and coocood committed Jan 4, 2018
1 parent 9863cc0 commit 76bce9d
Showing 1 changed file with 59 additions and 60 deletions.
119 changes: 59 additions & 60 deletions docs/tidb_http_api.md
Original file line number Diff line number Diff line change
@@ -1,90 +1,89 @@
# TiDB HTTP API
# TiDB HTTP API

`TiDBIP` is the ip of the TiDB server. `10080` is the default status port, and you can edit it in tidb.toml when starting the TiDB server
`TiDBIP` is the ip of the TiDB server. `10080` is the default status port, and you can edit it in tidb.toml when starting the TiDB server.

> 1. Get the current status of TiDB, including the connections, version and git_hash
1. Get the current status of TiDB, including the connections, version and git_hash

```
curl http://{TiDBIP}:10080/status
```
```shell
curl http://{TiDBIP}:10080/status
```

> 2. Get all metrics of TiDB
1. Get all metrics of TiDB

```
curl http://{TiDBIP}:10080/metrics
```
```shell
curl http://{TiDBIP}:10080/metrics
```

> 3. Get the metadata of all regions
1. Get the metadata of all regions

```
curl http://{TiDBIP}:10080/regions/meta
```
```shell
curl http://{TiDBIP}:10080/regions/meta
```

> 4. Get the information of a specific region by ID
1. Get the information of a specific region by ID

```
curl http://{TiDBIP}:10080/regions/{regionID}
```
```shell
curl http://{TiDBIP}:10080/regions/{regionID}
```

> 5. Get regions Information from db.table
1. Get regions Information from db.table

```
curl http://{TiDBIP}:10080/tables/{db}/{table}/regions
```
```shell
curl http://{TiDBIP}:10080/tables/{db}/{table}/regions
```

> 6. Get schema Information about all db
1. Get schema Information about all db

```
curl http://{TiDBIP}:10080/schema
```
```shell
curl http://{TiDBIP}:10080/schema
```

> 7. Get schema Information about db
1. Get schema Information about db

```
curl http://{TiDBIP}:10080/schema/{db}
```
```shell
curl http://{TiDBIP}:10080/schema/{db}
```

> 8. Get schema Information about db.table, and you can get schema info by tableid
1. Get schema Information about db.table, and you can get schema info by tableID (tableID is the **unique** identifier of table in TiDB)

```
curl http://{TiDBIP}:10080/schema/{db}/{table}
```shell
curl http://{TiDBIP}:10080/schema/{db}/{table}
curl http://{TiDBIP}:10080/schema?tableid={tableid}
curl http://{TiDBIP}:10080/schema?table_id={tableID}
```

```
1. Get disk-usage info about db.table

> 9. Get disk-usage info about db.table
```shell
curl http://{TiDBIP}:10080/tables/{db}/{table}/disk-usage
```

```
curl http://{TiDBIP}:10080/tables/{db}/{table}/disk-usage
```
1. Get MVCC Information of the key with a specified handle ID

> 10. Get MVCC Information of the key with a specified handle ID
```shell
curl http://{TiDBIP}:10080/mvcc/key/{db}/{table}/{handle}
```

```
curl http://{TiDBIP}:10080/mvcc/key/{db}/{table}/{handle}
```
1. Get MVCC Information of the first key in the table with a specified start ts

> 11. Get MVCC Information of the first key in the table with a specified start ts
```shell
curl http://{TiDBIP}:10080/mvcc/txn/{startTS}/{db}/{table}
```

```
curl http://{TiDBIP}:10080/mvcc/txn/{startTS}/{db}/{table}
```
1. Get MVCC Information of the key with a specified handle ID

> 12. Get MVCC Information of the key with a specified handle ID
```shell
curl http://{TiDBIP}:10080/mvcc/txn/{startTS}
```

```
curl http://{TiDBIP}:10080/mvcc/txn/{startTS}
```
1. Get MVCC Information by a hex value

> 13. Get MVCC Information by a hex value
```shell
curl http://{TiDBIP}:10080/mvcc/hex/{hexKey}
```

```
curl http://{TiDBIP}:10080/mvcc/hex/{hexKey}
```
1. Get MVCC Information of a specified index key, argument example: column_name_1=column_value_1&column_name_2=column_value2...

> 14. Get MVCC Information of a specified index key, argument example: column_name_1=column_value_1&column_name_2=column_value2...
```
curl http://{TiDBIP}:10080/mvcc/index/{db}/{table}/{index}/{handle}?${c1}={v1}&${c2}=${v2}
```
```shell
curl http://{TiDBIP}:10080/mvcc/index/{db}/{table}/{index}/{handle}?${c1}={v1}&${c2}=${v2}
```

0 comments on commit 76bce9d

Please sign in to comment.