Skip to main content

regional_hostnames

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

Overview

Nameregional_hostnames
TypeResource
Idcloudflare.addressing.regional_hostnames

Fields

The following fields are returned by SELECT queries:

Fetch hostname response

NameDatatypeDescription
created_onstring (date-time)When the regional hostname was created (example: 2014-01-01T05:20:00.12345Z)
hostnamestringDNS hostname to be regionalized, must be a subdomain of the zone. Wildcards are supported for one level, e.g *.example.com (example: foo.example.com)
region_keystringIdentifying key for the region (example: ca)
routingstringConfigure which routing method to use for the regional hostname (default: dns, example: dns)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectzone_id, hostnameFetch the configuration for a specific Regional Hostname, within a zone.
listselectzone_idList all Regional Hostnames within a zone.
createinsertzone_id, hostname, region_keyCreate a new Regional Hostname entry. Cloudflare will only use data centers that are physically located within the chosen region to decrypt and service HTTPS traffic. Learn more about Regional Services.
editupdatezone_id, hostname, region_keyUpdate the configuration for a specific Regional Hostname. Only the region_key of a hostname is mutable.
deletedeletezone_id, hostnameDelete the region configuration for a specific Regional Hostname.

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

SELECT examples

Fetch the configuration for a specific Regional Hostname, within a zone.

SELECT
created_on,
hostname,
region_key,
routing
FROM cloudflare.addressing.regional_hostnames
WHERE zone_id = '{{ zone_id }}' -- required
AND hostname = '{{ hostname }}' -- required
;

INSERT examples

Create a new Regional Hostname entry. Cloudflare will only use data centers that are physically located within the chosen region to decrypt and service HTTPS traffic. Learn more about Regional Services.

INSERT INTO cloudflare.addressing.regional_hostnames (
hostname,
region_key,
routing,
zone_id
)
SELECT
'{{ hostname }}' /* required */,
'{{ region_key }}' /* required */,
'{{ routing }}',
'{{ zone_id }}'
RETURNING
errors,
messages,
result,
success
;

UPDATE examples

Update the configuration for a specific Regional Hostname. Only the region_key of a hostname is mutable.

UPDATE cloudflare.addressing.regional_hostnames
SET
region_key = '{{ region_key }}'
WHERE
zone_id = '{{ zone_id }}' --required
AND hostname = '{{ hostname }}' --required
AND region_key = '{{ region_key }}' --required
RETURNING
errors,
messages,
result,
success;

DELETE examples

Delete the region configuration for a specific Regional Hostname.

DELETE FROM cloudflare.addressing.regional_hostnames
WHERE zone_id = '{{ zone_id }}' --required
AND hostname = '{{ hostname }}' --required
;