Download OpenAPI specification:
Cluster-internal read endpoints used by ontology-query after it resolves a published knowledge-network model to a physical Vega resource.
Vega is the final policy enforcement point. Before every physical read it verifies that the managed proxy account is active, still belongs to the stated knowledge network, and currently has the exact resource permission in bkn-safe. These checks are not cached.
Only schema inspection and filtered resource-data queries are exposed. This surface does not provide resource discovery, raw SQL, write, administration, build, or task operations.
All identity and BKN context headers are trusted workload credentials. They must be supplied only by ontology-query over the cluster-internal network; they are not accepted as end-user authentication on the public API.
Cluster-internal endpoint used by bkn-backend after it derives a binding target from the
candidate model. The caller identity is the effective delegator returned by bkn-safe
preflight. Vega rechecks exactly the requested view_detail or query_data operation and
returns only the resource identity, name, and schema. It does not expose the unrestricted
internal resource detail API.
| id required | string Physical Vega resource ID |
| operation required | string Enum: "view_detail" "query_data" |
| X-Account-ID required | string |
| X-Account-Type required | string Value: "user" |
{- "id": "string",
- "name": "string",
- "schema_definition": [
- {
- "name": "string",
- "type": "string",
- "api_name": "string",
- "display_name": "string",
- "description": "string",
- "original_name": "string",
- "original_type": "string",
- "original_description": "string",
- "features": [
- {
- "name": "string",
- "display_name": "string",
- "feature_type": "keyword",
- "description": "string",
- "ref_property": "string",
- "is_default": true,
- "is_native": true,
- "config": { }
}
], - "attributes": { }
}
]
}Requires view_detail. Only an object_type child may use this
operation. The response deliberately omits resource metadata other than
schema_definition.
| id required | string Physical Vega resource ID |
| X-Account-ID required | string Active managed proxy account ID |
| X-Account-Type required | string Value: "app" |
| x-bkn-caller-id required | string Original end-user or workload caller ID |
| x-bkn-caller-type required | string Original caller account type |
| x-bkn-kn-id required | string Knowledge network managed by the proxy account |
| x-bkn-child-type required | string Enum: "object_type" "relation_type" "metric" |
| x-bkn-child-id required | string Published knowledge-network child ID |
| x-bkn-proxy-version required | integer <uint64> >= 1 Current positive version of BKN's knowledge-network-to-proxy mapping, used for trusted-context validation and audit correlation |
| x-bkn-target-type required | string Value: "resource" |
| x-bkn-target-id required | string Must exactly match the resource ID in the path |
| x-bkn-operation required | string Value: "view_detail" |
| x-bkn-execution-id | string Optional upstream execution identifier included in the audit event |
{- "schema_definition": [
- {
- "name": "string",
- "type": "string",
- "api_name": "string",
- "display_name": "string",
- "description": "string",
- "original_name": "string",
- "original_type": "string",
- "original_description": "string",
- "features": [
- {
- "name": "string",
- "display_name": "string",
- "feature_type": "keyword",
- "description": "string",
- "ref_property": "string",
- "is_default": true,
- "is_native": true,
- "config": { }
}
], - "attributes": { }
}
]
}Requires query_data. object_type, relation_type, and metric
children may use this operation. X-HTTP-Method-Override must be GET;
write overrides are rejected before authorization and physical access.
| id required | string Physical Vega resource ID |
| X-Account-ID required | string Active managed proxy account ID |
| X-Account-Type required | string Value: "app" |
| x-bkn-caller-id required | string Original end-user or workload caller ID |
| x-bkn-caller-type required | string Original caller account type |
| x-bkn-kn-id required | string Knowledge network managed by the proxy account |
| x-bkn-child-type required | string Enum: "object_type" "relation_type" "metric" |
| x-bkn-child-id required | string Published knowledge-network child ID |
| x-bkn-proxy-version required | integer <uint64> >= 1 Current positive version of BKN's knowledge-network-to-proxy mapping, used for trusted-context validation and audit correlation |
| x-bkn-target-type required | string Value: "resource" |
| x-bkn-target-id required | string Must exactly match the resource ID in the path |
| x-bkn-operation required | string Value: "query_data" |
| x-bkn-execution-id | string Optional upstream execution identifier included in the audit event |
| X-HTTP-Method-Override required | string Value: "GET" |
object 过滤条件树。叶节点使用 field、operation、value 和 value_from(const/field); and/or 通过 sub_conditions 嵌套。Override=DELETE 时必填且非空。 时间常量:date 为 YYYY-MM-DD;time 为 HH:mm:ss[.fraction];
datetime 支持 RFC3339、YYYY-MM-DD HH:mm:ss[.fraction] 或 int64 整数毫秒时间戳
(JSON 整数或数字字符串)。小数秒支持 1–9 位;无时区 datetime 按服务器 TZ 解释,默认 UTC。
date/datetime 的 before 使用 可用操作取决于字段类型和查询通道。索引字段比较的日期族两侧均须为 date/datetime/timestamp。 索引 TEXT 的精确及模式匹配要求 keyword Feature。 本地索引常量 !=/not_eq 和 not_in 仅比较具有精确索引值的记录, NULL 或缺失字段不命中;约束位于各自的条件分支内,显式 OR null 仍按该分支求值。 对 string/text 使用 keyword 字段或子字段;原始字符串超过该字段 ignore_above 时, 原值仍保留在 _source,但不写入 keyword 索引和 doc_values,因此也不会命中上述否定条件, 即使查询常量本身未超限。平台新增 string/text keyword 特征的默认上限为 256, 长度单位为 UTF-16 code units,实际限制以索引 mapping 为准。 例如上限 256 时,300 个 ASCII 字符的 body 不会命中 body != "hello" 或 body not_in ["hello"]。这项限制可能使本地索引与源端 SQL 的结果不同; 显式 null/not_null/exist/not_exist 按各自字段的索引存在性求值, 不保证与上述比较条件覆盖全部原始值。 查询常量自身超限则返回 400 VegaBackend.Resource.QueryValueExceedsKeywordLimit, not_in 任一候选值超限也按此处理,与已存储长值不参与比较的行为不同。 日期类 not_in 的存在性约束也计入既有的 1024 条查询子句上限。 需要完整原始值比较时,对支持源查询的 table resource 可设置 ignore_local_index=true; 不会自动回源,dataset 没有原始表查询通道。正文检索可使用已配置全文特征的 match/match_phrase。 contain 在源查询中匹配逗号分隔值的全部给定项, 在索引查询中匹配任一项;索引 not_contain 排除全部给定项。 knn_vector 在索引维度已知时要求输入向量维度匹配。 非法输入或超限返回 HTTP 400,服务端配置或执行故障返回相应 5xx。 已保存的派生视图固定条件非法时返回 VegaBackend.LogicalView.DefinitionInvalid。 索引 datetime 集合最多 1024 个不同时刻;含范围条件的过滤树最多 1024 个查询子句; time 集合展开后最多 65536 项,并受引擎配置限制。 能力与兼容说明。 | |
object (PagingRequest) 首次请求使用 offset 和 limit;cursor 续页以 cursor 定位,need_total 可携带但不会覆盖首次请求冻结值,其余查询参数不得重传。 | |
Array of objects (SortField) 排序字段。派生逻辑视图的非聚合查询支持保留元字段 | |
| output_fields | Array of strings 指定输出字段列表。显式指定的字段必须全部合法;任一字段不存在时整单拒绝,返回
HTTP 400 |
| binary_mode | string Default: "metadata" Enum: "metadata" "content" Binary 字段的返回形式。省略时按 |
| ignore_local_index | boolean Default: false 是否跳过可用的本地索引并查询表的原始数据源;默认 |
| need_total | boolean Default: false 是否在响应里携带 total_count。cursor 首次请求的值会被冻结;续页携带的值被忽略。 |
object (Aggregation) | |
Array of objects (GroupByItem) 索引分组使用同一 PIT 的 composite 分页,保留 NULL/缺失键及多维 NULL 组合, 输出真正的 JSON null;空字符串、0、-1 和字符串 "NULL" 保持独立。 所有索引分组都要求源端支持 OpenSearch PIT 创建、搜索及关闭 API, 包括省略 aggregation,以及 count_distinct 默认或显式允许近似的查询。 PIT API 从 OpenSearch 2.4 引入,因此低于 2.4 的版本不支持此分组路径; 版本达到 2.4 仍须满足所用 API、参数和读取权限要求,不代表各版本均已验收。 当前不适配 Elasticsearch 的 /_pit API,不能因其支持 PIT 就视为兼容索引分组。 创建 PIT 时源端返回 400/404,转换为 HTTP 400 参数错误;401/403 转换为 源端读取权限错误。不回退到 terms 或自动切换查询通道。 日历分组仅返回存在文档的日期,不补齐缺口。COUNT/COUNT_DISTINCT 忽略空值, 已有分组内度量全为空时计数为 0,SUM/AVG/MIN/MAX 为 null。 SUM/MIN/MAX 的 Decimal 结果先按字段有效 scale 做 HALF_UP 归一化; 输出、HAVING、排序及分页使用同一个归一化值,AVG 保留既有结果精度。 HAVING 在聚合值归一化之后执行,再进行全局排序与 offset/limit 截取。 源库及索引未指定排序时按 group_by 顺序对分组键升序排序,NULL 在前; 显式排序并列时以尚未排序的分组键升序打破并列。索引路径由此替代旧 terms 的默认桶顺序。 每页 1000 桶,单页响应最多 8 MiB,保留分组状态计费预算 16 MiB, 整次执行最多 30 秒(更短请求超时优先),与精确去重共享每进程 4 个扫描槽位。 超预算返回 HTTP 422 VegaBackend.Query.ExecutionBudgetExceeded; 用户 limit 只截取完整计算后的结果,较小 limit 不减少扫描范围,也不绕过预算。 旧 terms 曾返回 top-N 的高基数查询,现在可能因完整扫描超预算而返回 422。 超时、分片失败或扫描不完整不返回部分结果。内部 composite 续页不开放公开聚合 cursor。 | |
object (HavingClause) |
{- "filter_condition": { },
- "paging": {
- "mode": "cursor",
- "offset": 0,
- "limit": 1,
- "keep_alive_sec": 60,
- "cursor": "string"
}, - "sort": [
- {
- "field": "string",
- "direction": "asc"
}
], - "output_fields": [
- "string"
], - "binary_mode": "metadata",
- "ignore_local_index": false,
- "need_total": false,
- "aggregation": {
- "property": "string",
- "aggr": "count",
- "allow_approximate": true,
- "alias": "string"
}, - "group_by": [
- {
- "property": "string",
- "description": "string",
- "calendar_interval": "minute"
}
], - "having": {
- "field": "__value",
- "operation": "==",
- "value": null
}
}{- "is_approximate": true,
- "query_source": "local_index",
- "entries": [
- {
- "_id": "string"
}
], - "total_count": 0,
- "paging": {
- "next_cursor": "string",
- "expires_at_sec": 0
}, - "warnings": [
- "string"
]
}