Skip to content

Commit

Permalink
[Docs] Update API links
Browse files Browse the repository at this point in the history
  • Loading branch information
pedrosousa committed Jan 3, 2025
1 parent 30e3718 commit 9924006
Show file tree
Hide file tree
Showing 11 changed files with 23 additions and 24 deletions.
2 changes: 1 addition & 1 deletion src/content/docs/dns/dns-firewall/faq.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,6 @@ Yes. The default TTL is 30 seconds. You can set `negative_cache_ttl` via the [AP
To set up PTR records for the DNS Firewall cluster IPs that point to your nameserver hostnames, use the following API endpoints:

- [Show DNS Firewall Cluster Reverse DNS](/api/resources/dns_firewall/subresources/reverse_dns/methods/get/)
- [Update DNS Firewall Cluster Reverse DNS](/api/resources/dns_firewall/methods/edit/-reverse-dns)
- [Update DNS Firewall Cluster Reverse DNS](/api/resources/dns_firewall/subresources/reverse_dns/methods/edit/)

</Details>
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ https://api.cloudflare.com/client/v4/zones/{zone_id}/phases/http_request_firewal

<Details header="Example: Add a single rule to a phase entry point ruleset at the zone level">

The following example adds a single rule to a phase entry point ruleset (with ID `{ruleset_id}`) at the zone level using the [Create a zone ruleset rule](/api/resources/rulesets/methods/create/) operation.
The following example adds a single rule to a phase entry point ruleset (with ID `{ruleset_id}`) at the zone level using the [Create a zone ruleset rule](/api/resources/rulesets/subresources/rules/methods/create/) operation.

```bash
curl https://api.cloudflare.com/client/v4/zone/{zone_id}/rulesets/{ruleset_id}/rules \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ When you add rules to a custom ruleset using the [Update an account ruleset](/ap

You can use other API operations depending on the type of operation:

- Add a single rule to an existing custom ruleset: Use the [Create an account ruleset rule](/api/resources/rulesets/methods/create/Rule) operation.
- Add a single rule to an existing custom ruleset: Use the [Create an account ruleset rule](/api/resources/rulesets/subresources/rules/methods/create/) operation.
- Update a single rule in a custom ruleset: Use the [Update an account ruleset rule](/api/resources/rulesets/subresources/rules/methods/edit/) operation.

:::
Expand Down
4 changes: 2 additions & 2 deletions src/content/docs/ruleset-engine/rulesets-api/add-rule.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ Use one of the following API endpoints:
| [Create an account ruleset rule][ar-account] | `POST /accounts/{account_id}/rulesets/{ruleset_id}/rules` |
| [Create a zone ruleset rule][ar-zone] | `POST /zones/{zone_id}/rulesets/{ruleset_id}/rules` |

[ar-account]: /api/resources/rulesets/methods/create/Rule
[ar-zone]: /api/resources/rulesets/methods/create/
[ar-account]: /api/resources/rulesets/subresources/rules/methods/create/
[ar-zone]: /api/resources/rulesets/subresources/rules/methods/create/

Include the rule definition in the request body.

Expand Down
2 changes: 1 addition & 1 deletion src/content/docs/ruleset-engine/rulesets-api/delete.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ Use one of the following API endpoints:
| [Delete an account ruleset version][drv-account] | `DELETE /accounts/{account_id}/rulesets/{ruleset_id}/versions/{version_number}` |
| [Delete a zone ruleset version][drv-zone] | `DELETE /zones/{zone_id}/rulesets/{ruleset_id}/versions/{version_number}` |

[drv-account]: /api/resources/rulesets/methods/delete/Version
[drv-account]: /api/resources/rulesets/subresources/versions/methods/delete/
[drv-zone]: /api/resources/rulesets/subresources/versions/methods/delete/

If the delete operation succeeds, the method call returns a `204 No Content` HTTP status code.
Expand Down
4 changes: 2 additions & 2 deletions src/content/docs/ruleset-engine/rulesets-api/view.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -195,9 +195,9 @@ Use one of the following API endpoints:
| [Get an account entry point ruleset version][gerv-account] | `GET /accounts/{account_id}/rulesets/phases/{phase_name}/entrypoint/versions/{version_number}` |
| [Get a zone entry point ruleset version][gerv-zone] | `GET /zones/{zone_id}/rulesets/phases/{phase_name}/entrypoint/versions/{version_number}` |

[grv-account]: /api/resources/rulesets/methods/get/Version
[grv-account]: /api/resources/rulesets/subresources/versions/methods/get/
[grv-zone]: /api/resources/rulesets/subresources/versions/methods/get/
[gerv-account]: /api/resources/rulesets/subresources/phases/methods/get/Version
[gerv-account]: /api/resources/rulesets/subresources/phases/subresources/versions/methods/get/
[gerv-zone]: /api/resources/rulesets/subresources/phases/subresources/versions/methods/get/

When the specified phase entry point ruleset does not exist, this API method returns a `404 Not Found` HTTP status code.
Expand Down
19 changes: 9 additions & 10 deletions src/content/docs/waf/custom-rules/skip/api-examples.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ sidebar:
head:
- tag: title
content: API examples of custom rules with the Skip action

---

Use the [Rulesets API](/ruleset-engine/rulesets-api/) to configure custom rules via API.
Expand All @@ -17,17 +16,17 @@ The `skip` action supports different [skip options](/waf/custom-rules/skip/optio

This page contains examples of different skip rule scenarios for custom rules. Take the following into account:

* The `{zone_id}` value is the [ID of the zone](/fundamentals/setup/find-account-and-zone-ids/) where you want to add the rule.
- The `{zone_id}` value is the [ID of the zone](/fundamentals/setup/find-account-and-zone-ids/) where you want to add the rule.

* The `{ruleset_id}` value is the ID of the [entry point ruleset](/ruleset-engine/about/rulesets/#entry-point-ruleset) of the `http_request_firewall_custom` phase. For details on obtaining this ruleset ID, refer to [List and view rulesets](/ruleset-engine/rulesets-api/view/). The API examples in this page add a skip rule to an existing ruleset using the [Create a zone ruleset rule](/api/resources/rulesets/methods/create/) operation.
- The `{ruleset_id}` value is the ID of the [entry point ruleset](/ruleset-engine/about/rulesets/#entry-point-ruleset) of the `http_request_firewall_custom` phase. For details on obtaining this ruleset ID, refer to [List and view rulesets](/ruleset-engine/rulesets-api/view/). The API examples in this page add a skip rule to an existing ruleset using the [Create a zone ruleset rule](/api/resources/rulesets/subresources/rules/methods/create/) operation.

However, the entry point ruleset may not exist yet. In this case, invoke the [Create a zone ruleset](/api/resources/rulesets/methods/create/) operation to create the entry point ruleset with a skip rule. Refer to [Create ruleset](/ruleset-engine/rulesets-api/create/#example---create-a-zone-level-phase-entry-point-ruleset) for an example.

* Although each example only includes one action parameter, you can use several skip options in the same rule by specifying the `ruleset`, `phases`, and `products` action parameters simultaneously.
- Although each example only includes one action parameter, you can use several skip options in the same rule by specifying the `ruleset`, `phases`, and `products` action parameters simultaneously.

## Skip the remaining rules in the current ruleset

This example invokes the [Create a zone ruleset rule](/api/resources/rulesets/methods/create/) operation to add a skip rule to the existing `http_request_firewall_custom` phase entry point ruleset with ID `{ruleset_id}`. The rule will skip all remaining rules in the current ruleset for requests matching the rule expression:
This example invokes the [Create a zone ruleset rule](/api/resources/rulesets/subresources/rules/methods/create/) operation to add a skip rule to the existing `http_request_firewall_custom` phase entry point ruleset with ID `{ruleset_id}`. The rule will skip all remaining rules in the current ruleset for requests matching the rule expression:

```bash
curl https://api.cloudflare.com/client/v4/zones/{zone_id}/rulesets/{ruleset_id}/rules \
Expand All @@ -45,7 +44,7 @@ curl https://api.cloudflare.com/client/v4/zones/{zone_id}/rulesets/{ruleset_id}/

## Skip a phase

This example invokes the [Create a zone ruleset rule](/api/resources/rulesets/methods/create/) operation to add a rule to the existing `http_request_firewall_custom` phase entry point ruleset with ID `{ruleset_id}`. The rule will skip the `http_ratelimit` phase for requests matching the rule expression:
This example invokes the [Create a zone ruleset rule](/api/resources/rulesets/subresources/rules/methods/create/) operation to add a rule to the existing `http_request_firewall_custom` phase entry point ruleset with ID `{ruleset_id}`. The rule will skip the `http_ratelimit` phase for requests matching the rule expression:

```bash
curl https://api.cloudflare.com/client/v4/zones/{zone_id}/rulesets/{ruleset_id}/rules \
Expand All @@ -67,10 +66,10 @@ Refer to [Available skip options](/waf/custom-rules/skip/options/) for the list

## Skip a phase and do not log matching requests

This example invokes the [Create a zone ruleset rule](/api/resources/rulesets/methods/create/) operation to add a rule that:
This example invokes the [Create a zone ruleset rule](/api/resources/rulesets/subresources/rules/methods/create/) operation to add a rule that:

* Skips the `http_ratelimit` phase
* Disables event logging for the current rule
- Skips the `http_ratelimit` phase
- Disables event logging for the current rule

```bash
curl https://api.cloudflare.com/client/v4/zones/{zone_id}/rulesets/{ruleset_id}/rules \
Expand All @@ -95,7 +94,7 @@ Refer to [Available skip options: Logging](/waf/custom-rules/skip/options/#loggi

## Skip security products

This example uses the [Create a zone ruleset rule](/api/resources/rulesets/methods/create/) operation to add a rule that skips the [Zone Lockdown](/waf/tools/zone-lockdown/) and [User Agent Blocking](/waf/tools/user-agent-blocking/) products for requests matching the rule expression:
This example uses the [Create a zone ruleset rule](/api/resources/rulesets/subresources/rules/methods/create/) operation to add a rule that skips the [Zone Lockdown](/waf/tools/zone-lockdown/) and [User Agent Blocking](/waf/tools/user-agent-blocking/) products for requests matching the rule expression:

```bash
curl https://api.cloudflare.com/client/v4/zones/{zone_id}/rulesets/{ruleset_id}/rules \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ The following example adds a rule that skips all remaining rules in the entry po

Save the entry point ruleset ID (`060013b1eeb14c93b0dcd896537e0d2c`) for the next step.

2. Invoke the [Create a zone ruleset rule](/api/resources/rulesets/methods/create/) operation (a `POST` request) to add an exception (or skip rule) at the beginning of the rules list, since a skip rule applies only to rules listed after it. The exact rule location is defined in the [`position` object](/ruleset-engine/rulesets-api/add-rule/#define-the-rule-position-in-the-ruleset).
2. Invoke the [Create a zone ruleset rule](/api/resources/rulesets/subresources/rules/methods/create/) operation (a `POST` request) to add an exception (or skip rule) at the beginning of the rules list, since a skip rule applies only to rules listed after it. The exact rule location is defined in the [`position` object](/ruleset-engine/rulesets-api/add-rule/#define-the-rule-position-in-the-ruleset).

```bash
curl "https://api.cloudflare.com/client/v4/zones/{zone_id}/rulesets/{entry_point_ruleset_id}/rules" \
Expand Down Expand Up @@ -138,7 +138,7 @@ The following example adds a rule that skips the [Cloudflare Managed Ruleset](/w
- The ID of the entry point ruleset (`060013b1eeb14c93b0dcd896537e0d2c` in this example)
- The ID of the `execute` rule deployment the managed ruleset (`1bdb49371c1f46958fc8b985efcb79e7` in this example)

2. Invoke the [Create a zone ruleset rule](/api/resources/rulesets/methods/create/) operation (a `POST` request) to add an exception (or skip rule) immediately before the `execute` rule deploying the Cloudflare Managed Ruleset, since a skip rule applies only to rules listed after it. The exact rule location is defined in the [`position` object](/ruleset-engine/rulesets-api/add-rule/#define-the-rule-position-in-the-ruleset).
2. Invoke the [Create a zone ruleset rule](/api/resources/rulesets/subresources/rules/methods/create/) operation (a `POST` request) to add an exception (or skip rule) immediately before the `execute` rule deploying the Cloudflare Managed Ruleset, since a skip rule applies only to rules listed after it. The exact rule location is defined in the [`position` object](/ruleset-engine/rulesets-api/add-rule/#define-the-rule-position-in-the-ruleset).

```bash
curl "https://api.cloudflare.com/client/v4/zones/{zone_id}/rulesets/{entry_point_ruleset_id}/rules" \
Expand Down Expand Up @@ -270,7 +270,7 @@ The following example adds a rule that skips a particular rule of the [Cloudflar
- The ID of the Cloudflare Managed Ruleset (<RuleID id="efb7b8c949ac4650a09736fc376e9aee" />)
- The ID of the rule to skip (<RuleID id="d9e350f1b72d4730899c8a420e48a85d" /> in this example)

3. Invoke the [Create a zone ruleset rule](/api/resources/rulesets/methods/create/) operation (a `POST` request) to add an exception (or skip rule) immediately before the `execute` rule deploying the Cloudflare Managed Ruleset, since a skip rule applies only to rules listed after it.
3. Invoke the [Create a zone ruleset rule](/api/resources/rulesets/subresources/rules/methods/create/) operation (a `POST` request) to add an exception (or skip rule) immediately before the `execute` rule deploying the Cloudflare Managed Ruleset, since a skip rule applies only to rules listed after it.

```bash
curl "https://api.cloudflare.com/client/v4/zones/{zone_id}/rulesets/{entry_point_ruleset_id}/rules" \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ To create a {props.ruleType} for a zone, add a rule <Markdown text={props.extraO

1. Invoke the [Get a zone entry point ruleset](/api/resources/rulesets/subresources/phases/methods/get/) 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.

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/resources/rulesets/methods/create/) operation to add a {props.ruleType} to the existing ruleset. Refer to the examples below for details.
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/resources/rulesets/subresources/rules/methods/create/) operation to add a {props.ruleType} to the existing ruleset. Refer to the examples below for details.

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/resources/rulesets/methods/create/) 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.
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ params:

import { Markdown } from "~/components";

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 an account ruleset rule](/api/resources/rulesets/methods/create/Rule) operation to add an `execute` rule to the existing ruleset deploying the <Markdown text={props.deploymentItem} />. By default, the rule will be added at the end of the list of rules already in the ruleset.
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 an account ruleset rule](/api/resources/rulesets/subresources/rules/methods/create/) operation to add an `execute` rule to the existing ruleset deploying the <Markdown text={props.deploymentItem} />. By default, the rule will be added at the end of the list of rules already in the ruleset.
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ params:

import { Markdown } from "~/components";

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/resources/rulesets/methods/create/) operation to add an `execute` rule to the existing ruleset deploying the <Markdown text={props.deploymentItem} />. By default, the rule will be added at the end of the list of rules already in the ruleset.
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/resources/rulesets/subresources/rules/methods/create/) operation to add an `execute` rule to the existing ruleset deploying the <Markdown text={props.deploymentItem} />. By default, the rule will be added at the end of the list of rules already in the ruleset.

0 comments on commit 9924006

Please sign in to comment.