Snapshots

Delete a snapshot

Deleting a link in an incremental chain does not lose the snapshots that depend on it — the daemon keeps what they need.

A snapshot held by two hosts at once — a move part way through handing its history over — is served from the copy on the host its computer now lives on. One that cannot be attributed that way, such as an orphan, answers 409 until the handover finishes; nothing is changed.

THE DELETION OUTLIVES THIS CALL. You get a 202 and the snapshot’s row the moment the deletion is accepted, not when it finishes — detaching those dependents, then removing the stored objects, takes time that scales with the chain and with how much is stored, which is longer than any HTTP request survives. Poll GET /snapshots?include=unfinished for the id and WAIT FOR THE ROW TO GO. Its absence there is the deletion having finished; there is no state that means "deleted". A bare GET /snapshots drops the row as soon as it reads deleting, which can be long before the deletion has finished, so absence from a bare listing says only that the snapshot can no longer be restored or cloned.

A ROW THAT STAYS SAYS WHICH OF TWO THINGS HAPPENED, by its state, and it is the opposite polarity to a failed capture, which leaves no row at all. Once the daemon has detached the dependents it records the deletion and marks the snapshot deleting, and that state is left out of a bare listing because a half-deleted snapshot is not one you can restore or clone. A deleting row finishes without you: one held up by a backup upload of this snapshot that is slow to stop reads deleting while it waits and finishes once the upload has stopped, and one that stalls after that is retried by the daemon itself. A row still in the state it had has not recorded the deletion. It may still be working: detaching its dependents, or waiting on a slow upload while backup storage also refuses the record, which it goes on trying to write. Or it failed before recording anything (a dependent that is itself being deleted, below, or backup storage refusing the record with no upload to wait on), and then nothing was destroyed and nothing retries it. A row that stays in its old state is therefore worth a second DELETE: it is refused with a 409 while another deletion of this snapshot holds it, and otherwise accepted as one more attempt, which does no harm if an earlier one is still waiting; a 202 does not say that the first one failed.

EVERYTHING THAT CAN REFUSE A DELETION OF THIS SNAPSHOT IS REFUSED HERE, before the 202: no such snapshot, a capture reading through it, a clone or a migration holding it, and a deletion of this snapshot already running. That last one is what a second DELETE gets for as long as the first is working, so it is an answer about progress rather than a fault. Each of those 409s ends by itself and carries reason: "contention".

ONE CONFLICT ARRIVES AFTER THE 202, and it is about a different snapshot: a dependent that is ITSELF being deleted cannot be detached, so deleting the link it hangs off fails once the work starts. Nothing is destroyed — the row stays exactly as it was, in its ordinary state rather than deleting — and the delete succeeds once the dependent’s own deletion has finished. Deleting a chain one link at a time, waiting for each row to go, never meets it.

Requires the member role or higher.

delete/snapshots/{id}

Request

  • Base URL: https://app.mandala.computer/api/v1
  • URL: https://app.mandala.computer/api/v1/snapshots/{id}
  • Auth: HTTP bearer

Path parameters

idstring required

The snapshot id.

Response

The deletion, accepted — the row that goes when it has finished. It omits orphaned, which this answer does not work out; GET /snapshots carries it.

idstring
computer_idstring

The computer these bytes came from. May name a computer that no longer exists.

computer_namestring

For a computer that still exists, its current name — so a rename is reflected without re-reading anything. For an orphan, the name at capture, which is all there is. Absent on snapshots taken before the daemon recorded it.

orphanedboolean

True when no host that answered lists the source computer, and every host that did not answer is one the platform’s records show holding none of this account’s computers. False when a host lists it. Omitted when that cannot be established, with computer_unreachable: true. Also omitted on the row DELETE /snapshots/{id} answers with, which does not work it out; read it from GET /snapshots.

computer_unreachableboolean

True when source computer presence cannot be established. Snapshot bytes may still be available; orphaned is omitted.

restore_availableboolean

The snapshot has a usable copy on the current source computer host. False for old-host copies; clone remains available when the snapshot itself is reachable.

namestring
kind'disk' | 'memory'

disk or memory.

state'capturing' | 'pending' | 'durable' | 'deleting'

Where these bytes have got to. capturing — the copy is still being taken, and this row is a placeholder rather than a snapshot: restore, clone and delete all 404 on it, though its id is already the id it will keep. pending — it is on the host and usable, and is being pushed to backup storage. durable — it is in backup storage too, which is the state your plan’s retention (GET /retention) ages out. deleting — a deletion began and has not finished, whether still under way or stalled; you only see these if you asked for them with include=unfinished.

Poll this after a capture, and wait for it to stop reading capturing rather than for it to read pending. pending is where a finished capture lands, but replication can carry it on to durable between two polls; both are states you can act on. A row that disappears without ever leaving capturing is a capture that failed.

A capture holds its computer until its upload to backup storage has finished, not just until it leaves capturing: a new capture of the SAME computer is refused (409, reason: "contention") while that upload runs, which is ordinarily for as long as this row reads pending, and is accepted once it reads durable. Restore, clone and delete all work from pending.

size_bytesinteger
created_atstring

RFC 3339 timestamp.

osstring
templatestring
cpuinteger
ram_mbinteger
disk_gbinteger
resolutionstring

The screen the capture was taken at, and what a clone of it comes up as.

autoboolean

Taken by the scheduler rather than by hand. Only these are ever aged out by your plan’s retention, and GET /retention is the window they are aged out on.

incrementalboolean

This snapshot is a link in a chain rather than a full copy, which is why it bills smaller.

unreachableboolean

As on Computer — a row from the placement cache, with nothing else on it.

Changes

No recorded changes to this operation across all 1 revision of this API.