跳转至

概述

资产详情API用于查询某个资产的详细信息,包括表名,表的描述信息,表的类型信息,表的标签信息,表的属性信息,表的类目信息,表的关注数量信息,表的负责人信息,表的路径信息,表的字段详细信息。

接口URL

GET  Http://{air_host:air_port}/air/api/v1/asset/detail

请求参数

3.1 公共参数(HEADERS)

参数 必选 描述 类型 最大长度
tenant-id 租户ID,需要根据租户id查询对应的集群id String 32
auth-type 固定值,用于设置身份认证方式UID:使用 UID 进行身份认证TOKEN:使用 TOKEN 进行身份认证 String 32
auth-value 与 auth-type 类型的选择一致,填入相应值 String 32
query-user-account 用户名,使用该用户身份查询数据 String 32

3.2 请求参数

参数 必选 描述 类型
datasetGuid 资产的路径字符串形式,格式是"catalogName"."schemaName"."tableName" String

响应参数

参数 必选 描述 示例值 类型 最大长度
errorCode 错误码 DWS01002 String 32
errorMessage 错误信息 用户不存在 String 512
traceId traceId 343f9ff2dcd7642861 String 128
data 查询返回的数据内容 4.1data 表

4.1 data表

参数 必选 描述 示例值 类型
tableName 表名字 call_center String
description 表描述信息 call_center描述 String
guid 资产路径字符串形式 "mysql"."tpcds"."call_center" String
path 资产路径数组形式 ["mysql", "tpcds","call_center"] Array
type 表的类型:VIEW: 逻辑视图TABLE: 基础视图INTERNAL_TABLE: 物理表DIALECT_VIEW: 方言视图PARAMS_TYPE: 参数化视图 TABLE String
originalSql 视图定义,如果是基础视图则没有定义 SELECT * FROM"mysql"."tpcds"."call_center" String
gmtCreate 资产创建时间(时间戳) 1736756168599 Long
gmtModified 资产修改时间(时间戳) 1736756168599 Long
sourceType 资产来源哪个数据源(基础视图才有) MYSQL String
categories 当前资产在哪个分类下(默认是在未分类) ["销售","华中区"] Array
isAttention 当前用户是否关注了这张表 true Boolean
attentions 表的关注数量 2 Integer
columns 字段信息 详细4.2columns Array
attributes 表的属性信息 详见4.3attributes Array
tags 表的标签信息 详解4.4tags Array

4.2 columns字段信息

[{
  "name":"dept_no",
  "description":"部门id",
  "isPartitioned": true / false, // 是否分区字段
  "attributes": "详见4.3attributes", // 字段属性信息
  "tags":"详见4.4tags", // 字段的标签信息
  "type": "VARCHAR(4)" // 字段类型
}]

4.3 attributes资产属性信息

[{
  "assetAttributeId":"qtu47f6t4w", // 资产属性唯一id
  "assetType":"VIEW/COLUMN", // VIEW:表资产属性  COLUMN: 字段资产属性
  "displayName":"字段类型", // 资产属性展示名字
  "content":"string", // 资产属性内容
}]

4.4 tags标签信息

[{
  "tagId": "asu97l6t4g", // 标签的唯一id
  "tagName": "上游资产", // 标签的名字
}]

请求示例

5.1 查看基础视图详情

查看 "gausss"."tpcds"."store"详情信息

请求url: GET Http://127.0.0.1:8080/air/api/v1/asset/detail?datasetGuid=%22gauss%22.%22tpcds%22.%22store%22

返回信息:

{
    "data": {
        "attributes": [
            {
                "assetAttributeId": "F32KB6X",
                "assetType": "VIEW",
                "content": "3级",
                "displayName": "安全等级",
            }
        ],
        "categories": [{
          "categoryId":"asu97l6t4g",
          "name:": "未分类"
        }],
        "columnResponse": [
            {
                "attributes": [
                    {
                        "assetAttributeId": "ATTR_FVESTW5",
                        "assetPath": "\"gauss\".\"tpcds\".\"store\"",
                        "assetType": "COLUMN",
                        "content": "int",
                        "displayName": "字段类型",
                        "type": "ENUM"
                    }
                ],
                "description": "",
                "displayColumnType": "INTEGER",
                "isPartitioned": false,
                "name": "s_closed_date_sk",

                "tags": [
                    {
                        "tagColor": "#59A14E",
                        "tagId": "TAG_Q5JVGB0",
                        "tagName": "重要信息",
                        "tagType": "COLUMN"
                    }
                ],
                "type": "INTEGER"
            }
        ],
        "description": "",
        "isAttention": false,
        "attentions": 0,
        "gmtCreate": 1736263158138,
        "gmtModified": 1736263158138,
        "guid": "\"gauss\".\"tpcds\".\"store\"",
        "name": "store",
        "owner": "Aloudata",
        "path": ["gauss", "tpcds", "store"],
        "sourceType": "GAUSS",
        "tableName": "store",
        "tags": [
            {
                "tagColor": "#B07AA1",
                "tagId": "TAG_M2HMO16",
                "tagName": "上游资产",
                "tagType": "VIEW"
            }
        ],
        "type": "TABLE"
    },
    "errorCode": "",
    "errorMsg": "",
    "success": true,
    "traceId": "894f3a9852ac46e8af7ac4e17f69227a.157.17367605287919151"
}