UpdateRunner
client.Runners.Update(ctx, body) (*RunnerUpdateResponse, error)
POST/gitpod.v1.RunnerService/UpdateRunner
Updates a runner’s configuration.
Use this method to:
- Modify runner settings
- Update release channels
- Change runner status
- Configure auto-update settings
Examples
-
Update configuration:
Changes runner settings.
runnerId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" name: "Updated Runner Name" spec: configuration: releaseChannel: RUNNER_RELEASE_CHANNEL_LATEST autoUpdate: true
UpdateRunner
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"),
)
runner, err := client.Runners.Update(context.TODO(), gitpod.RunnerUpdateParams{
Name: gitpod.F("Updated Runner Name"),
RunnerID: gitpod.F("d2c94c27-3b76-4a42-b88c-95a85e392c68"),
Spec: gitpod.F(gitpod.RunnerUpdateParamsSpec{
Configuration: gitpod.F(gitpod.RunnerUpdateParamsSpecConfiguration{
AutoUpdate: gitpod.F(true),
ReleaseChannel: gitpod.F(gitpod.RunnerReleaseChannelLatest),
}),
}),
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", runner)
}
{}Returns Examples
{}