Meta Action
Meta Info Action is used to obtain metadata information in the cluster. Such as database list, table structure, etc.
List Database
Request
1. 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
1. {
2. "msg": "OK",
3. "code": 0,
4. "data": [
5. "db1", "db2", "db3", ...
6. ],
7. "count": 3
8. }
- The data field returns a list of database names.
List Table
Request
1. 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
1. {
2. "msg": "OK",
3. "code": 0,
4. "data": [
5. "tbl1", "tbl2", "tbl3", ...
6. ],
7. "count": 0
8. }
- The data field returns a list of table names.
Schema Info
Request
1. 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
1. GET /api/meta/namespaces/default/databases/db1/tables/tbl1/schema
3. {
4. "msg": "success",
5. "code": 0,
6. "data": {
7. "tbl1": {
8. "schema": [{
9. "Field": "k1",
10. "Type": "INT",
11. "Null": "Yes",
12. "Extra": "",
13. "Default": null,
14. "Key": "true"
15. },
16. {
17. "Field": "k2",
18. "Type": "INT",
19. "Null": "Yes",
20. "Extra": "",
21. "Default": null,
22. "Key": "true"
23. }
24. ],
25. "is_base": true
26. }
27. },
28. "count": 0
29. }
1. GET /api/meta/namespaces/default/databases/db1/tables/tbl1/schema?with_mv?=1
3. {
4. "msg": "success",
5. "code": 0,
6. "data": {
7. "tbl1": {
8. "schema": [{
9. "Field": "k1",
10. "Type": "INT",
11. "Null": "Yes",
12. "Extra": "",
13. "Default": null,
14. "Key": "true"
15. },
16. {
17. "Field": "k2",
18. "Type": "INT",
19. "Null": "Yes",
20. "Extra": "",
21. "Default": null,
22. "Key": "true"
23. }
24. ],
25. "is_base": true
26. },
27. "rollup1": {
28. "schema": [{
29. "Field": "k1",
30. "Type": "INT",
31. "Null": "Yes",
32. "Extra": "",
33. "Default": null,
34. "Key": "true"
35. }],
36. "is_base": false
37. }
38. },
39. "count": 0
40. }
- The data field returns the table structure information of the base table or rollup table.
