Preview restoring one container's appdata
POST/appdata/backup/restore/preview
Required role: admin. Only an account or token with the admin role can call this operation.
curl --request POST \
--header "Authorization: Bearer $HOSERVA_TOKEN" \
--header "Content-Type: application/json" \
--data @body.json \
"https://$HOSERVA_HOST:8008/api/v1/appdata/backup/restore/preview"
Queues an appdata_restore_preview job (service class, scoped to the container) that reports what restoreAppdata would overwrite for the same archive on the same destination, before anything is changed. Read the result with getAppdataRestorePreview once the job has succeeded. The job fetches, decrypts and verifies the archive exactly as the restore does and fails with the restore's own error when the archive is corrupt, is another container's, names a directory outside the appdata location, or holds entries a restore could not unpack. It then compares each archived directory with the live one, walking the live appdata only for this job: files present in both are replaced, files only in the archive are added, and files only in the live appdata are removed, because the restore replaces each directory as a whole. It stops no container, writes nothing under the appdata location and leaves no fetched archive on disk, on success or failure. It queues behind a backup or restore of the same container and runs beside those of others. Cancelling it stops the fetch, the reading of the archive and the walk of the live directories; the decryption and the verification read that follow the fetch run to their end first. 404 archive_not_found for an archive the named destination does not hold, 404 backup_destination_not_found, 400 appdata_archive_invalid for a request that names no archive of this installation and container, and 409 array_stopped while the array is stopped or its storage is not ready.
Request
Responses
- 200
- default
The queued or running preview job.
An error response.