Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
c272a29
added apirequest
marciocloudflare Mar 7, 2025
e8c7345
added apirequest comp
marciocloudflare Mar 10, 2025
4b58298
Merge branch 'production' into marcio/pcx15975-magic-api
marciocloudflare Mar 10, 2025
d554f92
Merge remote-tracking branch 'origin/production' into marcio/pcx15975…
marciocloudflare Mar 10, 2025
9471b45
removed api
marciocloudflare Mar 10, 2025
0b71b7e
Merge remote-tracking branch 'origin/production' into marcio/pcx15975…
marciocloudflare Mar 10, 2025
384bdcd
added apirequest component
marciocloudflare Mar 10, 2025
fd0c7d3
corrected fields
marciocloudflare Mar 10, 2025
8057892
removed old api example
marciocloudflare Mar 10, 2025
0eb4dd1
added api component
marciocloudflare Mar 10, 2025
3d51de7
corrected link to API site
marciocloudflare Mar 10, 2025
76d7688
added apirequest import
marciocloudflare Mar 10, 2025
4d6c137
added json fields
marciocloudflare Mar 10, 2025
9555133
corrected json
marciocloudflare Mar 10, 2025
6c83806
removed old example
marciocloudflare Mar 10, 2025
e53f4ca
corrected output example
marciocloudflare Mar 10, 2025
836e746
updated api url
marciocloudflare Mar 10, 2025
523d0d6
added put apirequest schema
marciocloudflare Mar 10, 2025
305b26f
removed old code
marciocloudflare Mar 10, 2025
6ddcb33
added response example
marciocloudflare Mar 10, 2025
ead3f54
corrected link
marciocloudflare Mar 10, 2025
ea4cea1
added component corrected enpoint
marciocloudflare Mar 10, 2025
3a79de6
deleted old api
marciocloudflare Mar 10, 2025
45e1c97
indentation
marciocloudflare Mar 11, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ head:
content: Magic Network Monitoring encrypt network flow data
---

import { APIRequest } from "~/components"

Customers can encrypt the network flow data sent from their router to Cloudflare by [routing](https://www.cloudflare.com/learning/network-layer/what-is-routing/) their network flow traffic through a device running the WARP client. Then, encrypted network flow traffic can be forwarded from the WARP enabled device to Cloudflare's network flow endpoints.

To learn more about the WARP client, and to install the WARP client on Linux, macOS, or Windows, you can visit the [WARP client documentation](/cloudflare-one/connections/connect-devices/warp/).
Expand All @@ -28,22 +30,19 @@ The `warp_devices` array at the account level is a list of WARP devices through

For example:

```bash
curl --request PATCH \
"https://api.cloudflare.com/client/v4/accounts/{account_id}/mnm/config" \
--header "X-Auth-Email: <EMAIL>" \
--header "X-Auth-Key: <API_KEY>" \
--header "Content-Type: application/json" \
--data '{
"warp_devices": [
<APIRequest
path="/accounts/{account_id}/mnm/config"
method="PATCH"
json={{
"warp_devices": [
{
"id": "5360368d-b351-4791-abe1-93550dabd351",
"name": "My warp device",
"router_ip": "203.0.113.1"
"id": "<YOUR_WARP_DEVICE_UNIQUE_IDENTIFIER>",
"name": "<NAME_OF_WARP_DEVICE>",
"router_ip": "YOUR_ROUTER_IP"
}
]
}'
```
}}
/>

## 2. Route Magic Network Monitoring traffic through WARP

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ head: []
description: Use the API to set up and configure Magic Tunnel health alerts
---

import { Render, Tabs, TabItem } from "~/components";
import { APIRequest, Render, Tabs, TabItem } from "~/components";

<Render
file="magic-tunnel-health-alerts/magic-tunnel-health-alerts"
Expand Down Expand Up @@ -36,28 +36,28 @@ Refer to the [documentation for Notifications](/notifications/get-started/) to l

Send a [`POST` request](/api/resources/alerting/subresources/policies/methods/create/) to create a Magic Transit tunnel health alert. You can set tunnel health alerts with any SLO value between `0` and `99.99`.

