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.
bucketpathstringrequiredBucket ID.
streampathstringrequiredStream ID.
offsetpathstringrequiredSnapshot offset: the 20-character zero-padded decimal token returned by previous reads or Stream-Snapshot-Offset headers.
Stream-IncarnationheaderstringOptional 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.
RangeheaderstringOptional: one byte range of the snapshot, bytes=a-b, bytes=a- or bytes=-n. The answer is 206 with only those bytes and Content-Range: bytes a-b/total. Several ranges, a value that does not parse, or a request that also carries If-Range get the whole snapshot as 200. A body in the cold tier is read only where the range needs it.
| Status | Meaning |
|---|---|
200 | Snapshot blob returned. |
206 | The requested byte range returned. |
304 | If-None-Match named the snapshot's ETag. The headers are those of the 200. |
307 | In a cluster, this node is not the stream's group leader. Location is the same request on the leader. |
400 | The request carries incarnation, which immutable reads carry in the path instead. |
404 | Stream, snapshot, or offset not found. When the stream exists and the snapshot is not its latest, Stream-Incarnation is the stream's token. |
412 | Stream-Incarnation did not match. The response's Stream-Incarnation is the current token. |
416 | The range starts at or past the end of the snapshot. Content-Range: bytes */total names its size, and Stream-Incarnation the stream's token. |
502 | The snapshot body is in the cold tier and could not be read. |
503 | The 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, Accept-Ranges: bytes, ETag (the snapshot digest in quotes), 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. They describe the whole snapshot on a 206 too: the digest always covers the whole body. A 404 comes before the range is looked at, then 416, then 412. A revalidation with If-None-Match ignores the range and answers 412 or 304. To read a snapshot through a cache, use immutable reads. A body stored in the cold tier is streamed from it. Snapshot answers are never compressed.
curl 'http://127.0.0.1:4437/demo/hello/snapshot/00000000000000000042'curl -H 'Range: bytes=0-55' \
'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.