Skip to main content

lists

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

Overview

Namelists
TypeResource
Idcloudflare.zero_trust.lists

Fields

The following fields are returned by SELECT queries:

Get Zero Trust list details response.

NameDatatypeDescription
idstringIdentify the API resource with a UUID. (example: f174e90a-fafe-4643-bbbc-4a0ed4fc8415)
namestringSpecify the list name. (example: Admin Serial Numbers)
countnumberIndicate the number of items in the list. (x-stainless-terraform-configurability: computed)
created_atstring (date-time) (example: 2014-01-01T05:20:00.12345Z)
descriptionstringProvide the list description. (example: The serial numbers for administrators, x-stainless-terraform-configurability: computed_optional)
itemsarrayProvide the list items. (x-stainless-collection-type: set)
typestringSpecify the list type. (SERIAL, URL, DOMAIN, EMAIL, IP, CATEGORY, LOCATION, DEVICE, AAGUID) (example: SERIAL)
updated_atstring (date-time) (example: 2014-01-01T05:20:00.12345Z)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectlist_id, account_idFetch a single Zero Trust list.
listselectaccount_idtypeFetch all Zero Trust lists for an account.
createinsertaccount_id, name, typeCreates a new Zero Trust list.
editupdatelist_id, account_idAppends or removes an item from a configured Zero Trust list.
updatereplacelist_id, account_id, nameUpdates a configured Zero Trust list. Skips updating list items if not included in the payload. A non empty list items will overwrite the existing list.
deletedeletelist_id, account_idDeletes a Zero Trust list.

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
account_idstringThe Cloudflare account ID.
list_idstring
typestring

SELECT examples

Fetch a single Zero Trust list.

SELECT
id,
name,
count,
created_at,
description,
items,
type,
updated_at
FROM cloudflare.zero_trust.lists
WHERE list_id = '{{ list_id }}' -- required
AND account_id = '{{ account_id }}' -- required
;

INSERT examples

Creates a new Zero Trust list.

INSERT INTO cloudflare.zero_trust.lists (
description,
items,
name,
type,
account_id
)
SELECT
'{{ description }}',
'{{ items }}',
'{{ name }}' /* required */,
'{{ type }}' /* required */,
'{{ account_id }}'
RETURNING
errors,
messages,
result,
success
;

UPDATE examples

Appends or removes an item from a configured Zero Trust list.

UPDATE cloudflare.zero_trust.lists
SET
append = '{{ append }}',
remove = '{{ remove }}'
WHERE
list_id = '{{ list_id }}' --required
AND account_id = '{{ account_id }}' --required
RETURNING
errors,
messages,
result,
success;

REPLACE examples

Updates a configured Zero Trust list. Skips updating list items if not included in the payload. A non empty list items will overwrite the existing list.

REPLACE cloudflare.zero_trust.lists
SET
description = '{{ description }}',
items = '{{ items }}',
name = '{{ name }}'
WHERE
list_id = '{{ list_id }}' --required
AND account_id = '{{ account_id }}' --required
AND name = '{{ name }}' --required
RETURNING
errors,
messages,
result,
success;

DELETE examples

Deletes a Zero Trust list.

DELETE FROM cloudflare.zero_trust.lists
WHERE list_id = '{{ list_id }}' --required
AND account_id = '{{ account_id }}' --required
;