Skip to main content

gre_tunnels

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

Overview

Namegre_tunnels
TypeResource
Idcloudflare.magic_transit.gre_tunnels

Fields

The following fields are returned by SELECT queries:

List GRE Tunnel Details response

NameDatatypeDescription
gre_tunnelobject

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectgre_tunnel_id, account_idx-magic-new-hc-targetLists informtion for a specific GRE tunnel.
listselectaccount_idx-magic-new-hc-targetLists GRE tunnels associated with an account.
createinsertaccount_id, name, customer_gre_endpoint, cloudflare_gre_endpoint, interface_addressx-magic-new-hc-targetCreates a new GRE tunnel. Use ?validate_only=true as an optional query parameter to only run validation without persisting changes.
updatereplacegre_tunnel_id, account_id, name, customer_gre_endpoint, cloudflare_gre_endpoint, interface_addressx-magic-new-hc-targetUpdates a specific GRE tunnel. Use ?validate_only=true as an optional query parameter to only run validation without persisting changes.
bulk_updatereplaceaccount_idx-magic-new-hc-targetUpdates multiple GRE tunnels. Use ?validate_only=true as an optional query parameter to only run validation without persisting changes.
deletedeletegre_tunnel_id, account_idx-magic-new-hc-targetDisables and removes a specific static GRE tunnel. Use ?validate_only=true as an optional query parameter to only run validation without persisting changes.

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.
gre_tunnel_idstring
x-magic-new-hc-targetbooleanIf true, the health check target in the response body will be presented using the new object format. Defaults to false.

SELECT examples

Lists informtion for a specific GRE tunnel.

SELECT
gre_tunnel
FROM cloudflare.magic_transit.gre_tunnels
WHERE gre_tunnel_id = '{{ gre_tunnel_id }}' -- required
AND account_id = '{{ account_id }}' -- required
AND x-magic-new-hc-target = '{{ x-magic-new-hc-target }}'
;

INSERT examples

Creates a new GRE tunnel. Use ?validate_only=true as an optional query parameter to only run validation without persisting changes.

INSERT INTO cloudflare.magic_transit.gre_tunnels (
automatic_return_routing,
bgp,
cloudflare_gre_endpoint,
customer_gre_endpoint,
description,
health_check,
interface_address,
interface_address6,
mtu,
name,
ttl,
account_id,
x-magic-new-hc-target
)
SELECT
{{ automatic_return_routing }},
'{{ bgp }}',
'{{ cloudflare_gre_endpoint }}' /* required */,
'{{ customer_gre_endpoint }}' /* required */,
'{{ description }}',
'{{ health_check }}',
'{{ interface_address }}' /* required */,
'{{ interface_address6 }}',
{{ mtu }},
'{{ name }}' /* required */,
{{ ttl }},
'{{ account_id }}',
'{{ x-magic-new-hc-target }}'
RETURNING
errors,
messages,
result,
success
;

REPLACE examples

Updates a specific GRE tunnel. Use ?validate_only=true as an optional query parameter to only run validation without persisting changes.

REPLACE cloudflare.magic_transit.gre_tunnels
SET
automatic_return_routing = {{ automatic_return_routing }},
cloudflare_gre_endpoint = '{{ cloudflare_gre_endpoint }}',
customer_gre_endpoint = '{{ customer_gre_endpoint }}',
description = '{{ description }}',
health_check = '{{ health_check }}',
interface_address = '{{ interface_address }}',
interface_address6 = '{{ interface_address6 }}',
mtu = {{ mtu }},
name = '{{ name }}',
ttl = {{ ttl }}
WHERE
gre_tunnel_id = '{{ gre_tunnel_id }}' --required
AND account_id = '{{ account_id }}' --required
AND name = '{{ name }}' --required
AND customer_gre_endpoint = '{{ customer_gre_endpoint }}' --required
AND cloudflare_gre_endpoint = '{{ cloudflare_gre_endpoint }}' --required
AND interface_address = '{{ interface_address }}' --required
AND x-magic-new-hc-target = {{ x-magic-new-hc-target}}
RETURNING
errors,
messages,
result,
success;

DELETE examples

Disables and removes a specific static GRE tunnel. Use ?validate_only=true as an optional query parameter to only run validation without persisting changes.

DELETE FROM cloudflare.magic_transit.gre_tunnels
WHERE gre_tunnel_id = '{{ gre_tunnel_id }}' --required
AND account_id = '{{ account_id }}' --required
AND x-magic-new-hc-target = '{{ x-magic-new-hc-target }}'
;