DeleteEnvironment
client.Environments.Delete(ctx, body) (*EnvironmentDeleteResponse, error)
POST/gitpod.v1.EnvironmentService/DeleteEnvironment
Permanently deletes an environment.
Running environments are automatically stopped before deletion. If force is true, the environment is deleted immediately without graceful shutdown.
Examples
-
Delete with graceful shutdown:
Deletes an environment after gracefully stopping it.
environmentId: "07e03a28-65a5-4d98-b532-8ea67b188048" force: false -
Force delete:
Immediately deletes an environment without waiting for graceful shutdown.
environmentId: "07e03a28-65a5-4d98-b532-8ea67b188048" force: true
DeleteEnvironment
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"),
)
environment, err := client.Environments.Delete(context.TODO(), gitpod.EnvironmentDeleteParams{
EnvironmentID: gitpod.F("07e03a28-65a5-4d98-b532-8ea67b188048"),
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", environment)
}
{}Returns Examples
{}