Prebuilds
prebuilds
Methods
Cancels a running prebuild.
Use this method to:
- Stop prebuilds that are no longer needed
- Free up resources for other operations
Examples
Cancel prebuild:
Stops a running prebuild and cleans up resources.
prebuildId: "07e03a28-65a5-4d98-b532-8ea67b188048"
Creates a prebuild for a project.
Use this method to:
- Create on-demand prebuilds for faster environment startup
- Trigger prebuilds after repository changes
- Generate prebuilds for specific environment classes
The prebuild process creates an environment, runs the devcontainer prebuild lifecycle, and creates a snapshot for future environment provisioning.
Examples
Create basic prebuild:
Creates a prebuild for a project using default settings.
projectId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" spec: timeout: "3600s" # 60 minutes defaultCreate prebuild with custom environment class:
Creates a prebuild with a specific environment class and timeout.
projectId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" environmentClassId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" spec: timeout: "3600s" # 1 hour
Creates a logs access token for a prebuild.
Use this method to:
- Stream logs from a running prebuild
- Access archived logs from completed prebuilds
Generated tokens are valid for one hour.
Examples
Create prebuild logs token:
Generates a token for accessing prebuild logs.
prebuildId: "07e03a28-65a5-4d98-b532-8ea67b188048"
Creates a warm pool for a project and environment class.
A warm pool maintains pre-created environment instances from a prebuild snapshot so that new environments can start near-instantly.
Only one warm pool is allowed per <project, environment_class> pair. The environment class must have prebuilds enabled on the project.
The pool's snapshot is managed automatically: when a new prebuild completes for the same project and environment class, the pool's snapshot is updated and the runner rotates instances.
Examples
Create warm pool:
Creates a warm pool with 2 instances for a project and environment class.
projectId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" environmentClassId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" desiredSize: 2
Deletes a prebuild.
Prebuilds are automatically deleted after some time. Use this method to manually delete a prebuild before automatic cleanup, for example to remove a prebuild that should no longer be used.
Deletion is processed asynchronously. The prebuild will be marked for deletion and removed from the system in the background.
Examples
Delete prebuild:
Marks a prebuild for deletion and removes it from the system.
prebuildId: "07e03a28-65a5-4d98-b532-8ea67b188048"
Deletes a warm pool.
Deletion is processed asynchronously. The pool is marked for deletion and the runner drains instances in the background.
Warm pools are also automatically deleted when prebuilds are disabled on the project or the environment class is removed from the prebuild configuration.
Examples
Delete warm pool:
warmPoolId: "a1b2c3d4-5678-9abc-def0-1234567890ab"
ListPrebuilds
pagination contains the pagination response
prebuilds are the prebuilds that matched the query
Lists warm pools with optional filtering.
Use this method to:
- View all warm pools for a project
- Monitor warm pool status across environment classes
Examples
List warm pools for a project:
filter: projectIds: ["b0e12f6c-4c67-429d-a4a6-d9838b5da047"]
Gets details about a specific prebuild.
Use this method to:
- Check prebuild status and progress
- Access prebuild logs for debugging
Examples
Get prebuild details:
Retrieves comprehensive information about a prebuild.
prebuildId: "07e03a28-65a5-4d98-b532-8ea67b188048"
Gets details about a specific warm pool.
Use this method to:
- Check warm pool status and phase
- View the current snapshot being warmed
- Monitor pool health
Examples
Get warm pool:
warmPoolId: "a1b2c3d4-5678-9abc-def0-1234567890ab"
Updates a warm pool's configuration.
Use this method to change the desired pool size.
Examples
Update pool size:
warmPoolId: "a1b2c3d4-5678-9abc-def0-1234567890ab" desiredSize: 5
Domain types
Prebuild represents a prebuild for a project that creates a snapshot for faster environment startup times.
PrebuildMetadata contains metadata about the prebuild
PrebuildPhase represents the lifecycle phase of a prebuild
PrebuildSpec contains the configuration used to create a prebuild
PrebuildStatus contains the current status and progress of a prebuild
PrebuildTrigger indicates how the prebuild was triggered
WarmPool maintains pre-created environment instances from a prebuild snapshot for near-instant environment startup. One warm pool exists per <project, environment_class> pair.
WarmPoolMetadata contains metadata about the warm pool
WarmPoolPhase represents the lifecycle phase of a warm pool
WarmPoolSpec contains the desired configuration for a warm pool
WarmPoolStatus contains the current status of a warm pool as reported by the runner