lans
Creates, updates, deletes, gets or lists a lans resource.
Overview
| Name | lans |
| Type | Resource |
| Id | cloudflare.magic_transit.lans |
Fields
The following fields are returned by SELECT queries:
- get
- list
Site LAN Details response
| Name | Datatype | Description |
|---|---|---|
id | string | Identifier (example: 023e105f4ecef8ad9ca31a8372d0c353) |
name | string | |
bond_id | integer | |
site_id | string | Identifier (example: 023e105f4ecef8ad9ca31a8372d0c353) |
ha_link | boolean | mark 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_breakout | boolean | mark true to use this LAN for source-based breakout traffic |
is_prioritized | boolean | mark true to use this LAN for source-based prioritized traffic |
nat | object | |
physport | integer | |
routed_subnets | array | |
static_addressing | object | If 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_tag | integer | VLAN ID. Use zero for untagged. |
List Site LANs response
| Name | Datatype | Description |
|---|---|---|
id | string | Identifier (example: 023e105f4ecef8ad9ca31a8372d0c353) |
name | string | |
bond_id | integer | |
site_id | string | Identifier (example: 023e105f4ecef8ad9ca31a8372d0c353) |
ha_link | boolean | mark 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_breakout | boolean | mark true to use this LAN for source-based breakout traffic |
is_prioritized | boolean | mark true to use this LAN for source-based prioritized traffic |
nat | object | |
physport | integer | |
routed_subnets | array | |
static_addressing | object | If 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_tag | integer | VLAN ID. Use zero for untagged. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | site_id, account_id, lan_id | Get a specific Site LAN. | |
list | select | account_id, site_id | Lists Site LANs associated with an account. | |
magic_site_lans_create_lan | insert | account_id, site_id | Creates a new Site LAN. If the site is in high availability mode, static_addressing is required along with secondary and virtual address. | |
edit | update | site_id, account_id, lan_id | Patch a specific Site LAN. | |
update | replace | site_id, account_id, lan_id | Update a specific Site LAN. | |
delete | delete | site_id, account_id, lan_id | Remove 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.
| Name | Datatype | Description |
|---|---|---|
account_id | string | The Cloudflare account ID. |
lan_id | string | |
site_id | string | The site ID. |
SELECT examples
- get
- list
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
;
Lists Site LANs associated with an account.
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 account_id = '{{ account_id }}' -- required
AND site_id = '{{ site_id }}' -- required
;
INSERT examples
- magic_site_lans_create_lan
- Manifest
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
;
# Description fields are for documentation purposes
- name: lans
props:
- name: account_id
value: "{{ account_id }}"
description: Required parameter for the lans resource.
- name: site_id
value: "{{ site_id }}"
description: Required parameter for the lans resource.
- name: bond_id
value: {{ bond_id }}
- name: ha_link
value: {{ ha_link }}
description: |
mark 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.
- name: is_breakout
value: {{ is_breakout }}
description: |
mark true to use this LAN for source-based breakout traffic
- name: is_prioritized
value: {{ is_prioritized }}
description: |
mark true to use this LAN for source-based prioritized traffic
- name: name
value: "{{ name }}"
- name: nat
value:
static_prefix: "{{ static_prefix }}"
- name: physport
value: {{ physport }}
- name: routed_subnets
value:
- nat:
static_prefix: "{{ static_prefix }}"
next_hop: "{{ next_hop }}"
prefix: "{{ prefix }}"
- name: static_addressing
description: |
If 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.
value:
address: "{{ address }}"
dhcp_relay:
server_addresses:
- "{{ server_addresses }}"
dhcp_server:
dhcp_options:
- code: {{ code }}
type: "{{ type }}"
value: "{{ value }}"
dhcp_pool_end: "{{ dhcp_pool_end }}"
dhcp_pool_start: "{{ dhcp_pool_start }}"
dns_server: "{{ dns_server }}"
dns_servers:
- "{{ dns_servers }}"
reservations: "{{ reservations }}"
secondary_address: "{{ secondary_address }}"
virtual_address: "{{ virtual_address }}"
- name: vlan_tag
value: {{ vlan_tag }}
description: |
VLAN ID. Use zero for untagged.
UPDATE examples
- edit
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
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
- delete
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
;