fallback_origin
Creates, updates, deletes, gets or lists a fallback_origin resource.
Overview
| Name | fallback_origin |
| Type | Resource |
| Id | cloudflare.custom_hostnames.fallback_origin |
Fields
The following fields are returned by SELECT queries:
- list
Get Fallback Origin for Custom Hostnames response
| Name | Datatype | Description |
|---|---|---|
created_at | string (date-time) | This is the time the fallback origin was created. (example: 2019-10-28T18:11:23.37411Z) |
errors | array | These are errors that were encountered while trying to activate a fallback origin. |
origin | string | Your origin hostname that requests to your custom hostnames will be sent to. (example: fallback.example.com) |
status | string | Status of the fallback origin's activation. (initializing, pending_deployment, pending_deletion, active, deployment_timed_out, deletion_timed_out) (example: pending_deployment) |
updated_at | string (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:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list | select | zone_id | Retrieves the current fallback origin configuration for custom hostnames on a zone. The fallback origin handles traffic when specific custom hostname origins are unavailable. | |
update | replace | zone_id, origin | Updates the fallback origin configuration for custom hostnames on a zone. Sets the default origin server for custom hostname traffic. | |
delete | delete | zone_id | Removes 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.
| Name | Datatype | Description |
|---|---|---|
zone_id | string | The Cloudflare zone ID. |
SELECT examples
- list
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
- update
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
- delete
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
;