Skip to content
Ona Docs

ListEnvironmentClasses

runners.configurations.environment_classes.list(EnvironmentClassListParams**kwargs) -> SyncEnvironmentClassesPage[EnvironmentClass]
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
token: Optional[str]
page_size: Optional[int]
maximum100
minimum0
filter: Optional[Filter]
can_create_environments: Optional[bool]

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: Optional[bool]

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

runner_ids: Optional[Sequence[str]]

runner_ids filters the response to only EnvironmentClasses of these Runner IDs

runner_kinds: Optional[List[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"
runner_providers: Optional[List[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
class EnvironmentClass:
id: str

id is the unique identifier of the environment class

runner_id: str

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

configuration: Optional[List[FieldValue]]

configuration describes the configuration of the environment class

key: Optional[str]
value: Optional[str]
description: Optional[str]

description is a human readable description of the environment class

maxLength200
minLength3
display_name: Optional[str]

display_name is the human readable name of the environment class

maxLength127
minLength3
enabled: Optional[bool]

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

ListEnvironmentClasses

import os
from gitpod import Gitpod

client = Gitpod(
    bearer_token=os.environ.get("GITPOD_API_KEY"),  # This is the default and can be omitted
)
page = client.runners.configurations.environment_classes.list(
    filter={
        "enabled": True
    },
    pagination={
        "page_size": 20
    },
)
page = page.environment_classes[0]
print(page.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"
  }
}