networks
Creates, updates, deletes, gets or lists a networks resource.
Overview
| Name | networks |
| Type | Resource |
| Id | cloudflare.zero_trust.networks |
Fields
The following fields are returned by SELECT queries:
- get
- list
Get device managed network details response.
| Name | Datatype | Description |
|---|---|---|
name | string | The name of the device managed network. This name must be unique. (example: managed-network-1) |
network_id | string | API UUID. (example: f174e90a-fafe-4643-bbbc-4a0ed4fc8415) |
config | object | The configuration object containing information for the WARP client to detect the managed network. |
type | string | The type of device managed network. (tls) (example: tls) |
List your device managed networks response.
| Name | Datatype | Description |
|---|---|---|
name | string | The name of the device managed network. This name must be unique. (example: managed-network-1) |
network_id | string | API UUID. (example: f174e90a-fafe-4643-bbbc-4a0ed4fc8415) |
config | object | The configuration object containing information for the WARP client to detect the managed network. |
type | string | The type of device managed network. (tls) (example: tls) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | network_id, account_id | Fetches details for a single managed network. | |
list | select | account_id | Fetches a list of managed networks for an account. | |
edit | update | ip_network_encoded, account_id | Updates an existing private network route in an account. The CIDR in ip_network_encoded must be written in URL-encoded format. | |
update | replace | network_id, account_id | Updates a configured device managed network. | |
device_managed_networks_delete_device_managed_network | delete | network_id, account_id | Deletes a device managed network and fetches a list of the remaining device managed networks for an account. | |
delete | delete | ip_network_encoded, account_id | virtual_network_id, tun_type, tunnel_id | Deletes a private network route from an account. The CIDR in ip_network_encoded must be written in URL-encoded format. If no virtual_network_id is provided it will delete the route from the default vnet. If no tun_type is provided it will fetch the type from the tunnel_id or if that is missing it will assume Cloudflare Tunnel as default. If tunnel_id is provided it will delete the route from that tunnel, otherwise it will delete the route based on the vnet and tun_type. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
account_id | string | The Cloudflare account ID. |
ip_network_encoded | string | |
network_id | string | |
tun_type | string | |
tunnel_id | string (uuid) | |
virtual_network_id | string (uuid) |
SELECT examples
- get
- list
Fetches details for a single managed network.
SELECT
name,
network_id,
config,
type
FROM cloudflare.zero_trust.networks
WHERE network_id = '{{ network_id }}' -- required
AND account_id = '{{ account_id }}' -- required
;
Fetches a list of managed networks for an account.
SELECT
name,
network_id,
config,
type
FROM cloudflare.zero_trust.networks
WHERE account_id = '{{ account_id }}' -- required
;
UPDATE examples
- edit
Updates an existing private network route in an account. The CIDR in ip_network_encoded must be written in URL-encoded format.
UPDATE cloudflare.zero_trust.networks
SET
-- No updatable properties
WHERE
ip_network_encoded = '{{ ip_network_encoded }}' --required
AND account_id = '{{ account_id }}' --required
RETURNING
errors,
messages,
result,
success;
REPLACE examples
- update
Updates a configured device managed network.
REPLACE cloudflare.zero_trust.networks
SET
config = '{{ config }}',
name = '{{ name }}',
type = '{{ type }}'
WHERE
network_id = '{{ network_id }}' --required
AND account_id = '{{ account_id }}' --required
RETURNING
errors,
messages,
result,
success;
DELETE examples
- device_managed_networks_delete_device_managed_network
- delete
Deletes a device managed network and fetches a list of the remaining device managed networks for an account.
DELETE FROM cloudflare.zero_trust.networks
WHERE network_id = '{{ network_id }}' --required
AND account_id = '{{ account_id }}' --required
;
Deletes a private network route from an account. The CIDR in ip_network_encoded must be written in URL-encoded format. If no virtual_network_id is provided it will delete the route from the default vnet. If no tun_type is provided it will fetch the type from the tunnel_id or if that is missing it will assume Cloudflare Tunnel as default. If tunnel_id is provided it will delete the route from that tunnel, otherwise it will delete the route based on the vnet and tun_type.
DELETE FROM cloudflare.zero_trust.networks
WHERE ip_network_encoded = '{{ ip_network_encoded }}' --required
AND account_id = '{{ account_id }}' --required
AND virtual_network_id = '{{ virtual_network_id }}'
AND tun_type = '{{ tun_type }}'
AND tunnel_id = '{{ tunnel_id }}'
;