Skip to content
Ona Docs

ListEnvironmentClasses

client.Runners.Configurations.EnvironmentClasses.List(ctx, params) (*EnvironmentClassesPage[EnvironmentClass], error)
POST/gitpod.v1.RunnerConfigurationService/ListEnvironmentClasses

Lists environment classes with optional filtering.

Use this method to:

  • View available classes
  • Filter by capability
  • Check enabled status

Examples

  • List all classes:

    Shows all environment classes.

    pagination:
      pageSize: 20
  • Filter enabled classes:

    Lists only enabled environment classes.

    filter:
      enabled: true
    pagination:
      pageSize: 20

buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE

ParametersExpand Collapse
params RunnerConfigurationEnvironmentClassListParams
Token param.Field[string]Optional

Query param

PageSize param.Field[int64]Optional

Query param

maximum100
minimum0

Body param

CanCreateEnvironments boolOptional

can_create_environments filters the response to only environment classes that can be used to create new environments by the caller. Unlike enabled, which indicates general availability, this ensures the caller only sees environment classes they are allowed to use.

Enabled boolOptional

enabled filters the response to only enabled or disabled environment classes. If not set, all environment classes are returned.

RunnerIDs []stringOptional

runner_ids filters the response to only EnvironmentClasses of these Runner IDs

RunnerKinds []RunnerKindOptional

runner_kind filters the response to only environment classes from runners of these kinds.

One of the following:
const RunnerKindUnspecified RunnerKind = "RUNNER_KIND_UNSPECIFIED"
const RunnerKindLocal RunnerKind = "RUNNER_KIND_LOCAL"
const RunnerKindRemote RunnerKind = "RUNNER_KIND_REMOTE"
const RunnerKindLocalConfiguration RunnerKind = "RUNNER_KIND_LOCAL_CONFIGURATION"
RunnerProviders []RunnerProviderOptional

runner_providers filters the response to only environment classes from runners of these providers.

One of the following:
const RunnerProviderUnspecified RunnerProvider = "RUNNER_PROVIDER_UNSPECIFIED"
const RunnerProviderAwsEc2 RunnerProvider = "RUNNER_PROVIDER_AWS_EC2"
const RunnerProviderLinuxHost RunnerProvider = "RUNNER_PROVIDER_LINUX_HOST"
const RunnerProviderDesktopMac RunnerProvider = "RUNNER_PROVIDER_DESKTOP_MAC"
const RunnerProviderManaged RunnerProvider = "RUNNER_PROVIDER_MANAGED"
const RunnerProviderGcp RunnerProvider = "RUNNER_PROVIDER_GCP"
const RunnerProviderDevAgent RunnerProvider = "RUNNER_PROVIDER_DEV_AGENT"
ReturnsExpand Collapse
type EnvironmentClass struct{…}
ID string

id is the unique identifier of the environment class

RunnerID string

runner_id is the unique identifier of the runner the environment class belongs to

Configuration []FieldValueOptional

configuration describes the configuration of the environment class

Key stringOptional
Value stringOptional
Description stringOptional

description is a human readable description of the environment class

maxLength200
minLength3
DisplayName stringOptional

display_name is the human readable name of the environment class

maxLength127
minLength3
Enabled boolOptional

enabled indicates whether the environment class can be used to create new environments.

ListEnvironmentClasses

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"),
  )
  page, err := client.Runners.Configurations.EnvironmentClasses.List(context.TODO(), gitpod.RunnerConfigurationEnvironmentClassListParams{
    Filter: gitpod.F(gitpod.RunnerConfigurationEnvironmentClassListParamsFilter{
      Enabled: gitpod.F(true),
    }),
    Pagination: gitpod.F(gitpod.RunnerConfigurationEnvironmentClassListParamsPagination{
      PageSize: gitpod.F(int64(20)),
    }),
  })
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", page)
}
{
  "environmentClasses": [
    {
      "id": "id",
      "runnerId": "runnerId",
      "configuration": [
        {
          "key": "key",
          "value": "value"
        }
      ],
      "description": "xxx",
      "displayName": "xxx",
      "enabled": true
    }
  ],
  "pagination": {
    "nextToken": "nextToken"
  }
}
Returns Examples
{
  "environmentClasses": [
    {
      "id": "id",
      "runnerId": "runnerId",
      "configuration": [
        {
          "key": "key",
          "value": "value"
        }
      ],
      "description": "xxx",
      "displayName": "xxx",
      "enabled": true
    }
  ],
  "pagination": {
    "nextToken": "nextToken"
  }
}