Read snapshot

GET /{bucket}/{stream}/snapshot/{offset} returns the snapshot blob at a specific offset. To read the latest snapshot, take its offset from the Stream-Snapshot-Offset header of HEAD.

bucketpathstringrequired

Bucket ID.

streampathstringrequired

Stream ID.

offsetpathstringrequired

Snapshot offset: the 20-character zero-padded decimal token returned by previous reads or Stream-Snapshot-Offset headers.

Stream-Incarnationheaderstring

Optional precondition: the stream's incarnation token, as a previous response's Stream-Incarnation header returned it. The read is answered only if the stream that serves it is still that incarnation; otherwise it answers 412. Without the header, the request behaves exactly as described here. A malformed value answers 400. See Stream-Incarnation.

StatusMeaning
200Snapshot blob returned.
307In a cluster, this node is not the stream's group leader. Location is the same request on the leader.
404Stream, snapshot, or offset not found.
412Stream-Incarnation did not match. The response's Stream-Incarnation is the current token.
502The snapshot body is in the cold tier and could not be read.
503The group has no known leader, or the leader could not confirm its leadership in time. Retry after Retry-After.

Response headers include Content-Type, Content-Length, Stream-Next-Offset, Stream-Snapshot-Offset, Stream-Snapshot-Digest, Stream-Incarnation, and Stream-Up-To-Date: true when the snapshot offset is the stream's tail. A body stored in the cold tier is streamed from it.

curl 'http://127.0.0.1:4437/demo/hello/snapshot/00000000000000000042'

Snapshot reads are served by the group's leader after it confirms with a majority of voters that it still leads, so the read reflects every snapshot publish acknowledged before the request. A follower answers 307 to the leader; follow the redirect. See Durability and consistency.

See snapshots for the snapshot lifecycle.