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"
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"
ListPrebuilds
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"
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