按资产 ID 查询数据资产

使用资产 ID 查询资产、派生关系和适用的解析清单。

GET https://api.moi.matrixorigin.cn/v5/catalog/data-assets/{id}

调用前准备

BASE_URL 使用产品 API 前缀 https://api.moi.matrixorigin.cn/v5;专有部署填写对应的产品 API 地址。

从实际资产结果取得 asset_id。准备对资产根卷具有读取权限的个人访问令牌和工作区 ID。BASE_URL 包含同环境产品前缀;MOI_KEY 和 WORKSPACE_ID 分别为产品凭据与工作区 ID。示例 ID 和数据均为占位值。

请求参数

curl --fail-with-body -sS -X GET "$BASE_URL/catalog/data-assets/asset-example" \
  -H "X-API-Key: $MOI_KEY" \
  -H "X-Workspace-ID: $WORKSPACE_ID"

字段

类型

是否必填

说明

id

string

是

路径中的资产 ID;不是数值记录 id、原始 file_id 或 asset_ref。

资产 ID 和原始文件 ID 使用不同读取入口。需要按文件查询时继续使用已有文件查询接口。

成功响应

{
  "code": "OK",
  "msg": "OK",
  "data": {
    "asset": {
      "id": 1,
      "asset_id": "asset-example",
      "name": "orders.csv",
      "raw_file_id": "file-example",
      "volume_id": 30,
      "source": "workflow",
      "meta": {
        "source": "sample"
      },
      "created_at": 1794390000,
      "updated_at": 1794390001,
      "asset_type": "file",
      "asset_ref": "file-example"
    },
    "derivations": [
      {
        "id": 2,
        "asset_id": "asset-example",
        "kind": "parsed_from",
        "file_id": "parsed-file-example",
        "meta": {
          "step": "parse"
        },
        "created_at": 1794390000,
        "updated_at": 1794390001,
        "root_asset_id": "asset-example",
        "source_asset_id": "asset-example",
        "target_asset_id": "parsed-asset-example",
        "case_id": "case-example",
        "producer_workitem_id": "producer-example",
        "recorded_by_workitem_id": "recorder-example",
        "parallel_index": 1,
        "logical_slot": "parsed",
        "idempotency_key": "key-example"
      }
    ],
    "manifest": {
      "id": 3,
      "asset_id": "asset-example",
      "raw_file_id": "file-example",
      "parsed_file_id": "parsed-file-example",
      "manifest": {
        "format": "sample"
      },
      "created_at": 1794390000,
      "updated_at": 1794390001,
      "root_asset_id": "asset-example",
      "source_file_id": "file-example",
      "parsed_asset_id": "parsed-asset-example"
    },
    "assets_by_id": {
      "asset-example": {
        "id": 1,
        "asset_id": "asset-example",
        "name": "orders.csv",
        "raw_file_id": "file-example",
        "volume_id": 30,
        "source": "workflow",
        "meta": {
          "source": "sample"
        },
        "created_at": 1794390000,
        "updated_at": 1794390001,
        "asset_type": "file",
        "asset_ref": "file-example"
      },
      "parsed-asset-example": {
        "id": 1,
        "asset_id": "parsed-asset-example",
        "name": "parsed.jsonl",
        "volume_id": 30,
        "source": "workflow",
        "meta": {
          "source": "sample"
        },
        "created_at": 1794390000,
        "updated_at": 1794390001,
        "asset_type": "file",
        "asset_ref": "parsed-file-example"
      }
    }
  }
}

字段

类型

说明

code

string

成功时为 OK。

msg

string

成功时为 OK。

data.asset

object

目标资产。字段见资产对象。

data.derivations

object[](对象数组)

派生关系;空列表可省略。字段见派生关系。

data.manifest

object

解析清单;不存在时省略。字段见清单对象。

data.assets_by_id

object

相关资产按 asset_id 索引,值使用同一资产结构;空集合可省略。

错误响应

{
  "code": "ErrNotFound",
  "msg": "示例错误信息"
}

HTTP

code

条件

404

ErrNotFound

业务读取中目标资产不存在;权限边界也可能先返回自身错误。

400

ErrParamInvalid

资产标识或工作区输入无效。

身份、权限及依赖失败以实际返回的 code、msg 和诊断字段为准。错误文案可随语言变化。

最后更新于