Skip to content
Ona Docs

ListEnvironmentClasses

client.runners.configurations.environmentClasses.list(EnvironmentClassListParams { token, pageSize, filter, pagination } params, RequestOptionsoptions?): EnvironmentClassesPage<EnvironmentClass { id, runnerId, configuration, 3 more } >
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: EnvironmentClassListParams { token, pageSize, filter, pagination }
token?: string

Query param

pageSize?: number

Query param

maximum100
minimum0
filter?: Filter

Body param

canCreateEnvironments?: boolean | null

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?: boolean | null

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

runnerIds?: Array<string>

runner_ids filters the response to only EnvironmentClasses of these Runner IDs

runnerKinds?: Array<RunnerKind>

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

One of the following:
"RUNNER_KIND_UNSPECIFIED"
"RUNNER_KIND_LOCAL"
"RUNNER_KIND_REMOTE"
"RUNNER_KIND_LOCAL_CONFIGURATION"
runnerProviders?: Array<RunnerProvider>

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

One of the following:
"RUNNER_PROVIDER_UNSPECIFIED"
"RUNNER_PROVIDER_AWS_EC2"
"RUNNER_PROVIDER_LINUX_HOST"
"RUNNER_PROVIDER_DESKTOP_MAC"
"RUNNER_PROVIDER_MANAGED"
"RUNNER_PROVIDER_GCP"
"RUNNER_PROVIDER_DEV_AGENT"
ReturnsExpand Collapse
EnvironmentClass { id, runnerId, configuration, 3 more }
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?: Array<FieldValue { key, value } >

configuration describes the configuration of the environment class

key?: string
value?: string
description?: string

description is a human readable description of the environment class

maxLength200
minLength3
displayName?: string

display_name is the human readable name of the environment class

maxLength127
minLength3
enabled?: boolean

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

ListEnvironmentClasses

import Gitpod from '@gitpod/sdk';

const client = new Gitpod({
  bearerToken: process.env['GITPOD_API_KEY'], // This is the default and can be omitted
});

// Automatically fetches more pages as needed.
for await (const environmentClass of client.runners.configurations.environmentClasses.list({
  filter: { enabled: true },
  pagination: { pageSize: 20 },
})) {
  console.log(environmentClass.id);
}
{
  "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"
  }
}