Enabling or Disabling a Risk Rule
Function
This API is used to enable or disable risk rules.
Calling Method
For details, see Calling APIs.
URI
POST /v1/{project_id}/{instance_id}/audit/rule/risk/switch
| Parameter | Mandatory | Parameter Type | Description |
|---|---|---|---|
| project_id | Yes | String | Project ID. |
| instance_id | Yes | String | Instance ID. You can obtain the value from the ID field in the API for querying the instance list. |
Request Parameter
| Parameter | Mandatory | Parameter Type | Description |
|---|---|---|---|
| X-Auth-Token | Yes | String | User token. It can be obtained by calling the IAM API (value of X-Subject-Token in the response header). |
| Parameter | Mandatory | Parameter Type | Description |
|---|---|---|---|
| ids | Yes | String | Rule ID. Use commas (,) to separate multiple IDs. You can obtain the value from the ID field in the API for querying risk rule policies. |
| status | Yes | String | Switch status
|
Response Parameters
Status code: 200
| Parameter | Parameter Type | Description |
|---|---|---|
| status | String | Response status |
Status code: 400
| Parameter | Parameter Type | Description |
|---|---|---|
| error | Object | Error message. |
| Parameter | Parameter Type | Description |
|---|---|---|
| error_code | String | Error code |
| error_msg | String | Error message |
Status code: 403
| Parameter | Parameter Type | Description |
|---|---|---|
| error | Object | Error message. |
| Parameter | Parameter Type | Description |
|---|---|---|
| error_code | String | Error code |
| error_msg | String | Error message |
Example Request
/v1/{project_id}/{instance_id}/audit/rule/risk/switch
{
"ids" : "c7ILB3kBCwCqSg3B2OpF",
"status" : "OFF"
} Response Examples
Example response with status code 200:
The request has succeeded.
{
"status" : "SUCCESS"
} Status code: 400
Invalid request parameters.
{
"error" : {
"error_code" : "DBSS.XXX",
"error_msg" : "XXX"
}
} Status code: 403
Authentication failed.
{
"error" : {
"error_code" : "DBSS.XXX",
"error_msg" : "XXX"
}
} Status Code
| Status Code | Description |
|---|---|
| 200 | Request succeeded. |
| 400 | Invalid request parameters. |
| 403 | Authentication failed. |
Error Codes
For details, see Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.