Skip to main content

networks

Creates, updates, deletes, gets or lists a networks resource.

Overview

Namenetworks
TypeResource
Idcloudflare.zero_trust.networks

Fields

The following fields are returned by SELECT queries:

Get device managed network details response.

NameDatatypeDescription
namestringThe name of the device managed network. This name must be unique. (example: managed-network-1)
network_idstringAPI UUID. (example: f174e90a-fafe-4643-bbbc-4a0ed4fc8415)
configobjectThe configuration object containing information for the WARP client to detect the managed network.
typestringThe type of device managed network. (tls) (example: tls)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectnetwork_id, account_idFetches details for a single managed network.
listselectaccount_idFetches a list of managed networks for an account.
editupdateip_network_encoded, account_idUpdates an existing private network route in an account. The CIDR in ip_network_encoded must be written in URL-encoded format.
updatereplacenetwork_id, account_idUpdates a configured device managed network.
device_managed_networks_delete_device_managed_networkdeletenetwork_id, account_idDeletes a device managed network and fetches a list of the remaining device managed networks for an account.
deletedeleteip_network_encoded, account_idvirtual_network_id, tun_type, tunnel_idDeletes 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.

NameDatatypeDescription
account_idstringThe Cloudflare account ID.
ip_network_encodedstring
network_idstring
tun_typestring
tunnel_idstring (uuid)
virtual_network_idstring (uuid)

SELECT examples

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
;

UPDATE examples

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

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

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
;