You can call this operation to select a default rule group or customize a rule group used by the RegEx protection engine for specified domains. The system provides three default rule groups.


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
Domains String Yes ["",""]

The domains that have been added to WAF.

Note You can specify multiple domain names.
InstanceId String Yes waf_elasticity-cn-0xldbqtm005

The ID of the WAF instance.

Note You can call the DescribeInstanceInfo operation to query the ID of a WAF instance.
RuleGroupId Long Yes 1012

The ID of the protection rule group. The system provides the following default rule groups:

  • 1011: strict rules
  • 1012: normal rules
  • 1013: loose rules
Note You can also enter the ID of a custom rule group. The ID is displayed on the Customize Rule Groups page in the WAF console.
WafVersion Long No 1

The system data identifier that is used to control optimistic locking.

ResourceGroupId String No rg-atstuj3rtoptyui

The ID of the resource group to which the queried domains belong in Resource Management. By default, no value is specified, indicating that the domains belong to the default resource group.

Response parameters

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

The ID of the request.


Sample requests

http(s)://[Endpoint]/? Action=SetDomainRuleGroup
&<Common request parameters>

Sample success responses

XML format


JSON format


Error codes

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