Updated on 2025-11-17 GMT+08:00

Creating a Lineage

Function

This API is used to create a lineage.

Calling Method

For details, see Calling APIs.

URI

POST /v1/{project_id}/lineage/lineage-info

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID. For details about how to obtain it, see Project ID and Account ID.

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token. This parameter is mandatory if token authentication is used. You can obtain it from the value of X-Subject-Token in the response message header returned by the "Obtaining a User Token" API of the IAM service.

workspace

Yes

String

Workspace ID. For details about how to obtain it, see Instance ID and Workspace ID.

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

cluster_id

No

String

Cluster ID

data_source_type

No

String

Data connection type

connection_id

No

String

Data connection ID

connection_name

No

String

Data connection name

workspace_id

No

String

Workspace ID

job_id

No

String

Job ID

node_name

No

String

Operator name

table_lineage

No

TableLineageV2 object

Lineage

Table 4 TableLineageV2

Parameter

Mandatory

Type

Description

input_tables

Yes

Array of TableInfoV2 objects

Upstream lineage table list. The list size ranges from 1 to 100.

output_tables

Yes

Array of TableInfoV2 objects

Downstream lineage table list. The list size ranges from 1 to 100.

column_lineages

No

Array of ColumnLineageV2 objects

Field lineage list. The list size ranges from 0 to 100.

Table 5 TableInfoV2

Parameter

Mandatory

Type

Description

catalog

No

String

Catalog name

database

No

String

Database name

schema

No

String

Schema name

table

No

String

Table name

Table 6 ColumnLineageV2

Parameter

Mandatory

Type

Description

input_columns

Yes

Array of ColumnDetails objects

Upstream lineage field list. The list size ranges from 1 to 100.

output_columns

Yes

Array of ColumnDetails objects

Downstream lineage field list. The list size ranges from 1 to 100.

Table 7 ColumnDetails

Parameter

Mandatory

Type

Description

database

No

String

Database name

schema

No

String

Schema name

table

No

String

Table name

column

No

String

Specifies the column name.

Response Parameters

Status code: 200

Table 8 Response body parameters

Parameter

Type

Description

[items]

Array of ObjectIdInfo objects

Lineage Import Result

Table 9 ObjectIdInfo

Parameter

Type

Description

name

String

Name of a job operator.

type_name

String

Asset type.

qualified_name

String

Uniquely qualified name of a job asset.

Status code: 400

Table 10 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error description.

Status code: 401

Table 11 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error description.

Status code: 403

Table 12 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error description.

Status code: 404

Table 13 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error description.

Example Requests

{
  "cluster_id" : "actual_cluster_id",
  "data_source_type" : "actual_data_source_type",
  "connection_id" : "003b3ed52daf41e6829a0bc74526f5f7",
  "connection_name" : "dli_test",
  "workspace_id" : "1b59d3c777ad4d619b89eeac4f3cce87",
  "job_id" : "testJobID",
  "node_name" : "testNodeMName",
  "table_lineage" : {
    "input_tables" : [ {
      "catalog" : "spark_catalog",
      "database" : "nbbtemp",
      "schema" : "",
      "table" : "origndata_typeall"
    } ],
    "output_tables" : [ {
      "catalog" : "spark_catalog",
      "database" : "nbbtemp",
      "schema" : "",
      "table" : "lineageTable1"
    } ],
    "column_lineages" : [ {
      "input_columns" : [ {
        "database" : "nbbtemp",
        "schema" : "",
        "table" : "origndata_typeall",
        "column" : "stringf"
      } ],
      "output_columns" : [ {
        "database" : "nbbtemp",
        "schema" : "",
        "table" : "lineageTable1",
        "column" : "col1"
      } ]
    } ]
  }
}

Example Responses

Status code: 200

OK

[ {
  "name" : "test",
  "type_name" : "Node",
  "qualified_name" : "manual.a0683065-cfb6-42d3-a0ff-87b2cc5e3c79@node.0833a5737480d53b2f25c010dc1a7b88-workspace-ee119e8faee347a389e8c295b926331c"
} ]

Status Codes

Status Code

Description

200

OK

400

BadRequest

401

Unauthorized

403

Forbidden

404

Not Found