Enable or Disable a Single Security Detection Rule¶
POST /api/v1/security_rule/set_disable
Overview¶
Set the enabled/disabled status of a single security rule. Setting it to its current status again returns success.
Before Calling and Usage Steps¶
Use ruleUUID to operate on a single rule. Pass true to disable and false to enable. If the status is already the same, true is also returned and scheduling is not repeated. After a write request times out, first verify the existing rule and scheduling status, and retry only after confirming the result.
Request Headers¶
| Parameter | Type | Required | Description |
|---|---|---|---|
| DF-API-KEY | string | Y | OpenAPI Key of the target workspace. Obtain it from the workspace's API Key management. |
Body Request Parameters¶
| Parameter | Type | Required | Description |
|---|---|---|---|
| ruleUUID | string | Y | UUID of a single security detection rule. Allow null: False Allow empty string: False Example: srul_exampleHow to obtain or enter: Get content.data[].uuid from the Security Detection Rule List. |
| isDisable | boolean | Y | true disables, false enables. Allow null: False Example: trueHow to obtain or enter: Enter a JSON boolean value based on the target status: pass true to disable and false to enable. |
Request Example¶
curl --request POST 'https://openapi.guance.com/api/v1/security_rule/set_disable' \
-H 'DF-API-KEY: <DF-API-KEY>' \
-H 'Content-Type: application/json' \
--data-raw '{"ruleUUID": "srul_example", "isDisable": true}'
Response¶
HTTP 200, application/json.
| Field | Type | Description |
|---|---|---|
| content | boolean | true when the operation succeeds. |
{
"code": 200,
"content": true,
"errorCode": "",
"message": "",
"success": true,
"traceId": "TRACE-EXAMPLE"
}
Error Responses¶
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 / ft.InvalidParameter | Field missing, type or configuration does not meet requirements | Invalid parameter | Check fields and values against the request parameter table. |
| 403 | ft.Forbidden | API Key lacks API permission, or has no operation permission for the current AI rule | Forbidden | Confirm the Key's workspace, permissions, and target rule. |
| 400 | ft.UnsupportFreeWorkspaceSecurityCfg | The current workspace edition does not support security configuration | Edition not supported | Confirm the target workspace edition. |
| 404 | ft.ObjectNotExists | Rule does not exist, has been deleted, or does not belong to the current workspace | Rule does not exist | Re-obtain the UUID from the current workspace rule list. |
| 403 | ft.ForbiddenCspmOperation / ft.ForbiddenSiemOperation / ft.ForbiddenAbaOperation | Caller has no operation permission for the corresponding category of security rules | Rule operation denied | Check permissions for the corresponding rule category. |
| 400 | ft.OuterFuncFailed | AI scheduling update, enable/disable, or cleanup not confirmed | External function call failed | Check the current state of the rule and scheduling by traceId, then decide whether to retry. |