```bash
curl https://api.cloudflare.com/client/v4/accounts/account_id/alerting/v3/policies \
--header 'Authorization: Bearer <YOUR_TOKEN>' \
--header 'Content-Type: application/json' \
--data '{
"alert_type": "magic_tunnel_health_check_event",
"description": "<DESCRIBE_POLICY>",
"enabled": true,
"filters": {
"slo": [
"99.9"
]
},
"mechanisms": {
"email": [
{
"id": "EMAIL_ADDRESS"
}
],
"name": "<DESCRIBE_ALERT>"
}'
```
<APIRequest
path="/accounts/{account_id}/alerting/v3/policies"
method="POST"
json={{
"alert_type": "magic_tunnel_health_check_event",
"description": "<DESCRIBE_POLICY>",
"enabled": true,
"filters": {
"slo": [
"99.9"
]
},
"mechanisms": {
"email": [
{
"id": "EMAIL_ADDRESS"
}
]},
"name": "<DESCRIBE_ALERT>"

}}
/>

```json output
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ head: []
description: Use the API to set up and configure Magic Tunnel health alerts
---

import { Render, Tabs, TabItem } from "~/components";
import { APIRequest, Render, Tabs, TabItem } from "~/components";

<Render
file="magic-tunnel-health-alerts/magic-tunnel-health-alerts"
Expand Down Expand Up @@ -34,28 +34,27 @@ Refer to the [documentation for Notifications](/notifications/get-started/) to l

Send a [`POST` request](/api/resources/alerting/subresources/policies/methods/create/) to create a Magic WAN tunnel health alert. You can set tunnel health alerts with any SLO value between `0` and `99.99`.

```bash
curl https://api.cloudflare.com/client/v4/accounts/account_id/alerting/v3/policies \
--header 'Authorization: Bearer <YOUR_TOKEN>' \
--header 'Content-Type: application/json' \
--data '{
"alert_type": "magic_wan_tunnel_health",
"description": "<DESCRIBE_POLICY>",
"enabled": true,
"filters": {
"slo": [
"99.9"
]
},
"mechanisms": {
"email": [
{
"id": "EMAIL_ADDRESS"
}
],
"name": "<DESCRIBE_ALERT>"
}'
```
<APIRequest
path="/accounts/{account_id}/alerting/v3/policies"
method="POST"
json={{
"alert_type": "magic_wan_tunnel_health",
"description": "<DESCRIBE_POLICY>",
"enabled": true,
"filters": {
"slo": [
"99.9"
]
},
"mechanisms": {
"email": [
{
"id": "EMAIL_ADDRESS"
}
]},
"name": "<DESCRIBE_ALERT>"
}}
/>

```json output
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ title: Network segmentation
description: Define policies to define if traffic should flow between your LANs without leaving your local premises, or if traffic should be forwarded to Cloudflare for additional security configurations.
---

import { Render, TabItem, Tabs } from "~/components";
import { APIRequest, Render, TabItem, Tabs } from "~/components";

You can define policies in your Connector to either allow traffic to flow between your LANs without it leaving your local premises or to forward it via the Cloudflare network where you can add additional security features. The default behavior is to drop all LAN-to-LAN traffic. These policies can be created for specific subnets, and link two LANs.

Expand Down Expand Up @@ -69,17 +69,14 @@ The new policy will ensure that traffic between the specified LANs flows locally

<Render file="connector/account-id-api-key" />

Create a `POST` request [using the API](/api/operations/magic-site-acls-create-acl) to create a network policy.
Create a `POST` request [using the API](/api/resources/magic_transit/subresources/sites/subresources/acls/methods/create/) to create a network policy.

Example:

```bash
curl https://api.cloudflare.com/client/v4/accounts/{account_id}/magic/sites/{site_id}/acls \
--header "X-Auth-Email: <EMAIL>" \
--header "X-Auth-Key: <API_KEY>" \
--header "Content-Type: application/json" \
--data '{
"acl": {
<APIRequest
path="/accounts/{account_id}/magic/sites/{site_id}/acls"
method="POST"
json={{
"description": "<POLICY_DESCRIPTION>",
"forward_locally": true,
"lan_1": {
Expand All @@ -106,38 +103,60 @@ curl https://api.cloudflare.com/client/v4/accounts/{account_id}/magic/sites/{sit
"protocols": [
"tcp"
]
}
}'
```
}}
/>

