文档首页/ 数据安全中心 DSC/ API参考/ API/ 数据脱敏/ 根据主键获取ES脱敏任务信息 - ListTemplatesV3
更新时间:2026-10-09 GMT+08:00
分享

根据主键获取ES脱敏任务信息 - ListTemplatesV3

功能介绍

根据主键获取ES脱敏任务信息

调用方法

请参见如何调用API。

授权信息

账号具备所有API的调用权限,如果使用账号下的IAM用户调用当前API,该IAM用户需具备调用API所需的权限。

  • 如果使用角色与策略授权,具体权限要求请参见权限和授权项。
  • 如果使用身份策略授权,当前API调用无需身份策略权限。

URI

GET /v1/{project_id}/sdg/server/mask/bigdata/templates/{template_id}

表1 路径参数

参数

是否必选

参数类型

描述

project_id

是

String

参数解释:

项目ID。可参考获取项目ID获取。

约束限制:

不涉及

取值范围:

以IAM服务接口返回值为准,字符长度32-32,满足正则匹配"^[a-z0-9]{32}$"

默认取值:

不涉及

template_id

是

String

参数解释:

模板ID

约束限制:

不涉及

取值范围:

不涉及

默认取值:

不涉及

请求参数

表2 请求Header参数

参数

是否必选

参数类型

描述

X-Auth-Token

是

String

参数解释:

用户Token。通过调用IAM服务查询用户Token接口获取(响应消息头中X-Subject-Token的值)。

约束限制:

不涉及

取值范围:

IAM服务查询用户Token接口为准

默认取值:

不涉及

响应参数

状态码:200

表3 响应Body参数

参数

参数类型

描述

id

String

参数解释:

ID

取值范围:

不涉及

type

String

参数解释:

ES脱敏模板类型

取值范围:

不涉及

db_type

String

参数解释:

数据库类型

取值范围:

不涉及

status

Integer

参数解释:

模板状态

取值范围:

不涉及

template_name

String

参数解释:

模板名称

取值范围:

不涉及

data_source

Array of DataSource objects

参数解释:

数据源配置列表

取值范围:

不涉及

data_dest

Array of DataDest objects

参数解释:

数据目的端配置列表

取值范围:

不涉及

strategy

Array of Strategy objects

参数解释:

脱敏策略列表

取值范围:

不涉及

trigger_time

String

参数解释:

任务触发时间

取值范围:

不涉及

mask_template_id

String

参数解释:

脱敏模板ID

取值范围:

不涉及

run_status

String

参数解释:

运行状态

取值范围:

不涉及

algorithm

String

参数解释:

算法

取值范围:

不涉及

algorithm_id

String

参数解释:

算法ID

取值范围:

不涉及

algorithm_type

String

参数解释:

算法类型

取值范围:

不涉及

choosing_fields

Array of strings

选择字段

data_dest_id

String

参数解释:

数据目的ID

取值范围:

不涉及

data_source_id

String

参数解释:

数据源ID

取值范围:

不涉及

dest_field_name

String

参数解释:

目标字段名

取值范围:

不涉及

dest_ins_id

String

参数解释:

目的实例ID

取值范围:

不涉及

index_name

String

参数解释:

索引名称

取值范围:

不涉及

parameter

Object

参数解释:

参数

取值范围:

不涉及

source_ins_id

String

参数解释:

来源实例ID

取值范围:

不涉及

src_field_name

String

参数解释:

源字段名

取值范围:

不涉及

template_id

String

参数解释:

模板ID

取值范围:

不涉及

type_name

String

参数解释:

类型名称

取值范围:

不涉及

表4 DataSource

参数

参数类型

描述

source_ins_id

String

参数解释:

源端实例ID

取值范围:

不涉及

data_source_id

String

参数解释:

数据源端ID

取值范围:

不涉及

index

String

参数解释:

源端序号

取值范围:

不涉及

type

String

参数解释:

源端类型

取值范围:

不涉及

choosing_fields

Array of strings

参数解释:

脱敏任务选择的字段列表

取值范围:

不涉及

表5 DataDest

参数

参数类型

描述

dest_ins_id

String

参数解释:

目的端实例ID

取值范围:

不涉及

data_dest_id

String

参数解释:

数据目的端ID

取值范围:

不涉及

index

String

参数解释:

目的端序号

取值范围:

不涉及

type

String

参数解释:

目的端类型

取值范围:

不涉及

表6 Strategy

参数

参数类型

描述

src_field_name

String

参数解释:

源字段名称

取值范围:

不涉及

dest_field_name

String

参数解释:

目标字段名称

取值范围:

不涉及

algorithm

String

参数解释:

脱敏算法

取值范围:

不涉及

algorithm_type

String

参数解释:

脱敏算法类型

取值范围:

不涉及

parameter

String

参数解释:

算法参数

取值范围:

不涉及

algorithm_id

String

参数解释:

脱敏算法ID

取值范围:

不涉及

请求示例

根据主键获取ES脱敏任务信息

/v1/2b31ed520xxxxxxebedb6e57xxxxxxxx/sdg/server/mask/bigdata/templates/xxxx-xxxx-xxxx-xxxx

响应示例

状态码:200

{
  "type" : "ES",
  "db_type" : "ES",
  "status" : 1,
  "template_name" : "es-mask-template-01",
  "data_source" : [ "{\"source_ins_id\":\"9f2a3b4c-5d6e-4f7a-8b9c-0d1e2f3a4b5c\",\"data_source_id\":\"src-customer-db\",\"db_name\":\"customer_db\",\"table_name\":\"customer_info\"}" ],
  "data_dest" : [ "{\"dest_ins_id\":\"1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d\",\"data_dest_id\":\"dst-mask-db\",\"db_name\":\"mask_db\",\"table_name\":\"customer_info_masked\"}" ],
  "strategy" : [ "{\"src_column_name\":\"phone\",\"dest_column_name\":\"phone_masked\",\"algorithm\":\"SHA256\",\"algorithm_type\":\"MASK_BY_HASH\"}" ],
  "trigger_time" : "0 0 2 * * ?",
  "mask_template_id" : "9f2a3b4c-5d6e-4f7a-8b9c-0d1e2f3a4b5c",
  "run_status" : "FINISHED",
  "dest_dest_id" : "b3c4d5e6-7f8a-4b9c-0d1e-2f3a4b5c6d7e",
  "dest_ins_id" : "1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d",
  "index_name" : "customer_info_index",
  "type_name" : "_doc",
  "source_ins_id" : "9f2a3b4c-5d6e-4f7a-8b9c-0d1e2f3a4b5c",
  "choosing_fields" : [ "phone", "id_card" ],
  "data_source_id" : "1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d",
  "src_field_name" : "phone",
  "dest_field_name" : "phone_masked",
  "algorithm" : "SHA256",
  "algorithm_type" : "MASK_BY_HASH",
  "parameter" : {
    "length" : "8"
  },
  "algorithm_id" : "9f2a3b4c-5d6e-4f7a-8b9c-0d1e2f3a4b5c",
  "template_id" : "1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d"
}

状态码

状态码

描述

200

查询成功

错误码

请参见错误码。

相关文档