status #
Returns the current (or last) job, the last background reindex, and every archive waiting for a purge. With a jobId, returns that job only, with the plan it applied. With subscribe: true (WebSocket or MQTT only), also subscribes the connection to the job's realtime progress.
Query Syntax #
HTTP #
URL: http://kuzzle:7512/_/mapping-migration/migration/status
URL: http://kuzzle:7512/_/mapping-migration/migration/status?jobId=<jobId>
URL: http://kuzzle:7512/_/mapping-migration/migration/status?index=<index>&collection=<collection>
Method: GETOther protocols #
{
"controller": "mapping-migration/migration",
"action": "status",
"jobId": "<jobId>", // optional
"index": "<index>", // optional, with collection
"collection": "<collection>", // optional, with index
"subscribe": true // optional, WebSocket or MQTT only
}Kourou #
kourou mapping-migration/migration:status -a jobId=<jobId>Arguments #
| Argument | Type | Description |
|---|---|---|
jobId | string | Only that job, the current one or an archived one, with the plan it applied (changes). No reindex, no archives then; index and collection are ignored |
index, collection | string | Both or neither: the last reindex of that collection instead of the last one of the cluster |
subscribe | boolean | Also join the job's progress room: one message at each phase change or error, at most one every progressInterval during the copy. Refused over HTTP (subscribe_unsupported) |
Response #
Without jobId:
{
"job": {
"jobId": "…",
"index": "iot",
"collection": "sensors",
"phase": "copying",
"allowFailures": false,
"total": 300000,
"processed": 156000,
"failed": 0,
"lastError": null,
"owner": "knode-…",
"checkpointAt": 1764000006022,
"createdAt": 1764000000000,
"lockedAt": 1764000000012,
"copiedAt": null,
"finishedAt": null,
"updatedAt": 1764000006022
},
"reindex": null,
"archives": [
{
"jobId": "…",
"index": "iot",
"collection": "devices",
"indice": "&iot.devices",
"archivedAt": 1763990000000,
"failed": 0,
"changes": [ /* ... */ ],
"allowFailures": false,
"createdAt": 1763989970000,
"lockedAt": 1763989970010,
"copiedAt": 1763989999000,
"total": 1000000,
"processed": 1000000
}
],
"subscription": { "channel": "…", "roomId": "…" } // with subscribe only
}With jobId: { "job": { ..., "changes": [ ... ] } }, plus subscription with subscribe.
job #
null if no job ever ran. Timestamps are milliseconds since the epoch.
| Property | Type | Description |
|---|---|---|
jobId | string | Job identifier |
index, collection | string | The collection migrated |
phase | string | waiting, copying, copied, done or aborted, see Job phases |
allowFailures | boolean | As given to start |
total | number | Documents to copy |
processed | number | Documents copied or failed so far |
failed | number | Failed documents, listed by failures |
lastError | string | Last error, null if none |
owner | string | Id of the Kuzzle node running the job |
checkpointAt | number | Last checkpoint (a phase change or a batch copied); frozen while the job is stalled |
createdAt | number | start received |
lockedAt | number | Writes closed |
copiedAt | number | Copy done (includes the grace delay since lockedAt) |
finishedAt | number | done or aborted: writes reopened |
updatedAt | number | Last change of the job state |
changes | object[] | With jobId only: the plan applied, see change kinds |
A job replaced by another one is read from its archive: it is done, finishedAt and updatedAt are its archive time, and lastError, owner and checkpointAt are null. An aborted job replaced by another one, or a purged one, has no archive: unknown_job (404).
reindex #
The last background reindex (of the cluster, or of index / collection), null if none.
| Property | Type | Description |
|---|---|---|
taskId | string | Elasticsearch task id, null when untracked |
index, collection | string | The collection reindexed |
startedAt | number | When it started |
state | string | running, done, failed, unknown or untracked, see Reindexes |
total, updated | number | Documents to reindex, and reindexed so far |
failed | number | Documents refused |
failures | object[] | The first 100 refused documents, [{ documentId, reason }]; null for a caller without document:search on the collection |
error | string | The error that stopped the task, if any |
finishedAt | number | When the task ended, null while it runs |
archives #
Every archive waiting for a purge, oldest first. Each has these fields:
| Property | Type | Description |
|---|---|---|
jobId | string | The job that archived it, the id purge takes |
index, collection | string | The collection migrated |
indice | string | The archive: the collection's old indice, outside of any collection |
archivedAt | number | When the collection was switched to the new indice |
failed | number | Failed documents, kept in the archive only |
changes | object[] | The plan applied, see change kinds |
allowFailures | boolean | As given to start |
createdAt, lockedAt, copiedAt | number | The job's timestamps, as in job |
total, processed | number | Documents to copy, and copied or failed |
An archive made by a 1.0.0 beta has null for the fields that beta did not record (allowFailures, createdAt, lockedAt, copiedAt, total, processed).
Progress messages #
With subscribe, each message on subscription.channel carries the job view above in result._source.
Possible errors #
| Error id | Status | When |
|---|---|---|
plugin.mapping-migration.subscribe_unsupported | 400 | subscribe: true over HTTP |
plugin.mapping-migration.invalid_flag | 400 | Over HTTP, subscribe is neither true, false nor the bare flag |
api.assert.missing_argument | 400 | index without collection, or the reverse |
plugin.mapping-migration.unknown_job | 404 | jobId is neither the current job nor an archived one |
plugin.mapping-migration.unsupported_engine | 412 | Kuzzle does not run on Elasticsearch 8 |