Skip to content

Commit 14a8bef

Browse files
committed
Update rules-creation-workflow partial
1 parent b8f2d17 commit 14a8bef

File tree

7 files changed

+35
-27
lines changed

7 files changed

+35
-27
lines changed

src/content/docs/rules/compression-rules/create-api.mdx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,10 @@ When creating a compression rule via API, make sure you:
2424

2525
<Render
2626
file="rules-creation-workflow"
27-
params={{ one: "a compression rule", two: "http_response_compression" }}
27+
params={{
28+
ruleName: "a compression rule",
29+
phaseName: "http_response_compression",
30+
}}
2831
/>
2932

3033
## Examples

src/content/docs/rules/configuration-rules/create-api.mdx

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,30 +7,34 @@ sidebar:
77
head:
88
- tag: title
99
content: Create a configuration rule via API
10-
1110
---
1211

13-
import { Details, Render } from "~/components"
12+
import { Details, Render } from "~/components";
1413

1514
Use the [Rulesets API](/ruleset-engine/rulesets-api/) to create configuration rules via API.
1615

1716
## Basic rule settings
1817

1918
When creating a configuration rule via API, make sure you:
2019

21-
* Set the rule action to `set_config`.
22-
* Define the parameters in the `action_parameters` field according to the [settings](/rules/configuration-rules/settings/) you wish to override for matching requests.
23-
* Deploy the rule to the `http_config_settings` phase at the zone level.
20+
- Set the rule action to `set_config`.
21+
- Define the parameters in the `action_parameters` field according to the [settings](/rules/configuration-rules/settings/) you wish to override for matching requests.
22+
- Deploy the rule to the `http_config_settings` phase at the zone level.
2423

2524
## Procedure
2625

27-
<Render file="rules-creation-workflow" params={{ one: "a configuration rule", two: "http_config_settings" }} />
26+
<Render
27+
file="rules-creation-workflow"
28+
params={{
29+
ruleName: "a configuration rule",
30+
phaseName: "http_config_settings",
31+
}}
32+
/>
2833

2934
Make sure your API token has the [required permissions](#required-api-token-permissions) to perform the API operations.
3035

3136
## Example requests
3237

33-
3438
<Details header="Example: Add a rule that enables Email Obfuscation and Browser Integrity Check">
3539

3640
The following example sets the rules of an existing phase ruleset (`{ruleset_id}`) to a single configuration rule — enabling Email Obfuscation and Browser Integrity Check for the contacts page — using the [Update a zone ruleset](/api/resources/rulesets/methods/update/) operation:
@@ -55,10 +59,8 @@ https://api.cloudflare.com/client/v4/zones/{zone_id}/rulesets/{ruleset_id} \
5559
}'
5660
```
5761

58-
5962
</Details>
6063

61-
6264
<Details header="Example: Add a rule that turns on I'm Under Attack mode for the admin area">
6365

6466
The following example sets the rules of an existing phase ruleset (`{ruleset_id}`) to a single configuration rule — turning on I'm Under Attack mode for the administration area — using the [Update a zone ruleset](/api/resources/rulesets/methods/update/) operation:
@@ -82,13 +84,12 @@ https://api.cloudflare.com/client/v4/zones/{zone_id}/rulesets/{ruleset_id} \
8284
}'
8385
```
8486

85-
8687
</Details>
8788

88-
***
89+
---
8990

9091
## Required API token permissions
9192

9293
The API token used in API requests to manage configuration rules must have at least the following permission:
9394

94-
* *Zone* > *Config Rules* > *Edit*
95+
- _Zone_ > _Config Rules_ > _Edit_

src/content/docs/rules/origin-rules/create-api.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ When creating an origin rule via API, make sure you:
2424

2525
<Render
2626
file="rules-creation-workflow"
27-
params={{ one: "an origin rule", two: "http_request_origin" }}
27+
params={{ ruleName: "an origin rule", phaseName: "http_request_origin" }}
2828
/>
2929

3030
Make sure your API token has the [required permissions](#required-api-token-permissions) to perform the API operations.

src/content/docs/rules/transform/request-header-modification/create-api.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ When creating an HTTP request header modification rule via API, make sure you:
2626
<Render
2727
file="rules-creation-workflow"
2828
params={{
29-
one: "an HTTP request header modification rule",
30-
two: "http_request_late_transform",
29+
ruleName: "an HTTP request header modification rule",
30+
phaseName: "http_request_late_transform",
3131
}}
3232
/>
3333

src/content/docs/rules/transform/response-header-modification/create-api.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ When creating an HTTP response header modification rule via API, make sure you:
2525
<Render
2626
file="rules-creation-workflow"
2727
params={{
28-
one: "an HTTP response header modification rule",
29-
two: "http_response_headers_transform",
28+
ruleName: "an HTTP response header modification rule",
29+
phaseName: "http_response_headers_transform",
3030
}}
3131
/>
3232

src/content/docs/rules/transform/url-rewrite/create-api.mdx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,10 @@ When creating a rewrite URL rule via API, make sure you:
2424

2525
<Render
2626
file="rules-creation-workflow"
27-
params={{ one: "a rewrite URL rule", two: "http_request_transform" }}
27+
params={{
28+
ruleName: "a rewrite URL rule",
29+
phaseName: "http_request_transform",
30+
}}
2831
/>
2932

3033
Make sure your API token has the [required permissions](#required-api-token-permissions) to perform the API operations.
Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
11
---
2-
inputParameters: ruleName;;phaseName
3-
2+
params:
3+
- ruleName
4+
- phaseName
45
---
56

6-
import { Markdown } from "~/components"
7+
import { Markdown } from "~/components";
78

8-
Follow this workflow to create {props.one} for a given zone via API:
9+
Follow this workflow to create {props.ruleName} for a given zone via API:
910

10-
1. Use the [List zone rulesets](/api/resources/rulesets/methods/list/) operation to check if there is already a ruleset for the <code>{props.two}</code> phase at the zone level.
11+
1. Use the [List zone rulesets](/api/resources/rulesets/methods/list/) operation to check if there is already a ruleset for the <code>{props.phaseName}</code> phase at the zone level.
1112

1213
2. If the phase ruleset does not exist, create it using the [Create a zone ruleset](/api/resources/rulesets/methods/create/) operation. In the new ruleset properties, set the following values:
1314

14-
* **kind**: `zone`
15-
* **phase**: <code>{props.two}</code>
15+
- **kind**: `zone`
16+
- **phase**: <code>{props.phaseName}</code>
1617

17-
3. Use the [Update a zone ruleset](/api/resources/rulesets/methods/update/) operation to add {props.one} to the list of ruleset rules. Alternatively, include the rule in the [Create a zone ruleset](/api/resources/rulesets/methods/create/) request mentioned in the previous step.
18+
3. Use the [Update a zone ruleset](/api/resources/rulesets/methods/update/) operation to add {props.ruleName} to the list of ruleset rules. Alternatively, include the rule in the [Create a zone ruleset](/api/resources/rulesets/methods/create/) request mentioned in the previous step.

0 commit comments

Comments
 (0)