Meta Info Action
Meta Action
Meta Info Action is used to obtain metadata information in the cluster. Such as database list, table structure, etc.
List Databaseβ
Requestβ
GET /api/meta/namespaces/<ns_name>/databases
Descriptionβ
Get a list of all database names, arranged in alphabetical order.
Path parametersβ
None
Query parametersβ
limit
Limit the number of result rows returned
offset
Pagination information, need to be used with
limit
Request bodyβ
None
Responseβ
{
"msg": "OK",
"code": 0,
"data": [
"db1", "db2", "db3", ...
],
"count": 3
}
- The data field returns a list of database names.
List Tableβ
Requestβ
GET /api/meta/namespaces/<ns_name>/databases/<db_name>/tables
Descriptionβ
Get a list of tables in the specified database, arranged in alphabetical order.
Path parametersβ
<db_name>
Specify database
Query parametersβ
limit
Limit the number of result rows returned
offset
Pagination information, need to be used with
limit
Request bodyβ
None
Responseβ
{
"msg": "OK",
"code": 0,
"data": [
"tbl1", "tbl2", "tbl3", ...
],
"count": 0
}
- The data field returns a list of table names.
Schema Infoβ
Requestβ
GET /api/meta/namespaces/<ns_name>/databases/<db_name>/tables/<tbl_name>/schema
Descriptionβ
Get the table structure information of the specified table in the specified database.
Path parametersβ
<db_name>
Specify the database name
<tbl_name>
Specify table name
Query parametersβ
with_mv
Optional. If not specified, the table structure of the base table is returned by default. If specified, all rollup index will also be returned.
Request bodyβ
None
Responseβ
GET /api/meta/namespaces/default/databases/db1/tables/tbl1/schema
{
"msg": "success",
"code": 0,
"data": {
"tbl1": {
"schema": [{
"Field": "k1",
"Type": "INT",
"Null": "Yes",
"Extra": "",
"Default": null,
"Key": "true"
},
{
"Field": "k2",
"Type": "INT",
"Null": "Yes",
"Extra": "",
"Default": null,
"Key": "true"
}
],
"is_base": true
}
},
"count": 0
}
GET /api/meta/namespaces/default/databases/db1/tables/tbl1/schema?with_mv?=1
{
"msg": "success",
"code": 0,
"data": {
"tbl1": {
"schema": [{
"Field": "k1",
"Type": "INT",
"Null": "Yes",
"Extra": "",
"Default": null,
"Key": "true"
},
{
"Field": "k2",
"Type": "INT",
"Null": "Yes",
"Extra": "",
"Default": null,
"Key": "true"
}
],
"is_base": true
},
"rollup1": {
"schema": [{
"Field": "k1",
"Type": "INT",
"Null": "Yes",
"Extra": "",
"Default": null,
"Key": "true"
}],
"is_base": false
}
},
"count": 0
}
- The data field returns the table structure information of the base table or rollup table.