Skip to content

Enable or Disable Rules



POST /api/v1/sensitive_data_scanner/set_disable

Overview

Provide 1 to 100 rule UUIDs; duplicates are removed before processing.

Before You Begin and Usage Steps

Provide 1 to 100 rule UUIDs; duplicates are removed before processing. If any rule does not exist, belongs to another workspace, or has been deleted, the entire batch fails. Rules already in the target state are not counted as changes. The data scope is the workspace to which the API Key belongs.

Request Headers

Parameter Type Required Description
DF-API-KEY string Y Access key.
Example: <DF-API-KEY>
How to obtain or fill in: Obtain the Key required by this API from API Key management in the target workspace.

Body Parameters

Parameter Type Required Description
sensitiveRuleUUIDs array Y Rule UUIDs to operate on, 1–100 strings. After deduplication, all objects must belong to the current workspace; otherwise, the entire batch is left unchanged.
Allows null: False
Minimum length: 1
Maximum length: 100
Example: ['sdsr_32cc36108f2c4194a70fc12554583f20']
How to obtain or fill in: Take content.data[].uuid from the Sensitive Data Scanning rule list, or take content.ruleUUIDs[] from the creation response.
sensitiveRuleUUIDs[*] string Maximum length: 48
Example: sdsr_32cc36108f2c4194a70fc12554583f20
How to obtain or fill in: Take content.data[].uuid from the Sensitive Data Scanning rule list, or take content.ruleUUIDs[] from the creation response.
isDisable boolean Y true disables (status 2), false enables (status 0).
Allows null: False
Example: False
How to obtain or fill in: Fill in a boolean according to the target state; use true to disable and false to enable.

Additional Parameter Notes

Sets rule statuses in batches and returns the UUIDs of the rules that actually changed. Setting the same status repeatedly returns an empty array.

Request Example

curl 'https://openapi.guance.com/api/v1/sensitive_data_scanner/set_disable' \
  -H 'DF-API-KEY: <DF-API-KEY>' \
  -H 'Content-Type: application/json' \
  --data-raw '{"sensitiveRuleUUIDs":["sdsr_32cc36108f2c4194a70fc12554583f20"],"isDisable":false}'

Response

HTTP 200, application/json.

Field Type Description
content.affectedRuleUUIDs array<string> UUIDs of the rules that actually changed.
content.affectedCount integer Number of rules that actually changed.
{
    "code": 200,
    "content": {
        "affectedRuleUUIDs": [
            "sdsr_32cc36108f2c4194a70fc12554583f20"
        ],
        "affectedCount": 1
    },
    "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
400 ft.JsonFormatError The top level of the request body is not a JSON object JSON format error Submit a JSON object as the request body.
400 ft.RequestJsonFormatError JSON syntax error Request JSON format error Fix the JSON syntax.
403 ft.Forbidden Insufficient permission for the API, or the current workspace version does not support it Forbidden Confirm the workspace to which the Key belongs, the permissions, and the workspace version.
406 ft.ParameterValidationFailed / ft.InvalidParameter A field is missing or a field value violates the validation conditions Invalid parameter Check the JSON fields, types, and value ranges.
404 ft.ObjectNotExists The rule does not exist, has been deleted, or does not belong to the current workspace Rule does not exist Obtain the UUID again from the rule list of the current workspace.

Feedback

Is this page helpful?