Minion API
3 endpoints.
Get the basic status of a Minion Job
Section titled “Get the basic status of a Minion Job”For a given Minion job ID, check whether it succeeded or failed.
Minion jobs are ran for various occasions like thumbnails, cache warmup and handling incoming files.
For some jobs, you can check the notes field for progress information. Look at https://docs.mojolicious.org/Minion/Guide#Job-progress for more information.
Path parameters
- jobidintegerrequired
- ID of the Job to query status for.
Responses
200Job status data
{
"error": null,
"notes": {
"example_note": "This note could contain the name of the upload, for example."
},
"state": "finished",
"task": "handle_upload"
}Request failed — Usual causes: the instance address is wrong or unreachable; cross-origin access is not enabled on the instance; or this page is HTTPS while the instance is plain HTTP on a LAN address, which the browser blocks as mixed content. “Copy as cURL” above sends the same request from a terminal.
Your own instance address. Requests go from this browser straight to it.
Get the full status of a Minion Job
Section titled “Get the full status of a Minion Job”Get the status of a Minion Job.
This API is there for internal usage mostly, but you can use it to get detailed status for jobs like plugin runs or URL downloads.
Path parameters
- jobidintegerrequired
Responses
200Job detail
{
"args": [
"/tmp/QF3UCnKdMr/myfile.zip"
],
"attempts": 1,
"children": [],
"created": 1601145004,
"delayed": 1601145004,
"expires": null,
"finished": 1601145004,
"id": 7,
"lax": 0,
"notes": {},
"parents": [],
"priority": 0,
"queue": "default",
"result": {
"id": "75d18ce470dc99f83dc355bdad66319d1f33c82b",
"message": "This file already exists in the Library.",
"success": 0
},
"retried": null,
"retries": 0,
"started": 1601145004,
"state": "finished",
"task": "handle_upload",
"time": 1601145005,
"worker": 1
}Request failed — Usual causes: the instance address is wrong or unreachable; cross-origin access is not enabled on the instance; or this page is HTTPS while the instance is plain HTTP on a LAN address, which the browser blocks as mixed content. “Copy as cURL” above sends the same request from a terminal.
Your own instance address. Requests go from this browser straight to it.
Queue a Minion job
Section titled “Queue a Minion job”Queue a Job with the specified type and parameters.
See LANraragi::Utils::Minion for all the available types of jobs and the parameters they require.
There’s no API contract in place for whether a Job type exists on a given server version, so I wouldn’t recommend using this unless you have a good reason to.
Path parameters
- jobnamestring · enum: thumbnail_task | tank_thumbnail_task | page_thumbnails | regen_all_thumbnails | find_duplicates | build_stat_hashes | handle_upload | download_url | run_pluginrequired
- Type of the job to instantiate.
Query parameters
- argsstringrequired
- Arguments as a JSON array string
- priorityinteger · default: 0optional
- Priority of the Minion job. The higher the number, the more important the job is.
Responses
200Enqueued job
{
"job": 0,
"operation": "",
"success": 1
}This endpoint needs an administrator token — a guest (read-only) token is refused by the server.
Request failed — Usual causes: the instance address is wrong or unreachable; cross-origin access is not enabled on the instance; or this page is HTTPS while the instance is plain HTTP on a LAN address, which the browser blocks as mixed content. “Copy as cURL” above sends the same request from a terminal.
Your own instance address. Requests go from this browser straight to it.