All Products
Search
Document Center

DataWorks:EditRecognizeRule

Last Updated:Nov 21, 2024

Edits 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

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
dataworks:EditRecognizeRuleupdate
*All Resources
*
    none
none

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 the sensitive data identification rule. Enter the username of the Alibaba Cloud account.

dsg-uat
SensitiveIdstringYes

The sensitive field ID. You can call the QuerySensNodeInfo operation to query the IDs of all sensitive fields. You can also call the QueryRecognizeRuleDetail operation to query the IDs of specific sensitive fields.

1a928de7-3962-4e07-93ac-e1973baa1024
SensitiveNamestringYes

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

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.

TemplateIdstringYes

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

e1970541-6cf5-4d23-b101-d5b66f6e1024
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.

StatusintegerNo

The status of the sensitive field. Valid values:

  • 0: draft
  • 1: effective
0
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"}
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
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

Response parameters

ParameterTypeDescriptionExample
object

The data returned.

Successboolean

Indicates whether the request was successful. Valid values:

  • 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.