## UpdateWarmPool `prebuilds.update_warm_pool(PrebuildUpdateWarmPoolParams**kwargs) -> PrebuildUpdateWarmPoolResponse` **post** `/gitpod.v1.PrebuildService/UpdateWarmPool` Updates a warm pool's configuration. Use this method to change the desired pool size. ### Examples - Update pool size: ```yaml warmPoolId: "a1b2c3d4-5678-9abc-def0-1234567890ab" desiredSize: 5 ``` ### Parameters - `warm_pool_id: str` warm_pool_id specifies the warm pool to update - `desired_size: Optional[int]` desired_size updates the number of warm instances to maintain. Deprecated: Use min_size and max_size instead for dynamic scaling. - `max_size: Optional[int]` max_size updates the maximum number of warm instances to maintain. The pool will never scale above this value. Must be >= min_size and <= 20. - `min_size: Optional[int]` min_size updates the minimum number of warm instances to maintain. The pool will never scale below this value. Must be >= 0 and <= max_size. Set to 0 to allow full scale-down. ### Returns - `class PrebuildUpdateWarmPoolResponse: …` - `warm_pool: WarmPool` WarmPool maintains pre-created environment instances from a prebuild snapshot for near-instant environment startup. One warm pool exists per pair. - `metadata: WarmPoolMetadata` metadata contains organizational and ownership information - `created_at: datetime` created_at is when the warm pool was created - `updated_at: datetime` updated_at is when the warm pool was last updated - `environment_class_id: Optional[str]` environment_class_id is the environment class whose instances are warmed - `organization_id: Optional[str]` organization_id is the ID of the organization that owns the warm pool - `project_id: Optional[str]` project_id is the ID of the project this warm pool belongs to - `runner_id: Optional[str]` runner_id is the runner that manages this warm pool. Derived from the environment class. - `spec: WarmPoolSpec` spec contains the desired configuration for this warm pool - `desired_phase: Optional[WarmPoolPhase]` desired_phase is the intended lifecycle phase for this warm pool. Managed by the API and reconciler. - `"WARM_POOL_PHASE_UNSPECIFIED"` - `"WARM_POOL_PHASE_PENDING"` - `"WARM_POOL_PHASE_READY"` - `"WARM_POOL_PHASE_DEGRADED"` - `"WARM_POOL_PHASE_DELETING"` - `"WARM_POOL_PHASE_DELETED"` - `desired_size: Optional[int]` desired_size is the number of warm instances to maintain. Deprecated: Use min_size and max_size instead for dynamic scaling. Existing pools will be migrated to min_size=max_size=desired_size. - `max_size: Optional[int]` max_size is the maximum number of warm instances to maintain. The pool will never scale above this value. Must be >= min_size and <= 20. - `min_size: Optional[int]` min_size is the minimum number of warm instances to maintain. The pool will never scale below this value. Must be >= 0 and <= max_size. Set to 0 to allow full scale-down. - `snapshot_id: Optional[str]` snapshot_id is the prebuild snapshot to warm up in the pool. Updated by the reconciler when a new prebuild completes for this project and environment class. Empty when no completed prebuild exists yet. - `spec_version: Optional[str]` spec_version is incremented each time the spec is updated. Used for optimistic concurrency control. - `status: WarmPoolStatus` status contains the current status reported by the runner - `phase: WarmPoolPhase` phase is the current phase of the warm pool lifecycle - `desired_size: Optional[int]` desired_size is the current target number of instances the autoscaler has decided on. Unlike running_instances, this value is stable and does not fluctuate as instances are claimed and backfilled. - `failure_message: Optional[str]` failure_message contains details about why the warm pool is degraded or failed - `running_instances: Optional[int]` running_instances is the number of running warm instances in the pool, ready to be claimed for near-instant environment startup. - `status_version: Optional[str]` status_version is incremented each time the status is updated. Used for optimistic concurrency control. - `stopped_instances: Optional[int]` stopped_instances is the number of pre-provisioned but stopped instances in the pool. When a running instance is claimed, stopped instances are used to backfill the running pool faster than provisioning from scratch. Stopped instances only incur storage costs, allowing a larger total pool at lower cost than keeping all instances running. - `id: Optional[str]` id is the unique identifier for the warm pool ### Example ```python import os from gitpod import Gitpod client = Gitpod( bearer_token=os.environ.get("GITPOD_API_KEY"), # This is the default and can be omitted ) response = client.prebuilds.update_warm_pool( warm_pool_id="a1b2c3d4-5678-9abc-def0-1234567890ab", desired_size=5, ) print(response.warm_pool) ``` #### Response ```json { "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" } } ```