Revert a container's last update
POST/apps/:id/revert
Required role: admin. Only an account or token with the admin role can call this operation.
curl --request POST \
--header "Authorization: Bearer $HOSERVA_TOKEN" \
"https://$HOSERVA_HOST:8008/api/v1/apps/{id}/revert"
Queues a container_update job (service class) that puts the container back on the image it ran before its latest update and restores the appdata snapshot taken just before it. A running container is stopped first, so it never runs the updated image against the restored data; the snapshot is restored, writing a snapshot of the appdata it replaces (pre-restore), so anything written since the update is kept in an archive; the container is recreated from the kept image without pulling; then it is started, once, on the previous image. A container that was stopped stays stopped. A revert deletes nothing from the pool. Refused with 409 nothing_to_revert when the container has no update to revert (see listAppUpdateHistory), with 409 revert_unavailable when the update is on record but can no longer be undone (the previous image was removed, its keep period ended, or the snapshot is gone from its destination), and with 409 array_stopped / 503 array_state_unknown while the array is stopped or unreadable; no job is queued and nothing is changed. If the job fails after it has stopped the container, the container is left stopped, because the restore may already have replaced its data and the updated image must not run against that; reverting again finishes it, while the snapshot is still on its destination, after which the container is started by hand.
Request
Responses
- 200
- default
The queued job.
An error response.