Cloudflare 中文文档
Ruleset Engine
编辑这个页面
跳转官方原文档
Set theme to dark (⇧+D)

Update and deploy rulesets

You can use the API to update basic properties of a ruleset (currently only the description) and the list of rules in the ruleset.

Use one of the following API endpoints:

Operation Method + Endpoint
Update an account ruleset PUT /accounts/{account_id}/rulesets/{ruleset_id}
Update a zone ruleset PUT /zones/{zone_id}/rulesets/{ruleset_id}
Update an account entry point ruleset PUT /accounts/{account_id}/rulesets/phases/{phase_name}/entrypoint
Update a zone entry point ruleset PUT /zones/{zone_id}/rulesets/phases/{phase_name}/entrypoint

​​ Example - Set the rules of a ruleset

Use this API method to set the rules of a ruleset. You must include all the rules you want to associate with the ruleset in every request.

Request
Response

​​ Example - Deploy a ruleset

To deploy a ruleset, create a rule with "action": "execute" that executes the ruleset, and add the ruleset ID to the action_parameters field in the id parameter.

The following example deploys a managed ruleset to the zone-level http_request_firewall_managed phase of a zone ({zone_id}).

Request
Response

For more information on deploying rulesets, refer to Deploy rulesets.

​​ Example - Update ruleset description

You can use this API method to update the description of an existing ruleset or phase entry point.

Request

The response includes the complete ruleset definition, including all the rules.

Response