Skip to content

View Asset Lineage

API Description

Use this API to retrieve upstream and downstream lineage relationships for a specified asset.

API URL

GET http://{anymetrics_host:anymetrics_port}/anymetrics/api/v1/lineage/queryVertexLineage

To obtain anymetrics_host:anymetrics_port, see Calling APIs.

Request Parameters

Common Request Headers

Parameter Type Required Description
tenant-id String Yes The tenant ID of the tenant that contains the metric query assets.
auth-type String Yes Authentication type. Supported values: UID, TOKEN, ACCOUNT, APIKEY.
auth-value String Yes Authentication value corresponding to auth-type.

Request Parameters

Parameter Type Required Description
vertex_id String Yes Vertex ID.
vertex_type String Yes Vertex type.
input_step Integer Yes Number of upstream edge hops.
output_step Integer Yes Number of downstream edge hops.

Resource Description

Lineage relationship description:

image.png

Vertex types and descriptions:

Vertex Type Vertex ID Description ID Example
FILE File GUID in the engine. Format: catalog.schema.table, where the three parts represent catalog, schema, and table. aloudata_am_upload_database_dev.public.product
FILE_COLUMN Column in an uploaded file table. The column name is appended to the file GUID in the format catalog.schema.table.column. aloudata_am_upload_database_dev.public.product.product_name
PHYSICAL_TABLE Physical table GUID in the engine. Format: catalog.schema.table. default_catalog.anymetrics.tb_order
PHYSICAL_TABLE_COLUMN Column in a physical table. The column name is appended to the physical table GUID in the format catalog.schema.table.column. default_catalog.anymetrics.tb_order.order_amt
DATASET Dataset name. tb_order
DATASET_COLUMN Dataset name plus dataset column name. Format: dataset.column. tb_order.order_amt
DIMENSION Dimension name, that is, the dimName dimension attribute. tb_order_city
METRIC Metric name, that is, the metricName metric attribute. 7d_sum_order_amt
ANALYSIS_VIEW Metric view name. 7d_sum_order_amt_view

Request Example

http://127.0.0.1:8083/anymetrics/api/v1/lineage/queryVertexLineage?input_step=1&output_step=1&vertex_id=DFGHJK&vertex_type=METRIC

Response Example

{
    "data": {
        "vertexList": [
            {
                "vertexId": "DWD_CW_YFHZ",
                "vertexType": "DATASET",
                "displayName": "DWD_CW_YFHZ",
                "description": "",
                "custom": null
            },
            {
                "vertexId": "DWD_CW_YFHZ.YWFWDM",
                "vertexType": "DATASET_COLUMN",
                "displayName": null,
                "description": null,
                "custom": null
            },
            {
                "vertexId": "DFGHJK",
                "vertexType": "METRIC",
                "displayName": "GHJDFGHJ",
                "description": "CVBN",
                "custom": {
                    "originDataType": "BIGINT",
                    "type": "ATOMIC",
                    "category": [
                        {
                            "name": "Uncategorized",
                            "id": "-1"
                        }
                    ]
                }
            },
            {
                "vertexId": "date_dimension.year",
                "vertexType": "DATASET_COLUMN",
                "displayName": null,
                "description": null,
                "custom": null
            },
            {
                "vertexId": "DWD_CW_YFHZ.CJRQ",
                "vertexType": "DATASET_COLUMN",
                "displayName": null,
                "description": null,
                "custom": null
            },
            {
                "vertexId": "test1",
                "vertexType": "ANALYSIS_VIEW",
                "displayName": "test1",
                "description": "",
                "custom": null
            }
        ],
        "edgeList": [
            {
                "srcVertex": {
                    "vertexId": "DWD_CW_YFHZ.YWFWDM",
                    "vertexType": "DATASET_COLUMN"
                },
                "dstVertex": {
                    "vertexId": "DFGHJK",
                    "vertexType": "METRIC"
                },
                "edgeType": "COLUMN_IMPACT"
            },
            {
                "srcVertex": {
                    "vertexId": "date_dimension.year",
                    "vertexType": "DATASET_COLUMN"
                },
                "dstVertex": {
                    "vertexId": "DFGHJK",
                    "vertexType": "METRIC"
                },
                "edgeType": "COLUMN_IMPACT"
            },
            {
                "srcVertex": {
                    "vertexId": "DWD_CW_YFHZ.CJRQ",
                    "vertexType": "DATASET_COLUMN"
                },
                "dstVertex": {
                    "vertexId": "DFGHJK",
                    "vertexType": "METRIC"
                },
                "edgeType": "COLUMN_IMPACT"
            },
            {
                "srcVertex": {
                    "vertexId": "DWD_CW_YFHZ",
                    "vertexType": "DATASET"
                },
                "dstVertex": {
                    "vertexId": "DFGHJK",
                    "vertexType": "METRIC"
                },
                "edgeType": "TABLE_IMPACT"
            },
            {
                "srcVertex": {
                    "vertexId": "DFGHJK",
                    "vertexType": "METRIC"
                },
                "dstVertex": {
                    "vertexId": "test1",
                    "vertexType": "ANALYSIS_VIEW"
                },
                "edgeType": "TABLE_IMPACT"
            }
        ]
    },
    "success": true,
    "code": "200",
    "errorMsg": null,
    "detailErrorMsg": null,
    "traceId": "260f158866654614b2ac8f1392995c3a.11134.17346624665670963"
}