Skip to content

Disable/Enable



POST /api/v1/data_query_rule/set_disable

Overview

Batch enable/disable access rules.

Before You Call and Usage Steps

First verify the UUIDs and affected identities, then submit in batches. Enabling or disabling only changes the rule status; it does not change raw data and does not withdraw in-flight queries. Disabling means the rule no longer participates in subsequent scope/masking calculations, and final permissions must be revalidated. Only true is returned; per-item results are not provided, and invalid UUIDs among them do not cause a 404.

If none currently match (including [], all unknown/cross-workspace UUIDs, or deleted UUIDs), the controller does not set the audit context, and a subsequent read by the public route causes a 500; this does not prove that any change occurred. First obtain non-empty valid targets from the list, and after an error, query the status again.

This operation only modifies the rule status and commits it to the Database, then clears the rule Cache and records audit information; it does not replace the rule definition or re-run cross-site configuration validation. On failure, first read the status back from the list/details, then handle incomplete Cache or audit processing; if none match, a 500 may also be returned when reading the missing audit context.

Changes to rule status affect the data query scope/result masking for subsequently matching identities; they do not modify, delete, or backfill raw data, nor do they add basic query permissions for roles. Multiple roles and rules are merged according to query-side policies, so final permissions cannot be inferred from a single rule; Owner is exempt, and the "Data Access Scope Restriction" settings for Administrators and Workspaces change how roles with no match are handled. Use representative members to validate actual queries. After a status change, the rule Cache is invalidated, but all in-flight queries are not guaranteed to switch immediately.

Request Headers

Parameter Name 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 the permissions required for this operation from API Key Management in the target Workspace.

Body Request Parameters

Parameter Name Type Required Description
queryRuleUuids[*] string A single non-empty UUID; the original declaration does not validate each item.
Example: lqrl_example
How to obtain or enter: A single rule UUID.
queryRuleUuids array Y Required array; non-empty is recommended; only non-deleted matches in the current Workspace; the log module is further restricted to logging.
Allow null: False
Example: ["lqrl_example"]
How to obtain or enter: Obtain the target UUID set from the Data Access Rule List.
isDisable boolean Y Required JSON boolean; true stores status=2, false stores 0, and deleted rules are not restored.
Allow null: False
Example: true
How to obtain or enter: Use true to pause a rule and false to re-enable it.

Request Example

curl --request POST 'https://openapi.guance.com/api/v1/data_query_rule/set_disable' \
  -H 'DF-API-KEY: <DF-API-KEY>' \
  -H 'Content-Type: application/json' \
  --data-raw '{"queryRuleUuids":["lqrl_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 true on success; this is not a per-item result and does not mean all input UUIDs were modified.
{
  "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 Resolution
406 ft.ParameterValidationFailed A request field is missing, or a 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 Correct the JSON according to content.reason, line, and column.
500 ft.InternalServerError An unhandled exception occurs during Database status commit, Redis rule Cache, or audit processing; when no UUID matches, it may fail because g.audit_info is missing Internal error First query the current status by the original rule UUID to confirm whether it has taken effect; if already committed, handle incomplete Cache or audit processing, retain traceId, and do not add the rule again.

Feedback

Is this page helpful?