Configures a default or custom rule group that is used by the RegEx Protection Engine for a specific domain name. WAF provides three default rule groups.

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 SetDomainRuleGroup

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

Domains String Yes ["1.example.com","2.example.com"]

The domain name that is added to WAF.

Note You can specify multiple domain names.
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.
RuleGroupId Long Yes 1012

The ID of the rule group that is configured in the RegEx Protection Engine. WAF provides the following default rule groups:

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

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

ResourceGroupId String No rg-atstuj3rtop****

The ID of the resource group to which the domain name belongs in Resource Management. This parameter is empty by default, indicating that the domain name belongs to the default resource group.

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=SetDomainRuleGroup
&Domains=www.example.com
&InstanceId=waf_elasticity-cn-0xldbqt****
&RuleGroupId=1012
&<Common request parameters>

Sample success responses

XML format

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

JSON format

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

Error codes

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