```json output
{
"errors": [],
"messages": [],
"result": {
"acls": [
{
"description": "<POLICY_DESCRIPTION>",
"forward_locally": true,
"id": "023e105f4ecef8ad9ca31a8372d0c353",
"lan_1": {
"lan_id": "<LAN_ID>",
"lan_name": "<LAN_NAME>",
"ports": [1],
"subnets": ["192.0.2.1"]
},
"lan_2": {
"lan_id": "<LAN_ID>",
"lan_name": "<LAN_NAME>",
"ports": [1],
"subnets": ["192.0.2.1"]
},
"name": "<POLICY_NAME>",
"protocols": ["tcp"]
}
]
},
"success": true
"errors": [
{
"code": 1000,
"message": "message"
}
],
"messages": [
{
"code": 1000,
"message": "message"
}
],
"result": {
"id": "023e105f4ecef8ad9ca31a8372d0c353",
"description": "Allows local traffic between PIN pads and cash register.",
"forward_locally": true,
"lan_1": {
"lan_id": "lan_id",
"lan_name": "lan_name",
"port_ranges": [
"8080-9000"
],
"ports": [
1
],
"subnets": [
"192.0.2.1"
]
},
"lan_2": {
"lan_id": "lan_id",
"lan_name": "lan_name",
"port_ranges": [
"8080-9000"
],
"ports": [
1
],
"subnets": [
"192.0.2.1"
]
},
"name": "PIN Pad - Cash Register",
"protocols": [
"tcp"
],
"unidirectional": true
},
"success": true
}
```

Expand All @@ -163,18 +182,14 @@ The new policy will ensure that traffic between the specified LANs flows locally

<Render file="connector/account-id-api-key" />

Create a `PUT` request [using the API](/api/operations/magic-site-acls-update-acl) to edit a network policy.
Create a `PUT` request [using the API](/api/resources/magic_transit/subresources/sites/subresources/acls/methods/update/) to edit a network policy.

Example:

```bash
curl --request PUT \
https://api.cloudflare.com/client/v4/accounts/{account_id}/magic/sites/{site_id}/acls/{acl_id} \
--header "X-Auth-Email: <EMAIL>" \
--header "X-Auth-Key: <API_KEY>" \
--header "Content-Type: application/json" \
--data '{
"acl": {
<APIRequest
path="/accounts/{account_id}/magic/sites/{site_id}/acls/{acl_id}"
method="PUT"
json={{
"description": "<POLICY_DESCRIPTION>",
"forward_locally": true,
"lan_1": {
Expand All @@ -201,8 +216,37 @@ https://api.cloudflare.com/client/v4/accounts/{account_id}/magic/sites/{site_id}
"protocols": [
"tcp"
]
}
}'
}}
/>

```json output
{
"errors": [
{
"code": 1000,
"message": "message"
}
],
"messages": [
{
"code": 1000,
"message": "message"
}
],
"result": {
"id": "023e105f4ecef8ad9ca31a8372d0c353",
"connector_id": "ac60d3d0435248289d446cedd870bcf4",
"description": "description",
"ha_mode": true,
"location": {
"lat": "37.6192",
"lon": "122.3816"
},
"name": "site_1",
"secondary_connector_id": "8d67040d3835dbcf46ce29da440dc482"
},
"success": true
}
```

</TabItem> </Tabs>
Expand All @@ -224,15 +268,13 @@ https://api.cloudflare.com/client/v4/accounts/{account_id}/magic/sites/{site_id}

<Render file="connector/account-id-api-key" />

Create a `DELETE` request [using the API](/api/operations/magic-site-acls-delete-acl) to delete a network policy.
Create a `DELETE` request [using the API](/api/resources/magic_transit/subresources/sites/subresources/acls/methods/delete/) to delete a network policy.

Example:

```bash
curl --request DELETE \
https://api.cloudflare.com/client/v4/accounts/{account_id}/magic/sites/{site_id}/acls/{acl_identifier} \
--header "X-Auth-Email: <EMAIL>" \
--header "X-Auth-Key: <API_KEY>"
```
<APIRequest
path="/accounts/{account_id}/magic/sites/{site_id}/acls/{acl_id}"
method="DELETE"
/>

</TabItem> </Tabs>
Loading