Skip to content
Ona Docs

GetEnvironmentClass

client.Runners.Configurations.EnvironmentClasses.Get(ctx, body) (*RunnerConfigurationEnvironmentClassGetResponse, error)
POST/gitpod.v1.RunnerConfigurationService/GetEnvironmentClass

Gets details about a specific environment class.

Use this method to:

  • View class configuration
  • Check resource settings
  • Verify availability

Examples

  • Get class details:

    Retrieves information about a specific class.

    environmentClassId: "d2c94c27-3b76-4a42-b88c-95a85e392c68"
ParametersExpand Collapse
body RunnerConfigurationEnvironmentClassGetParams
EnvironmentClassID param.Field[string]Optional
formatuuid
ReturnsExpand Collapse
type RunnerConfigurationEnvironmentClassGetResponse struct{…}
EnvironmentClass EnvironmentClassOptional
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.

GetEnvironmentClass

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"),
  )
  environmentClass, err := client.Runners.Configurations.EnvironmentClasses.Get(context.TODO(), gitpod.RunnerConfigurationEnvironmentClassGetParams{
    EnvironmentClassID: gitpod.F("d2c94c27-3b76-4a42-b88c-95a85e392c68"),
  })
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", environmentClass.EnvironmentClass)
}
{
  "environmentClass": {
    "id": "id",
    "runnerId": "runnerId",
    "configuration": [
      {
        "key": "key",
        "value": "value"
      }
    ],
    "description": "xxx",
    "displayName": "xxx",
    "enabled": true
  }
}
Returns Examples
{
  "environmentClass": {
    "id": "id",
    "runnerId": "runnerId",
    "configuration": [
      {
        "key": "key",
        "value": "value"
      }
    ],
    "description": "xxx",
    "displayName": "xxx",
    "enabled": true
  }
}