获取数据集详情 - ShowDatasetDetail
功能介绍
获取数据集详情。
授权信息
账号具备所有API的调用权限,如果使用账号下的IAM用户调用当前API,该IAM用户需具备调用API所需的权限。
- 如果使用角色与策略授权,具体权限要求请参见权限和授权项。
- 如果使用身份策略授权,当前API调用无需身份策略权限。
URI
GET /v1/{project_id}/datasets/{dataset_id}/metadata
|
参数 |
是否必选 |
参数类型 |
描述 |
|---|---|---|---|
|
dataset_id |
是 |
String |
数据集ID。 |
|
project_id |
是 |
String |
项目ID。获取方法请参考获取项目ID。 |
请求参数
|
参数 |
是否必选 |
参数类型 |
描述 |
|---|---|---|---|
|
X-Workspace-Id |
是 |
String |
工作空间ID。获取方法请参见获取工作空间ID。 |
|
X-Auth-Token |
是 |
String |
用户Token。通过调用IAM服务获取IAM用户Token接口,接口返回的响应消息头中“X-Subject-Token”就是需要获取的用户Token。 |
响应参数
状态码:200
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
caption |
String |
数据集语义化名称。 |
|
domain_id |
String |
租户ID。 |
|
ds_id |
String |
数据源ID。 |
|
ds_type |
String |
数据源类型。
|
|
id |
String |
数据集ID。 |
|
logical_schema |
表4 object |
数据集逻辑schema。 |
|
physical_schema |
表13 object |
数据集物理schema。 |
|
project_id |
String |
项目ID。 |
|
version |
String |
数据集版本:默认为2.0,1.0|2.0。 |
|
workspace_id |
String |
工作空间ID。 |
|
create_date |
Long |
创建时间戳。 |
|
create_user |
String |
创建者ID。 |
|
create_user_name |
String |
创建者名称。 |
|
update_date |
Long |
更新时间戳。 |
|
update_user |
String |
更新者ID。 |
|
update_user_name |
String |
更新者名称。 |
|
resource_code |
String |
数据集资源标识。 |
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
field_schema |
表5 object |
字段schema。 |
|
relations |
Array of 表10 objects |
物理表关系。 |
|
variables |
Array of 表12 objects |
SQL变量列表。 |
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
dimensions |
Array of 表6 objects |
维度。 |
|
measures |
Array of 表9 objects |
度量。 |
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
caption |
String |
维度语义化名。 |
|
cube_id |
String |
维度所属物理表ID。 |
|
description |
String |
维度描述。 |
|
id |
String |
维度ID。 |
|
hierarchies |
Array of 表7 objects |
维度层级。 |
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
caption |
String |
语义化名。 |
|
column_formula |
String |
level表达式。 |
|
data_type |
String |
字段类型。
|
|
expansion_type |
Integer |
扩展字段类型。
|
|
id |
String |
ID。 |
|
is_expansion |
Integer |
是否为扩展字段。 枚举值:
|
|
level_type |
String |
level类型。 |
|
origin_column_name |
String |
原始字段名称。 |
|
origin_column_type |
String |
原始字段类型。 |
|
origin_data_type |
String |
转换前的数据类型。
|
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
caption |
String |
度量语义化名。 |
|
column_formula |
String |
度量字段表达式。 |
|
cube_id |
String |
字段所属物理表id。 |
|
data_type |
String |
数据类型:STRING|NUMBER|DATE|DATETIME。 枚举值:
|
|
expansion_type |
Integer |
扩展字段类型:0-普通扩展字段;1-聚合扩展字段。 |
|
id |
String |
度量ID。 |
|
is_expansion |
Integer |
是否为扩展字段:0-不是;1-是。 |
|
origin_column_name |
String |
原始字段名称。 |
|
origin_column_type |
String |
原始字段类型。 |
|
origin_data_type |
String |
转换前的数据类型:STRING|NUMBER|DATE|DATETIME。 枚举值:
|
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
join_type |
String |
关联类型:left join|right join|inner join。 |
|
joins |
Array of 表11 objects |
关联键。 |
|
relation |
String |
关系类型:one-to-one|one-to-many|many-to-one。 |
|
source |
String |
源表ID。 |
|
target |
String |
目标表ID。 |
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
condition |
String |
关系,equal-to。 |
|
source_key |
String |
源字段ID。 |
|
source_type |
String |
源字段类型:dimension|measure。 |
|
target_key |
String |
目标字段ID。 |
|
target_type |
String |
目标字段类型:dimension|measure。 |
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
default_values |
Array of objects |
变量默认值。 |
|
format |
String |
变量格式,针对日期时间类型变量有效。 |
|
name |
String |
变量名称。 |
|
type |
String |
参数解释: 变量类型,目前支持文本、数值、日期、系统变量等类型。 约束限制: 不涉及 取值范围: 以下枚举值:
默认取值: 不涉及 |
|
use_scope |
String |
变量作用域,dataset|global。 |
请求示例
GET https://{endpoint}/v2/{project_id}/datasets/{dataset_id}/metadata
响应示例
状态码:200
获取数据集详情成功。
{
"create_date" : 1705458279173,
"create_user" : "cfcxxxx4501811aedcxxxxbbfe8",
"create_user_name" : "xxxxxxx",
"update_date" : 1705458279173,
"update_user" : "cfcc77xxxx364501811aedcxxxxbbfe8",
"update_user_name" : "xxxxxxx",
"project_id" : "34ba64e53axxxb68cd7xxxxa8cc17bd",
"workspace_id" : "d39157xxxx5f43c2bdxxxx74792b2d5e",
"id" : "b745d57b-xxxx-4f2a-xxxx-3c0ff5fcf92f",
"caption" : "api测试数据集10",
"version" : "2.0",
"ds_id" : "2eaa208dxxxxxxx9496914134fae2d4",
"ds_type" : "DWS",
"domain_id" : "10ae45e7xxxxxxbe954a211426d003",
"physical_schema" : {
"tables" : [ {
"id" : "a25173cb-xxxx-42ec-xxxxx-67483f6cdaab",
"database_name" : "modernbi_demo",
"schema_name" : "autotest",
"table_name" : "order_info",
"table_type" : "table",
"sql_text" : "",
"is_fact_table" : false
}, {
"id" : "b745d57b-xxxx-4f2a-xxxx-3c0ff5fcf92f",
"database_name" : "modernbi_demo",
"schema_name" : "autotest",
"table_name" : "sql_order_info",
"table_type" : "sql",
"sql_text" : "select * from autotest.order_info",
"is_fact_table" : true
} ]
},
"logical_schema" : {
"field_schema" : {
"measures" : [ {
"id" : "2d83ad17-32bb-xxxx-9c55-xxxxxxx",
"caption" : "cs_bill_customer_sk",
"is_expansion" : 0,
"expansion_type" : 0,
"column_formula" : "cs_xxxxx_customer_sk",
"origin_column_name" : "cs_xxxx_customer_sk",
"origin_column_type" : "int8",
"data_type" : "NUMBER",
"origin_data_type" : "NUMBER",
"cube_id" : "2d83ad17-xxxxxxxxx-9c55-2a47415bdaf6"
} ],
"dimensions" : [ {
"id" : "a25173cb-e229-xxxxxxx-67483f6cdaab.id",
"caption" : "id1",
"dimension_type" : "StandardDimension",
"hierarchies" : [ {
"caption" : "id1",
"levels" : [ {
"id" : "a25173cb-xxxxxxxxc-a4b4-67483f6cdaab.id",
"caption" : "id1",
"data_type" : "STRING",
"origin_data_type" : "STRING",
"origin_column_name" : "id",
"origin_column_type" : "varchar(255)",
"column_formula" : "id",
"level_type" : null,
"is_expansion" : 0,
"expansion_type" : 0
} ]
} ],
"cube_id" : "a25173cb-xxxxxxxc-a4b4-67483f6cdaab"
} ]
},
"variables" : null,
"relations" : [ {
"source" : "b745d57b-axxxxx8ee4-3c0ff5fcf92f",
"target" : "a25173cb-xxxxxx-a4b4-67483f6cdaab",
"join_type" : "left join",
"relation" : "many-to-one",
"joins" : [ {
"source_key" : "product_id",
"source_type" : "dimension",
"target_key" : "product_id",
"target_type" : "dimension",
"condition" : "equal-to"
} ]
} ]
}
}
状态码
|
状态码 |
描述 |
|---|---|
|
200 |
获取数据集详情成功。 |
错误码
请参见错误码。