CreateWarmPool
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
Body ParametersJSON
environment_class_id specifies which environment class to warm. Must be listed in the project’s prebuild configuration environment_class_ids.
project_id specifies the project this warm pool belongs to. The project must have prebuilds enabled.
desired_size is the number of warm instances to maintain. Deprecated: Use min_size and max_size instead for dynamic scaling.
CreateWarmPool
curl https://app.gitpod.io/api/gitpod.v1.PrebuildService/CreateWarmPool \
-H 'Content-Type: application/json' \
-H "Authorization: Bearer $GITPOD_API_KEY" \
-d '{
"environmentClassId": "d2c94c27-3b76-4a42-b88c-95a85e392c68",
"projectId": "b0e12f6c-4c67-429d-a4a6-d9838b5da047"
}'{
"warmPool": {
"metadata": {
"createdAt": "2019-12-27T18:11:19.117Z",
"updatedAt": "2019-12-27T18:11:19.117Z",
"environmentClassId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"organizationId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"projectId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"runnerId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"
},
"spec": {
"desiredPhase": "WARM_POOL_PHASE_UNSPECIFIED",
"desiredSize": 1,
"maxSize": 1,
"minSize": 20,
"snapshotId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"specVersion": "specVersion"
},
"status": {
"phase": "WARM_POOL_PHASE_UNSPECIFIED",
"desiredSize": 0,
"failureMessage": "failureMessage",
"runningInstances": 0,
"statusVersion": "statusVersion",
"stoppedInstances": 0
},
"id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"
}
}Returns Examples
{
"warmPool": {
"metadata": {
"createdAt": "2019-12-27T18:11:19.117Z",
"updatedAt": "2019-12-27T18:11:19.117Z",
"environmentClassId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"organizationId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"projectId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"runnerId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"
},
"spec": {
"desiredPhase": "WARM_POOL_PHASE_UNSPECIFIED",
"desiredSize": 1,
"maxSize": 1,
"minSize": 20,
"snapshotId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"specVersion": "specVersion"
},
"status": {
"phase": "WARM_POOL_PHASE_UNSPECIFIED",
"desiredSize": 0,
"failureMessage": "failureMessage",
"runningInstances": 0,
"statusVersion": "statusVersion",
"stoppedInstances": 0
},
"id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"
}
}