查询 Catalog 列表¶
返回当前工作区中可访问的 Catalog 列表。
POST https://moi.matrixorigin.cn/newmoi/catalog/list
调用前准备¶
准备有目标工作区访问权限的个人访问令牌和目标工作区 ID。
下方示例使用:
$AI_STUDIO_API_KEY:实际个人访问令牌,通过X-API-KeyHeader 传递。$WORKSPACE_ID:目标工作区 ID,通过X-Workspace-IDHeader 传递。
请求示例¶
curl -X POST "https://moi.matrixorigin.cn/newmoi/catalog/list" \
-H "X-API-Key: $AI_STUDIO_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID"
成功响应¶
成功时返回 200 和当前身份可读取的 Catalog 列表。
{
"code": "OK",
"msg": "OK",
"data": {
"list": [
{
"id": 1,
"name": "sales",
"display_name": "sales",
"description": "销售数据",
"database_count": 1,
"volume_count": 1,
"file_count": 2,
"table_count": 3,
"created_at": "2026-08-18T10:00:00Z",
"created_by": "user-001",
"updated_at": "2026-08-18T10:00:00Z",
"updated_by": "user-001",
"reserved": false,
"allowed_actions": ["catalog.read", "catalog.update"]
}
]
}
}
响应字段如下。
本文中,类型后的 [] 表示数组,例如 string[] 是字符串数组;字段路径中的 [] 表示数组中的每一项,例如 data.list[].id 表示 data.list 数组中每一项的 id 字段。
字段 |
类型 |
说明 |
|---|---|---|
|
string |
成功时为 |
|
string |
成功时为 |
|
object(对象数组) |
Catalog 列表;没有可读 Catalog 时为空数组。 |
|
integer |
Catalog ID。 |
|
string |
Catalog 名称。 |
|
string |
Catalog 说明。 |
|
string |
Catalog 显示名称;有值时返回。 |
|
string |
Catalog 显示说明;有值时返回。 |
|
integer |
下属数据库数量。 |
|
integer |
下属卷数量;有值时返回。 |
|
integer |
下属文件数量;有值时返回。 |
|
integer |
下属表数量;有值时返回。 |
|
string |
创建时间;有值时返回。 |
|
string |
创建者标识;有值时返回。 |
|
string |
更新时间;有值时返回。 |
|
string |
更新者标识;有值时返回。 |
|
boolean |
是否为保留 Catalog。 |
|
string(字符串数组) |
当前身份允许的操作。 |
错误响应¶
{
"code": "ErrServer",
"msg": "服务器内部错误",
"data": null
}
常见 HTTP 错误¶
HTTP 状态码 |
错误代码 |
常见原因 |
建议操作 |
|---|---|---|---|
|
|
缺少或无效的访问凭据。 |
检查 API Key 和工作区 Header。 |
|
|
服务端未能读取 Catalog 列表。 |
稍后重试。 |
后续操作¶
使用 data.list[].id 查询 Catalog 详情。