lockdowns
Creates, updates, deletes, gets or lists a lockdowns resource.
Overview
| Name | lockdowns |
| Type | Resource |
| Id | cloudflare.firewall.lockdowns |
Fields
The following fields are returned by SELECT queries:
- get
- list
Get a Zone Lockdown rule response
| Name | Datatype | Description |
|---|---|---|
id | string | The unique identifier of the Zone Lockdown rule. (example: 372e67954025e0ba6aaa6d586b9e0b59) |
configurations | array | A 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_on | string (date-time) | The timestamp of when the rule was created. (example: 2014-01-01T05:20:00.12345Z) |
description | string | An informative summary of the rule. (example: Restrict access to these endpoints to requests from a known IP address) |
modified_on | string (date-time) | The timestamp of when the rule was last modified. (example: 2014-01-01T05:20:00.12345Z) |
paused | boolean | When true, indicates that the rule is currently paused. |
urls | array | The 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. |
List Zone Lockdown rules response
| Name | Datatype | Description |
|---|---|---|
id | string | The unique identifier of the Zone Lockdown rule. (example: 372e67954025e0ba6aaa6d586b9e0b59) |
configurations | array | A 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_on | string (date-time) | The timestamp of when the rule was created. (example: 2014-01-01T05:20:00.12345Z) |
description | string | An informative summary of the rule. (example: Restrict access to these endpoints to requests from a known IP address) |
modified_on | string (date-time) | The timestamp of when the rule was last modified. (example: 2014-01-01T05:20:00.12345Z) |
paused | boolean | When true, indicates that the rule is currently paused. |
urls | array | The 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:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | lock_downs_id, zone_id | Fetches the details of a Zone Lockdown rule. | |
list | select | zone_id | page, description, modified_on, ip, priority, uri_search, ip_range_search, per_page, created_on, description_search, ip_search | Fetches Zone Lockdown rules. You can filter the results using several optional parameters. |
create | insert | zone_id, urls, configurations | Creates a new Zone Lockdown rule. | |
update | replace | lock_downs_id, zone_id, urls, configurations | Updates an existing Zone Lockdown rule. | |
delete | delete | lock_downs_id, zone_id | Deletes 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.
| Name | Datatype | Description |
|---|---|---|
lock_downs_id | string | |
zone_id | string | The Cloudflare zone ID. |
created_on | string (date-time) | |
description | string | |
description_search | string | |
ip | string | |
ip_range_search | string | |
ip_search | string | |
modified_on | string (date-time) | |
page | number | |
per_page | number | |
priority | number | |
uri_search | string |
SELECT examples
- get
- list
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
;
Fetches Zone Lockdown rules. You can filter the results using several optional parameters.
SELECT
id,
configurations,
created_on,
description,
modified_on,
paused,
urls
FROM cloudflare.firewall.lockdowns
WHERE zone_id = '{{ zone_id }}' -- required
AND page = '{{ page }}'
AND description = '{{ description }}'
AND modified_on = '{{ modified_on }}'
AND ip = '{{ ip }}'
AND priority = '{{ priority }}'
AND uri_search = '{{ uri_search }}'
AND ip_range_search = '{{ ip_range_search }}'
AND per_page = '{{ per_page }}'
AND created_on = '{{ created_on }}'
AND description_search = '{{ description_search }}'
AND ip_search = '{{ ip_search }}'
;
INSERT examples
- create
- Manifest
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
;
# Description fields are for documentation purposes
- name: lockdowns
props:
- name: zone_id
value: "{{ zone_id }}"
description: Required parameter for the lockdowns resource.
- name: configurations
description: |
A 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.
value:
- target: "{{ target }}"
value: "{{ value }}"
- name: description
value: "{{ description }}"
description: |
An informative summary of the rule. This value is sanitized and any tags will be removed.
- name: paused
value: {{ paused }}
description: |
When true, indicates that the rule is currently paused.
default: false
- name: priority
value: {{ priority }}
description: |
The priority of the rule to control the processing order. A lower number indicates higher priority. If not provided, any rules with a configured priority will be processed before rules without a priority.
- name: urls
value:
- "{{ urls }}"
description: |
The URLs to include in the current WAF override. You can use wildcards. Each entered URL will be escaped before use, which means you can only use simple wildcard patterns.
REPLACE examples
- update
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
- delete
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
;