> ## 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.

# Validate Runner Configuration

> Validates a runner configuration.

`Unary` · [`Runner Configurations`](/docs/api-reference/generated/runner-configuration/overview)

Validates a runner configuration.

Use this method to:

* Check configuration validity
* Verify integration settings
* Validate environment classes

### Examples

* Validate SCM integration:

  Checks if an SCM integration is valid.

  ```yaml theme={null}
  runnerId: "d2c94c27-3b76-4a42-b88c-95a85e392c68"
  scmIntegration:
    id: "integration-id"
    scmId: "github"
    host: "github.com"
    oauthClientId: "client_id"
    oauthPlaintextClientSecret: "client_secret"
  ```

## Endpoint

```text theme={null}
POST /api/gitpod.v1.RunnerConfigurationService/ValidateRunnerConfiguration
```

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.RunnerConfigurationService/ValidateRunnerConfiguration" \
    --header "Authorization: Bearer $ONA_API_KEY" \
    --header "Content-Type: application/json" \
    --data '{
    "runnerId": "<runner-id>"
  }'
  ```

  ```python Python theme={null}
  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.ValidateRunnerConfigurationRequest(
      runner_id="<runner-id>",
  )
  response = ona.services.runner_configuration.validate_runner_configuration(request)
  print(response)
  ```

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

  async function main() {
    const ona = createClientFromEnv();
    const request = create(ValidateRunnerConfigurationRequestSchema, {
      runnerId: "<runner-id>",
    });
    const response = await ona.services.runnerConfiguration.validateRunnerConfiguration(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.ValidateRunnerConfigurationRequest{
  		RunnerId: "<runner-id>",
  	})
  	response, err := ona.Services.RunnerConfiguration.ValidateRunnerConfiguration(context.Background(), request)
  	if err != nil {
  		log.Fatal(err)
  	}
  	fmt.Println(response.Msg)
  }
  ```

  ```json Request body theme={null}
  {
    "runnerId": "<runner-id>"
  }
  ```
</CodeGroup>

## Request

`gitpod.v1.ValidateRunnerConfigurationRequest`

| Field              | Type                                                                                                     | Required | Description                      |
| ------------------ | -------------------------------------------------------------------------------------------------------- | -------- | -------------------------------- |
| `runnerId`         | string                                                                                                   | No       | Constraints: `string.uuid=true`. |
| `environmentClass` | [EnvironmentClass](#type-gitpod-v1-environment-class)                                                    | No       |                                  |
| `scmIntegration`   | [ValidateSCMIntegration](#type-gitpod-v1-validate-runner-configuration-request-validate-scm-integration) | No       |                                  |

## Response

`gitpod.v1.ValidateRunnerConfigurationResponse`

| Field              | Type                                                                                    | Required | Description |
| ------------------ | --------------------------------------------------------------------------------------- | -------- | ----------- |
| `environmentClass` | [EnvironmentClassValidationResult](#type-gitpod-v1-environment-class-validation-result) | No       |             |
| `scmIntegration`   | [SCMIntegrationValidationResult](#type-gitpod-v1-scm-integration-validation-result)     | 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-environment-class-validation-result" />

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

  | Field                 | Type                                                                    | Required | Description |
  | --------------------- | ----------------------------------------------------------------------- | -------- | ----------- |
  | `valid`               | boolean                                                                 | No       |             |
  | `displayNameError`    | string                                                                  | No       |             |
  | `descriptionError`    | string                                                                  | No       |             |
  | `configurationErrors` | array of [FieldValidationError](#type-gitpod-v1-field-validation-error) | No       |             |
</Accordion>

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

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

  | Field   | Type   | Required | Description |
  | ------- | ------ | -------- | ----------- |
  | `key`   | string | No       |             |
  | `error` | string | No       |             |
</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-scm-integration-validation-result" />

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

  | Field        | Type    | Required | Description |
  | ------------ | ------- | -------- | ----------- |
  | `valid`      | boolean | No       |             |
  | `scmIdError` | string  | No       |             |
  | `hostError`  | string  | No       |             |
  | `oauthError` | string  | No       |             |
  | `patError`   | string  | No       |             |
</Accordion>

<a id="type-gitpod-v1-validate-runner-configuration-request-validate-scm-integration" />

<Accordion title="ValidateSCMIntegration">
  `gitpod.v1.ValidateRunnerConfigurationRequest.ValidateSCMIntegration`

  | Field                        | Type          | Required | Description                                                                                                                                                                                                                                                                                                 |
  | ---------------------------- | ------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
  | `id`                         | string        | No       | id is the unique identifier of the SCM integration                                                                                                                                                                                                                                                          |
  | `scmId`                      | string        | No       | scm\_id references the scm\_id in the runner's configuration schema that this integration is for                                                                                                                                                                                                            |
  | `host`                       | string        | No       |                                                                                                                                                                                                                                                                                                             |
  | `oauthClientId`              | string        | No       | oauth\_client\_id is the OAuth app's client ID, if OAuth is configured. If configured, oauth\_client\_secret must also be set.                                                                                                                                                                              |
  | `oauthPlaintextClientSecret` | string        | No       | oauth\_plaintext\_client\_secret is the OAuth app's client secret in clear text, if OAuth is configured. This can be set to validate any new client secret before it is encrypted and stored. This value will not be stored and get encrypted with the runner's public key before passing it to the runner. |
  | `oauthEncryptedClientSecret` | base64 string | No       | oauth\_encrypted\_client\_secret is the OAuth app's client secret encrypted with the runner's public key, if OAuth is configured. This can be used to e.g. validate an already encrypted client secret of an existing SCM integration.                                                                      |
  | `pat`                        | boolean       | No       |                                                                                                                                                                                                                                                                                                             |
  | `issuerUrl`                  | string        | No       | issuer\_url can be set to override the authentication provider URL, if it doesn't match the SCM host.                                                                                                                                                                                                       |
  | `virtualDirectory`           | string        | No       | virtual\_directory is the virtual directory path for Azure DevOps Server (e.g., "/tfs"). This field is only used for Azure DevOps Server SCM integrations and should be empty for other SCM types. Azure DevOps Server APIs work without collection when PAT scope is 'All accessible organizations'.       |
</Accordion>
