wans
Creates, updates, deletes, gets or lists a wans resource.
Overview
| Name | wans |
| Type | Resource |
| Id | cloudflare.magic_transit.wans |
Fields
The following fields are returned by SELECT queries:
- get
- list
Site WAN Details response
| Name | Datatype | Description |
|---|---|---|
id | string | Identifier (example: 023e105f4ecef8ad9ca31a8372d0c353) |
name | string | |
site_id | string | Identifier (example: 023e105f4ecef8ad9ca31a8372d0c353) |
health_check_rate | string | Magic WAN health check rate for tunnels created on this link. The default value is mid. (low, mid, high) (default: mid, example: low) |
physport | integer | |
priority | integer | Priority of WAN for traffic loadbalancing. |
static_addressing | object | (optional) if omitted, use DHCP. Submit secondary_address when site is in high availability mode. |
vlan_tag | integer | VLAN ID. Use zero for untagged. |
List Site WANs response
| Name | Datatype | Description |
|---|---|---|
id | string | Identifier (example: 023e105f4ecef8ad9ca31a8372d0c353) |
name | string | |
site_id | string | Identifier (example: 023e105f4ecef8ad9ca31a8372d0c353) |
health_check_rate | string | Magic WAN health check rate for tunnels created on this link. The default value is mid. (low, mid, high) (default: mid, example: low) |
physport | integer | |
priority | integer | Priority of WAN for traffic loadbalancing. |
static_addressing | object | (optional) if omitted, use DHCP. Submit secondary_address when site is in high availability mode. |
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, wan_id | Get a specific Site WAN. | |
list | select | account_id, site_id | Lists Site WANs associated with an account. | |
magic_site_wans_create_wan | insert | account_id, site_id, physport | Creates a new Site WAN. | |
edit | update | site_id, account_id, wan_id | Patch a specific Site WAN. | |
update | replace | site_id, account_id, wan_id | Update a specific Site WAN. | |
delete | delete | site_id, account_id, wan_id | Remove a specific Site WAN. |
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. |
site_id | string | The site ID. |
wan_id | string |
SELECT examples
- get
- list
Get a specific Site WAN.
SELECT
id,
name,
site_id,
health_check_rate,
physport,
priority,
static_addressing,
vlan_tag
FROM cloudflare.magic_transit.wans
WHERE site_id = '{{ site_id }}' -- required
AND account_id = '{{ account_id }}' -- required
AND wan_id = '{{ wan_id }}' -- required
;
Lists Site WANs associated with an account.
SELECT
id,
name,
site_id,
health_check_rate,
physport,
priority,
static_addressing,
vlan_tag
FROM cloudflare.magic_transit.wans
WHERE account_id = '{{ account_id }}' -- required
AND site_id = '{{ site_id }}' -- required
;
INSERT examples
- magic_site_wans_create_wan
- Manifest
Creates a new Site WAN.
INSERT INTO cloudflare.magic_transit.wans (
name,
physport,
priority,
static_addressing,
vlan_tag,
account_id,
site_id
)
SELECT
'{{ name }}',
{{ physport }} /* required */,
{{ priority }},
'{{ static_addressing }}',
{{ vlan_tag }},
'{{ account_id }}',
'{{ site_id }}'
RETURNING
errors,
messages,
result,
success
;
# Description fields are for documentation purposes
- name: wans
props:
- name: account_id
value: "{{ account_id }}"
description: Required parameter for the wans resource.
- name: site_id
value: "{{ site_id }}"
description: Required parameter for the wans resource.
- name: name
value: "{{ name }}"
- name: physport
value: {{ physport }}
- name: priority
value: {{ priority }}
- name: static_addressing
description: |
(optional) if omitted, use DHCP. Submit secondary_address when site is in high availability mode.
value:
address: "{{ address }}"
gateway_address: "{{ gateway_address }}"
secondary_address: "{{ secondary_address }}"
- name: vlan_tag
value: {{ vlan_tag }}
description: |
VLAN ID. Use zero for untagged.
UPDATE examples
- edit
Patch a specific Site WAN.
UPDATE cloudflare.magic_transit.wans
SET
name = '{{ name }}',
physport = {{ physport }},
priority = {{ priority }},
static_addressing = '{{ static_addressing }}',
vlan_tag = {{ vlan_tag }}
WHERE
site_id = '{{ site_id }}' --required
AND account_id = '{{ account_id }}' --required
AND wan_id = '{{ wan_id }}' --required
RETURNING
errors,
messages,
result,
success;
REPLACE examples
- update
Update a specific Site WAN.
REPLACE cloudflare.magic_transit.wans
SET
name = '{{ name }}',
physport = {{ physport }},
priority = {{ priority }},
static_addressing = '{{ static_addressing }}',
vlan_tag = {{ vlan_tag }}
WHERE
site_id = '{{ site_id }}' --required
AND account_id = '{{ account_id }}' --required
AND wan_id = '{{ wan_id }}' --required
RETURNING
errors,
messages,
result,
success;
DELETE examples
- delete
Remove a specific Site WAN.
DELETE FROM cloudflare.magic_transit.wans
WHERE site_id = '{{ site_id }}' --required
AND account_id = '{{ account_id }}' --required
AND wan_id = '{{ wan_id }}' --required
;