jobs
Creates, updates, deletes, gets or lists a jobs resource.
Overview
| Name | jobs |
| Type | Resource |
| Id | cloudflare.aisearch.jobs |
Fields
The following fields are returned by SELECT queries:
- get_by_account
- list_by_account_by_account
Returns a AI Search Job Details.
| Name | Datatype | Description |
|---|---|---|
id | string | |
description | string | |
end_reason | string | |
ended_at | string | |
last_seen_at | string | |
source | string | (user, schedule) |
started_at | string |
Returns a list of AI Search Jobs.
| Name | Datatype | Description |
|---|---|---|
id | string | |
description | string | |
end_reason | string | |
ended_at | string | |
last_seen_at | string | |
source | string | (user, schedule) |
started_at | string |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_by_account | select | id, job_id, account_id | Retrieves details for a specific AI Search indexing job. | |
list_by_account_by_account | select | id, account_id | page, per_page | Lists indexing jobs for an AI Search instance. |
create_by_account | insert | id, account_id | Creates a new indexing job for an AI Search instance. | |
update | update | id, job_id, account_id, name, action | Updates the status of an AI Search indexing job. | |
ai_search_instance_change_job_status | update | id, job_id, account_id, action | Updates 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.
| Name | Datatype | Description |
|---|---|---|
account_id | string | The Cloudflare account ID. |
id | string | Resource ID. |
job_id | string | The job ID. |
name | string | Resource name. |
page | integer | |
per_page | integer |
SELECT examples
- get_by_account
- list_by_account_by_account
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
;
Lists indexing jobs for an AI Search instance.
SELECT
id,
description,
end_reason,
ended_at,
last_seen_at,
source,
started_at
FROM cloudflare.aisearch.jobs
WHERE id = '{{ id }}' -- required
AND account_id = '{{ account_id }}' -- required
AND page = '{{ page }}'
AND per_page = '{{ per_page }}'
;
INSERT examples
- create_by_account
- Manifest
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
;
# Description fields are for documentation purposes
- name: jobs
props:
- name: id
value: "{{ id }}"
description: Required parameter for the jobs resource.
- name: account_id
value: "{{ account_id }}"
description: Required parameter for the jobs resource.
- name: description
value: "{{ description }}"
UPDATE examples
- update
- ai_search_instance_change_job_status
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;
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 action = '{{ action }}' --required
RETURNING
result,
success;