diff --git a/src/content/docs/api-shield/security/schema-validation/api.mdx b/src/content/docs/api-shield/security/schema-validation/api.mdx index c631dc26f64922..afb1643ebbd443 100644 --- a/src/content/docs/api-shield/security/schema-validation/api.mdx +++ b/src/content/docs/api-shield/security/schema-validation/api.mdx @@ -9,7 +9,7 @@ head: content: Configure Schema Validation --- -import { GlossaryTooltip, Steps } from "~/components" +import { GlossaryTooltip, Steps, APIRequest } from "~/components" Schema Validation 2.0 allows all corresponding configuration calls to be made via API. This validation centers more around individual endpoints and lets you set mitigation actions for each endpoint individually. Additionally, you can use Cloudflare-provided learned schemas that we [learn automatically](/api-shield/management-and-monitoring/#endpoint-schema-learning) from your traffic for individual endpoints. @@ -49,13 +49,18 @@ Endpoints must be listed in Endpoint Management for Schema Validation to match r Upload a schema via the v4 API using `POST`. This example requires a `example_schema.yaml` schema file in the current folder. -```bash title="cURL command" -curl --request POST "https://api.cloudflare.com/client/v4/zones/{zone_id}/api_gateway/user_schemas" \ ---header "Authorization: Bearer " \ ---form file=@example_schema.yaml --form kind=openapi_v3 --form name=example_schema --form validation_enabled=false -``` - -```json title="Result" +", + validation_enabled: true + }} +/> + +```json output { "result": { @@ -80,16 +85,15 @@ By default, Schema Validation is disabled for an uploaded schema so that you can Use a `PATCH` request to activate a schema after inspection. -```bash title="cURL command" -curl --request PATCH "https://api.cloudflare.com/client/v4/zones/{zone_id}/api_gateway/user_schemas/{schema_id}" \ ---header "Authorization: Bearer " \ ---header 'Content-Type: application/json' \ ---data '{ - "validation_enabled": true - }' -``` + -```json title="Result" +```json output { "result": { @@ -119,7 +123,7 @@ curl --request GET "https://api.cloudflare.com/client/v4/zones/{zone_id}/api_gat --header 'Content-Type: application/json' ``` -```json title="Result" +```json output { "result": [ @@ -158,7 +162,7 @@ curl "https://api.cloudflare.com/client/v4/zones/{zone_id}/api_gateway/operation ]' ``` -```json title="Result" +```json output { "result": [ { @@ -202,7 +206,7 @@ curl "https://api.cloudflare.com/client/v4/zones/{zone_id}/api_gateway/settings/ --header "Authorization: Bearer " ``` -```json title="Result" +```json output { "result": { "validation_default_mitigation_action": "none", @@ -227,7 +231,7 @@ curl --request PUT "https://api.cloudflare.com/client/v4/zones/{zone_id}/api_gat }' ``` -```json title="Result" +```json output { "result": { "validation_default_mitigation_action": "block", @@ -249,7 +253,7 @@ curl "https://api.cloudflare.com/client/v4/zones/{zone_id}/api_gateway/operation --header "Authorization: Bearer " ``` -```json title="Result" +```json output { "result": { "mitigation_action": "null" @@ -276,7 +280,7 @@ curl --request PUT "https://api.cloudflare.com/client/v4/zones/{zone_id}/api_gat }' ``` -```json title="Result" +```json output { "result": { "mitigation_action": "block" @@ -295,12 +299,12 @@ You can get an overview of the schemas currently active on a zone using `GET`. `validation_enabled=true` is an optional parameter. -```bash title="cURL command" -curl "https://api.cloudflare.com/client/v4/zones/{zone_id}/api_gateway/user_schemas?omit_source=true" \ ---header "Authorization: Bearer " -``` + -```json title="Result" +```json output { "result": [ { @@ -329,12 +333,12 @@ We recommend using the query parameter `omit_source=true` to only display active You can delete a schema using `DELETE`. -```bash title="cURL command" -curl --request DELETE "https://api.cloudflare.com/client/v4/zones/{zone_id}/api_gateway/user_schemas/{schema_id}" \ ---header "Authorization: Bearer " -``` + -```json title="Result" +```json output { "result": null, "success": true, @@ -354,7 +358,7 @@ curl "https://api.cloudflare.com/client/v4/zones/{zone_id}/api_gateway/operation --header "Authorization: Bearer " ``` -```json title="Result" +```json output { "result": { @@ -404,7 +408,7 @@ curl --request PUT "https://api.cloudflare.com/client/v4/zones/{zone_id}/api_gat --header "Authorization: Bearer " ``` -```json title="Result" +```json output { "result": null, "success": true, @@ -434,7 +438,7 @@ curl --request PATCH "https://api.cloudflare.com/client/v4/zones/{zone_id}/api_g }' ``` -```json title="Result" +```json output { "result": { "validation_default_mitigation_action": "block", diff --git a/src/content/docs/api-shield/security/volumetric-abuse-detection.mdx b/src/content/docs/api-shield/security/volumetric-abuse-detection.mdx index 48fbb3777d05a3..b8434c69c984e5 100644 --- a/src/content/docs/api-shield/security/volumetric-abuse-detection.mdx +++ b/src/content/docs/api-shield/security/volumetric-abuse-detection.mdx @@ -7,7 +7,7 @@ sidebar: --- -import { GlossaryTooltip, Steps, Render } from "~/components" +import { GlossaryTooltip, Steps, Render, APIRequest } from "~/components" Cloudflare Volumetric Abuse Detection helps you set up a system of adaptive rate limiting. @@ -60,6 +60,11 @@ Refer to the [Rules documentation](https://developers.cloudflare.com/waf/rate-li [Rate limit recommendations are available via the API](/api/resources/api_gateway/subresources/operations/methods/get/) if you would like to dynamically update rate limits over time. + + ## Special cases diff --git a/src/content/docs/bots/frequently-asked-questions.mdx b/src/content/docs/bots/frequently-asked-questions.mdx index c0ee6c6a268bc1..92aebf11f292cc 100644 --- a/src/content/docs/bots/frequently-asked-questions.mdx +++ b/src/content/docs/bots/frequently-asked-questions.mdx @@ -6,7 +6,7 @@ sidebar: order: 11 --- -import { Render, RuleID } from "~/components"; +import { Render, RuleID, APIRequest } from "~/components"; ## Bots @@ -171,19 +171,19 @@ This is a known issue the Bots team is working to resolve in the near future. In 1. List the existing Rulesets at the zone level. - ```bash - curl "https://api.cloudflare.com/client/v4/zones/{zone_id}/rulesets" \ - --header "Authorization: Bearer " - ``` + 2. From the output in step 1, find the ruleset ID that is associated with the zone's SBFM configuration. You should be able to see `"kind": "zone"` and `"phase": "http_request_sbfm"` for that ruleset. 3. Use the ruleset ID you found to delete the SBFM ruleset. - ```bash - curl --request DELETE "https://api.cloudflare.com/client/v4/zones/{zone_id}/rulesets/{ruleset_id}" \ - --header "Authorization: Bearer " - ``` + Note that you need to replace `` with your own [API token](/fundamentals/api/get-started/create-token/). diff --git a/src/content/docs/ddos-protection/botnet-threat-feed.mdx b/src/content/docs/ddos-protection/botnet-threat-feed.mdx index 35076a299da6fd..2a602b4645d007 100644 --- a/src/content/docs/ddos-protection/botnet-threat-feed.mdx +++ b/src/content/docs/ddos-protection/botnet-threat-feed.mdx @@ -11,7 +11,7 @@ learning_center: link: https://www.cloudflare.com/learning/ddos/what-is-a-ddos-botnet/ --- -import { Steps } from "~/components" +import { Steps, APIRequest } from "~/components" The Cloudflare DDoS Botnet Threat Feed is a threat intelligence feed for service providers (SPs) such as hosting providers and Internet service providers (ISPs) that provides information about their own IP addresses that have participated in HTTP DDoS attacks as observed from Cloudflare's global network. The feed aims to help service providers stop the abuse and reduce DDoS attacks originating from within their networks. @@ -96,13 +96,12 @@ Retrieves all the data in the botnet tracking database for a given ASN (currentl The provided `{asn}` must be affiliated with your account. -```bash title="Example request" -curl "https://api.cloudflare.com/client/v4/accounts/{account_id}/botnet_feed/asn/{asn}/full_report" \ ---header "Content-Type: application/json" \ ---header "Authorization: Bearer " -``` + -```json title="Example response" +```json output { "result": [ { @@ -129,13 +128,12 @@ The provided `{asn}` must be affiliated with your account. `{date}` must be an ISO 8601-formatted date: `YYYY-MM-DD`. If no date is specified, the API responds with the data from the day before. -```bash title="Example request" -curl "https://api.cloudflare.com/client/v4/accounts/{account_id}/botnet_feed/asn/{asn}/day_report?date=2024-05-05" \ ---header "Content-Type: application/json" \ ---header "Authorization: Bearer " -``` + -```json title="Example response" +```json output { "result": [ {