Skip to content

Enable/Disable



POST /api/v1/data_mask_rule/set_disable

Overview

Batch enable or disable data masking rules in the current workspace.

Prerequisites and Usage Steps

This write endpoint requires the dataRightsManage.workspaceConfigManage management permission.

Use the API Key of the target workspace. This group configures standalone sensitive rules at the query return stage; it does not rewrite raw stored data, create fields, or serve as a permanent deletion/anonymization API.

Uniformly enable or disable the matching rules in this batch; after being disabled, a rule no longer participates in subsequent queries as an enabled configuration, which does not mean the role is prohibited from querying. Returning true does not mean every item in the request array matched; an empty batch and a complete miss may also succeed. You can safely verify the list and then process known states again, to avoid treating non-matches as successfully changed. After the database commit, rule caches are cleared by match category; if cache clearing fails, a 500 may be returned, but the state has already been committed, so read it back before retrying.

Effectiveness also depends on the target query chain, data category, and actual role set; role configuration is not data query authorization itself. When the same account/Key has multiple roles with query permission for that category, if one of the roles has no applicable sensitive rule, this group of rules may not be applied as a whole. Do not bind only one role and assume that all readers are forcibly masked; verify with the actual role/Key in Query Data and on the target display surface. Currently, regular expression replacement only handles string values; numbers, objects, arrays, booleans, and null are not automatically converted to strings for masking. In standard queries, the matching part of a string is replaced with *, and other text is retained; saving regular expression checks uses the regex library, while the query execution path uses standard re. It is recommended to use only syntax compatible with Python's standard re.

Request Headers

Parameter Type Required Description
DF-API-KEY string Y OpenAPI authentication credential for the workspace.
Example: <DF-API-KEY>
How to obtain or enter: Obtain an OpenAPI Key with this operation permission from API Key Management in the target workspace.

Body Request Parameters

Parameter Type Required Description
dataMaskRuleUUIDs[*] string It is recommended that each item be a non-empty string; do not use true to determine that all UUIDs matched.
Example: wdmk_example
How to obtain or enter: Enter a single rule UUID, not the name.
isDisable boolean Y Required boolean; uniformly set status=2 or 0 for matching rules; does not restore deleted rules.
Allows null: False
Example: true
How to obtain or enter: Enter true to disable and false to enable.
dataMaskRuleUUIDs array Y Required array. [] can succeed but does not change rules; only undeleted records in the current workspace are processed. Unknown, out-of-workspace, or deleted UUIDs do not match and do not report errors per item.
Allows null: False
Example: ["wdmk_example"]
How to obtain or enter: Select the target rule UUIDs item by item from Data Masking Rule List.

Request Example

curl --request POST 'https://openapi.guance.com/api/v1/data_mask_rule/set_disable' \
  -H 'DF-API-KEY: <DF-API-KEY>' \
  -H 'Content-Type: application/json' \
  --data-raw '{"dataMaskRuleUUIDs":["wdmk_example"],"isDisable":true}'

Response

HTTP 200, application/json. The example below shows the main fields that can be read directly.

Field Type Description
content boolean Returns true after processing is complete; does not include the number of matches or per-item status.
{
  "code": 200,
  "content": true,
  "errorCode": "",
  "message": "",
  "success": true,
  "traceId": "TRACE-EXAMPLE"
}

Error Response

For authentication, rate limiting, and common request errors, see Common Error Definitions.

HTTP Status errorCode Trigger Condition Message or Response Description Handling
406 ft.ParameterValidationFailed Request field is missing, or the field value violates the declared validation conditions Parameter parsing failed Check the parameter location, field name, type, and value.
400 ft.RequestJsonFormatError Invalid request JSON syntax Request JSON format error Fix the JSON according to content.reason, line, and column.
400 ft.JsonFormatError The top level of the request JSON is not an object Some JSON file format errors Submit an object as shown in the example.
500 ft.InternalServerError Storage or response failed; a 500 may also occur if cache clearing fails after a write is committed Internal error For write requests, read back using the list/details first, then decide whether to retry; retain the traceId and contact the administrator.

Feedback

Is this page helpful?