> ## Documentation Index
> Fetch the complete documentation index at: https://ona.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# List Environment Classes

> Lists available environment classes with their specifications and resource limits.

`Unary` · [`Environments`](/docs/api-reference/generated/environment/overview)

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.

  ```yaml theme={null}
  {}
  ```

buf:lint:ignore RPC\_REQUEST\_RESPONSE\_UNIQUE

## Endpoint

```text theme={null}
POST /api/gitpod.v1.EnvironmentService/ListEnvironmentClasses
```

Send a Bearer token as described in [Authentication](/docs/api-reference#authenticate-requests). If your organization uses a custom management-plane domain, replace `https://app.ona.com` with that domain.

## Request example

<CodeGroup>
  ```bash cURL theme={null}
  export ONA_HOST=https://app.ona.com
  export ONA_API_KEY=<your-token>

  curl --request POST \
    --url "$ONA_HOST/api/gitpod.v1.EnvironmentService/ListEnvironmentClasses" \
    --header "Authorization: Bearer $ONA_API_KEY" \
    --header "Content-Type: application/json" \
    --data '{
    "pagination": {
      "pageSize": 1
    }
  }'
  ```

  ```python Python theme={null}
  import gitpod.v1.pagination_pb2 as pagination_pb2
  import gitpod.v1.runner_configuration_pb2 as runner_configuration_pb2
  from ona_sdk import create_client_from_env

  ona = create_client_from_env()
  request = runner_configuration_pb2.ListEnvironmentClassesRequest(
      pagination=pagination_pb2.PaginationRequest(
          page_size=1,
      ),
  )
  response = ona.services.environment.list_environment_classes(request)
  print(response)
  ```

  ```typescript TypeScript theme={null}
  import { create } from "@bufbuild/protobuf";
  import { createClientFromEnv } from "@gitpod/sdk";
  import { ListEnvironmentClassesRequestSchema } from "@gitpod/sdk/gitpod/v1/runner_configuration_pb";

  async function main() {
    const ona = createClientFromEnv();
    const request = create(ListEnvironmentClassesRequestSchema, {
      pagination: {
        pageSize: 1,
      },
    });
    const response = await ona.services.environment.listEnvironmentClasses(request);
    console.log(response);
  }

  main().catch(console.error);
  ```

  ```go Go theme={null}
  package main

  import (
  	"context"
  	"fmt"
  	"log"

  	"connectrpc.com/connect"
  	"github.com/gitpod-io/gitpod-sdk-go/sdk"
  	gitpodpb "github.com/gitpod-io/gitpod-sdk-go/v1"
  )

  func main() {
  	ona, err := sdk.NewFromEnv()
  	if err != nil {
  		log.Fatal(err)
  	}

  	request := connect.NewRequest(&gitpodpb.ListEnvironmentClassesRequest{
  		Pagination: &gitpodpb.PaginationRequest{
  			PageSize: 1,
  		},
  	})
  	response, err := ona.Services.Environment.ListEnvironmentClasses(context.Background(), request)
  	if err != nil {
  		log.Fatal(err)
  	}
  	fmt.Println(response.Msg)
  }
  ```

  ```json Request body theme={null}
  {
    "pagination": {
      "pageSize": 1
    }
  }
  ```
</CodeGroup>

## Request

`gitpod.v1.ListEnvironmentClassesRequest`

| Field        | Type                                                              | Required | Description                                                                |
| ------------ | ----------------------------------------------------------------- | -------- | -------------------------------------------------------------------------- |
| `pagination` | [PaginationRequest](#type-gitpod-v1-pagination-request)           | No       | pagination contains the pagination options for listing environment classes |
| `filter`     | [Filter](#type-gitpod-v1-list-environment-classes-request-filter) | No       |                                                                            |

## Response

`gitpod.v1.ListEnvironmentClassesResponse`

| Field                | Type                                                           | Required | Description                                                                |
| -------------------- | -------------------------------------------------------------- | -------- | -------------------------------------------------------------------------- |
| `pagination`         | [PaginationResponse](#type-gitpod-v1-pagination-response)      | No       | pagination contains the pagination options for listing environment classes |
| `environmentClasses` | array of [EnvironmentClass](#type-gitpod-v1-environment-class) | No       |                                                                            |

## Related types

<a id="type-gitpod-v1-environment-class" />

<Accordion title="EnvironmentClass">
  `gitpod.v1.EnvironmentClass`

  | Field           | Type                                               | Required | Description                                                                                                               |
  | --------------- | -------------------------------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------- |
  | `id`            | string                                             | No       | id is the unique identifier of the environment class                                                                      |
  | `displayName`   | string                                             | No       | display\_name is the human readable name of the environment class Constraints: `string.max_len=127, string.min_len=3`.    |
  | `description`   | string                                             | No       | description is a human readable description of the environment class Constraints: `string.max_len=200, string.min_len=3`. |
  | `configuration` | array of [FieldValue](#type-gitpod-v1-field-value) | No       | configuration describes the configuration of the environment class                                                        |
  | `runnerId`      | string                                             | No       | runner\_id is the unique identifier of the runner the environment class belongs to                                        |
  | `enabled`       | boolean                                            | No       | enabled indicates whether the environment class can be used to create new environments.                                   |
</Accordion>

<a id="type-gitpod-v1-field-value" />

<Accordion title="FieldValue">
  `gitpod.v1.FieldValue`

  | Field   | Type   | Required | Description |
  | ------- | ------ | -------- | ----------- |
  | `key`   | string | No       |             |
  | `value` | string | No       |             |
</Accordion>

<a id="type-gitpod-v1-list-environment-classes-request-filter" />

<Accordion title="Filter">
  `gitpod.v1.ListEnvironmentClassesRequest.Filter`

  | Field                   | Type                                                       | Required | Description                                                                                                                                                                                                                                                                |
  | ----------------------- | ---------------------------------------------------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
  | `runnerIds`             | array of string                                            | No       | runner\_ids filters the response to only EnvironmentClasses of these Runner IDs Constraints: `repeated.items.string.uuid=true, repeated.max_items=25, repeated.min_items=0`.                                                                                               |
  | `enabled`               | boolean                                                    | No       | enabled filters the response to only enabled or disabled environment classes. If not set, all environment classes are returned.                                                                                                                                            |
  | `canCreateEnvironments` | boolean                                                    | No       | 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. |
  | `runnerKinds`           | array of [RunnerKind](#enum-gitpod-v1-runner-kind)         | No       | runner\_kind filters the response to only environment classes from runners of these kinds. Constraints: `repeated.max_items=25, repeated.min_items=0`.                                                                                                                     |
  | `runnerProviders`       | array of [RunnerProvider](#enum-gitpod-v1-runner-provider) | No       | runner\_providers filters the response to only environment classes from runners of these providers. Constraints: `repeated.max_items=25, repeated.min_items=0`.                                                                                                            |
</Accordion>

<a id="type-gitpod-v1-pagination-request" />

<Accordion title="PaginationRequest">
  `gitpod.v1.PaginationRequest`

  | Field      | Type    | Required | Description                                                                                                                              |
  | ---------- | ------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------- |
  | `pageSize` | integer | No       | Page size is the maximum number of results to retrieve per page. Defaults to 25. Maximum 100. Constraints: `int32.gte=0, int32.lte=100`. |
  | `token`    | string  | No       | Token for the next set of results that was returned as next\_token of a PaginationResponse                                               |
</Accordion>

<a id="type-gitpod-v1-pagination-response" />

<Accordion title="PaginationResponse">
  `gitpod.v1.PaginationResponse`

  | Field       | Type   | Required | Description                                                                             |
  | ----------- | ------ | -------- | --------------------------------------------------------------------------------------- |
  | `nextToken` | string | No       | Token passed for retrieving the next set of results. Empty if there are no more results |
</Accordion>

<a id="enum-gitpod-v1-runner-kind" />

<Accordion title="RunnerKind">
  RunnerKind represents the kind of a runner

  | Value                             | Number | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
  | --------------------------------- | -----: | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
  | `RUNNER_KIND_UNSPECIFIED`         |      0 | Default zero value. Do not set explicitly.                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
  | `RUNNER_KIND_LOCAL`               |      1 | **Deprecated.** Deprecated: Local runners are no longer supported. Use RUNNER\_PROVIDER\_AWS\_EC2 or RUNNER\_PROVIDER\_GCP instead.                                                                                                                                                                                                                                                                                                                                                                        |
  | `RUNNER_KIND_REMOTE`              |      2 | The runner is a remote runner                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
  | `RUNNER_KIND_LOCAL_CONFIGURATION` |      3 | The runner is a system-managed runner that holds shared configuration for local runners. Every organization automatically has one of these runners, and it cannot be deleted nor can new runners of this kind be created. Organization admins can update this runner to change the shared configuration, including: - SCM Integrations. All local runners will use these integrations. - DesiredPhase. Can be set to STOPPED to disable all local runners. This runner cannot be used to run environments. |
</Accordion>

<a id="enum-gitpod-v1-runner-provider" />

<Accordion title="RunnerProvider">
  RunnerProvider identifies the specific implementation type of a runner.
  Each provider maps to a specific kind of runner (local or remote), as
  specified below for each provider.

  | Value                         | Number | Description                                                                                                               |
  | ----------------------------- | -----: | ------------------------------------------------------------------------------------------------------------------------- |
  | `RUNNER_PROVIDER_UNSPECIFIED` |      0 |                                                                                                                           |
  | `RUNNER_PROVIDER_AWS_EC2`     |      1 | AWS EC2 based runner that deploys as a CloudFormation stack Kind: RUNNER\_KIND\_REMOTE                                    |
  | `RUNNER_PROVIDER_LINUX_HOST`  |      2 | **Deprecated.** Deprecated: Is no longer supported. Use RUNNER\_PROVIDER\_AWS\_EC2 or RUNNER\_PROVIDER\_GCP instead.      |
  | `RUNNER_PROVIDER_DESKTOP_MAC` |      3 | **Deprecated.** Deprecated: Is no longer supported. Use RUNNER\_PROVIDER\_AWS\_EC2 or RUNNER\_PROVIDER\_GCP instead.      |
  | `RUNNER_PROVIDER_MANAGED`     |      4 | Internal use only. A runner managed by the Ona-operated RunnerManager. Do not use when creating your own runners.         |
  | `RUNNER_PROVIDER_GCP`         |      5 | Runner for GCP platform deployed using terraform Kind: RUNNER\_KIND\_REMOTE                                               |
  | `RUNNER_PROVIDER_DEV_AGENT`   |      6 | Internal use only. A development runner for testing within an Ona environment. Do not use when creating your own runners. |
</Accordion>
