Prebuilds

prebuilds

Methods

Cancel Prebuild -> { prebuild }
post/gitpod.v1.PrebuildService/CancelPrebuild

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" 
Create Prebuild -> { prebuild }
post/gitpod.v1.PrebuildService/CreatePrebuild

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 default 
  • Create 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 
Create Prebuild Logs Token -> { accessToken }
post/gitpod.v1.PrebuildService/CreatePrebuildLogsToken

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" 
Delete Prebuild -> unknown
post/gitpod.v1.PrebuildService/DeletePrebuild

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" 
List Prebuilds -> PrebuildsPage<>
post/gitpod.v1.PrebuildService/ListPrebuilds

ListPrebuilds

Get Prebuild -> { prebuild }
post/gitpod.v1.PrebuildService/GetPrebuild

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 = { metadata, spec, status, 1 more... }

Prebuild represents a prebuild for a project that creates a snapshot for faster environment startup times.

PrebuildMetadata = { createdAt, creator, updatedAt, 5 more... }

PrebuildMetadata contains metadata about the prebuild

PrebuildPhase = "PREBUILD_PHASE_UNSPECIFIED" | "PREBUILD_PHASE_PENDING" | "PREBUILD_PHASE_STARTING" | 9 more...

PrebuildPhase represents the lifecycle phase of a prebuild

PrebuildSpec = { desiredPhase, specVersion, timeout }

PrebuildSpec contains the configuration used to create a prebuild

PrebuildStatus = { phase, completionTime, environmentId, 4 more... }

PrebuildStatus contains the current status and progress of a prebuild

PrebuildTrigger = "PREBUILD_TRIGGER_UNSPECIFIED" | "PREBUILD_TRIGGER_MANUAL" | "PREBUILD_TRIGGER_SCHEDULED"

PrebuildTrigger indicates how the prebuild was triggered