API - Pause, resume, stop, retry or delete an ingestion job (ingest_queue_action)

Data Ingestion

Does to one Data Ingestion job what the buttons of the queue page do: stop, pause, resume, retry or delete it, or replace its documents.

Endpointhttps://api.opensolr.com/solr_manager/api/ingest_queue_action
MethodGET or POST
Authemail and api_key of your account, as GET or POST parameters: Authentication.

01 · Parameters

job_idRequired

The job.

queue_actionRequired

stop, pause, resume, retry, delete or save_payload.

payloadWith save_payload

The new documents of the job, as a JSON array. They follow every rule of ingest: at most 50, uri, title, description and text.

Which action works in which state is shown on the queue page: The Data Ingestion queue.

02 · Example

curl -s "https://api.opensolr.com/solr_manager/api/ingest_queue_action?email=YOUR_EMAIL&api_key=YOUR_API_KEY&job_id=9f2c41d0b7e84a1c8e3f5a6b7c8d9e0f&queue_action=pause"

03 · Answer

status says whether the action was done and msg what happened. save_payload also answers total_docs, the number of documents now in the job.

04 · Errors

ERROR_INVALID_PARAMETERSHTTP 200

job_id or queue_action is missing.

ERROR_INVALID_ACTION_MUST_BE_...HTTP 200

queue_action is not one of the six.

ERROR_JOB_NOT_FOUNDHTTP 200

No such job of yours.

ERROR_PAYLOAD_REQUIREDHTTP 200

save_payload without payload.

ERROR_PAYLOAD_MUST_BE_VALID_JSON_ARRAYHTTP 200

payload is not a JSON array.

VALIDATION_ERRORSHTTP 200

The new documents break the rules of ingest.

ERROR_QUEUE_UNAVAILABLE_TRY_AGAINHTTP 200

The queue did not answer. Try again.

WRONG_API_HOSTHTTP 404

Called on opensolr.com. The answer carries the right URL.

ERROR_AUTHENTICATION_FAILEDHTTP 403

The email and API key do not match.

ERROR_RATE_LIMIT_PER_MINUTEHTTP 429

Too many calls. Wait for the Retry-After seconds: Rate limits.

05 · Related

Retry every failed job of an index at once: ingest_queue_retry_failed.

Every error code and HTTP status of the API: API errors. Calls per minute and per hour: Rate limits.