Skip to main content

origin_cloud_regions

Creates, updates, deletes, gets or lists an origin_cloud_regions resource.

Overview

Nameorigin_cloud_regions
TypeResource
Idcloudflare.cache.origin_cloud_regions

Fields

The following fields are returned by SELECT queries:

Get origin cloud region mapping response.

NameDatatypeDescription
idstring (origin_public_cloud_region) (example: origin_public_cloud_region)
editablebooleanWhether the setting can be modified by the current user.
modified_onstring (date-time)Time the mapping was last modified.
valueobjectA single origin IP-to-cloud-region mapping.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectzone_id, origin_ipReturns the cloud region mapping for a single origin IP address. The IP path parameter is normalized before lookup (RFC 5952 for IPv6). Returns 404 (code 1142) if the zone has no mappings or if the specified IP has no mapping.
listselectzone_idReturns all IP-to-cloud-region mappings configured for the zone. Each mapping tells Cloudflare which cloud vendor and region hosts the origin at that IP, enabling the edge to route via the nearest Tiered Cache upper-tier co-located with that cloud provider. Returns an empty array when no mappings exist.
origin_cloud_regions_createinsertzone_id, ip, vendor, regionAdds a single IP-to-cloud-region mapping for the zone. The IP must be a valid IPv4 or IPv6 address and is normalized to canonical form before storage (RFC 5952 for IPv6). Returns 400 (code 1145) if a mapping for that IP already exists — use PATCH to update an existing entry. The vendor and region are validated against the list from GET /zones/{zone_id}/cache/origin_cloud_regions/supported_regions.
origin_cloud_regions_upsertupdatezone_id, ip, vendor, regionAdds or updates a single IP-to-cloud-region mapping for the zone. Unlike POST, this operation is idempotent — if a mapping for the IP already exists it is overwritten. Returns the complete updated list of all mappings for the zone. Returns 403 (code 1164) when the zone has reached the limit of 3,500 IP mappings.
origin_cloud_regions_deletedeletezone_id, origin_ipRemoves the cloud region mapping for a single origin IP address. The IP path parameter is normalized before lookup. Returns the deleted entry on success. Returns 404 (code 1163) if no mapping exists for the specified IP. When the last mapping for the zone is removed the underlying rule record is also deleted.

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
origin_ipstringOrigin IP address whose mapping should be deleted.
zone_idstringThe Cloudflare zone ID.

SELECT examples

Returns the cloud region mapping for a single origin IP address. The IP path parameter is normalized before lookup (RFC 5952 for IPv6). Returns 404 (code 1142) if the zone has no mappings or if the specified IP has no mapping.

SELECT
id,
editable,
modified_on,
value
FROM cloudflare.cache.origin_cloud_regions
WHERE zone_id = '{{ zone_id }}' -- required
AND origin_ip = '{{ origin_ip }}' -- required
;

INSERT examples

Adds a single IP-to-cloud-region mapping for the zone. The IP must be a valid IPv4 or IPv6 address and is normalized to canonical form before storage (RFC 5952 for IPv6). Returns 400 (code 1145) if a mapping for that IP already exists — use PATCH to update an existing entry. The vendor and region are validated against the list from GET /zones/{zone_id}/cache/origin_cloud_regions/supported_regions.

INSERT INTO cloudflare.cache.origin_cloud_regions (
ip,
region,
vendor,
zone_id
)
SELECT
'{{ ip }}' /* required */,
'{{ region }}' /* required */,
'{{ vendor }}' /* required */,
'{{ zone_id }}'
RETURNING
errors,
messages,
result,
success
;

UPDATE examples

Adds or updates a single IP-to-cloud-region mapping for the zone. Unlike POST, this operation is idempotent — if a mapping for the IP already exists it is overwritten. Returns the complete updated list of all mappings for the zone. Returns 403 (code 1164) when the zone has reached the limit of 3,500 IP mappings.

UPDATE cloudflare.cache.origin_cloud_regions
SET
ip = '{{ ip }}',
region = '{{ region }}',
vendor = '{{ vendor }}'
WHERE
zone_id = '{{ zone_id }}' --required
AND ip = '{{ ip }}' --required
AND vendor = '{{ vendor }}' --required
AND region = '{{ region }}' --required
RETURNING
errors,
messages,
result,
success;

DELETE examples

Removes the cloud region mapping for a single origin IP address. The IP path parameter is normalized before lookup. Returns the deleted entry on success. Returns 404 (code 1163) if no mapping exists for the specified IP. When the last mapping for the zone is removed the underlying rule record is also deleted.

DELETE FROM cloudflare.cache.origin_cloud_regions
WHERE zone_id = '{{ zone_id }}' --required
AND origin_ip = '{{ origin_ip }}' --required
;