allowlist
Creates, updates, deletes, gets or lists an allowlist resource.
Overview
| Name | allowlist |
| Type | Resource |
| Id | cloudflare.ddos_protection.allowlist |
Fields
The following fields are returned by SELECT queries:
- list
List all allowlist prefixes response.
| Name | Datatype | Description |
|---|---|---|
id | string | The unique ID of the allowlist prefix. |
comment | string | An optional comment describing the allowlist prefix. |
created_on | string (date-time) | The creation timestamp of the allowlist prefix. |
enabled | boolean | Whether to enable the allowlist prefix into effect. Defaults to false. |
modified_on | string (date-time) | The last modification timestamp of the allowlist prefix. |
prefix | string | The allowlist prefix in CIDR format. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list | select | account_id | page, per_page, order, direction | List all allowlist prefixes for an account. |
create | insert | account_id, prefix, comment, enabled | Create an allowlist prefix for an account. | |
bulk_delete | delete | account_id | Delete all allowlist prefixes for an account. |
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 |
|---|---|---|
account_id | string | The Cloudflare account ID. |
direction | string | The direction of ordering (ASC or DESC). Defaults to 'ASC'. |
order | string | The field to order by. Defaults to 'prefix'. |
page | integer (int64) | The page number for pagination. Defaults to 1. |
per_page | integer (int64) | The number of items per page. Must be between 10 and 1000. Defaults to 25. |
SELECT examples
- list
List all allowlist prefixes for an account.
SELECT
id,
comment,
created_on,
enabled,
modified_on,
prefix
FROM cloudflare.ddos_protection.allowlist
WHERE account_id = '{{ account_id }}' -- required
AND page = '{{ page }}'
AND per_page = '{{ per_page }}'
AND order = '{{ order }}'
AND direction = '{{ direction }}'
;
INSERT examples
- create
- Manifest
Create an allowlist prefix for an account.
INSERT INTO cloudflare.ddos_protection.allowlist (
comment,
enabled,
prefix,
account_id
)
SELECT
'{{ comment }}' /* required */,
{{ enabled }} /* required */,
'{{ prefix }}' /* required */,
'{{ account_id }}'
RETURNING
errors,
messages,
result,
success
;
# Description fields are for documentation purposes
- name: allowlist
props:
- name: account_id
value: "{{ account_id }}"
description: Required parameter for the allowlist resource.
- name: comment
value: "{{ comment }}"
description: |
An comment describing the allowlist prefix.
- name: enabled
value: {{ enabled }}
description: |
Whether to enable the allowlist prefix into effect.
- name: prefix
value: "{{ prefix }}"
description: |
The allowlist prefix to add in CIDR format.
DELETE examples
- bulk_delete
Delete all allowlist prefixes for an account.
DELETE FROM cloudflare.ddos_protection.allowlist
WHERE account_id = '{{ account_id }}' --required
;