Skip to content
Ona Docs

StopService

client.Environments.Automations.Services.Stop(ctx, body) (*EnvironmentAutomationServiceStopResponse, error)
POST/gitpod.v1.EnvironmentAutomationService/StopService

Stops an automation service. This call does not block until the service is stopped. This call will not error if the service is already stopped or has been stopped.

Use this method to:

  • Pause service operations
  • Gracefully stop services
  • Prepare for updates

Examples

  • Stop service:

    Gracefully stops a running service.

    id: "d2c94c27-3b76-4a42-b88c-95a85e392c68"
ParametersExpand Collapse
body EnvironmentAutomationServiceStopParams
ID param.Field[string]Optional
formatuuid
ReturnsExpand Collapse
type EnvironmentAutomationServiceStopResponse interface{…}

StopService

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.Automations.Services.Stop(context.TODO(), gitpod.EnvironmentAutomationServiceStopParams{
    ID: gitpod.F("d2c94c27-3b76-4a42-b88c-95a85e392c68"),
  })
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", response)
}
{}
Returns Examples
{}