diff --git a/src/content/docs/load-balancing/private-network/tunnels-setup.mdx b/src/content/docs/load-balancing/private-network/tunnels-setup.mdx index 559a30ed32cd325..fe06ab3c1149f42 100644 --- a/src/content/docs/load-balancing/private-network/tunnels-setup.mdx +++ b/src/content/docs/load-balancing/private-network/tunnels-setup.mdx @@ -5,7 +5,7 @@ sidebar: order: 2 --- -import { Render, TabItem, Tabs } from "~/components"; +import { Render, TabItem, Tabs, APIRequest } from "~/components"; Consider the following steps to learn how to configure Private Network Load Balancing solution, using [Cloudflare Tunnel](/cloudflare-one/connections/connect-networks/) as the off-ramp to securely connect to your private or internal services. @@ -86,23 +86,21 @@ All origins with private IPs must have `virtual_network_id` specified. ::: -```bash -curl --request PATCH \ -https://api.cloudflare.com/client/v4/accounts/{account_id}/load_balancers/pools/{pool_id} \ ---header "Authorization: Bearer " \ ---header "Content-Type: application/json" \ ---data '{ - "origins": [ - { - "name": "origin-1", - "address": "10.0.0.1", - "enabled": true, - "weight": 1, - "virtual_network_id": "a5624d4e-044a-4ff0-b3e1-e2465353d4b4" - } - ] -}' -``` + diff --git a/src/content/docs/load-balancing/reference/migration-guides/health-monitor-notifications.mdx b/src/content/docs/load-balancing/reference/migration-guides/health-monitor-notifications.mdx index 2ed02fe69d77663..d37912886a2b5f2 100644 --- a/src/content/docs/load-balancing/reference/migration-guides/health-monitor-notifications.mdx +++ b/src/content/docs/load-balancing/reference/migration-guides/health-monitor-notifications.mdx @@ -6,7 +6,7 @@ sidebar: --- -import { Details } from "~/components" +import { Details, APIRequest } from "~/components" Cloudflare is migrating the notifications used by load balancing [health monitors](/load-balancing/monitors/) to use Cloudflare's centralized [Notifications Service](/notifications/). @@ -113,15 +113,13 @@ Though you can perform these steps in the dashboard, Cloudflare recommends you u If using the Cloudflare API, we recently added a [`PATCH`](/api/resources/load_balancers/subresources/pools/methods/bulk_edit/) endpoint so you can easily remove email notifications from multiple pools at the same time. -```bash title="Request" -curl --request PATCH \ -"https://api.cloudflare.com/client/v4/accounts/{account_id}/load_balancers/pools" \ ---header "Authorization: Bearer " \ ---header "Content-Type: application/json" \ ---data '{ - "notification_email": "" -}' -``` + This API call supports the standard pagination query parameters, either `limit/offset` or `per_page/page`, so by default it only updates the first 25 pools listed. To make sure you update all your pools, you may want to adjust your API call so it loops through various pages or includes a larger number of pools with each request. diff --git a/src/content/partials/load-balancing/load-balancer-create-api.mdx b/src/content/partials/load-balancing/load-balancer-create-api.mdx index 96e562a70774bcc..8dbe3ed3d7b8337 100644 --- a/src/content/partials/load-balancing/load-balancer-create-api.mdx +++ b/src/content/partials/load-balancing/load-balancer-create-api.mdx @@ -3,6 +3,8 @@ --- +import { APIRequest } from "~/components"; + For a full list of properties, refer to [Create Load Balancer](/api/resources/load_balancers/methods/create/). If you need help with API authentication, refer to [Cloudflare API documentation](/fundamentals/api/). :::note @@ -13,47 +15,46 @@ Since load balancers only exist on a zone — and not an account — you may nee ::: -```bash title="Request" -curl "https://api.cloudflare.com/client/v4/zones/{zone_id}/load_balancers" \ ---header "Authorization: Bearer " \ ---header "Content-Type: application/json" \ ---data '{ - "description": "Load Balancer for lb.example.com", - "name": "lb.example.com", - "enabled": true, - "ttl": 30, - "fallback_pool": "17b5962d775c646f3f9725cbc7a53df4", - "default_pools": [ - "17b5962d775c646f3f9725cbc7a53df4", - "9290f38c5d07c2e2f4df57b1f61d4196", - "00920f38ce07c2e2f4df50b1f61d4194" - ], - "proxied": true, - "steering_policy": "random_steering", - "session_affinity": "cookie", - "session_affinity_attributes": { - "samesite": "Auto", - "secure": "Auto", - "drain_duration": 100, - "zero_downtime_failover": "sticky" - }, - "session_affinity_ttl": 5000, - "adaptive_routing": { - "failover_across_pools": true - }, - "location_strategy": { - "prefer_ecs": "always", - "mode": "resolver_ip" - }, - "random_steering": { - "pool_weights": { - "de90f38ced07c2e2f4df50b1f61d4194": 0.3, - "9290f38c5d07c2e2f4df57b1f61d4196": 0.5 + The response contains the complete definition of the new load balancer. diff --git a/src/content/partials/load-balancing/monitor-create-api.mdx b/src/content/partials/load-balancing/monitor-create-api.mdx index 1c3bc7ca0e2ef48..d1d69939d9bd159 100644 --- a/src/content/partials/load-balancing/monitor-create-api.mdx +++ b/src/content/partials/load-balancing/monitor-create-api.mdx @@ -3,34 +3,35 @@ --- +import { APIRequest } from "~/components"; + For a full list of monitor properties, refer to [Create Monitor](/api/resources/load_balancers/subresources/monitors/methods/create/). If you need help with API authentication, refer to [Cloudflare API documentation](/fundamentals/api/). -```bash title="Request" -curl "https://api.cloudflare.com/client/v4/accounts/{account_id}/load_balancers/monitors" \ ---header "Authorization: Bearer " \ ---header "Content-Type: application/json" \ ---data '{ - "type": "https", - "description": "Login page monitor", - "method": "GET", - "path": "/health", - "header": { - "Host": ["example.com"], - "X-App-ID": ["abc123"] - }, - "port": 8080, - "timeout": 3, - "retries": 0, - "interval": 90, - "expected_body": "alive", - "expected_codes": "2xx", - "follow_redirects": true, - "allow_insecure": true, - "consecutive_up": 3, - "consecutive_down": 2, - "probe_zone": "example.com" -}' -``` + The response contains the complete definition of the new monitor. diff --git a/src/content/partials/load-balancing/pool-create-api.mdx b/src/content/partials/load-balancing/pool-create-api.mdx index 98bc5291ffbe1fc..f31a4a95a3e33fd 100644 --- a/src/content/partials/load-balancing/pool-create-api.mdx +++ b/src/content/partials/load-balancing/pool-create-api.mdx @@ -3,56 +3,52 @@ --- +import { APIRequest } from "~/components"; + For a full list of properties, refer to [Create Pool](/api/resources/load_balancers/subresources/pools/methods/create/). If you need help with API authentication, refer to [Cloudflare API documentation](/fundamentals/api/). -```bash title="Request" -curl "https://api.cloudflare.com/client/v4/accounts/{account_id}/load_balancers/pools" \ ---header "Authorization: Bearer " \ ---header "Content-Type: application/json" \ ---data '{ - "description": "Primary data center - Provider XYZ", - "name": "primary-dc-1", - "enabled": false, - "load_shedding": { - "default_percent": 0, - "default_policy": "random", - "session_percent": 0, - "session_policy": "hash" - }, - "minimum_origins": 2, - "monitor": "f1aba936b94213e5b8dca0c0dbf1f9cc", - "check_regions": [ - "WEU", - "ENAM" - ], - "origins": [ - { - "name": "app-server-1", - "address": "0.0.0.0", - "enabled": true, - "weight": 0.56, - "header": { - "Host": [ - "example.com" - ] + The response contains the complete definition of the new pool.