Skip to main content

jobs

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

Overview

Namejobs
TypeResource
Idcloudflare.aisearch.jobs

Fields

The following fields are returned by SELECT queries:

Returns a AI Search Job Details.

NameDatatypeDescription
idstring
descriptionstring
end_reasonstring
ended_atstring
last_seen_atstring
sourcestring (user, schedule)
started_atstring

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_by_accountselectid, job_id, account_idRetrieves details for a specific AI Search indexing job.
list_by_account_by_accountselectid, account_idpage, per_pageLists indexing jobs for an AI Search instance.
create_by_accountinsertid, account_idCreates a new indexing job for an AI Search instance.
updateupdateid, job_id, account_id, name, actionUpdates the status of an AI Search indexing job.
ai_search_instance_change_job_statusupdateid, job_id, account_id, actionUpdates the status of an AI Search indexing job.

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.
idstringResource ID.
job_idstringThe job ID.
namestringResource name.
pageinteger
per_pageinteger

SELECT examples

Retrieves details for a specific AI Search indexing job.

SELECT
id,
description,
end_reason,
ended_at,
last_seen_at,
source,
started_at
FROM cloudflare.aisearch.jobs
WHERE id = '{{ id }}' -- required
AND job_id = '{{ job_id }}' -- required
AND account_id = '{{ account_id }}' -- required
;

INSERT examples

Creates a new indexing job for an AI Search instance.

INSERT INTO cloudflare.aisearch.jobs (
description,
id,
account_id
)
SELECT
'{{ description }}',
'{{ id }}',
'{{ account_id }}'
RETURNING
result,
success
;

UPDATE examples

Updates the status of an AI Search indexing job.

UPDATE cloudflare.aisearch.jobs
SET
action = '{{ action }}'
WHERE
id = '{{ id }}' --required
AND job_id = '{{ job_id }}' --required
AND account_id = '{{ account_id }}' --required
AND name = '{{ name }}' --required
AND action = '{{ action }}' --required
RETURNING
result,
success;