Skip to main content

Rebuild

Queue a new build for an existing template, e.g. after a failed build, or to pick up an updated base image.
Rebuild is idempotent: if an in-flight build already exists with the same configuration, you get back the existing build instead of a duplicate. To wait for the new build to finish, poll it by the ID that rebuild() returns. Continuing from the build above:
rebuild() does not update latestBuildId / latest_build_id. On a template returned by Template.create, waitUntilReady() / wait_until_ready() and streamBuildLogs() / stream_build_logs() keep following the first build. A template returned by Template.connect has no latestBuildId, so they follow the most recent build. Polling getBuild() / get_build() with the ID that rebuild() returns works in both cases.

List and inspect builds

listBuilds() / list_builds() returns the template’s 20 most recent builds, newest first.

Cancel an in-flight build

cancelBuild is a no-op for builds already in a terminal state.

Delete a template

Both calls are idempotent on 404. Once the delete succeeds the template’s name is released for reuse — you can immediately create a new template with the same name. A template can’t be deleted while something still uses it:
  • a sandbox created from the template that is not deleted, including a paused one
  • a snapshot of such a sandbox, even after the sandbox itself is deleted
The call then raises ConflictError with a message such as template has 2 sandbox(es) or snapshot(s) still referencing it; delete them first. Kill the sandboxes and delete their snapshots, then delete the template again. Snapshot.list() lists the snapshots of one sandbox, so keep the IDs of the sandboxes you create from a template: