All Products
Search
Document Center

DataWorks:AddRecognizeRule

Last Updated:Oct 17, 2024

Adds a sensitive field that is defined based on the category and sensitivity level of data in Data Security Guard.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

There is currently no authorization information disclosed in the API.

Request parameters

ParameterTypeRequiredDescriptionExample
TenantIdstringYes

The tenant ID. To obtain the tenant ID, perform the following steps: Log on to the DataWorks console. Find your workspace and go to the DataStudio page. On the DataStudio page, click the logon username in the upper-right corner and click User Info in the Menu section.

10241024
AccountNamestringYes

The Alibaba Cloud account that is used to create a sensitive data identification rule. Enter the username of the Alibaba Cloud account.

dsg-uat
SensitiveNamestringYes

The name of the custom sensitive field. Enter a string that is less than 128 characters in length.

TemplateIdstringYes

The template ID. You can call the QueryDefaultTemplate operation to obtain the template ID.

e1970541-6cf5-4d23-b101-d5b66f6e1024
NodeIdstringYes

The ID of the data category. You can call the QuerySensClassification operation to query the ID of all data categories. Then, you can select a data category to create a sensitive field. Enter the ID of the selected data category.

0ce67949-0810-400f-a24a-cc5ffafe1024
NodeParentstringYes

The information about the parent data category of the current data category. You can call the QuerySensClassification operation to obtain the ID of a data category.

LevelstringYes

The sensitivity level of the sensitive field. You can select one from all sensitivity levels that are defined in a template as the sensitivity level of the sensitive field, such as level 1 to level 10.

1
LevelNamestringNo

The name of the sensitivity level. You can call the QueryDefaultTemplate operation to obtain the name of the sensitivity level in the related template.

SensitiveDescriptionstringNo

The description of the sensitive field. Enter a string that is less than 128 characters in length.

OperationTypeintegerYes

The type of the arithmetic operation. Valid values:

  • 0: OR
  • 1: AND
0
RecognizeRulesTypestringNo

The type of the sensitive data identification rule. Valid values:

  • 1: regular expression
  • 2: built-in rule
  • 3: sample library
  • 4: self-generated data identification model
1
RecognizeRulesstringNo

The content of the sensitive data identification rule. You can call the QuerySensNodeInfo operation to query the value of the current parameter for a built-in sensitive field.

{"contentRule":{"_clazz":"com.alipay.dsgclient.sdk.dsg.fastscan.engine.cond.GenderCond"},"_clazz":"com.alipay.dsg.dal.model.RuleContent"}
ContentScanstringNo

Identifies content. You can call the QuerySensNodeInfo operation to query the value of the current parameter for a built-in sensitive field.

{"_clazz":"com.alipay.dsgclient.sdk.dsg.fastscan.engine.cond.NationalityCond"}
HitThresholdintegerNo

The hit ratio threshold. If more than 60%, which is a sample hit ratio threshold, of all sample data records hit the Name Entity Recognition (NER) model, the sensitive field is hit. The value can be an integer from 0 to 100.

50
ColScanstringNo

Scans fields. The system identifies only fields that are assigned with values.

  • The value must be in the ${Project name}.${Table name}.${Field name} or ${Project name}.${Schema name}.${Table name}.${Field name} format.
  • *Wildcards are supported. For example, the asterisk (*) in default.table.column1* can be used to match any content following default.table.column1, such as default.table.column10.
default.qujian.*
ColExcludestringNo

Excludes fields. The system does not identify fields that are assigned with values.

  • The value must be in the ${Project name}.${Table name}.${Field name} or ${Project name}.${Schema name}.${Table name}.${Field name} format.
  • *Wildcards are supported. For example, the asterisk (*) in default.table.column1* can be used to match any content following default.table.column1, such as default.table.column10.
default.qujian.*6
CommentScanstringNo

Scans content. The value is the text of each field comment in your data asset. Fuzzy match is supported.

test
StatusintegerNo

The status of the sensitive field. Valid values:

  • 0: draft
  • 1: effective
0

Response parameters

ParameterTypeDescriptionExample
object

The data returned.

Successboolean

Indicates whether the request was successful.

  • true
  • false
true
ErrorCodestring

The error code.

9990030003
ErrorMessagestring

The error message.

HttpStatusCodeinteger

The HTTP status code.

200
Dataany

The returned result in the JSON format.

{ "HttpStatusCode": 200, "Success": true }
RequestIdstring

The request ID.

10000001

Examples

Sample success responses

JSONformat

{
  "Success": true,
  "ErrorCode": "9990030003",
  "ErrorMessage": "",
  "HttpStatusCode": 200,
  "Data": "{   \"HttpStatusCode\": 200,   \"Success\": true }",
  "RequestId": "10000001"
}

Error codes

HTTP status codeError codeError message
400BADPARAMETERSParameters are missing or in the wrong format.

For a list of error codes, visit the Service error codes.