查看衍生指标详情
功能介绍
通过ID获取衍生详情信息。
调用方法
请参见如何调用API。
URI
GET /v2/{project_id}/design/derivative-indexs/{id}
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
project_id |
是 |
String |
项目ID,获取方法请参见项目ID和账号ID。 最小长度:3 最大长度:64 |
id |
是 |
String |
实体ID,填写String类型替代Long类型。 |
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
latest |
否 |
Boolean |
是否查询最新的。 |
请求参数
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
X-Auth-Token |
是 |
String |
IAM Token,通过调用IAM服务获取用户Token接口获取(响应消息头中X-Subject-Token的值) 使用Token认证时必选。 最小长度:0 最大长度:4096 |
workspace |
是 |
String |
工作空间ID,获取方法请参见实例ID和工作空间ID。 最小长度:3 最大长度:64 |
X-Project-Id |
否 |
String |
项目ID,获取方法请参见项目ID和账号ID。 多project场景采用AK/SK认证的接口请求,则该字段必选。 最小长度:3 最大长度:64 |
Content-Type |
否 |
String |
默认值:application/json;charset=UTF-8 可选,有Body体的情况下必选,没有Body体则无需填写和校验。 最小长度:3 最大长度:64 |
响应参数
状态码: 200
参数 |
参数类型 |
描述 |
---|---|---|
data |
data object |
返回数据。 |
参数 |
参数类型 |
描述 |
---|---|---|
id |
String |
编码,填写String类型替代Long类型。 |
name_en |
String |
字段名。 最大长度:200 |
name_ch |
String |
中文名。 最大长度:200 |
description |
String |
描述,只读。 最大长度:600 |
create_by |
String |
创建人。 |
data_type |
String |
字段类型。 |
l1_id |
String |
主题域分组ID,只读,填写String类型替代Long类型。 |
l2_id |
String |
主题域ID。 |
l3_id |
String |
业务对象guid,填写String类型替代Long类型。 |
status |
String |
实体的发布状态,只读,创建和更新时无需填写。 枚举值:
|
atomic_index_id |
String |
原子指标ID,填写String类型替代Long类型。 |
time_condition_id |
String |
时间限定ID,填写String类型替代Long类型。 |
time_field_id |
String |
时间限定关联字段ID,填写String类型替代Long类型。 |
time_field_name |
String |
时间限定关联字段名称,只读。 |
common_conditions |
Array of CommonConditionVO objects |
通用限定信息。 |
dimension_groups |
Array of DerivativeIndexDimensionVO objects |
维度组(颗粒度)。 |
monitor |
MetricMonitorVO object |
指标监控。 |
atomic_index |
AtomicIndexVO object |
原子指标信息,名称、单位,只读。 |
time_condition_name |
String |
时间限定名称,只读。 |
create_time |
String |
创建时间,只读,格式遵循RFC3339,精确到秒,UTC时区,即yyyy-mm-ddTHH:MM:SSZ,如1970-01-01T00:00:00Z。 |
update_time |
String |
更新时间,只读,格式遵循RFC3339,精确到秒,UTC时区,即yyyy-mm-ddTHH:MM:SSZ,如1970-01-01T00:00:00Z。 |
l1 |
String |
主题域分组中文名,只读,创建和更新时无需填写。 |
l2 |
String |
主题域中文名,只读,创建和更新时无需填写。 |
l3 |
String |
业务对象中文名,只读,创建和更新时无需填写。 |
summary_table_id |
String |
汇总表ID,只读,填写String类型替代Long类型。 |
approval_info |
ApprovalVO object |
审批信息,只读参数。业务对象最近一次的审批信息,包括审批的业务详情、审核人信息、审核时间等。 |
new_biz |
BizVersionManageVO object |
业务版本管理,只读。 |
参数 |
参数类型 |
描述 |
---|---|---|
name |
String |
名称。 |
field_ids |
Array of strings |
字段id信息,格式:table_id.field_id。 |
field_names |
Array of strings |
字段名称信息,格式:表名称.字段名称。 |
cal_exp |
String |
计算表达式,形如'${table_id.column_id} > 1',其中table_id表示引用字段所属表ID,column_id表示引用字段ID。 最大长度:20000 |
cal_fn_ids |
Array of strings |
引用函数ID,填写String类型替代Long类型。 |
front_configs |
String |
前端表达式配置,用于前端数据恢复。 |
id |
String |
通用限定ID,只读,填写String类型替代Long类型。 |
参数 |
参数类型 |
描述 |
---|---|---|
group_id |
String |
维度分组ID。 |
role |
String |
维度角色。 |
dimension_id |
String |
维度ID,填写String类型替代Long类型。 |
hierarchies_id |
String |
维度层级ID,填写String类型替代Long类型。 |
ordinal |
Integer |
序号,只读。 |
group_name |
String |
维度分组名称。 |
group_code |
String |
维度分组编码。 |
biz_type |
String |
业务实体类型。 枚举值:
|
hierarchies |
Array of DimensionHierarchiesVO objects |
层级属性,只读。 |
l1 |
String |
主题域分组,只读。 |
l2 |
String |
主题域,只读。 |
l3 |
String |
业务对象,只读。 |
l1_id |
String |
主题域分组ID,只读,填写String类型替代Long类型。 |
l2_id |
String |
主题域ID。 |
l3_id |
String |
业务对象ID,只读,填写String类型替代Long类型。 |
dw_type |
String |
数据连接类型。 |
id |
String |
层级的ID,只读,填写String类型替代Long类型。 |
参数 |
参数类型 |
描述 |
---|---|---|
id |
String |
编码,填写String类型替代Long类型。 |
name |
String |
层级名称。 最大长度:600 |
attrs |
Array of HierarchiesAttrVO objects |
层级包含的属性。 |
create_time |
String |
创建时间,只读,格式遵循RFC3339,精确到秒,UTC时区,即yyyy-mm-ddTHH:MM:SSZ,如1970-01-01T00:00:00Z。 |
update_time |
String |
更新时间,只读,格式遵循RFC3339,精确到秒,UTC时区,即yyyy-mm-ddTHH:MM:SSZ,如1970-01-01T00:00:00Z。 |
create_by |
String |
创建人。 |
update_by |
String |
更新人。 |
参数 |
参数类型 |
描述 |
---|---|---|
id |
String |
编码,填写String类型替代Long类型。 |
hierarchies_id |
String |
层级ID,填写String类型替代Long类型。 |
attr_id |
String |
属性ID,填写String类型替代Long类型。 |
level |
Integer |
层次。 |
attr_name_en |
String |
引用属性编码。 |
attr_name_ch |
String |
引用属性名称,只读。 |
detail_attr_ids |
Array of strings |
详情属性ID,填写String类型替代Long类型。 |
detail_attr_name_ens |
Array of strings |
详情属性英文。 |
detail_attr_name_chs |
Array of strings |
详情属性中文,只读。 |
attr |
DimensionAttributeVO object |
引用属性字段,只读。 |
detail_attrs |
Array of DimensionAttributeVO objects |
详情字段,只读。 |
参数 |
参数类型 |
描述 |
---|---|---|
id |
String |
编码,填写String类型替代Long类型。 |
dimension_id |
String |
维度ID,只读,填写String类型替代Long类型。 |
code_table_field_id |
String |
码表属性ID,填写String类型替代Long类型。 |
name_en |
String |
字段名。 最大长度:600 |
name_ch |
String |
业务属性。 最大长度:200 |
description |
String |
描述。 最大长度:600 |
create_by |
String |
创建人。 |
data_type |
String |
字段类型。 |
domain_type |
String |
字段类型所属域。 枚举值:
|
data_type_extend |
String |
数据类型扩展字段。 最大长度:50 |
is_primary_key |
Boolean |
是否主键。 缺省值:false |
is_biz_primary |
Boolean |
是否业务主键。 缺省值:false |
is_partition_key |
Boolean |
是否分区。 缺省值:false |
ordinal |
Integer |
序号。 |
not_null |
Boolean |
是否不为空。 缺省值:false |
stand_row_id |
String |
关联的数据标准的ID,填写String类型替代Long类型。 |
stand_row_name |
String |
关联的数据标准名称,只读。 最大长度:600 |
quality_infos |
Array of QualityInfoVO objects |
质量信息,只读。 |
secrecy_levels |
Array of SecrecyLevelVO objects |
密级 |
status |
String |
实体的发布状态,只读,创建和更新时无需填写。 枚举值:
|
create_time |
String |
创建时间,只读,格式遵循RFC3339,精确到秒,UTC时区,即yyyy-mm-ddTHH:MM:SSZ,如1970-01-01T00:00:00Z。 |
update_time |
String |
更新时间,只读,格式遵循RFC3339,精确到秒,UTC时区,即yyyy-mm-ddTHH:MM:SSZ,如1970-01-01T00:00:00Z。 |
alias |
String |
别名 |
self_defined_fields |
Array of SelfDefinedFieldVO objects |
自定义项。 |
参数 |
参数类型 |
描述 |
---|---|---|
id |
String |
编码ID,填写String类型替代Long类型。 |
table_id |
String |
表ID,只读,填写String类型替代Long类型。 |
attr_id |
String |
属性ID,只读,填写String类型替代Long类型。 |
biz_type |
String |
业务实体类型。 枚举值:
|
data_quality_id |
String |
质量ID,填写String类型替代Long类型。 |
show_control |
Integer |
是否要显示正则表达式。 |
data_quality_name |
String |
质量名称。 |
alert_conf |
String |
告警配置。 |
expression |
String |
正则相关校验规则中正则配置。 |
extend_info |
String |
扩展信息。 |
from_standard |
Boolean |
是否来源于数据标准质量配置,只读。 缺省值:false |
result_description |
String |
结果说明。 |
create_by |
String |
创建人,只读。 |
update_by |
String |
更新人,只读。 |
create_time |
String |
创建时间,只读,格式遵循RFC3339,精确到秒,UTC时区,即yyyy-mm-ddTHH:MM:SSZ,如1970-01-01T00:00:00Z。 |
update_time |
String |
更新时间,只读,格式遵循RFC3339,精确到秒,UTC时区,即yyyy-mm-ddTHH:MM:SSZ,如1970-01-01T00:00:00Z。 |
参数 |
参数类型 |
描述 |
---|---|---|
id |
String |
密级ID,填写String类型替代Long类型。 |
uuid |
String |
数据安全主键。 最大长度:128 |
name |
String |
密级名。 最大长度:250 |
slevel |
Integer |
密级等级。 |
description |
String |
密级描述。 最大长度:600 |
create_by |
String |
创建人。 |
update_by |
String |
更新人。 |
create_time |
String |
创建时间,只读,格式遵循RFC3339,精确到秒,UTC时区,即yyyy-mm-ddTHH:MM:SSZ,如1970-01-01T00:00:00Z。 |
update_time |
String |
更新时间,只读,格式遵循RFC3339,精确到秒,UTC时区,即yyyy-mm-ddTHH:MM:SSZ,如1970-01-01T00:00:00Z。 |
new_biz |
BizVersionManageVO object |
业务版本管理,只读。 |
参数 |
参数类型 |
描述 |
---|---|---|
fd_name_ch |
String |
自定义项中文名。 最大长度:200 |
fd_name_en |
String |
自定义项英文名。 最大长度:200 |
not_null |
Boolean |
是否必填。 |
fd_value |
String |
属性值。 |
参数 |
参数类型 |
描述 |
---|---|---|
id |
String |
编码,填写String类型替代Long类型。 |
other_metric_ids |
Array of strings |
其他指标ID,填写String类型替代Long类型。 |
other_metric_names |
Array of strings |
其他指标名称,只读。 |
other_compound_metric_ids |
Array of strings |
其他复合指标ID。 |
other_compound_metric_names |
Array of strings |
其他复合指标名称。 |
expression |
String |
告警表达式。 最大长度:2000 |
metric_id |
String |
挂载指ID,填写String类型替代Long类型。 |
front_configs |
String |
前端表达式配置,用于前端数据恢复。 |
metric_type |
String |
挂载指标类型。 |
参数 |
参数类型 |
描述 |
---|---|---|
id |
String |
编码,填写String类型替代Long类型。 |
name_en |
String |
原子指标英文名。 最大长度:200 |
name_ch |
String |
原子指标英文名。 最大长度:200 |
description |
String |
描述。 最大长度:600 |
create_by |
String |
创建人。 |
cal_exp |
String |
计算表达式,形如'sum(${fact_column_id})',其中fact_column_id表示引用事实表中的字段ID 最大长度:200 |
cal_fn_ids |
Array of strings |
引用函数ID,填写String类型替代Long类型。 |
l1_id |
String |
主题域分组ID,只读,填写String类型替代Long类型。 |
l2_id |
String |
主题域ID。 |
l3_id |
String |
业务对象guid,填写String类型替代Long类型。 |
table_id |
String |
事实表ID,填写String类型替代Long类型。 |
tb_name |
String |
事实表名称。 |
dw_type |
String |
数据连接类型,只读。 |
field_ids |
Array of strings |
字段ID信息,填写String类型替代Long类型。 |
field_names |
Array of strings |
字段名称信息。 |
status |
String |
实体的发布状态,只读,创建和更新时无需填写。 枚举值:
|
biz_type |
String |
业务实体类型。 枚举值:
|
create_time |
String |
创建时间,只读,格式遵循RFC3339,精确到秒,UTC时区,即yyyy-mm-ddTHH:MM:SSZ,如1970-01-01T00:00:00Z。 |
update_time |
String |
更新时间,只读,格式遵循RFC3339,精确到秒,UTC时区,即yyyy-mm-ddTHH:MM:SSZ,如1970-01-01T00:00:00Z。 |
l1 |
String |
主题域分组中文名,只读,创建和更新时无需填写。 |
l2 |
String |
主题域中文名,只读,创建和更新时无需填写。 |
l3 |
String |
业务对象中文名,只读,创建和更新时无需填写。 |
approval_info |
ApprovalVO object |
审批信息,只读参数。业务对象最近一次的审批信息,包括审批的业务详情、审核人信息、审核时间等。 |
new_biz |
BizVersionManageVO object |
业务版本管理,只读。 |
参数 |
参数类型 |
描述 |
---|---|---|
id |
String |
审批单ID,填写String类型替代Long类型。 |
tenant_id |
String |
项目ID,获取方式参考接口路径参数“project_id”。 |
name_ch |
String |
业务中文名。 |
name_en |
String |
业务英文名。 |
biz_id |
String |
业务ID,填写String类型替代Long类型。 |
biz_type |
String |
业务实体类型。 枚举值:
|
biz_info |
String |
序列化之后的业务详情,类型是string。 |
biz_info_obj |
Object |
业务详情,类型是object。 |
biz_version |
Integer |
业务版本。 |
biz_status |
String |
实体的发布状态,只读,创建和更新时无需填写。 枚举值:
|
approval_status |
String |
业务审批状态,只读。 枚举值:
|
approval_type |
String |
业务审核类型。 枚举值:
|
submit_time |
String |
提交时间。 |
create_by |
String |
创建者。 |
l1 |
String |
主题域分组中文名,只读,创建和更新时无需填写。 |
l2 |
String |
主题域中文名,只读,创建和更新时无需填写。 |
l3 |
String |
业务对象中文名,只读,创建和更新时无需填写。 |
approval_time |
String |
审核时间。 |
approver |
String |
审核人。 |
String |
审核人邮箱。 |
|
msg |
String |
审核信息。 |
directory_path |
String |
目录树。 |
参数 |
参数类型 |
描述 |
---|---|---|
id |
String |
ID信息,填写String类型替代Long类型。 |
biz_type |
String |
业务实体类型。 枚举值:
|
biz_id |
String |
业务ID,填写String类型替代Long类型。 |
biz_info |
String |
业务对象信息。 |
status |
String |
实体的发布状态,只读,创建和更新时无需填写。 枚举值:
|
biz_version |
Integer |
业务版本,只读。 |
create_time |
String |
创建时间,只读,格式遵循RFC3339,精确到秒,UTC时区,即yyyy-mm-ddTHH:MM:SSZ,如1970-01-01T00:00:00Z。 |
update_time |
String |
更新时间,只读,格式遵循RFC3339,精确到秒,UTC时区,即yyyy-mm-ddTHH:MM:SSZ,如1970-01-01T00:00:00Z。 |
状态码: 400
参数 |
参数类型 |
描述 |
---|---|---|
error_code |
String |
错误码,如DS.6000,请求处理失败。 最小长度:8 最大长度:36 |
error_msg |
String |
错误信息。 最小长度:2 最大长度:512 |
data |
Object |
返回的数据信息。 |
状态码: 401
参数 |
参数类型 |
描述 |
---|---|---|
error_code |
String |
错误码,如DS.6000,请求处理失败。 最小长度:8 最大长度:36 |
error_msg |
String |
错误信息。 最小长度:2 最大长度:512 |
data |
Object |
返回的数据信息。 |
状态码: 403
参数 |
参数类型 |
描述 |
---|---|---|
error_code |
String |
错误码,如DS.6000,请求处理失败。 最小长度:8 最大长度:36 |
error_msg |
String |
错误信息。 最小长度:2 最大长度:512 |
data |
Object |
返回的数据信息。 |
请求示例
根据衍生指标ID,获取衍生指标详情。
GET https://{endpoint}/v2/{project_id}/design/derivative-indexs/1181167466668310528
响应示例
状态码: 200
Success,返回data数据是DerivativeIndexVO详情。
{ "data" : { "value" : { "id" : "1181167466668310528", "name_en" : "sum_total_amount", "name_ch" : "总车费(供应商)", "description" : "", "create_by" : "ei_dayu_y00321344_01", "data_type" : "STRING", "l1_id" : "1170066794946420736", "l2_id" : null, "l3_id" : null, "status" : "PUBLISHED", "atomic_index_id" : "1170005876631875584", "time_condition_id" : null, "time_field_id" : null, "time_field_name" : null, "common_conditions" : [ ], "dimension_groups" : [ { "group_id" : "1169322847009742848", "role" : null, "dimension_id" : "1169322847009742848", "hierarchies_id" : null, "ordinal" : 1, "group_name" : "供应商", "group_code" : "dim_vendor", "biz_type" : "DIMENSION", "hierarchies" : null, "l1" : null, "l2" : null, "l3" : null, "l1_id" : null, "l2_id" : null, "l3_id" : null, "dw_type" : null, "id" : "1181167466768973824", "from_public" : null } ], "monitor" : null, "atomic_index" : { "id" : "1170005876631875584", "name_en" : "sum_total_amount", "name_ch" : "总车费", "description" : "", "create_by" : null, "cal_exp" : "sum(总车费) ", "cal_fn_ids" : null, "l1_id" : null, "l2_id" : null, "l3_id" : null, "table_id" : "1169329693619625984", "tb_name" : null, "dw_type" : null, "field_ids" : [ ], "field_names" : null, "status" : "DRAFT", "biz_type" : "FACT_LOGIC_TABLE", "create_time" : "2024-04-20T16:15:41.487+08:00", "update_time" : "2024-04-20T16:15:41.487+08:00", "l1" : null, "l2" : null, "l3" : null, "approval_info" : null, "new_biz" : null }, "time_condition_name" : null, "create_time" : "2023-12-04T09:37:49+08:00", "update_time" : "2023-12-04T09:37:49+08:00", "l1" : "test_001", "l2" : null, "l3" : null, "summary_table_id" : "1181167468975177728", "approval_info" : { "id" : "1181167467817549824", "tenant_id" : null, "name_ch" : null, "name_en" : null, "biz_id" : "1181167466668310528", "biz_type" : null, "biz_info" : null, "biz_info_obj" : null, "biz_version" : 0, "biz_status" : "PUBLISHED", "approval_status" : "APPROVED", "approval_type" : null, "submit_time" : "2023-12-04T09:37:49+08:00", "create_by" : null, "l1" : null, "l2" : null, "l3" : null, "approval_time" : "2023-12-04T09:37:49+08:00", "approver" : "ei_dayu_y00321344_01", "email" : null, "msg" : "Fast Approval OK.", "directory_path" : null }, "new_biz" : null } } }
状态码: 400
{ "error_code" : "DS.60xx", "error_msg" : "The user request is illegal." }
状态码: 401
{ "error_code" : "DS.60xx", "error_msg" : "User authentication failed." }
状态码: 403
{ "error_code" : "DS.60xx", "error_msg" : "The user does not have permission to call this API." }
SDK代码示例
SDK代码示例如下。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
package com.huaweicloud.sdk.test; import com.huaweicloud.sdk.core.auth.ICredential; import com.huaweicloud.sdk.core.auth.BasicCredentials; import com.huaweicloud.sdk.core.exception.ConnectionException; import com.huaweicloud.sdk.core.exception.RequestTimeoutException; import com.huaweicloud.sdk.core.exception.ServiceResponseException; import com.huaweicloud.sdk.dataartsstudio.v1.region.dataartsstudioRegion; import com.huaweicloud.sdk.dataartsstudio.v1.*; import com.huaweicloud.sdk.dataartsstudio.v1.model.*; public class ShowDerivativeIndexByIdSolution { public static void main(String[] args) { // The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security. // In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment String ak = System.getenv("CLOUD_SDK_AK"); String sk = System.getenv("CLOUD_SDK_SK"); String projectId = "{project_id}"; ICredential auth = new BasicCredentials() .withProjectId(projectId) .withAk(ak) .withSk(sk); dataartsstudioClient client = dataartsstudioClient.newBuilder() .withCredential(auth) .withRegion(dataartsstudioRegion.valueOf("<YOUR REGION>")) .build(); ShowDerivativeIndexByIdRequest request = new ShowDerivativeIndexByIdRequest(); request.withId("{id}"); try { ShowDerivativeIndexByIdResponse response = client.showDerivativeIndexById(request); System.out.println(response.toString()); } catch (ConnectionException e) { e.printStackTrace(); } catch (RequestTimeoutException e) { e.printStackTrace(); } catch (ServiceResponseException e) { e.printStackTrace(); System.out.println(e.getHttpStatusCode()); System.out.println(e.getRequestId()); System.out.println(e.getErrorCode()); System.out.println(e.getErrorMsg()); } } } |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# coding: utf-8 from huaweicloudsdkcore.auth.credentials import BasicCredentials from huaweicloudsdkdataartsstudio.v1.region.dataartsstudio_region import dataartsstudioRegion from huaweicloudsdkcore.exceptions import exceptions from huaweicloudsdkdataartsstudio.v1 import * if __name__ == "__main__": # The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security. # In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment ak = __import__('os').getenv("CLOUD_SDK_AK") sk = __import__('os').getenv("CLOUD_SDK_SK") projectId = "{project_id}" credentials = BasicCredentials(ak, sk, projectId) \ client = dataartsstudioClient.new_builder() \ .with_credentials(credentials) \ .with_region(dataartsstudioRegion.value_of("<YOUR REGION>")) \ .build() try: request = ShowDerivativeIndexByIdRequest() request.id = "{id}" response = client.show_derivative_index_by_id(request) print(response) except exceptions.ClientRequestException as e: print(e.status_code) print(e.request_id) print(e.error_code) print(e.error_msg) |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
package main import ( "fmt" "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/auth/basic" dataartsstudio "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/dataartsstudio/v1" "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/dataartsstudio/v1/model" region "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/dataartsstudio/v1/region" ) func main() { // The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security. // In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment ak := os.Getenv("CLOUD_SDK_AK") sk := os.Getenv("CLOUD_SDK_SK") projectId := "{project_id}" auth := basic.NewCredentialsBuilder(). WithAk(ak). WithSk(sk). WithProjectId(projectId). Build() client := dataartsstudio.NewdataartsstudioClient( dataartsstudio.dataartsstudioClientBuilder(). WithRegion(region.ValueOf("<YOUR REGION>")). WithCredential(auth). Build()) request := &model.ShowDerivativeIndexByIdRequest{} request.Id = "{id}" response, err := client.ShowDerivativeIndexById(request) if err == nil { fmt.Printf("%+v\n", response) } else { fmt.Println(err) } } |
更多编程语言的SDK代码示例,请参见API Explorer的代码示例页签,可生成自动对应的SDK代码示例。
状态码
状态码 |
描述 |
---|---|
200 |
Success,返回data数据是DerivativeIndexVO详情。 |
400 |
BadRequest |
401 |
Unauthorized |
403 |
Forbidden |