Skip to content
Ona Docs

CreateEnvironmentClass

runners.configurations.environment_classes.create(EnvironmentClassCreateParams**kwargs) -> EnvironmentClassCreateResponse
POST/gitpod.v1.RunnerConfigurationService/CreateEnvironmentClass

Creates a new environment class for a runner.

Use this method to:

  • Define compute resources
  • Configure environment settings
  • Set up runtime options

Examples

  • Create environment class:

    Creates a new environment configuration.

    runnerId: "d2c94c27-3b76-4a42-b88c-95a85e392c68"
    displayName: "Large Instance"
    description: "8 CPU, 16GB RAM"
    configuration:
      - key: "cpu"
        value: "8"
      - key: "memory"
        value: "16384"
ParametersExpand Collapse
configuration: Optional[Iterable[FieldValue]]
key: Optional[str]
value: Optional[str]
description: Optional[str]
maxLength200
minLength3
display_name: Optional[str]
maxLength127
minLength3
runner_id: Optional[str]
formatuuid
ReturnsExpand Collapse
class EnvironmentClassCreateResponse:
id: Optional[str]

CreateEnvironmentClass

import os
from gitpod import Gitpod

client = Gitpod(
    bearer_token=os.environ.get("GITPOD_API_KEY"),  # This is the default and can be omitted
)
environment_class = client.runners.configurations.environment_classes.create(
    configuration=[{
        "key": "cpu",
        "value": "8",
    }, {
        "key": "memory",
        "value": "16384",
    }],
    description="8 CPU, 16GB RAM",
    display_name="Large Instance",
    runner_id="d2c94c27-3b76-4a42-b88c-95a85e392c68",
)
print(environment_class.id)
{
  "id": "id"
}
Returns Examples
{
  "id": "id"
}