From 9924006c5a7388bc451087b5953c4aed2e4d5b76 Mon Sep 17 00:00:00 2001 From: Pedro Sousa <680496+pedrosousa@users.noreply.github.com> Date: Fri, 3 Jan 2025 15:48:21 +0000 Subject: [PATCH] [Docs] Update API links --- src/content/docs/dns/dns-firewall/faq.mdx | 2 +- .../add-rule-phase-rulesets.mdx | 2 +- .../custom-rulesets/add-rules-ruleset.mdx | 2 +- .../ruleset-engine/rulesets-api/add-rule.mdx | 4 ++-- .../ruleset-engine/rulesets-api/delete.mdx | 2 +- .../docs/ruleset-engine/rulesets-api/view.mdx | 4 ++-- .../waf/custom-rules/skip/api-examples.mdx | 19 +++++++++---------- .../waf-exceptions/define-api.mdx | 6 +++--- .../waf/api-generic-create-rule-procedure.mdx | 2 +- .../api-account/step2-create-rule.mdx | 2 +- .../rulesets/api-zone/step2-create-rule.mdx | 2 +- 11 files changed, 23 insertions(+), 24 deletions(-) diff --git a/src/content/docs/dns/dns-firewall/faq.mdx b/src/content/docs/dns/dns-firewall/faq.mdx index 145de8f61b9b1c7..402610a3d266600 100644 --- a/src/content/docs/dns/dns-firewall/faq.mdx +++ b/src/content/docs/dns/dns-firewall/faq.mdx @@ -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/) diff --git a/src/content/docs/ruleset-engine/basic-operations/add-rule-phase-rulesets.mdx b/src/content/docs/ruleset-engine/basic-operations/add-rule-phase-rulesets.mdx index 70e2a4f1f17c017..dd5251357bedca9 100644 --- a/src/content/docs/ruleset-engine/basic-operations/add-rule-phase-rulesets.mdx +++ b/src/content/docs/ruleset-engine/basic-operations/add-rule-phase-rulesets.mdx @@ -90,7 +90,7 @@ https://api.cloudflare.com/client/v4/zones/{zone_id}/phases/http_request_firewal
-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 \ diff --git a/src/content/docs/ruleset-engine/custom-rulesets/add-rules-ruleset.mdx b/src/content/docs/ruleset-engine/custom-rulesets/add-rules-ruleset.mdx index ac43657ca439270..a49dc101fdbf519 100644 --- a/src/content/docs/ruleset-engine/custom-rulesets/add-rules-ruleset.mdx +++ b/src/content/docs/ruleset-engine/custom-rulesets/add-rules-ruleset.mdx @@ -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. ::: diff --git a/src/content/docs/ruleset-engine/rulesets-api/add-rule.mdx b/src/content/docs/ruleset-engine/rulesets-api/add-rule.mdx index f015c4475dda9d6..dd8a15a6b162756 100644 --- a/src/content/docs/ruleset-engine/rulesets-api/add-rule.mdx +++ b/src/content/docs/ruleset-engine/rulesets-api/add-rule.mdx @@ -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. diff --git a/src/content/docs/ruleset-engine/rulesets-api/delete.mdx b/src/content/docs/ruleset-engine/rulesets-api/delete.mdx index 949f003fef90eec..90d3c9fec8f349d 100644 --- a/src/content/docs/ruleset-engine/rulesets-api/delete.mdx +++ b/src/content/docs/ruleset-engine/rulesets-api/delete.mdx @@ -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. diff --git a/src/content/docs/ruleset-engine/rulesets-api/view.mdx b/src/content/docs/ruleset-engine/rulesets-api/view.mdx index b02db52f53a7d48..06ad6d9f611e2e2 100644 --- a/src/content/docs/ruleset-engine/rulesets-api/view.mdx +++ b/src/content/docs/ruleset-engine/rulesets-api/view.mdx @@ -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. diff --git a/src/content/docs/waf/custom-rules/skip/api-examples.mdx b/src/content/docs/waf/custom-rules/skip/api-examples.mdx index 3a729065df73375..9618e0041da5922 100644 --- a/src/content/docs/waf/custom-rules/skip/api-examples.mdx +++ b/src/content/docs/waf/custom-rules/skip/api-examples.mdx @@ -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. @@ -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 \ @@ -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 \ @@ -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 \ @@ -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 \ diff --git a/src/content/docs/waf/managed-rules/waf-exceptions/define-api.mdx b/src/content/docs/waf/managed-rules/waf-exceptions/define-api.mdx index 583f80b1a95f1ae..5cfa9e0d223fc43 100644 --- a/src/content/docs/waf/managed-rules/waf-exceptions/define-api.mdx +++ b/src/content/docs/waf/managed-rules/waf-exceptions/define-api.mdx @@ -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" \ @@ -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" \ @@ -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 () - The ID of the rule to skip ( 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" \ diff --git a/src/content/partials/waf/api-generic-create-rule-procedure.mdx b/src/content/partials/waf/api-generic-create-rule-procedure.mdx index 0ff61899d2e762a..c5ecefd099067e8 100644 --- a/src/content/partials/waf/api-generic-create-rule-procedure.mdx +++ b/src/content/partials/waf/api-generic-create-rule-procedure.mdx @@ -11,6 +11,6 @@ To create a {props.ruleType} for a zone, add a rule {props.phaseName} 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. diff --git a/src/content/partials/waf/rulesets/api-account/step2-create-rule.mdx b/src/content/partials/waf/rulesets/api-account/step2-create-rule.mdx index ba3403331d5afc5..a584a901b17dc2f 100644 --- a/src/content/partials/waf/rulesets/api-account/step2-create-rule.mdx +++ b/src/content/partials/waf/rulesets/api-account/step2-create-rule.mdx @@ -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 . 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 . By default, the rule will be added at the end of the list of rules already in the ruleset. diff --git a/src/content/partials/waf/rulesets/api-zone/step2-create-rule.mdx b/src/content/partials/waf/rulesets/api-zone/step2-create-rule.mdx index 184be6084f046af..239d7595f28407a 100644 --- a/src/content/partials/waf/rulesets/api-zone/step2-create-rule.mdx +++ b/src/content/partials/waf/rulesets/api-zone/step2-create-rule.mdx @@ -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 . 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 . By default, the rule will be added at the end of the list of rules already in the ruleset.