You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/content/docs/ruleset-engine/rulesets-api/add-rule.mdx
+15-15Lines changed: 15 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ sidebar:
6
6
order: 7
7
7
---
8
8
9
-
import { Render } from"~/components";
9
+
import { Render, APIRequest } from"~/components";
10
10
11
11
Adds a single rule to an existing ruleset. Use this endpoint to add a rule without having to include all the existing ruleset rules in the request.
12
12
@@ -28,20 +28,20 @@ Invoking this method creates a new version of the ruleset.
28
28
29
29
## Example
30
30
31
-
The following example adds a rule to ruleset `{ruleset_id}` of zone `{zone_id}`. The ruleset ID was previously obtained using the [List zone rulesets](/api/resources/rulesets/methods/list/) operation, and corresponds to the entry point ruleset for the `http_request_firewall_custom` phase.
31
+
The following `POST` request adds a rule to ruleset `$RULESET_ID` of zone `$ZONE_ID`. The ruleset ID was previously obtained using the [List zone rulesets](/api/resources/rulesets/methods/list/) operation, and corresponds to the entry point ruleset for the `http_request_firewall_custom` phase.
32
32
33
33
The response will include the complete ruleset after adding the rule.
Creates a ruleset of a given kind in the specified phase. Allows you to create phase entry point rulesets.
12
12
@@ -32,35 +32,34 @@ The following parameters are required:
32
32
- The kind of ruleset the JSON object represents.
33
33
- Allowed values:
34
34
-`custom`: Creates a custom ruleset
35
-
-`root`: Creates a phase entry point ruleset at the account level
35
+
-`root`: Creates a phase [entry point ruleset](/ruleset-engine/about/rulesets/#entry-point-ruleset) at the account level
36
36
-`zone`: Creates a phase entry point ruleset at the zone level
37
37
-`phase` <Typetext="String" />
38
38
- The name of the [phase](/ruleset-engine/about/phases/) where the ruleset will be created.
39
-
- Check the specific Cloudflare product documentation for more information on the phases where you can create rulesets for that product.
39
+
- Check the [phases list](/ruleset-engine/reference/phases-list/) or the the specific Cloudflare product documentation for more information on the phases where you can create rulesets for that product.
40
40
41
41
Use the `rules` parameter to supply a list of rules for the ruleset. For an object definition, refer to [Rulesets API: JSON Object](/ruleset-engine/rulesets-api/json-object/).
42
42
43
43
## Example - Create a custom ruleset
44
44
45
45
The following `POST` request creates a custom ruleset in the `http_request_firewall_custom` phase containing a single rule.
The following `POST` request creates a zone-level phase entry point ruleset at the `http_request_firewall_managed` phase with a single rule that executes a managed ruleset.
115
93
116
94
:::note
117
-
118
-
You do not have to use this method to create a phase entry point ruleset — Cloudflare automatically creates the entry point ruleset when you add a rule to it, if it does not exist. Refer to [Add rules to phase entry point rulesets](/ruleset-engine/basic-operations/add-rule-phase-rulesets/) for more information.
119
-
95
+
You do not have to use this method to create a phase entry point ruleset. Cloudflare automatically creates the entry point ruleset when you add a rule to it, if it does not exist. Refer to [Add rules to phase entry point rulesets](/ruleset-engine/basic-operations/add-rule-phase-rulesets/) for more information.
The following `POST` request creates an account-level phase entry point ruleset for the `http_ratelimit` phase with a single rule that executes a rate limiting ruleset for all Enterprise zones in the account.
175
150
176
151
:::note
177
-
You do not have to use this method to create a phase entry point ruleset — Cloudflare automatically creates the entry point ruleset when you add a rule to it, if it does not exist. Refer to [Add rules to phase entry point rulesets](/ruleset-engine/basic-operations/add-rule-phase-rulesets/) for more information.
152
+
You do not have to use this method to create a phase entry point ruleset. Cloudflare automatically creates the entry point ruleset when you add a rule to it, if it does not exist. Refer to [Add rules to phase entry point rulesets](/ruleset-engine/basic-operations/add-rule-phase-rulesets/) for more information.
0 commit comments