Skip to content
Ona Docs

CreateRunnerLogsToken

client.Runners.NewLogsToken(ctx, body) (*RunnerNewLogsTokenResponse, error)
POST/gitpod.v1.RunnerService/CreateRunnerLogsToken

Creates an access token for runner logs and debug information.

Generated tokens are valid for one hour and provide runner-specific access permissions. The token is scoped to a specific runner and can be used to access support bundles.

Examples

  • Generate runner logs token:

    runnerId: "d2c94c27-3b76-4a42-b88c-95a85e392c68"
ParametersExpand Collapse
body RunnerNewLogsTokenParams
RunnerID param.Field[string]Optional

runner_id specifies the runner for which the logs token should be created.

+required

formatuuid
ReturnsExpand Collapse
type RunnerNewLogsTokenResponse struct{…}
AccessToken string

access_token is the token that can be used to access the logs and support bundle of the runner

CreateRunnerLogsToken

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.Runners.NewLogsToken(context.TODO(), gitpod.RunnerNewLogsTokenParams{
    RunnerID: gitpod.F("d2c94c27-3b76-4a42-b88c-95a85e392c68"),
  })
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", response.AccessToken)
}
{
  "accessToken": "accessToken"
}
Returns Examples
{
  "accessToken": "accessToken"
}