holds
Creates, updates, deletes, gets or lists a holds resource.
Overview
| Name | holds |
| Type | Resource |
| Id | cloudflare.zones.holds |
Fields
The following fields are returned by SELECT queries:
- list
| Name | Datatype | Description |
|---|---|---|
hold | boolean | |
hold_after | string | (example: 2023-01-31T15:56:36+00:00) |
include_subdomains | string |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list | select | zone_id | Retrieve whether the zone is subject to a zone hold, and metadata about the hold. | |
create | insert | zone_id | include_subdomains | Enforce a zone hold on the zone, blocking the creation and activation of zones with this zone's hostname. |
edit | update | zone_id | 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. | |
delete | delete | zone_id | hold_after | Stop 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.
| Name | Datatype | Description |
|---|---|---|
zone_id | string | The Cloudflare zone ID. |
hold_after | string | If 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_subdomains | boolean | If 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
- list
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
- create
- Manifest
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
;
# Description fields are for documentation purposes
- name: holds
props:
- name: zone_id
value: "{{ zone_id }}"
description: Required parameter for the holds resource.
- name: include_subdomains
value: {{ include_subdomains }}
description: If 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.
description: If 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.
UPDATE examples
- edit
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
- delete
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 }}'
;