Modifies the protection mode of a specific protection module of Web Application Firewall (WAF). The protection modules include the RegEx Protection Engine, Big Data Deep Learning Engine, HTTP flood protection, data risk control, and positive security model.

You can set the DefenseType parameter to specify the protection module. For more information about the value of this parameter, see the description of the DefenseType parameter in the "Request parameters" section of this topic.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes ModifyProtectionModuleMode

The operation that you want to perform. Set the value to ModifyProtectionModuleMode.

DefenseType String Yes waf

The protection module. Valid values:

  • waf: RegEx Protection Engine
  • dld: Big Data Deep Learning Engine
  • cc: HTTP Flood Protection
  • antifraud: Data Risk Control
  • normalized: Positive Security Model
Domain String Yes www.example.com

The domain name that is added to WAF.

InstanceId String Yes waf_elasticity-cn-0xldbqt****

The ID of the WAF instance.

Note You can call the DescribeInstanceInfo operation to query the ID of the WAF instance.
Mode Integer Yes 0

The protection mode of the specified protection module. Valid values:

Note The value of the Mode parameter varies based on the value of the DefenseType parameter.
  • RegEx Protection Engine (The DefenseType parameter is set to waf.)
    • 0: block mode
    • 1: warn mode
  • Big Data Deep Learning Engine (The DefenseType parameter is set to dld.)
    • 0: warn mode
    • 1: block mode
  • HTTP flood protection (The DefenseType parameter is set to ac_cc.)
    • 0: prevention mode
    • 1: protection-emergency mode
  • Data risk control (The DefenseType parameter is set to antifraud.)
    • 0: warn mode
    • 1: block mode
    • 2: strict interception mode
  • Positive security model (The DefenseType parameter is set to normalized.)
    • 1: block mode
    • 0: warn mode

Response parameters

Parameter Type Example Description
RequestId String D7861F61-5B61-46CE-A47C-6B19160D5EB0

The ID of the request.

Examples

Sample requests

http(s)://[Endpoint]/?Action=ModifyProtectionModuleMode
&DefenseType=waf
&Domain=www.example.com
&InstanceId=waf_elasticity-cn-0xldbqt****
&Mode=0
&<Common request parameters>

Sample success responses

XML format

<ModifyProtectionModuleModeResponse>
      <RequestId>D7861F61-5B61-46CE-A47C-6B19160D5EB0</RequestId>
</ModifyProtectionModuleModeResponse>

JSON format

{
    "RequestId": "D7861F61-5B61-46CE-A47C-6B19160D5EB0"
}

Error codes

For a list of error codes, visit the API Error Center.