Skip to content
Ona Docs

ListEnvironmentClasses

client.environments.classes.list(ClassListParams { token, pageSize, filter, pagination } params, RequestOptionsoptions?): EnvironmentClassesPage<EnvironmentClass { id, runnerId, configuration, 3 more } >
POST/gitpod.v1.EnvironmentService/ListEnvironmentClasses

Lists available environment classes with their specifications and resource limits.

Use this method to understand what types of environments you can create and their capabilities. Environment classes define the compute resources and features available to your environments.

Examples

  • List all available classes:

    Retrieves a list of all environment classes with their specifications.

    {}

buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE

ParametersExpand Collapse
params: ClassListParams { 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.environments.classes.list()) {
  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"
  }
}