Unary · Prebuilds
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 detailed information about a prebuild.
prebuildId: "07e03a28-65a5-4d98-b532-8ea67b188048"
Endpoint
POST /api/gitpod.v1.PrebuildService/GetPrebuild
https://app.ona.com with that domain.
Request example
export ONA_HOST=https://app.ona.com
export ONA_API_KEY=<your-token>
curl --request POST \
--url "$ONA_HOST/api/gitpod.v1.PrebuildService/GetPrebuild" \
--header "Authorization: Bearer $ONA_API_KEY" \
--header "Content-Type: application/json" \
--data '{
"prebuildId": "<prebuild-id>"
}'
import gitpod.v1.prebuild_pb2 as prebuild_pb2
from ona_sdk import create_client_from_env
ona = create_client_from_env()
request = prebuild_pb2.GetPrebuildRequest(
prebuild_id="<prebuild-id>",
)
response = ona.services.prebuild.get_prebuild(request)
print(response)
import { create } from "@bufbuild/protobuf";
import { createClientFromEnv } from "@gitpod/sdk";
import { GetPrebuildRequestSchema } from "@gitpod/sdk/gitpod/v1/prebuild_pb";
async function main() {
const ona = createClientFromEnv();
const request = create(GetPrebuildRequestSchema, {
prebuildId: "<prebuild-id>",
});
const response = await ona.services.prebuild.getPrebuild(request);
console.log(response);
}
main().catch(console.error);
package main
import (
"context"
"fmt"
"log"
"connectrpc.com/connect"
"github.com/gitpod-io/gitpod-sdk-go/sdk"
gitpodpb "github.com/gitpod-io/gitpod-sdk-go/v1"
)
func main() {
ona, err := sdk.NewFromEnv()
if err != nil {
log.Fatal(err)
}
request := connect.NewRequest(&gitpodpb.GetPrebuildRequest{
PrebuildId: "<prebuild-id>",
})
response, err := ona.Services.Prebuild.GetPrebuild(context.Background(), request)
if err != nil {
log.Fatal(err)
}
fmt.Println(response.Msg)
}
{
"prebuildId": "<prebuild-id>"
}
Request
gitpod.v1.GetPrebuildRequest
| Field | Type | Required | Description |
|---|---|---|---|
prebuildId | string | Yes | prebuild_id specifies the prebuild to retrieve Constraints: required=true, string.uuid=true. |
Response
gitpod.v1.GetPrebuildResponse
| Field | Type | Required | Description |
|---|---|---|---|
prebuild | Prebuild | Yes | Constraints: required=true. |
Related types
Prebuild
Prebuild
Prebuild represents a prebuild for a project that creates a snapshot
for faster environment startup times.
gitpod.v1.Prebuild| Field | Type | Required | Description |
|---|---|---|---|
id | string | No | id is the unique identifier for the prebuild Constraints: string.uuid=true. |
metadata | PrebuildMetadata | Yes | metadata contains organizational and ownership information Constraints: required=true. |
spec | PrebuildSpec | Yes | spec contains the configuration used to create this prebuild Constraints: required=true. |
status | PrebuildStatus | Yes | status contains the current status and progress of the prebuild Constraints: required=true. |
PrebuildMetadata
PrebuildMetadata
PrebuildMetadata contains metadata about the prebuild
gitpod.v1.PrebuildMetadata| Field | Type | Required | Description |
|---|---|---|---|
organizationId | string | No | organization_id is the ID of the organization that owns the prebuild Constraints: string.uuid=true. |
projectId | string | No | project_id is the ID of the project this prebuild was created for Constraints: string.uuid=true. |
environmentClassId | string | No | environment_class_id is the environment class used to create this prebuild. While the prebuild is created with a specific environment class, environments with different classes (e.g., smaller or larger instance sizes) can be created from the same prebuild, as long as they run on the same runner. If not specified in create requests, uses the project’s default environment class. Constraints: string.uuid=true. |
creator | Subject | Yes | creator is the identity of who created the prebuild. For manual prebuilds, this is the user who triggered it. For scheduled prebuilds, this is the configured executor. Constraints: required=true. |
createdAt | RFC 3339 timestamp | Yes | created_at is when the prebuild was created Constraints: required=true. |
updatedAt | RFC 3339 timestamp | Yes | updated_at is when the prebuild was last updated Constraints: required=true. |
triggeredBy | PrebuildTrigger | No | trigger describes the trigger that created this prebuild. Constraints: enum.defined_only=true. |
executor | Subject | No | executor is the identity used to run the prebuild. The executor’s SCM credentials are used to clone the repository. If not set, the creator’s identity is used. |
PrebuildSpec
PrebuildSpec
PrebuildSpec contains the configuration used to create a prebuild
gitpod.v1.PrebuildSpec| Field | Type | Required | Description |
|---|---|---|---|
specVersion | 64-bit integer string | No | spec_version is incremented each time the spec is updated. Used for optimistic concurrency control. |
desiredPhase | PrebuildPhase | No | desired_phase is the desired phase of the prebuild. Used to signal cancellation or other state changes. This field is managed by the API and reconciler. Constraints: enum.defined_only=true. |
timeout | duration string | No | timeout is the maximum time allowed for the prebuild to complete. Defaults to 60 minutes if not specified. Maximum allowed timeout is 2 hours. Constraints: duration.gte.seconds=300, duration.lte.seconds=7200. |
PrebuildStatus
PrebuildStatus
PrebuildStatus contains the current status and progress of a prebuild
gitpod.v1.PrebuildStatus| Field | Type | Required | Description |
|---|---|---|---|
phase | PrebuildPhase | Yes | phase is the current phase of the prebuild lifecycle Constraints: enum.defined_only=true, required=true. |
completionTime | RFC 3339 timestamp | No | completion_time is when the prebuild completed (successfully or with failure) |
failureMessage | string | No | failure_message contains details about why the prebuild failed |
logUrl | string | No | log_url provides access to prebuild logs. During prebuild execution, this references the environment logs. After completion, this may reference archived logs. Constraints: string.uri=true. |
environmentId | string | No | environment_id is the ID of the environment used to create this prebuild. This field is set when the prebuild environment is created. Constraints: string.uuid=true. |
statusVersion | 64-bit integer string | No | status_version is incremented each time the status is updated. Used for optimistic concurrency control. |
warningMessage | string | No | warning_message contains warnings from the prebuild environment that indicate something went wrong but the prebuild could still complete. For example, the devcontainer failed to build but the environment is still usable. These warnings will likely affect any environment started from this prebuild. |
snapshotCompletionPercentage | integer | No | snapshot_completion_percentage is the progress of snapshot creation (0-100). Only populated when phase is SNAPSHOTTING and progress is available from the cloud provider. This value may update infrequently or remain at 0 depending on the provider. Constraints: int32.gte=0, int32.lte=100. |
snapshotSizeBytes | 64-bit integer string | No | snapshot_size_bytes is the size of the snapshot in bytes. Only populated when the snapshot is available (phase is COMPLETED). |
PrebuildTrigger
PrebuildTrigger
PrebuildTrigger indicates how the prebuild was triggered
| Value | Number | Description |
|---|---|---|
PREBUILD_TRIGGER_UNSPECIFIED | 0 | PREBUILD_TRIGGER_UNSPECIFIED is the default value and should not be used |
PREBUILD_TRIGGER_MANUAL | 1 | PREBUILD_TRIGGER_MANUAL indicates the prebuild was manually triggered by a user |
PREBUILD_TRIGGER_SCHEDULED | 2 | PREBUILD_TRIGGER_SCHEDULED indicates the prebuild was triggered by a scheduled job |
PrebuildPhase
PrebuildPhase
PrebuildPhase represents the lifecycle phase of a prebuild
| Value | Number | Description |
|---|---|---|
PREBUILD_PHASE_UNSPECIFIED | 0 | PREBUILD_PHASE_UNSPECIFIED is the default value and should not be used |
PREBUILD_PHASE_PENDING | 10 | PREBUILD_PHASE_PENDING indicates the prebuild has been created but the environment has not yet started |
PREBUILD_PHASE_STARTING | 20 | PREBUILD_PHASE_STARTING indicates the prebuild is being started |
PREBUILD_PHASE_RUNNING | 30 | PREBUILD_PHASE_RUNNING indicates the prebuild is running and tasks are executing |
PREBUILD_PHASE_STOPPING | 40 | PREBUILD_PHASE_STOPPING indicates the prebuild is being stopped after completion |
PREBUILD_PHASE_SNAPSHOTTING | 50 | PREBUILD_PHASE_SNAPSHOTTING indicates the environment has stopped and a snapshot is being created |
PREBUILD_PHASE_COMPLETED | 60 | PREBUILD_PHASE_COMPLETED indicates the prebuild completed successfully and the snapshot is available |
PREBUILD_PHASE_FAILED | 70 | PREBUILD_PHASE_FAILED indicates the prebuild failed at any stage |
PREBUILD_PHASE_CANCELLING | 75 | PREBUILD_PHASE_CANCELLING indicates the prebuild is being cancelled (cleanup in progress) |
PREBUILD_PHASE_CANCELLED | 80 | PREBUILD_PHASE_CANCELLED indicates the prebuild was manually cancelled |
PREBUILD_PHASE_DELETING | 85 | PREBUILD_PHASE_DELETING indicates the prebuild is being deleted (cleanup in progress) |
PREBUILD_PHASE_DELETED | 90 | PREBUILD_PHASE_DELETED indicates the prebuild is being deleted |