Browse catalogs, databases, volumes and tables¶
Returns hierarchical navigation data for catalogs, databases, volumes, and tables accessible in the current workspace.
POST https://moi.matrixorigin.cn/newmoi/catalog/tree
Preparation before calling¶
Prepare a personal access token and target workspace ID that has access to the target workspace.
The example below uses:
$AI_STUDIO_API_KEY: The actual personal access token, passed through theX-API-KeyHeader.$WORKSPACE_ID: Target workspace ID, passed throughX-Workspace-IDHeader.
Request example¶
curl -X POST "https://moi.matrixorigin.cn/newmoi/catalog/tree" \
-H "X-API-Key: $AI_STUDIO_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID" \
-H 'Content-Type: application/json' \
-d '{
"include_table_leaves": true
}'
Request body¶
Parameter |
Type |
Required |
Description |
|---|---|---|---|
|
boolean |
No |
Whether to include table leaf nodes in the tree. |
Successful response¶
Returns 200 on success. The result contains only nodes that are readable by the current identity.
{
"code": "OK",
"msg": "OK",
"data": {
"tree": [
{
"id": "1",
"type": "catalog",
"name": "sales",
"display_name": "sales",
"description": "销售数据",
"reserved": false,
"node_list": [
{
"id": "2",
"type": "database",
"name": "orders",
"description": "",
"reserved": false,
"node_list": []
}
],
"allowed_actions": ["catalog.read"]
}
]
}
}
The response fields are as follows.
Field |
Type |
Description |
|---|---|---|
|
string |
|
|
string |
|
|
object[] |
Root node list; empty array when there are no readable resources. |
|
string |
Node ID. |
|
string |
Node type: |
|
string |
Node name. |
|
string |
Node display name; returned if there is a value. |
|
string |
Node description. |
|
string |
Node display description; returned if there is a value. |
|
boolean |
Whether it is a reserved node. |
|
boolean |
Whether it is a publishing node; returned when applicable. |
|
boolean |
Whether it is a subscribing node; returned when applicable. |
|
object[] |
Child node, the fields are the same as the parent node. |
|
string[] |
The operations that the current identity can perform on this node. |
|
boolean |
Whether it is referenced by the workflow as a target; returned if there is a value. |
|
object |
Binding information of volumes and workflow triggers; returned if there is a value. |
|
boolean |
Whether there is a trigger binding. |
|
integer |
Trigger ID. |
|
string |
Association workflow ID. |
|
string |
The name of the associated workflow. |
|
string |
The associated workflow version ID. |
In this document, [] after a type means an array; for example, object[] is an array of objects. In field paths, [] means each item in an array; for example, data.tree[].id is the id field of each item in data.tree.
Error response¶
{
"code": "ErrParamInvalid",
"msg": "请求参数无效",
"data": null
}
Common HTTP errors¶
HTTP status code |
error code |
Common causes |
Recommended actions |
|---|---|---|---|
|
|
The request body is not valid JSON. |
Check the request JSON. |
|
|
Missing or invalid access credentials. |
Check API Key and Workspace Header. |
|
|
The server failed to read the directory tree. |
Try again later. |
Follow-up operations¶
After completion, you can return to Query file products.