Skip to main content

datasets

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

Overview

Namedatasets
TypeResource
Idcloudflare.ai_gateway.datasets

Fields

The following fields are returned by SELECT queries:

Returns a single object if found

NameDatatypeDescription
idstring
namestring
gateway_idstringgateway id
created_atstring (date-time)
enableboolean
filtersarray
modified_atstring (date-time)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectaccount_id, gateway_id, idRetrieves details for a specific AI Gateway dataset.
listselectaccount_id, gateway_idpage, per_page, name, enable, searchLists all AI Gateway evaluator types configured for the account.
createinsertgateway_id, account_id, name, filters, enableCreates a new AI Gateway.
updatereplaceaccount_id, gateway_id, id, name, filters, enableUpdates an existing AI Gateway dataset.
deletedeleteaccount_id, gateway_id, idDeletes an AI Gateway dataset.

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.
gateway_idstringThe AI Gateway ID.
idstringResource ID.
enableboolean
namestring
pageinteger
per_pageinteger

SELECT examples

Retrieves details for a specific AI Gateway dataset.

SELECT
id,
name,
gateway_id,
created_at,
enable,
filters,
modified_at
FROM cloudflare.ai_gateway.datasets
WHERE account_id = '{{ account_id }}' -- required
AND gateway_id = '{{ gateway_id }}' -- required
AND id = '{{ id }}' -- required
;

INSERT examples

Creates a new AI Gateway.

INSERT INTO cloudflare.ai_gateway.datasets (
enable,
filters,
name,
gateway_id,
account_id
)
SELECT
{{ enable }} /* required */,
'{{ filters }}' /* required */,
'{{ name }}' /* required */,
'{{ gateway_id }}',
'{{ account_id }}'
RETURNING
result,
success
;

REPLACE examples

Updates an existing AI Gateway dataset.

REPLACE cloudflare.ai_gateway.datasets
SET
enable = {{ enable }},
filters = '{{ filters }}',
name = '{{ name }}'
WHERE
account_id = '{{ account_id }}' --required
AND gateway_id = '{{ gateway_id }}' --required
AND id = '{{ id }}' --required
AND name = '{{ name }}' --required
AND filters = '{{ filters }}' --required
AND enable = {{ enable }} --required
RETURNING
result,
success;

DELETE examples

Deletes an AI Gateway dataset.

DELETE FROM cloudflare.ai_gateway.datasets
WHERE account_id = '{{ account_id }}' --required
AND gateway_id = '{{ gateway_id }}' --required
AND id = '{{ id }}' --required
;