## 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. ```yaml runnerId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" name: "Updated Runner Name" spec: configuration: releaseChannel: RUNNER_RELEASE_CHANNEL_LATEST autoUpdate: true ``` ### Parameters - `body RunnerUpdateParams` - `Name param.Field[string]` The runner's name which is shown to users - `RunnerID param.Field[string]` runner_id specifies which runner to be updated. +required - `Spec param.Field[RunnerUpdateParamsSpec]` - `Configuration RunnerUpdateParamsSpecConfiguration` - `AutoUpdate bool` auto_update indicates whether the runner should automatically update itself. - `DevcontainerImageCacheEnabled bool` devcontainer_image_cache_enabled controls whether the shared devcontainer build cache is enabled for this runner. - `LogLevel LogLevel` log_level is the log level for the runner - `const LogLevelUnspecified LogLevel = "LOG_LEVEL_UNSPECIFIED"` - `const LogLevelDebug LogLevel = "LOG_LEVEL_DEBUG"` - `const LogLevelInfo LogLevel = "LOG_LEVEL_INFO"` - `const LogLevelWarn LogLevel = "LOG_LEVEL_WARN"` - `const LogLevelError LogLevel = "LOG_LEVEL_ERROR"` - `Metrics RunnerUpdateParamsSpecConfigurationMetrics` metrics contains configuration for the runner's metrics collection - `Enabled bool` enabled indicates whether the runner should collect metrics - `ManagedMetricsEnabled bool` When true, the runner pushes metrics to the management plane via ReportRunnerMetrics instead of directly to the remote_write endpoint. - `Password string` password is the password to use for the metrics collector - `URL string` url is the URL of the metrics collector - `Username string` username is the username to use for the metrics collector - `ReleaseChannel RunnerReleaseChannel` The release channel the runner is on - `const RunnerReleaseChannelUnspecified RunnerReleaseChannel = "RUNNER_RELEASE_CHANNEL_UNSPECIFIED"` - `const RunnerReleaseChannelStable RunnerReleaseChannel = "RUNNER_RELEASE_CHANNEL_STABLE"` - `const RunnerReleaseChannelLatest RunnerReleaseChannel = "RUNNER_RELEASE_CHANNEL_LATEST"` - `UpdateWindow UpdateWindow` update_window defines the daily time window (UTC) during which auto-updates are allowed. start_hour is required. If end_hour is omitted, it defaults to start_hour + 2. Send an empty UpdateWindow (no start_hour or end_hour) to clear a custom window and allow updates at any time. - `EndHour int64` end_hour is the end of the update window as a UTC hour (0-23). If not set, defaults to start_hour + 2. - `StartHour int64` start_hour is the beginning of the update window as a UTC hour (0-23). +required - `DesiredPhase RunnerPhase` desired_phase can currently only be updated on local-configuration runners, to toggle whether local runners are allowed for running environments in the organization. Set to: - ACTIVE to enable local runners. - INACTIVE to disable all local runners. Existing local runners and their environments will stop, and cannot be started again until the desired_phase is set to ACTIVE. Use this carefully, as it will affect all users in the organization who use local runners. - `const RunnerPhaseUnspecified RunnerPhase = "RUNNER_PHASE_UNSPECIFIED"` - `const RunnerPhaseCreated RunnerPhase = "RUNNER_PHASE_CREATED"` - `const RunnerPhaseInactive RunnerPhase = "RUNNER_PHASE_INACTIVE"` - `const RunnerPhaseActive RunnerPhase = "RUNNER_PHASE_ACTIVE"` - `const RunnerPhaseDeleting RunnerPhase = "RUNNER_PHASE_DELETING"` - `const RunnerPhaseDeleted RunnerPhase = "RUNNER_PHASE_DELETED"` - `const RunnerPhaseDegraded RunnerPhase = "RUNNER_PHASE_DEGRADED"` ### Returns - `type RunnerUpdateResponse interface{…}` ### Example ```go 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) } ``` #### Response ```json {} ```