You need to enable JavaScript to run this app.
导航
元数据信息API
最近更新时间:2023.05.26 20:16:03首次发布时间:2022.10.27 19:45:04
1. 获取数据集列表
POST /aeolus/api/v3/open/metadata/dataSetList

入参:
{
    "appId": 1,
    "dataSetIdList": [1],     可选参数,如果不传则返回项目下所有数据集
    "needSyncInfo": true,     是否需要最近同步时间,可选参数,默认值为true。false可提高接口性能
    "needUpstreamInfo": true  是否需要数据源信息,可选参数,默认值为true。false可提高接口性能
}

返回值:
{
    "data": [
        {
            "id": 1,                                数据集id
            "name": "",                             数据集name
            "url": "",                              数据集链接
            "owner": "",                            数据集所有者
            "upstreamInfo": [
                {"dbName": "a", "tableName": "b"}     上游表列表
            ],
            "type": {"code": 2, "name": "hive数据集"},  类型,code为标志码,name为可读名称
            "ctime": "2020-01-01 13:00:00",         创建时间
            "mtime": "2020-01-01 13:00:00"          更新时间
            "lastSyncTime": "2020-01-01 13:00:00"   最近同步时间
        }
    ]
}
2. 获取数据集所用数据源信息

注意:该 API 从 V2.46.0 版本之后可以使用



GET /aeolus/api/v3/open/openDataFactory/getDataModelInfo?dataSetId=1

