跳转至

统一目录实体类型列表



POST /api/v1/unified_catalog/entity_type_cfg/list

概述

分页读取当前空间可见的实体类型及其覆盖配置。

调用前和使用步骤

列表包含可见官方类型和当前空间自定义类型,withDefault=false仅后者;隐藏系统类型/default创建模板不在普通列表。默认类型优先、系统类型展示权重降序,再创建时间/编号升序。

OpenAPI默认withEntityCount=true,会访问实体查询服务;false省略数量。filters仅约束计数,不移除零命中类型。summaryOnly=true省略base Schema/View但仍可能包含customProperties等覆盖值;本公开入口不返回Front有效健康表单/effectiveViewDefine/entityStatusConfig。全部类型健康能力始终可读,system默认default、其他默认disabled。

请求头

参数名 类型 必选 说明
DF-API-KEY string Y 工作空间的 OpenAPI 鉴权凭据。
例子: <DF-API-KEY>
获取或填写方式: 从目标工作空间的 API Key 管理获取有该操作权限的 OpenAPI Key。

Body 请求参数

参数名 类型 必选 说明
filters.属性字段名 JSON 动态键和值由实体查询服务解释;空对象不筛选计数,推荐标量候选值数组。
例子: ["prod"]
获取或填写方式: 已有实体属性字段名及候选值。
pageIndex integer 可选默认1,最小1,控制器最多100000。
允许 null: False
$minValue: 1
例子: 1
获取或填写方式: 由调用方从1开始遍历类型配置列表。
pageSize integer 可选默认20,1..200。
允许 null: False
$minValue: 1
$maxValue: 200
例子: 20
获取或填写方式: 按客户端展示或批量读取需要设定。
search string 可选,去首尾空白;匹配entityType/name,不搜索description/任意属性值。
允许 null: False
例子: demo
获取或填写方式: 输入类型编码/显示名称关键词。
filters json 可选对象;当前仅withEntityCount=true时用于实体数量统计,不移除计数为0的类型,不据此保证只返回命中实体的类型;withEntityCount=false时不执行该筛选计数。
允许 null: False
例子: {"env": ["prod"]}
获取或填写方式: 选择实体attributes字段和值,来自该类型Schema及实体字段统计。
withDefault boolean 可选默认true,false只取当前空间自定义类型;不返回status=3的default创建模板。
允许 null: False
例子: true
获取或填写方式: 是否包含当前可见的官方默认类型。
withEntityCount boolean OpenAPI默认true;false省略entityCount并减少下游查询。不要套用Front/AIAPI默认false。
允许 null: False
例子: true
获取或填写方式: 是否需要为每个类型查询实体数量。
summaryOnly boolean 可选默认false;true不读取/返回schemaDefine/viewDefine/fieldMetadata,仍返回extraConfig/healthConfig/customProperties和可选计数,不保证完全无YAML字段。
允许 null: False
例子: true
获取或填写方式: 目录选择器可true取轻量类型摘要。

参数补充说明

请求参数说明

参数名 type 必选 说明
pageIndex integer 否 页码,默认 1
pageSize integer 否 每页数量,默认 20
search string 否 按实体类型编码或显示名搜索
filters json 否 通过实体 attributes 过滤,反向筛选实体类型
withDefault boolean 否 是否包含系统默认类型,默认 true
withEntityCount boolean 否 是否返回实体数量,默认 true
summaryOnly boolean 否 是否返回轻量摘要;为 true 时不读取或返回 schema/view/effective 定义

调用注意事项

  • 这是分页接口,建议显式传 pageIndex 和 pageSize。
  • 返回结果中的 extraConfig 为当前工作空间视角下的实体类型额外配置。
  • 默认类型和自定义类型会同时出现在结果中,具体取决于 withDefault。

请求例子

curl --request POST 'https://openapi.guance.com/api/v1/unified_catalog/entity_type_cfg/list' \
  -H 'DF-API-KEY: <DF-API-KEY>' \
  -H 'Content-Type: application/json' \
  --data-raw '{"pageIndex":1,"pageSize":20,"withDefault":true,"withEntityCount":false,"summaryOnly":true}'

响应

HTTP 200,application/json。下方示例展示可直接读取的主要字段。

