datasets
Creates, updates, deletes, gets or lists a datasets resource.
Overview
| Name | datasets |
| Type | Resource |
| Id | cloudflare.zero_trust.datasets |
Fields
The following fields are returned by SELECT queries:
- get
- list
Dataset read successfully.
| Name | Datatype | Description |
|---|---|---|
id | string (uuid) | |
name | string | |
case_sensitive | boolean | |
columns | array | |
created_at | string (date-time) | |
description | string | The description of the dataset. |
encoding_version | integer (int32) | |
num_cells | integer (int64) | |
secret | boolean | |
status | string | (empty, uploading, pending, processing, failed, complete) |
updated_at | string (date-time) | Stores when the dataset was last updated. This includes name or description changes as well as uploads. |
uploads | array |
Datasets read successfully.
| Name | Datatype | Description |
|---|---|---|
id | string (uuid) | |
name | string | |
case_sensitive | boolean | |
columns | array | |
created_at | string (date-time) | |
description | string | The description of the dataset. |
encoding_version | integer (int32) | |
num_cells | integer (int64) | |
secret | boolean | |
status | string | (empty, uploading, pending, processing, failed, complete) |
updated_at | string (date-time) | Stores when the dataset was last updated. This includes name or description changes as well as uploads. |
uploads | array |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | account_id, dataset_id | ||
list | select | account_id | Lists all DLP datasets configured for the account, including custom word lists and EDM datasets. | |
create | insert | account_id, name | Creates a new DLP (Data Loss Prevention) dataset for storing custom detection patterns. Datasets can contain exact match data, word lists, or EDM (Exact Data Match) configurations. | |
update | replace | account_id, dataset_id | Updates the configuration of an existing DLP dataset, such as its name, description, or detection settings. | |
delete | delete | account_id, dataset_id | This deletes all versions of the dataset. | |
dlp_datasets_define_columns | exec | account_id, dataset_id, version | This is used for multi-column EDMv2 datasets. The EDMv2 format can only be created in the Cloudflare dashboard. The columns in the response appear in the same order as in the request. |
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. |
dataset_id | string | The dataset ID. |
version | integer (int64) |
SELECT examples
- get
- list
Dataset read successfully.
SELECT
id,
name,
case_sensitive,
columns,
created_at,
description,
encoding_version,
num_cells,
secret,
status,
updated_at,
uploads
FROM cloudflare.zero_trust.datasets
WHERE account_id = '{{ account_id }}' -- required
AND dataset_id = '{{ dataset_id }}' -- required
;
Lists all DLP datasets configured for the account, including custom word lists and EDM datasets.
SELECT
id,
name,
case_sensitive,
columns,
created_at,
description,
encoding_version,
num_cells,
secret,
status,
updated_at,
uploads
FROM cloudflare.zero_trust.datasets
WHERE account_id = '{{ account_id }}' -- required
;
INSERT examples
- create
- Manifest
Creates a new DLP (Data Loss Prevention) dataset for storing custom detection patterns. Datasets can contain exact match data, word lists, or EDM (Exact Data Match) configurations.
INSERT INTO cloudflare.zero_trust.datasets (
case_sensitive,
description,
encoding_version,
name,
secret,
account_id
)
SELECT
{{ case_sensitive }},
'{{ description }}',
{{ encoding_version }},
'{{ name }}' /* required */,
{{ secret }},
'{{ account_id }}'
RETURNING
errors,
messages,
result,
success
;
# Description fields are for documentation purposes
- name: datasets
props:
- name: account_id
value: "{{ account_id }}"
description: Required parameter for the datasets resource.
- name: case_sensitive
value: {{ case_sensitive }}
description: |
Only applies to custom word lists. Determines if the words should be matched in a case-sensitive manner Cannot be set to false if `secret` is true or undefined
- name: description
value: "{{ description }}"
description: |
The description of the dataset.
- name: encoding_version
value: {{ encoding_version }}
description: |
Dataset encoding version Non-secret custom word lists with no header are always version 1. Secret EDM lists with no header are version 1. Multicolumn CSV with headers are version 2. Omitting this field provides the default value 0, which is interpreted the same as 1.
- name: name
value: "{{ name }}"
- name: secret
value: {{ secret }}
description: |
Generate a secret dataset. If true, the response will include a secret to use with the EDM encoder. If false, the response has no secret and the dataset is uploaded in plaintext.
REPLACE examples
- update
Updates the configuration of an existing DLP dataset, such as its name, description, or detection settings.
REPLACE cloudflare.zero_trust.datasets
SET
case_sensitive = {{ case_sensitive }},
description = '{{ description }}',
name = '{{ name }}'
WHERE
account_id = '{{ account_id }}' --required
AND dataset_id = '{{ dataset_id }}' --required
RETURNING
errors,
messages,
result,
success;
DELETE examples
- delete
This deletes all versions of the dataset.
DELETE FROM cloudflare.zero_trust.datasets
WHERE account_id = '{{ account_id }}' --required
AND dataset_id = '{{ dataset_id }}' --required
;
Lifecycle Methods
- dlp_datasets_define_columns
This is used for multi-column EDMv2 datasets. The EDMv2 format can only be created in the Cloudflare dashboard. The columns in the response appear in the same order as in the request.
EXEC cloudflare.zero_trust.datasets.dlp_datasets_define_columns
@account_id='{{ account_id }}' --required,
@dataset_id='{{ dataset_id }}' --required,
@version='{{ version }}' --required
;