入参
?dataSetId=xxx
出参
nodeConf": [
            {
                "children": [  children代表该节点为union类型,children对应的value为参与union的所有数据源的信息
                    {  union 1
                        "advanceSettings": [],
                        "clusterName": "cn",
                        "dataSourceType": "hive",  数据源类型
                        "dbName": "dw_aeolus",  库名(部分数据源类型有实际意义,如hive ck)
                        "displayDbName": "dw_aeolus",
                        "fields": [  数据源的字段列表
                            {
                          
                                "alias": "`source_table[dw_aeolus_slowpoke_hive_test_txt]`", 
                                "dsColumnNames": ["source_table1"],  该底表字段对应在数据集中的名称,list
                                "comment": "",
                                "isSelect": false,  👈🏻该数据源自带的字段是否被选用
                                "isSourceTableField": true,
                                "name": "source_table",  👈🏻字段名称(非维度指标;为原始字段)
                                "prepType": "string",
                                "type": "string"  👈🏻字段类型
                            },
                            ....
                        ],
                        "nodeType": "table",
                        "schemaName": "slowpoke_hive_test_txt",  表名
                        "tableAlias": "slowpoke_hive_test_txt",  表别称,当有多个相同表时,alias会加后缀进行区分
                        "tbId": "cn//dw_aeolus//slowpoke_hive_test_txt",
                        "tbName": "slowpoke_hive_test_txt"
                    },
                    {  union 2
                        "clusterName": "cn",
                        "dataSourceType": "hive",
                        "dbName": "dw_aeolus",
                        "displayDbName": "dw_aeolus",
                        "fields": [
                            {
                                "alias": "`source_table[dw_aeolus_slowpoke_hive_test_txt_1]`",
                                "comment": "",
                                "isSelect": true,
                                "isSourceTableField": true,
                                "name": "source_table",
                                "prepType": "string",
                                "type": "string"
                            },
                            .....
                        ],
                        "nodeType": "table",
                        "schemaName": "slowpoke_hive_test_txt_1",
                        "tableAlias": "slowpoke_hive_test_txt_1",
                        "tableRowFilter": {},
                        "tbId": "cn//dw_aeolus//slowpoke_hive_test_txt_1",
                        "tbName": "slowpoke_hive_test_txt"
                    }
                ],
                "fields": [  该fileds代表union 之后作为一个union table节点时,该节点所对应的字段
                    {
                        "alias": "map_store",
                        "comment": "map类型",
                        "dataSourceType": "hive",
                        "fieldMap": [
                            {
                                "fieldName": "map_store",
                                "tableId": "cn//dw_aeolus//slowpoke_hive_test_txt"
                            },
                            {
                                "fieldName": "map_store",
                                "tableId": "cn//dw_aeolus//slowpoke_hive_test_txt_1"
                            }
                        ],
                        "isPartition": false,
                        "isSourceTableField": false,
                        "name": "map_store",
                        "prepType": "string",
                        "type": "string"
                    },
                    ...
                ],
                "nodeType": "union_table"
            },
            {  没有children则代表该节点为单一节点,不存在union,下面为其全部信息,
               key对应内容含义与上面相同
                "clusterName": "cn",
                "dataSourceType": "hive",
                "dbName": "dw_aeolus",
                "displayDbName": "dw_aeolus",
                "fields": [
                    {
                        "alias": "`name[dw_aeolus_slowpoke_hive_two_partition]`",
                        "dsColumnNames": ["name_in_ds"],  该底表字段对应的数据集字段名称,list
                        "comment": "名称",
                        "isSelect": true,
                        "isSourceTableField": false,
                        "name": "name",
                        "prepType": "string",
                        "type": "string"
                    },
                    ....
                ],
                "nodeType": "table",
                "schemaName": "slowpoke_hive_two_partition",
                "tableAlias": "slowpoke_hive_two_partition",
                "tbId": "cn//dw_aeolus//slowpoke_hive_two_partition",
                "tbName": "slowpoke_hive_two_partition"
            }
        ],
        "nodeNum": 2  该数据集画布上组成的节点总数,注意是节点数,union之后所有的内容是一个节点
    }
}
DataSourceType枚举值
DATA_SOURCE_TYPE_HIVE = "hive"
DATA_SOURCE_TYPE_CLICK_HOUSE = "click_house"
DATA_SOURCE_TYPE_MYSQL = "mysql"
DATA_SOURCE_TYPE_KAFKA = "kafka"
DATA_SOURCE_TYPE_DRUID = "druid"
DATA_SOURCE_TYPE_CSV = "csv"
DATA_SOURCE_TYPE_CH_CSV = "ch_csv"
DATA_SOURCE_TYPE_EXCEL = "excel"
DATA_SOURCE_TYPE_CH_EXCEL = "ch_excel"
DATA_SOURCE_TYPE_DOCS = "docs"
DATA_SOURCE_TYPE_ADB2 = "adb2"
DATA_SOURCE_TYPE_ADB3 = "adb3"
DATA_SOURCE_TYPE_FOREIGN = "foreign"
DATA_SOURCE_TYPE_MAXCOMPUTE = "maxcompute"
DATA_SOURCE_TYPE_RESTAPI = "restapi"
DATA_SOURCE_TYPE_LARK_SHEET = "lark_sheet"
DATA_SOURCE_TYPE_LARK_BITABLE = "lark_bitable"
DATA_SOURCE_TYPE_RDS = "rds"
DATA_SOURCE_TYPE_POSTGRESQL = "postgresql"
DATA_SOURCE_TYPE_IMPALA = "impala"
DATA_SOURCE_TYPE_ORACLE = "oracle"
DATA_SOURCE_TYPE_SQLSERVER = "sqlserver"
DATA_SOURCE_TYPE_PHOENIX = "phoenix"
DATA_SOURCE_TYPE_DB2 = "db2"
DATA_SOURCE_TYPE_HANA = "hana"
DATA_SOURCE_TYPE_VERTICA = "vertica"
DATA_SOURCE_TYPE_GREENPLUM = "greenplum"
DATA_SOURCE_TYPE_TERADATA = "teradata"
3. 获取仪表盘列表
POST /aeolus/api/v3/open/metadata/dashboardList?appId=1

入参:
{
    "appId": 1,
    "dashboardIdList": [1],  可选参数,如果不传则返回项目下所有仪表盘
}

返回值:
{
    "data": [
        {
            "id": 1,                                仪表盘id
            "name": "",                             仪表盘名称
            "url": "",                              仪表盘链接
            "owner": "",                            仪表盘所有者
            "ctime": "2020-01-01 13:00:00",         创建时间
            "mtime": "2020-01-01 13:00:00"          更新时间
        }
    ]
}
4. 获取图表列表
POST /aeolus/api/v3/open/metadata/reportList?appId=1

