## ValidateRunnerConfiguration `client.Runners.Configurations.Validate(ctx, body) (*RunnerConfigurationValidateResponse, error)` **post** `/gitpod.v1.RunnerConfigurationService/ValidateRunnerConfiguration` 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 runnerId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" scmIntegration: id: "integration-id" scmId: "github" host: "github.com" oauthClientId: "client_id" oauthPlaintextClientSecret: "client_secret" ``` ### Parameters - `body RunnerConfigurationValidateParams` - `EnvironmentClass param.Field[EnvironmentClass]` - `RunnerID param.Field[string]` - `ScmIntegration param.Field[RunnerConfigurationValidateParamsScmIntegration]` - `ID string` id is the unique identifier of the SCM integration - `Host string` - `IssuerURL string` issuer_url can be set to override the authentication provider URL, if it doesn't match the SCM host. - `OAuthClientID string` oauth_client_id is the OAuth app's client ID, if OAuth is configured. If configured, oauth_client_secret must also be set. - `OAuthEncryptedClientSecret string` 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. - `OAuthPlaintextClientSecret string` 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. - `Pat bool` - `ScmID string` scm_id references the scm_id in the runner's configuration schema that this integration is for - `VirtualDirectory string` 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'. ### Returns - `type RunnerConfigurationValidateResponse struct{…}` - `EnvironmentClass EnvironmentClassValidationResult` - `ConfigurationErrors []FieldValidationError` - `Error string` - `Key string` - `DescriptionError string` - `DisplayNameError string` - `Valid bool` - `ScmIntegration ScmIntegrationValidationResult` - `HostError string` - `OAuthError string` - `PatError string` - `ScmIDError string` - `Valid bool` ### Example ```go 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"), ) response, err := client.Runners.Configurations.Validate(context.TODO(), gitpod.RunnerConfigurationValidateParams{ RunnerID: gitpod.F("d2c94c27-3b76-4a42-b88c-95a85e392c68"), ScmIntegration: gitpod.F(gitpod.RunnerConfigurationValidateParamsScmIntegration{ Host: gitpod.F("github.com"), ID: gitpod.F("integration-id"), OAuthClientID: gitpod.F("client_id"), OAuthPlaintextClientSecret: gitpod.F("client_secret"), ScmID: gitpod.F("github"), }), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", response.EnvironmentClass) } ``` #### Response ```json { "environmentClass": { "configurationErrors": [ { "error": "error", "key": "key" } ], "descriptionError": "descriptionError", "displayNameError": "displayNameError", "valid": true }, "scmIntegration": { "hostError": "hostError", "oauthError": "oauthError", "patError": "patError", "scmIdError": "scmIdError", "valid": true } } ```