设为节点生效版本

设置指定处理节点输出内容的生效版本。

POST https://api.moi.matrixorigin.cn/v5/lineage/artifacts/{artifact_id}/nodes/{node_id}/effective-revisions

调用前准备

准备可访问目标工作区的个人访问令牌和目标工作区 ID。

请求体

将示例中的 $ARTIFACT_ID、$NODE_ID、$AI_STUDIO_API_KEY、$WORKSPACE_ID 替换为实际值。

curl -X POST "https://api.moi.matrixorigin.cn/v5/lineage/artifacts/$ARTIFACT_ID/nodes/$NODE_ID/effective-revisions" \
  -H "X-API-Key: $AI_STUDIO_API_KEY" \
  -H "X-Workspace-ID: $WORKSPACE_ID" \
  -H "Content-Type: application/json" \
  -d '{
  "switches": [
    {
      "block_id": "block-001",
      "effective_revision_id": "rev-002"
    }
  ],
  "expected_effective_set_version": 0
}'

参数

类型

是否必填

说明

artifact_id

string

是

根资产 ID 与源运行 ID 组成的复合标识,作为一个路径段编码。

node_id

string

是

完整节点路径,例如 root.prepare。

请求体

字段

类型

是否必填

说明

expected_effective_set_version

integer

是

用于避免并发覆盖的生效版本集版本号。不小于 0。

switches

object(对象数组)

是

要更新的输出内容列表。至少 1 项。

switches[].block_id

string

对象提供时

输出块 ID。不能为空。

switches[].effective_revision_id

string

否

当前生效修订 ID。

switches[].use_original

boolean

否

是否使用原始内容作为基线。

expected_effective_set_version 必须提交,首次切换为 0。版本冲突返回 409。读取最新状态并核对选择后再提交。

switches 必须满足接口规定的非空与唯一性要求,不能重复选择同一目标。即使选择与当前相同,也会推进版本。目标不存在或版本冲突分别返回 404、409。

成功响应

{
  "code": "OK",
  "msg": "OK",
  "data": {
    "artifact_id": "asset-001:case-001",
    "node_id": "root.prepare",
    "effective_set_version": 4
  }
}

字段

类型

说明

data.artifact_id

string

处理结果 ID。

data.node_id

string

节点 ID。

data.node_execution_id

string

节点执行 ID。

data.output_artifact_id

string

输出产物 ID。

data.effective_set_version

integer

设置后的生效版本集版本号。不小于 1。

错误响应

{
  "code": "ErrParamInvalid",
  "msg": "请求参数无效",
  "data": null
}

字段

类型

是否必填

说明

code

string

否

错误代码。

msg

string

否

可读错误信息。

data

null

否

错误响应中为 null。

最后更新于