Skip to content

Commit 8d39664

Browse files
committed
Define parameter names in partial
1 parent 647c03c commit 8d39664

File tree

3 files changed

+20
-13
lines changed

3 files changed

+20
-13
lines changed

src/content/docs/waf/custom-rules/create-api.mdx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,14 @@ You must deploy custom rules to the `http_request_firewall_custom` [phase entry
1818

1919
## Create a custom rule
2020

21-
<Render file="api-generic-create-rule-procedure" params={{ one: "custom rule", two: "", three: "http_request_firewall_custom" }} />
21+
<Render
22+
file="api-generic-create-rule-procedure"
23+
params={{
24+
ruleType: "custom rule",
25+
extraObject: "",
26+
phaseName: "http_request_firewall_custom",
27+
}}
28+
/>
2229

2330
### Example A
2431

src/content/docs/waf/rate-limiting-rules/create-api.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ Rate limiting rules must appear at the end of the rules list.
2424
<Render
2525
file="api-generic-create-rule-procedure"
2626
params={{
27-
one: "rate limiting rule",
28-
two: "with a `ratelimit` object",
29-
three: "http_ratelimit",
27+
ruleType: "rate limiting rule",
28+
extraObject: "with a `ratelimit` object",
29+
phaseName: "http_ratelimit",
3030
}}
3131
/>
3232

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
---
2-
inputParameters: ruleName;;extraObject;;phase
3-
2+
params:
3+
- ruleType
4+
- extraObject
5+
- phaseName
46
---
57

6-
import { Markdown } from "~/components"
7-
8-
To create a {props.one} for a zone, add a rule {props.two} to the <code>{props.three}</code> phase entry point ruleset.
8+
import { Markdown } from "~/components";
99

10-
1. Invoke the [List zone rulesets](/api/operations/listZoneRulesets) method to obtain the list of rulesets in your zone. You will need the [zone ID](/fundamentals/setup/find-account-and-zone-ids/) for this operation.
10+
To create a {props.ruleType} for a zone, add a rule <Markdown text={props.extraObject} /> to the <code>{props.phaseName}</code> phase entry point ruleset.
1111

12-
2. Search for an entry point ruleset for the <code>{props.three}</code> phase in the response. Such a ruleset would have the following properties: `"kind": "zone"` and <code>"phase": "{props.three}"</code>. If you find the ruleset, take note of its ID for the next step.
12+
1. Invoke the [Get a zone entry point ruleset](/api/operations/getZoneEntrypointRuleset) operation to obtain the definition of the entry point ruleset for the <code>{props.phaseName}</code> phase. You will need the [zone ID](/fundamentals/setup/find-account-and-zone-ids/) for this task.
1313

14-
3. If the entry point ruleset already exists, invoke the [Create a zone ruleset rule](/api/operations/createZoneRulesetRule) operation to add a {props.one} to the existing ruleset. By default, the rule will be added at the end of the list of rules already in the ruleset. Refer to the examples below for details.
14+
2. If the entry point ruleset already exists (that is, if you received a `200 OK` status code and the ruleset definition), take note of the ruleset ID in the response. Then, invoke the [Create a zone ruleset rule](/api/operations/createZoneRulesetRule) operation to add a {props.ruleType} to the existing ruleset. Refer to the examples below for details.
1515

16-
If the entry point ruleset does not exist, invoke the [Create a zone ruleset](/api/operations/createZoneRuleset) operation to create the entry point ruleset with the new {props.one}. Refer to [Create ruleset](/ruleset-engine/rulesets-api/create/#example---create-a-zone-level-phase-entry-point-ruleset) for an example.
16+
3. If the entry point ruleset does not exist (that is, if you received a `404 Not Found` status code in step 1), create it using the [Create a zone ruleset](/api/operations/createZoneRuleset) operation. Include your {props.ruleType} in the `rules` array. Refer to [Create ruleset](/ruleset-engine/rulesets-api/create/#example---create-a-zone-level-phase-entry-point-ruleset) for an example.

0 commit comments

Comments
 (0)