Fork a Sailbox
Creates a running copy of the Sailbox from its current state. The copy has its own id and its own filesystem, and the original is left as it was. The Sailbox you fork can be running, sleeping, or paused. The copy comes up with the memory and filesystem the Sailbox has now, so processes it was running carry on there.
Commands run through an SDK or the CLI stop there. Everything they had written by then is on the filesystem, and one started with their background option keeps running. Start whatever else you need running again. A Sailbox that mounts a volume always comes up cold, with the disk intact and nothing running, and any Sailbox can come up cold, so write code that expects it.
Volumes mounted on the original Sailbox are mounted on the copy at the same paths. They are the same volumes, not copies, so both Sailboxes read and write the same files.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
Makes the request retry-safe. Sail remembers the answer it sent under a key, including a 400 or a 409, and replays it with Idempotent-Replayed: true for a retry that repeats the key, the method, the path, and the body. Bodies are compared byte for byte. Reusing a key for a different request returns 409, so send a corrected request under a new key. A key that is blank or only spaces is ignored, and the request runs without idempotency.
Any string of up to 255 bytes works, and characters outside ASCII count for more than one. A UUID is a good default. Keys are remembered for at least 24 hours and scoped to the API key that sent them.
A server error, or a failure to record the answer, can leave a key unsettled, and creating a Sailbox is where that matters. See Retrying safely.
255Path Parameters
Id of the Sailbox, as returned by create. It is sb_ followed by a UUID.
^sb_[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$Body
Name for the copy. Defaults to the original's name with -fork appended. Control characters are not allowed.
128Response
The new Sailbox is running. One that cannot be brought up fails the request instead of answering 200.
Id of the copy.
Current state of the Sailbox. Values in use today are creating, running, paused, sleeping, terminating, terminated, failed, create_failed, interrupted_restorable, and interrupted_unsafe_to_retry. New values can appear over time, so treat this as an open set.
Checkpoint counter of the Sailbox that was copied, at the moment of the copy. It goes up by one every time the Sailbox saves its state, which includes pausing and sleeping.
Name of the copy.