All Products
Search
Document Center

:EditRecognizeRule

最終更新日:May 13, 2024

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

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter

Type

Required

Example

Description

Action

String

Yes

EditRecognizeRule

The operation that you want to perform. Set the value to EditRecognizeRule.

TenantId

String

No

10241024

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.

AccountName

String

No

dsg-uat

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

SensitiveId

String

No

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

The ID of the sensitive field. 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.

SensitiveName

String

No

Name

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

NodeId

String

No

0ce67949-0810-400f-a24a-cc5ffafe1024

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.

NodeParent

String

No

Customer/Individual/Personal Natural Information/Personal Profile

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.

TemplateId

String

No

e1970541-6cf5-4d23-b101-d5b66f6e1024

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

level

String

No

1

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.

LevelName

String

No

Confidential

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

SensitiveDescription

String

No

This is a sensitive field that identifies names.

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

Status

Integer

No

0

The status of the sensitive field. Valid values:

  • 0: draft

  • 1: effective

OperationType

Integer

No

0

The type of the arithmetic operation. Valid values:

  • 0: OR

  • 1: AND

RecognizeRulesType

String

No

1

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

RecognizeRules

String

No

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

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.

ContentScan

String

No

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

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

ColScan

String

No

default.qujian.*

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.

ColExclude

String

No

default.qujian.*6

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.

CommentScan

String

No

test

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

HitThreshold

Integer

No

50

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.

Response parameters

Parameter

Type

Example

Description

Success

Boolean

true

Indicates whether the request was successful.

  • true

  • false

ErrorCode

String

9990030003

The error code.

ErrorMessage

String

A required parameter is not specified.

The error message.

HttpStatusCode

Integer

200

The HTTP status code.

Data

Any

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

The returned result in the JSON format.

RequestId

String

10000001

The request ID.

Examples

Sample requests

http(s)://[Endpoint]/?Action=EditRecognizeRule
&TenantId=10241024
&AccountName=dsg-uat
&SensitiveId=1a928de7-3962-4e07-93ac-e1973baa1024
&SensitiveName=Name
&NodeId=0ce67949-0810-400f-a24a-cc5ffafe1024
&NodeParent=Customer/Individual/Personal Natural Information/Personal Profile
&TemplateId=e1970541-6cf5-4d23-b101-d5b66f6e1024
&level=1
&LevelName=Confidential
&SensitiveDescription=A sensitive field that identifies names
&Status=0
&OperationType=0
&RecognizeRulesType=1
&RecognizeRules={"contentRule":{"_clazz":"com.alipay.dsgclient.sdk.dsg.fastscan.engine.cond.GenderCond"},"_clazz":"com.alipay.dsg.dal.model.RuleContent"}
&ContentScan={"_clazz":"com.alipay.dsgclient.sdk.dsg.fastscan.engine.cond.NationalityCond"}
&ColScan=default.qujian.*
&ColExclude=default.qujian.*6
&CommentScan=test
&HitThreshold=50
&<Common request parameters>

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<EditRecognizeRuleResponse>
    <Success>true</Success>
    <ErrorCode>9990030003</ErrorCode>
    <ErrorMessage>A required parameter is not specified.</ErrorMessage>
    <HttpStatusCode>200</HttpStatusCode>
    <Data>{ "HttpStatusCode": 200, "Success": true }</Data>
    <RequestId>10000001</RequestId>
</EditRecognizeRuleResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "Success" : true,
  "ErrorCode" : "9990030003",
  "ErrorMessage": "A required parameter is not specified.",
  "HttpStatusCode" : 200,
  "Data" : "{ \"HttpStatusCode\": 200, \"Success\": true }",
  "RequestId" : "10000001"
}

Error codes

HttpCode

Error code

Error message

Description

400

BADPARAMETERS

Parameters are missing or in the wrong format.

A required parameter is not specified.

For a list of error codes, see Service error codes.