Updated on 2024-01-15 GMT+08:00

Enabling or Disabling a Risk Rule

Function

This API is used to enable or disable a risk rule.

URI

POST /v1/{project_id}/{instance_id}/audit/rule/risk/switch

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

instance_id

Yes

String

Instance ID

project_id

Yes

String

Project ID

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

Content-type

Yes

String

The fixed value of this parameter is application/json;charset=UTF-8, which cannot be changed.

X-Auth-Token

Yes

String

User token.The token can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token.

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

ids

Yes

String

Risk IDs. Values are separated by commas (,).Risk id can be obtained from this interface:/v1/{project_id}/{instance_id}/dbss/audit/rule/risk

status

Yes

String

Its value can be OFF or ON.

Enumeration values:

  • OFF
  • ON

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

status

String

response status

Status code: 400

Table 5 Response body parameters

Parameter

Type

Description

error

Object

Error message.

Table 6 ErrorDetail

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error information.

Status code: 403

Table 7 Response body parameters

Parameter

Type

Description

error

Object

Error message.

Table 8 ErrorDetail

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error information.

Example Requests

/v1/{project_id}/{instance_id}/audit/rule/risk/switch

{
  "ids" : "c7ILB3kBCwCqSg3B2OpF",
  "status" : "OFF"
}

Example Responses

Status code: 200

Request succeeded.

{
  "status" : "SUCCESS"
}

Status code: 400

Invalid request parameter.

{
  "error" : {
    "error_code" : "DBSS.XXX",
    "error_msg" : "XXX"
  }
}

Status code: 403

Authentication failed.

{
  "error" : {
    "error_code" : "DBSS.XXX",
    "error_msg" : "XXX"
  }
}

Status Codes

Status Code

Description

200

Request succeeded.

400

Invalid request parameter.

403

Authentication failed.

Error Codes

See Error Codes.