Skip to main content

lans

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

Overview

Namelans
TypeResource
Idcloudflare.magic_transit.lans

Fields

The following fields are returned by SELECT queries:

Site LAN Details response

NameDatatypeDescription
idstringIdentifier (example: 023e105f4ecef8ad9ca31a8372d0c353)
namestring
bond_idinteger
site_idstringIdentifier (example: 023e105f4ecef8ad9ca31a8372d0c353)
ha_linkbooleanmark true to use this LAN for HA probing. only works for site with HA turned on. only one LAN can be set as the ha_link.
is_breakoutbooleanmark true to use this LAN for source-based breakout traffic
is_prioritizedbooleanmark true to use this LAN for source-based prioritized traffic
natobject
physportinteger
routed_subnetsarray
static_addressingobjectIf the site is not configured in high availability mode, this configuration is optional (if omitted, use DHCP). However, if in high availability mode, static_address is required along with secondary and virtual address.
vlan_tagintegerVLAN ID. Use zero for untagged.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectsite_id, account_id, lan_idGet a specific Site LAN.
listselectaccount_id, site_idLists Site LANs associated with an account.
magic_site_lans_create_laninsertaccount_id, site_idCreates a new Site LAN. If the site is in high availability mode, static_addressing is required along with secondary and virtual address.
editupdatesite_id, account_id, lan_idPatch a specific Site LAN.
updatereplacesite_id, account_id, lan_idUpdate a specific Site LAN.
deletedeletesite_id, account_id, lan_idRemove a specific Site LAN.

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.
lan_idstring
site_idstringThe site ID.

SELECT examples

Get a specific Site LAN.

SELECT
id,
name,
bond_id,
site_id,
ha_link,
is_breakout,
is_prioritized,
nat,
physport,
routed_subnets,
static_addressing,
vlan_tag
FROM cloudflare.magic_transit.lans
WHERE site_id = '{{ site_id }}' -- required
AND account_id = '{{ account_id }}' -- required
AND lan_id = '{{ lan_id }}' -- required
;

INSERT examples

Creates a new Site LAN. If the site is in high availability mode, static_addressing is required along with secondary and virtual address.

INSERT INTO cloudflare.magic_transit.lans (
bond_id,
ha_link,
is_breakout,
is_prioritized,
name,
nat,
physport,
routed_subnets,
static_addressing,
vlan_tag,
account_id,
site_id
)
SELECT
{{ bond_id }},
{{ ha_link }},
{{ is_breakout }},
{{ is_prioritized }},
'{{ name }}',
'{{ nat }}',
{{ physport }},
'{{ routed_subnets }}',
'{{ static_addressing }}',
{{ vlan_tag }},
'{{ account_id }}',
'{{ site_id }}'
RETURNING
errors,
messages,
result,
success
;

UPDATE examples

Patch a specific Site LAN.

UPDATE cloudflare.magic_transit.lans
SET
bond_id = {{ bond_id }},
is_breakout = {{ is_breakout }},
is_prioritized = {{ is_prioritized }},
name = '{{ name }}',
nat = '{{ nat }}',
physport = {{ physport }},
routed_subnets = '{{ routed_subnets }}',
static_addressing = '{{ static_addressing }}',
vlan_tag = {{ vlan_tag }}
WHERE
site_id = '{{ site_id }}' --required
AND account_id = '{{ account_id }}' --required
AND lan_id = '{{ lan_id }}' --required
RETURNING
errors,
messages,
result,
success;

REPLACE examples

Update a specific Site LAN.

REPLACE cloudflare.magic_transit.lans
SET
bond_id = {{ bond_id }},
is_breakout = {{ is_breakout }},
is_prioritized = {{ is_prioritized }},
name = '{{ name }}',
nat = '{{ nat }}',
physport = {{ physport }},
routed_subnets = '{{ routed_subnets }}',
static_addressing = '{{ static_addressing }}',
vlan_tag = {{ vlan_tag }}
WHERE
site_id = '{{ site_id }}' --required
AND account_id = '{{ account_id }}' --required
AND lan_id = '{{ lan_id }}' --required
RETURNING
errors,
messages,
result,
success;

DELETE examples

Remove a specific Site LAN.

DELETE FROM cloudflare.magic_transit.lans
WHERE site_id = '{{ site_id }}' --required
AND account_id = '{{ account_id }}' --required
AND lan_id = '{{ lan_id }}' --required
;