Skip to main content

fallback_origin

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

Overview

Namefallback_origin
TypeResource
Idcloudflare.custom_hostnames.fallback_origin

Fields

The following fields are returned by SELECT queries:

Get Fallback Origin for Custom Hostnames response

NameDatatypeDescription
created_atstring (date-time)This is the time the fallback origin was created. (example: 2019-10-28T18:11:23.37411Z)
errorsarrayThese are errors that were encountered while trying to activate a fallback origin.
originstringYour origin hostname that requests to your custom hostnames will be sent to. (example: fallback.example.com)
statusstringStatus of the fallback origin's activation. (initializing, pending_deployment, pending_deletion, active, deployment_timed_out, deletion_timed_out) (example: pending_deployment)
updated_atstring (date-time)This is the time the fallback origin was updated. (example: 2020-03-16T18:11:23.531995Z)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
listselectzone_idRetrieves the current fallback origin configuration for custom hostnames on a zone. The fallback origin handles traffic when specific custom hostname origins are unavailable.
updatereplacezone_id, originUpdates the fallback origin configuration for custom hostnames on a zone. Sets the default origin server for custom hostname traffic.
deletedeletezone_idRemoves the fallback origin configuration for custom hostnames on a zone. Custom hostnames without specific origins will no longer have a fallback.

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
zone_idstringThe Cloudflare zone ID.

SELECT examples

Retrieves the current fallback origin configuration for custom hostnames on a zone. The fallback origin handles traffic when specific custom hostname origins are unavailable.

SELECT
created_at,
errors,
origin,
status,
updated_at
FROM cloudflare.custom_hostnames.fallback_origin
WHERE zone_id = '{{ zone_id }}' -- required
;

REPLACE examples

Updates the fallback origin configuration for custom hostnames on a zone. Sets the default origin server for custom hostname traffic.

REPLACE cloudflare.custom_hostnames.fallback_origin
SET
origin = '{{ origin }}'
WHERE
zone_id = '{{ zone_id }}' --required
AND origin = '{{ origin }}' --required
RETURNING
errors,
messages,
result,
success;

DELETE examples

Removes the fallback origin configuration for custom hostnames on a zone. Custom hostnames without specific origins will no longer have a fallback.

DELETE FROM cloudflare.custom_hostnames.fallback_origin
WHERE zone_id = '{{ zone_id }}' --required
;