StopEnvironment
client.Environments.Stop(ctx, body) (*EnvironmentStopResponse, error)
POST/gitpod.v1.EnvironmentService/StopEnvironment
Stops a running environment.
Use this method to pause work while preserving the environment’s state. The environment can be resumed later using StartEnvironment.
Examples
-
Stop an environment:
Gracefully stops a running environment while preserving its state.
environmentId: "07e03a28-65a5-4d98-b532-8ea67b188048"
StopEnvironment
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.Environments.Stop(context.TODO(), gitpod.EnvironmentStopParams{
EnvironmentID: gitpod.F("07e03a28-65a5-4d98-b532-8ea67b188048"),
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response)
}
{}Returns Examples
{}