字段 类型 说明
content.items array<object> 当前页类型。
content.items[].id integer 或 null 类型记录编号;新建提交前可能null。
content.items[].uuid string enty_类型UUID;创建模板为default。
content.items[].workspaceUUID string 类型所属空间,官方类型可为空,工作空间覆盖配置仍单独按当前空间处理。
content.items[].entityType string 稳定类型编码,不是显示名。
content.items[].name string 显示名称。
content.items[].description string 描述。
content.items[].sourceType string default官方/默认,custom自定义。
content.items[].isSystem integer 系统级标记,不简单等价于sourceType。
content.items[].isHidden integer 隐藏标记;正常列表排除隐藏系统类型。
content.items[].showRank integer 或 null 系统类型展示排序权重,无值null。
content.items[].entityTypeGroupUUID string 历史分组标识,可空;公开接口不接受废弃分组写参数。
content.items[].groupInfo object 或 null 分组摘要;缺失可{},默认类型修改可null。
content.items[].groupInfo.uuid string 存在历史分组时的UUID。
content.items[].groupInfo.name string 存在历史分组时的名称。
content.items[].schemaDefine string 原始DataSchema YAML;summaryOnly列表省略。
content.items[].viewDefine string 原始UIView YAML;summaryOnly列表省略。
content.items[].extend object 动态类型扩展。
content.items[].extend.扩展键 JSON 具体键按原类型定义。
content.items[].status integer 正常0;default创建模板3,非列表中的活动资源。
content.items[].creator string 创建身份UUID/系统标识。
content.items[].updator string 更新身份。
content.items[].createAt integer 创建Unix秒。
content.items[].updateAt integer 更新Unix秒,未更新可-1。
content.items[].deleteAt integer 删除Unix秒,未删除-1。
content.items[].entityCount integer 当前空间实体数量;列表withEntityCount=false省略;新建/修改返回0不代表已查询真实数量。
content.items[].extraConfig object 当前空间额外配置,缺省{}。
content.items[].extraConfig.telemetrySelectors array 条件存在的遥测关联配置,不等同实体查询结果。
content.items[].extraConfig.telemetrySelectors[] JSON 对应配置动态项。
content.items[].extraConfig.disabledBuiltInViews array<string> 条件存在的禁用内建视图标识。
content.items[].extraConfig.disabledBuiltInViews[] string 单个视图标识。
content.items[].extraConfig.其他键 JSON 动态扩展,保留实际值。
content.items[].healthConfig object 当前空间类型有效健康策略;创建响应不固定含该字段。
content.items[].healthConfig.mode string system默认default,其他未配disabled;配置后可func/disabled。
content.items[].healthConfig.funcId string 仅func时存在的函数UUID。
content.items[].customProperties string 当前空间原始自定义字段YAML,保留注释。
content.pagination object 分页信息,保留在content,不是pageInfo上提结构。
content.pagination.pageIndex integer 当前页,从1开始。
content.pagination.pageSize integer 实际每页大小。
content.pagination.count integer 本页条数。
content.pagination.totalCount integer 当前可见类型配置总数,不是实体数量;不随计数filters排除零命中类型。
content.declaration object 或 null 非空业务对象附带的工作空间公共声明,未配置时可为null或空对象;空对象不添加。
{
  "code": 200,
  "content": {
    "items": [
      {
        "id": 100,
        "uuid": "enty_example",
        "workspaceUUID": "wksp_example",
        "entityType": "demo_service",
        "name": "示例服务",
        "description": "业务服务目录",
        "sourceType": "custom",
        "isSystem": 0,
        "isHidden": 0,
        "showRank": null,
        "entityTypeGroupUUID": "",
        "extend": {},
        "creator": "wsak_example",
        "updator": "wsak_example",
        "createAt": 1785427200,
        "updateAt": 1785427200,
        "deleteAt": -1,
        "status": 0,
        "groupInfo": {},
        "extraConfig": {},
        "healthConfig": {
          "mode": "disabled"
        },
        "customProperties": "# 保留原文与注释\ncustom_properties:\n  - name: business_owner\n    title: 业务负责人\n    type: string\n    required: false\n    extension_scope: custom\n    writable_sources: [manual, gitops]\n    capabilities: {display: true, edit: true, filter: false, sort: false}\n"
      }
    ],
    "pagination": {
      "pageIndex": 1,
      "pageSize": 20,
      "count": 1,
      "totalCount": 1
    },
    "declaration": {}
  },
  "errorCode": "",
  "message": "",
  "success": true,
  "traceId": "TRACE-EXAMPLE"
}

错误响应

鉴权、限流和公共请求错误参见公共错误定义。

下游错误沿Kodo共享映射,4xx可返回实际HTTP及ft.KodoCommonApiErr或已映射业务码;不是所有失败都转406。未透传的5xx/连接异常/成功结果结构不符最终为500 ft.InternalServerError。保留errorCode/message/traceId,按读取或写入阶段处理;成功HTTP不能替代实体实际可见性验收。

HTTP 状态 errorCode 触发条件 消息或响应说明 处理方式
406 ft.ParameterValidationFailed 请求字段缺失,或字段值违反声明的校验条件 参数解析失败 核对参数位置、字段名、类型和取值。
400 ft.RequestJsonFormatError 请求 JSON 语法无效 请求 JSON 格式错误 按 content.reason、line、column 修正 JSON。
400 ft.JsonFormatError Body顶层不是JSON对象 部分 json 文件格式错误 按示例提交对象,不用数组/字符串。
500 ft.InternalServerError 类型读取、实体计数、历史配置/原始Schema解析或格式化失败 内部错误 保留traceId及类型/筛选条件,核对历史定义和查询服务;这是读取失败,不表示本次保存了配置。

文档评价

文档内容是否对您有帮助?