Skip to content
Ona Docs

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
ParametersExpand Collapse
body RunnerUpdateParams
Name param.Field[string]Optional

The runner’s name which is shown to users

maxLength127
minLength3
RunnerID param.Field[string]Optional

runner_id specifies which runner to be updated.

+required

formatuuid
Spec param.Field[RunnerUpdateParamsSpec]Optional
Configuration RunnerUpdateParamsSpecConfigurationOptional
AutoUpdate boolOptional

auto_update indicates whether the runner should automatically update itself.

DevcontainerImageCacheEnabled boolOptional

devcontainer_image_cache_enabled controls whether the shared devcontainer build cache is enabled for this runner.

LogLevel LogLevelOptional

log_level is the log level for the runner

One of the following:
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 RunnerUpdateParamsSpecConfigurationMetricsOptional

metrics contains configuration for the runner’s metrics collection

Enabled boolOptional

enabled indicates whether the runner should collect metrics

ManagedMetricsEnabled boolOptional

When true, the runner pushes metrics to the management plane via ReportRunnerMetrics instead of directly to the remote_write endpoint.

Password stringOptional

password is the password to use for the metrics collector

URL stringOptional

url is the URL of the metrics collector

Username stringOptional

username is the username to use for the metrics collector

ReleaseChannel RunnerReleaseChannelOptional

The release channel the runner is on

One of the following:
const RunnerReleaseChannelUnspecified RunnerReleaseChannel = "RUNNER_RELEASE_CHANNEL_UNSPECIFIED"
const RunnerReleaseChannelStable RunnerReleaseChannel = "RUNNER_RELEASE_CHANNEL_STABLE"
const RunnerReleaseChannelLatest RunnerReleaseChannel = "RUNNER_RELEASE_CHANNEL_LATEST"
UpdateWindow UpdateWindowOptional

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 int64Optional

end_hour is the end of the update window as a UTC hour (0-23). If not set, defaults to start_hour + 2.

StartHour int64Optional

start_hour is the beginning of the update window as a UTC hour (0-23). +required

DesiredPhase RunnerPhaseOptional

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.
One of the following:
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"
ReturnsExpand Collapse
type RunnerUpdateResponse interface{…}

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
{}