UpdateWarmPool
client.Prebuilds.UpdateWarmPool(ctx, body) (*PrebuildUpdateWarmPoolResponse, error)
POST/gitpod.v1.PrebuildService/UpdateWarmPool
Updates a warm pool’s configuration.
Use this method to change the desired pool size.
Examples
-
Update pool size:
warmPoolId: "a1b2c3d4-5678-9abc-def0-1234567890ab" desiredSize: 5
UpdateWarmPool
package main
import (
"context"
"fmt"
"github.com/gitpod-io/gitpod-sdk-go"
"github.com/gitpod-io/gitpod-sdk-go/option"
)
func main() {
client := gitpod.NewClient(
option.WithBearerToken("My Bearer Token"),
)
response, err := client.Prebuilds.UpdateWarmPool(context.TODO(), gitpod.PrebuildUpdateWarmPoolParams{
WarmPoolID: gitpod.F("a1b2c3d4-5678-9abc-def0-1234567890ab"),
DesiredSize: gitpod.F(int64(5)),
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response.WarmPool)
}
{
"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"
}
}