Skip to content
Ona Docs

CreateEnvironmentClass

client.runners.configurations.environmentClasses.create(EnvironmentClassCreateParams { configuration, description, displayName, runnerId } body, RequestOptionsoptions?): EnvironmentClassCreateResponse { id }
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
body: EnvironmentClassCreateParams { configuration, description, displayName, runnerId }
configuration?: Array<FieldValue { key, value } >
key?: string
value?: string
description?: string
maxLength200
minLength3
displayName?: string
maxLength127
minLength3
runnerId?: string
formatuuid
ReturnsExpand Collapse
EnvironmentClassCreateResponse { id }
id?: string

CreateEnvironmentClass

import Gitpod from '@gitpod/sdk';

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

const environmentClass = await client.runners.configurations.environmentClasses.create({
  configuration: [
    { key: 'cpu', value: '8' },
    { key: 'memory', value: '16384' },
  ],
  description: '8 CPU, 16GB RAM',
  displayName: 'Large Instance',
  runnerId: 'd2c94c27-3b76-4a42-b88c-95a85e392c68',
});

console.log(environmentClass.id);
{
  "id": "id"
}
Returns Examples
{
  "id": "id"
}