Skip to main content

lockdowns

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

Overview

Namelockdowns
TypeResource
Idcloudflare.firewall.lockdowns

Fields

The following fields are returned by SELECT queries:

Get a Zone Lockdown rule response

NameDatatypeDescription
idstringThe unique identifier of the Zone Lockdown rule. (example: 372e67954025e0ba6aaa6d586b9e0b59)
configurationsarrayA list of IP addresses or CIDR ranges that will be allowed to access the URLs specified in the Zone Lockdown rule. You can include any number of ip or ip_range configurations.
created_onstring (date-time)The timestamp of when the rule was created. (example: 2014-01-01T05:20:00.12345Z)
descriptionstringAn informative summary of the rule. (example: Restrict access to these endpoints to requests from a known IP address)
modified_onstring (date-time)The timestamp of when the rule was last modified. (example: 2014-01-01T05:20:00.12345Z)
pausedbooleanWhen true, indicates that the rule is currently paused.
urlsarrayThe URLs to include in the rule definition. You can use wildcards. Each entered URL will be escaped before use, which means you can only use simple wildcard patterns.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectlock_downs_id, zone_idFetches the details of a Zone Lockdown rule.
listselectzone_idpage, description, modified_on, ip, priority, uri_search, ip_range_search, per_page, created_on, description_search, ip_searchFetches Zone Lockdown rules. You can filter the results using several optional parameters.
createinsertzone_id, urls, configurationsCreates a new Zone Lockdown rule.
updatereplacelock_downs_id, zone_id, urls, configurationsUpdates an existing Zone Lockdown rule.
deletedeletelock_downs_id, zone_idDeletes an existing Zone Lockdown rule.

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
lock_downs_idstring
zone_idstringThe Cloudflare zone ID.
created_onstring (date-time)
descriptionstring
ipstring
modified_onstring (date-time)
pagenumber
per_pagenumber
prioritynumber

SELECT examples

Fetches the details of a Zone Lockdown rule.

SELECT
id,
configurations,
created_on,
description,
modified_on,
paused,
urls
FROM cloudflare.firewall.lockdowns
WHERE lock_downs_id = '{{ lock_downs_id }}' -- required
AND zone_id = '{{ zone_id }}' -- required
;

INSERT examples

Creates a new Zone Lockdown rule.

INSERT INTO cloudflare.firewall.lockdowns (
configurations,
description,
paused,
priority,
urls,
zone_id
)
SELECT
'{{ configurations }}' /* required */,
'{{ description }}',
{{ paused }},
{{ priority }},
'{{ urls }}' /* required */,
'{{ zone_id }}'
RETURNING
errors,
messages,
result,
success
;

REPLACE examples

Updates an existing Zone Lockdown rule.

REPLACE cloudflare.firewall.lockdowns
SET
configurations = '{{ configurations }}',
urls = '{{ urls }}'
WHERE
lock_downs_id = '{{ lock_downs_id }}' --required
AND zone_id = '{{ zone_id }}' --required
AND urls = '{{ urls }}' --required
AND configurations = '{{ configurations }}' --required
RETURNING
errors,
messages,
result,
success;

DELETE examples

Deletes an existing Zone Lockdown rule.

DELETE FROM cloudflare.firewall.lockdowns
WHERE lock_downs_id = '{{ lock_downs_id }}' --required
AND zone_id = '{{ zone_id }}' --required
;