Skip to main content

holds

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

Overview

Nameholds
TypeResource
Idcloudflare.zones.holds

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
holdboolean
hold_afterstring (example: 2023-01-31T15:56:36+00:00)
include_subdomainsstring

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
listselectzone_idRetrieve whether the zone is subject to a zone hold, and metadata about the hold.
createinsertzone_idinclude_subdomainsEnforce a zone hold on the zone, blocking the creation and activation of zones with this zone's hostname.
editupdatezone_idUpdate the hold_after and/or include_subdomains values on an existing zone hold. The hold is enabled if the hold_after date-time value is in the past.
deletedeletezone_idhold_afterStop enforcement of a zone hold on the zone, permanently or temporarily, allowing the creation and activation of zones with this zone's 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
zone_idstringThe Cloudflare zone ID.
hold_afterstringIf hold_after is provided, the hold will be temporarily disabled, then automatically re-enabled by the system at the time specified in this RFC3339-formatted timestamp. Otherwise, the hold will be disabled indefinitely.
include_subdomainsbooleanIf provided, the zone hold will extend to block any subdomain of the given zone, as well as SSL4SaaS Custom Hostnames. For example, a zone hold on a zone with the hostname 'example.com' and include_subdomains=true will block 'example.com', 'staging.example.com', 'api.staging.example.com', etc.

SELECT examples

Retrieve whether the zone is subject to a zone hold, and metadata about the hold.

SELECT
hold,
hold_after,
include_subdomains
FROM cloudflare.zones.holds
WHERE zone_id = '{{ zone_id }}' -- required
;

INSERT examples

Enforce a zone hold on the zone, blocking the creation and activation of zones with this zone's hostname.

INSERT INTO cloudflare.zones.holds (
zone_id,
include_subdomains
)
SELECT
'{{ zone_id }}',
'{{ include_subdomains }}'
RETURNING
errors,
messages,
result,
success
;

UPDATE examples

Update the hold_after and/or include_subdomains values on an existing zone hold. The hold is enabled if the hold_after date-time value is in the past.

UPDATE cloudflare.zones.holds
SET
hold_after = '{{ hold_after }}',
include_subdomains = {{ include_subdomains }}
WHERE
zone_id = '{{ zone_id }}' --required
RETURNING
errors,
messages,
result,
success;

DELETE examples

Stop enforcement of a zone hold on the zone, permanently or temporarily, allowing the creation and activation of zones with this zone's hostname.

DELETE FROM cloudflare.zones.holds
WHERE zone_id = '{{ zone_id }}' --required
AND hold_after = '{{ hold_after }}'
;