DeleteService
client.Environments.Automations.Services.Delete(ctx, body) (*EnvironmentAutomationServiceDeleteResponse, error)
POST/gitpod.v1.EnvironmentAutomationService/DeleteService
Deletes an automation service. This call does not block until the service is deleted. If the service is not stopped it will be stopped before deletion.
Use this method to:
- Remove unused services
- Clean up service configurations
- Stop and delete services
Examples
-
Delete service:
Removes a service after stopping it.
id: "d2c94c27-3b76-4a42-b88c-95a85e392c68" force: false -
Force delete:
Immediately removes a service.
id: "d2c94c27-3b76-4a42-b88c-95a85e392c68" force: true
DeleteService
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"),
)
service, err := client.Environments.Automations.Services.Delete(context.TODO(), gitpod.EnvironmentAutomationServiceDeleteParams{
ID: gitpod.F("d2c94c27-3b76-4a42-b88c-95a85e392c68"),
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", service)
}
{}Returns Examples
{}