Skip to content
Ona Docs

ListEnvironmentClasses

client.Environments.Classes.List(ctx, params) (*EnvironmentClassesPage[EnvironmentClass], error)
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 EnvironmentClassListParams
Token param.Field[string]Optional

Query param

PageSize param.Field[int64]Optional

Query param

maximum100
minimum0
Filter param.Field[EnvironmentClassListParamsFilter]Optional

Body param

CanCreateEnvironments boolOptional

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 boolOptional

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

RunnerIDs []stringOptional

runner_ids filters the response to only EnvironmentClasses of these Runner IDs

RunnerKinds []RunnerKindOptional

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

One of the following:
const RunnerKindUnspecified RunnerKind = "RUNNER_KIND_UNSPECIFIED"
const RunnerKindLocal RunnerKind = "RUNNER_KIND_LOCAL"
const RunnerKindRemote RunnerKind = "RUNNER_KIND_REMOTE"
const RunnerKindLocalConfiguration RunnerKind = "RUNNER_KIND_LOCAL_CONFIGURATION"
RunnerProviders []RunnerProviderOptional

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

One of the following:
const RunnerProviderUnspecified RunnerProvider = "RUNNER_PROVIDER_UNSPECIFIED"
const RunnerProviderAwsEc2 RunnerProvider = "RUNNER_PROVIDER_AWS_EC2"
const RunnerProviderLinuxHost RunnerProvider = "RUNNER_PROVIDER_LINUX_HOST"
const RunnerProviderDesktopMac RunnerProvider = "RUNNER_PROVIDER_DESKTOP_MAC"
const RunnerProviderManaged RunnerProvider = "RUNNER_PROVIDER_MANAGED"
const RunnerProviderGcp RunnerProvider = "RUNNER_PROVIDER_GCP"
const RunnerProviderDevAgent RunnerProvider = "RUNNER_PROVIDER_DEV_AGENT"
ReturnsExpand Collapse
type EnvironmentClass struct{…}
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 []FieldValueOptional

configuration describes the configuration of the environment class

Key stringOptional
Value stringOptional
Description stringOptional

description is a human readable description of the environment class

maxLength200
minLength3
DisplayName stringOptional

display_name is the human readable name of the environment class

maxLength127
minLength3
Enabled boolOptional

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

ListEnvironmentClasses

package main

import (
  "context"
  "fmt"

  "github.com/gitpod-io/gitpod-sdk-go"
  "github.com/gitpod-io/gitpod-sdk-go/option"
)

func main() {
  client := gitpod.NewClient(
    option.WithBearerToken("My Bearer Token"),
  )
  page, err := client.Environments.Classes.List(context.TODO(), gitpod.EnvironmentClassListParams{

  })
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", page)
}
{
  "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"
  }
}