All Products
Search
Document Center

Web Application Firewall:ModifyDefenseRuleStatus

Last Updated:Oct 11, 2025

Changes the status of a protection rule.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

No authorization for this operation. If you encounter issues with this operation, contact technical support.

Request parameters

Parameter

Type

Required

Description

Example

InstanceId

string

Yes

The ID of the WAF instance.

Note

Call the DescribeInstance operation to query the ID of your WAF instance.

waf_cdnsdf3****

TemplateId

integer

No

The ID of the protection template.

7239

RuleId

integer

Yes

The ID of the protection rule to modify.

20002615

RuleStatus

integer

Yes

The new status of the protection rule. Valid values:

  • 0: disabled

  • 1: enabled

1

RegionId

string

No

The region where the WAF instance is deployed. Valid values:

  • cn-hangzhou: the Chinese mainland.

  • ap-southeast-1: outside the Chinese mainland.

cn-hangzhou

ResourceManagerResourceGroupId

string

No

The ID of the resource group.

rg-acfm***q

DefenseType

string

No

The type of the protection rule. Valid values:

  • template (default): a template protection rule.

  • resource: a rule that is configured for a protected object.

Valid values:

  • template :
    template
  • resource :
    resource

template

Response elements

Element

Type

Description

Example

object

The result of the request.

RequestId

string

The request ID.

BB305BF3-3C71-57A9-9704-E22F567689B0

Examples

Success response

JSON format

{
  "RequestId": "BB305BF3-3C71-57A9-9704-E22F567689B0"
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.