入参:
{
    "appId": 1,
    "reportIdList": [1],  可选参数,如果不传则返回项目下所有图表
}

返回值:
{
    "data": [
        {
            "id": 1,                                图表id
            "name": "",                             图表名称
            "url": "",                              图表链接
            "owner": "",                            图表所有者
            "ctime": "2020-01-01 13:00:00",         创建时间
            "mtime": "2020-01-01 13:00:00"          更新时间
        }
    ]
}
5. 获取仪表盘包含的图表
POST /aeolus/api/v3/open/metadata/dashboardReport

入参:
{
    "appId": 1,
    "dashboardIdList": [1],  可选参数,如果不传则返回项目下所有仪表盘包含的图表
}

返回值:
{
    "data": {
        "1001": [
            {
                "id": 1,                                图表id
                "name": "",                             图表name
                "url": "",                              图表链接
                "owner": "",                            图表所有者
                "ctime": "2020-01-01 13:00:00"          创建时间
                "mtime": "2020-01-01 13:00:00"          更新时间
            }
        ],
        "1002": []
    }
}
6. 获取图表关联的数据集
POST /aeolus/api/v3/open/metadata/reportDataset

入参:
{
    "appId": 1,
    "reportIdList": [1],      可选参数,如果不传则返回项目下所有图表关联的
    "needSyncInfo": true,     是否需要最近同步时间,可选参数,默认值为true。false可提高接口性能
    "needUpstreamInfo": true  是否需要数据源信息,可选参数,默认值为true。false可提高接口性能
}

返回值:
{
    "data": {
        "1001": [
            {
                "id": 1,                                数据集id
                "name": "",                             数据集name
                "url": "",                              数据集链接
                "owner": "",                            数据集所有者
                "ctime": "2020-01-01 13:00:00"          创建时间
                "lastSyncTime": "2020-01-01 13:00:00"   最近同步时间
            }
        ],
        "1002": []
    }
}
7. 获取图表所属的仪表盘
POST /aeolus/api/v3/open/metadata/reportDashboard

入参:
{
    "appId": 1,
    "reportIdList": [1],  可选参数,如果不传则返回项目下所有仪表盘包含的图表
}

返回值:
{
    "data": {
        "1001": [
            {
                "id": 1,                                仪表盘id
                "name": "",                             仪表盘名称
                "url": "",                              仪表盘链接
                "owner": "",                            仪表盘所有者
                "ctime": "2020-01-01 13:00:00"          创建时间
            }
        ],
        "1002": []
    }
}
8. 批量鉴定目标用户是否拥有某些权限
POST /aeolus/api/v3/open/auth/batchCheckAuth

入参:
{
    "originId": "user_1",  鉴权目标用户名
    "resType": "data_set",  需要鉴权的资源类型,枚举:app: 项目,data_set: 数据集, data_set_folder: 数据集文件夹, dashboard: 仪表盘, large_screen: 大屏
    "resIdList": [1, 2, 3],  需要鉴权的资源id列表
    "requiredRole": "",  目标用户需要的权限,可选参数,默认为read_role。枚举:view_only_role: 仅阅览, read_role: 读, write_role: 写, admin: 管理
}

返回值:
{
    "data": {
        "permittedIdList": [1, 2]  目标用户拥有requireRole的资源id列表
    }
}
9. 获取用户权限列表

注意,接口返回结果会与调用者身份取交集,防止越权获取权限。例如,token代表用户A有权限的数据集id为[1, 2, 3],获取其他用户有权限的数据集时,返回的id集合不会超过[1, 2, 3]。
建议app管理员作为token申请者(app管理员拥有项目下全部资源权限)。

GET /aeolus/api/v3/authManagement/userPermittedRes

入参:
{
    "resType": "data_set",  资源类型,数据集:data_set,仪表盘:dashboard
    "originId": "user_1",  用户名
}

返回值:
{
  "res_list": [
    {
      "id": 1,
       view_only_role:仅阅览(无下载权限),read_role:查看,write_role:编辑,admin:管理
      "actions": ["view_only_role", "read_role", "write_role", "admin"],
      "app_id": 123
    }
  ]
}